-
Notifications
You must be signed in to change notification settings - Fork 7
plat: renesas: Add support for RZ/A series #6
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
base: master
Are you sure you want to change the base?
plat: renesas: Add support for RZ/A series #6
Conversation
6474002 to
f890e68
Compare
f890e68 to
2adc306
Compare
2adc306 to
a8ec691
Compare
|
Hi @binhnguyen2434, @nhutnguyenkc |
Add support for Renesas RZ/A series Signed-off-by: Nhut Nguyen <[email protected]>
a8ec691 to
3a21f74
Compare
|
Hi @MichaelAllportWM , |
|
Param swizzle
The ones below mention the V2L in the comments and are not used in your code:
I assume that they have remained in error. There are also other param swizzle configurations which are not used but I understand if you want to keep them for possible use by customers with different board setups for example param_swizzle_T1b.c is not used by any of our boards but could possibly be used by other setups. |
|
Checkpatch |
|
Param MC |
|
Strict aliasing rule |
|
#include <string.h>
|
|
Dates in copywrite header |
| AUTH_METHOD_HASH, /* Authenticate by hash matching */ | ||
| AUTH_METHOD_SIG, /* Authenticate by PK operation */ | ||
| AUTH_METHOD_NV_CTR, /* Authenticate by Non-Volatile Counter */ | ||
| AUTH_METHOD_SBLIB, /* Authenticate by Renesas RZ/G2L SBLib */ |
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.
The G2L is not included in this repository so I think that this comment should probably change.
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 changed the comment to RZ/A SBLib
| */ | ||
| #define SB_RET_SAME_IMAGE_VERSION ((sb_ret_t)0x55005501UL) | ||
|
|
||
| /** A internal failure */ |
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.
Minor spelling correction: An internal failure
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.
Fixed to An
| /** Unsupported algorithm */ | ||
| #define SB_RET_ERR_CRYPTO_UNSUPPORTED_ALGORITHM ((sb_ret_t)0xAAAA0202UL) | ||
|
|
||
| /** Other resorece is using CryptoIP. */ |
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.
Minor spelling correction: Other resource
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.
Fixed to resource
| /** CRC mismatch */ | ||
| #define SB_RET_ERR_CRC_MISMATCH ((sb_ret_t)0xAAAA0300UL) | ||
|
|
||
| /** Unsupported polynominal */ |
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.
Minor spelling correction: Unsupported polynomial
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.
Fixed to polynomial
|
|
||
| static sb_secure_boot_api_t secure_boot_api; | ||
|
|
||
| int crypto_sblib_auth(void *data_ptr, size_t len, const void *key_cert, |
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.
*data_ptr and len are unused.
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 removed *data_ptr and len
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.
Again consider changing large arrays to static const.
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 changed them to static const in pfc.c
| func console_rza_flush | ||
| ldr x0, [x0, #CONSOLE_T_BASE] | ||
| 1: | ||
| /* Check TEND flag */ | ||
| ldrh w1, [x0, #FSR] | ||
| and w1, w1, #FSR_TEND | ||
| cmp w1, #FSR_TEND | ||
| bne 1b | ||
|
|
||
| mov w0, #0 | ||
| ret | ||
| endfunc console_rza_flush |
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.
Potential issue if built with LOG_LEVEL=0
The TEND flag will never be set, thus the device may loop infinitely.
This is catered for in this driver:
https://github.com/renesas-rz/rzg_trusted-firmware-a/blob/2.10.5/rzv2h_1.1.0/plat/renesas/rz/common/drivers/scifa.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.
Thanks. I applied your suggestion
| while (1) { | ||
| read_status = | ||
| spi_multi_cmd_read(SMCMR_CMD_READ_STATUS_REGISTER_1); | ||
| if ((read_status & STATUS_1_BUSY_BIT) == STATUS_1_BUSY) { | ||
| udelay(STATUS_BUSY_READ_DELAY_TIME); | ||
| continue; | ||
| } else { | ||
| break; | ||
| } | ||
| } |
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.
Minor point- It might be possible to write this section with fewer lines
do {
read_status = spi_multi_cmd_read(SMCMR_CMD_READ_STATUS_REGISTER_1);
if (!(read_status & STATUS_1_BUSY_BIT)) {
break;
}
udelay(STATUS_BUSY_READ_DELAY_TIME);
} while (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.
This file is unused, so I removed it
| if (false) | ||
| flash_read_status_register_spi( | ||
| myctrl); /* Avoiding build error */ |
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.
Upstream reviewers may ask for this to be changed.
Consider using a typedef'ed version of __attribute__((unused)) or removing the unused function
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. I add __unused to the definition of flash_read_status_register_spi and remove the line 287-289
| // Temporarily disable DMA. | ||
| // if ((buffer + length - 1U) <= (uintptr_t)UINT32_MAX) { | ||
| // emmc_dma = LOADIMAGE_FLAGS_DMA_ENABLE; | ||
| // } |
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.
Commented out code. Could this possibly be removed?
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.
Emmc is not supported, so I removed this file
Improve RZ/A platform Signed-off-by: Nhut Nguyen <[email protected]>
f6bc15b to
71fcce0
Compare
|
Hi @MichaelAllportWM ,
I have rechecked all and removed irrelevant ones, just keeping files built |
Agree, this include is unnecessary. I removed it |
I would like to keep the original date and extent to this year 2025 |
I fixed all error and most of warnings except for this one |
|
Along with your findings, following improvements have been made.
Your feedback is very helpful for us. Please let us know if you have any further suggestions or guidance. |
If I run I get 2 errors and 6 warnings review_checkpatch_issues.txt The ones I think are worth considering fixing are:
The other warnings are probably ok I think. |
Add support for Renesas RZ/A series
The original work is from https://github.com/renesas/rza-initial-program-loader