-
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.
*/ | ||
#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
/** 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
/** 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
|
||
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.
Again consider changing large arrays to static const.
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
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);
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
// 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?
Add support for Renesas RZ/A series
The original work is from https://github.com/renesas/rza-initial-program-loader