Skip to content

Revise the structure in RZ_A1 related directory #5813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 15, 2018

Conversation

TomoYamanaka
Copy link
Contributor

Description

I registed GR-LYCHEE as a Renesas new Mbed board.
And same as Cortex-M targets, I changed the folder structure to combine files that can be shared in RZ_A1 related directory.

In the below "features/FEATURE_LWIP" folders, same as Cortex-M targets, I changed the folder structure to combine files that can be shared as RZ/A1 related. And I renamed the folder name to "TARGET_RZ_A1XX" in order to make commonality explicit.
- "features/FEATURE_LWIP" folder
  <before>
  \features\FEATURE_LWIP\lwip-interface\lwip-eth\arch\TARGET_RZ_A1H
  \features\FEATURE_LWIP\lwip-interface\lwip-eth\arch\TARGET_VK_RZ_A1H
  <after>
  \features\FEATURE_LWIP\lwip-interface\lwip-eth\arch\TARGET_RZ_A1XX
In "targets/TARGET_RENESAS" folders, same as Cortex-M targets, I changed the folder structure to combine files that can be shared as RZ/A1 related.
 And I renamed the folder name to "TARGET_RZ_A1XX" in order to make commonality explicit.
- "targets/TARGET_RENESAS" folder
  <before>
  \targets\TARGET_RENESAS\TARGET_RZ_A1H
  \targets\TARGET_RENESAS\TARGET_VK_RZ_A1H
  <after>
  \targets\TARGET_RENESAS\TARGET_RZ_A1XX
…ctory

I made be available in common whatever the board related to RZ_A1 in the below files.
- Since there are the table code of Pinmap differs for each board, I moved the code to "PeripheralPins" file for each board, and changed to include PeripheralPins.h.
  analogin_api.c, can_api.c, gpio_irq_api.c, i2c_api.c, pinmap.c, port_api.c, pwmout_api.c, serial_api.c, spi_api.c and us_ticker.c

- Since there are some board-specific processes, I enclosed the processes with "#ifdef" and rearranged the functions to make be easier to enclose.
  can_api.c, ethernet_api.c and serial_api.c

- Since there are the driver configuration values differs for each board, I added "mbed_drv_cfg.h" file for each board and defined macros for the values, and changed to refer to the macros.
  can_api.c, gpio_api.c, pwmout_api.c and rtc_api.c
As a result of revision of folder structure, I changed the values of "extra_labels" of RZ_A1-related in targets.json.
For LWIP communication speedup in RZ_A1 related, I changed the below macro value and added the definition processing in RZ/A1 related header file(lwipopts_conf.h). For this reason, those macros are overrode by RZ/A1 related values, not default values.
I modified the debug message when using LWIP in RZ/A1 related mbed boards.
In eth_arch_enetif_init(), sys_thread_new() was called and task name is appeared as debug information, but task name for debug was a mistake.
@0xc0170
Copy link
Contributor

0xc0170 commented Jan 9, 2018

Please review travis failure (.s - should be .S extension)

@TomoYamanaka
Copy link
Contributor Author

I rebased my commits to change extention from .s to .S.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be split into 2 PR, one revise the dir structure , second on top of it, adding new target ?

I left few comments


#define RECV_TASK_PRI (osPriorityNormal)
#define PHY_TASK_PRI (osPriorityNormal)
#define PHY_TASK_WAIT (200)

WEAK int ethernetext_init(ethernet_cfg_t *p_ethcfg) { return -1;}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all functions here should have alignment as follows:

WEAK int ethernetext_init(ethernet_cfg_t *p_ethcfg) 
{ 
    return -1;
}

extern void trng_free_esp32(void);
extern int trng_get_bytes_esp32(uint8_t *output, size_t length, size_t *output_length);

void trng_init(trng_t *obj) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ new line in all these functions in this commit

*/

#if defined(DEVICE_TRNG)
#include "mbed.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include what is required here rather than one-do-it-all header file?

@TomoYamanaka
Copy link
Contributor Author

I will split this PR to two PRs. One is "revise the dir structure", other is "add new target".
Of course, I will reflect your above comments.

First:
I will revise this PR(only "revise the dir structure" excepting GR-LYCHEE related commits).
Second:
After this PR("revise the dir structure") was merged, I will PR "add new target" as a new request.

@TomoYamanaka TomoYamanaka changed the title Registration GR-LYCHEE board and Revise the structure in RZ_A1 related directory Revise the structure in RZ_A1 related directory Jan 11, 2018
@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Jan 11, 2018

I rebased those commits to separate "new target(GR-LYCHEE)" related commit from this PR, and renamed this PR title. This PR is contents of "revise the dir structure" RZ_A1 related.

I added the function declarations of Ethernet functions that have a WEAK attribute. Although several Ethernet functions was called in rza1_emac.c, GR-LYCHEE don't have Ethernert feature. But there may be case that GR-LYCHEE uses LWIP feature.
In this case, since GR-LYCHEE will occur the build error, I addressed the error by defining the functions with a WEAK attribute. For reason of WEAK attribute, there is no influence in GR-PEACH and VK_RZ_A1H that have Ethernet feature.
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting the PR.

Looks good to me the new structure, one question is if we could use target inheritance

@@ -2430,7 +2430,7 @@
"supported_form_factors": ["ARDUINO"],
"core": "Cortex-A9",
"program_cycle_s": 2,
"extra_labels": ["RENESAS", "MBRZA1H"],
"extra_labels": ["RENESAS", "RZ_A1XX", "RZA1H", "MBRZA1H"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to create RZ_A1XX target that the other would inherit from ? Thus device_has and all others would be also inherited. It could look like this:

- RZ_A1XX 
  - RZ_A1H
  - VK_RZ_A1H

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not everything can be inherited. For example, in case of VK_RZ_A1H, "release_versions" is 2 only, and in case of GR_LYCHEE(will be next PR), there is not "Ethernet" function.
Thus, I will create "RZ_A1XX" target in the form of items that can be shared, and will inherit it in both RZ_A1H and VK_RZ_A1H.

@@ -0,0 +1,19 @@
#ifndef MBED_DRV_CFG_H
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add copyrigh header files (as the rest of th files contain it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add the copyright in the below header files.
targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/mbed_drv_cfg.h
targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/mbed_drv_cfg.h

@cmonr
Copy link
Contributor

cmonr commented Jan 11, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 11, 2018

Build : SUCCESS

Build number : 842
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5813/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jan 11, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 11, 2018

I modified the lack of copyright in the below header files that I added for commonizing the RZ_A1 related files.
- targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/mbed_drv_cfg.h
- targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/mbed_drv_cfg.h
@TomoYamanaka
Copy link
Contributor Author

@0xc0170

Thank you for your comments. I added two commits that reflected your above advice.

"RZ_A1H": {
"inherits": ["RZ_A1XX"],
"supported_form_factors": ["ARDUINO"],
"extra_labels_add": ["RZA1H", "MBRZA1H"],
"device_has": ["ANALOGIN", "CAN", "ETHERNET", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
Copy link
Contributor

@0xc0170 0xc0170 Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small improvement - if RZ_A1XX is the parent, that one contains the implementation for entire HAL, therefore device_has can be moved there. Each inherited target can overwrite it add/remove.

features as well, then RZ A1H and VK RZ A1 targets have only few attributes to define, same for the upcominig new target.

I added the "RZ_A1XX" label for commonizing the setting in targets.json, and inherited in both RZ_A1H and VK_RZ_A1H.
@TomoYamanaka
Copy link
Contributor Author

@0xc0170

I rebased my commit due to apply small improvement that you mentioned.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VK RZ A1H should now compile and can be added release version for mbed 2?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 12, 2018

/morph build

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Jan 12, 2018

VK RZ A1H should now compile and can be added release version for mbed 2?

Regaring VK_RZ_A1H, @mbedNoobNinja will be in charge of updating.
Please refer to #5777.

@mbed-ci
Copy link

mbed-ci commented Jan 12, 2018

Build : SUCCESS

Build number : 850
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5813/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jan 12, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 12, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 12, 2018

@mbedNoobNinja FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants