-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
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.
Please review travis failure (.s - should be .S extension) |
I rebased my commits to change extention from .s to .S. |
There was a problem hiding this 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;} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
I will split this PR to two PRs. One is "revise the dir structure", other is "add new target". First: |
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.
There was a problem hiding this 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
targets/targets.json
Outdated
@@ -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"], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
/morph build |
Build : SUCCESSBuild number : 842 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 507 |
Test : SUCCESSBuild number : 687 |
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
Thank you for your comments. I added two commits that reflected your above advice. |
targets/targets.json
Outdated
"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"], |
There was a problem hiding this comment.
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.
I rebased my commit due to apply small improvement that you mentioned. |
There was a problem hiding this 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?
/morph build |
Regaring VK_RZ_A1H, @mbedNoobNinja will be in charge of updating. |
Build : SUCCESSBuild number : 850 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 520 |
Test : SUCCESSBuild number : 694 |
@mbedNoobNinja FYI |
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.