-
Notifications
You must be signed in to change notification settings - Fork 8.1k
driver: flash: initial support for Renesas RZ/A3UL, T2M, N2L #96781
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
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
1be274e to
bd0d144
Compare
|
|
||
| slot0_partition: partition@20200 { | ||
| label = "image-0"; | ||
| reg = <0x00020200 (DT_SIZE_M(16) - 0x20200)>; |
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.
should we use reg = <0x00020200 0xFDFE00>; instead?
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 would like to retain this value because it is more readable and easier to maintain.
| .command_length = 1U, | ||
| .address_length = 0U, | ||
| .data_length = THREE_BYTE, | ||
| .dummy_cycles = 0U}; |
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.
just for formatting
| .dummy_cycles = 0U}; | |
| .dummy_cycles = 0U,}; |
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.
Updated.
| .command_length = 1U, | ||
| .address_length = 3U, | ||
| .data_length = FOUR_BYTE, | ||
| .dummy_cycles = SPI_NOR_DUMMY_RD}; |
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.
| .dummy_cycles = SPI_NOR_DUMMY_RD}; | |
| .dummy_cycles = SPI_NOR_DUMMY_RD,}; |
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.
Updated.
|
|
||
| static int qspi_flash_rz_read(const struct device *dev, off_t offset, void *data, size_t 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.
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.
Removed.
| .command_length = 1U, | ||
| .address_length = 0U, | ||
| .data_length = data_length, | ||
| .dummy_cycles = 0U}; |
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.
| .dummy_cycles = 0U}; | |
| .dummy_cycles = 0U,}; |
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.
Updated.
| struct flash_renesas_rz_data *data = dev->data; | ||
| spi_flash_status_t status = {.write_in_progress = true}; | ||
| uint32_t timeout = UINT32_MAX; | ||
| fsp_err_t err = 0; |
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.
drop the initialized value since you literally set this in config->fsp_api->statusGet and you're using return 0
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 have updated it. Thank you.
|
|
||
| while ((status.write_in_progress) && (timeout > 0)) { | ||
| err = config->fsp_api->statusGet(data->fsp_ctrl, &status); | ||
| if (FSP_SUCCESS != (fsp_err_t)err) { |
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.
No need to cast it again since it's already declared as fsp_err_t
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 have updated it. Thank you.
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config FLASH_RENESAS_RZ_QSPI_XSPI | ||
| bool "Renesas RZ Quad-SPI driver" |
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.
| bool "Renesas RZ Quad-SPI driver" | |
| bool "Renesas RZ Quad-SPI XPSI driver" |
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.
Updated.
| Enable Quad-SPI XSPI Nor flash driver for RZ series | ||
|
|
||
| config FLASH_RENESAS_RZ_QSPI_SPIBSC | ||
| bool "Renesas RZ Quad-SPI driver" |
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.
| bool "Renesas RZ Quad-SPI driver" | |
| bool "Renesas RZ Quad-SPI SPIBC driver" |
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.
Updated.
| #define QSPI_DEFAULT_SR (0x40) | ||
| #define QSPI_UPDATE_CR (0xC0) /* Configuration register (DC0=1, DC1=1 (Dummy cycle = 10)) */ | ||
| #define QSPI_DATA_CR_UPDATE (QSPI_UPDATE_CR << 8 | QSPI_DEFAULT_SR) |
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.
| #define QSPI_DEFAULT_SR (0x40) | |
| #define QSPI_UPDATE_CR (0xC0) /* Configuration register (DC0=1, DC1=1 (Dummy cycle = 10)) */ | |
| #define QSPI_DATA_CR_UPDATE (QSPI_UPDATE_CR << 8 | QSPI_DEFAULT_SR) | |
| #ifdef CONFIG_FLASH_RENESAS_RZ_QSPI_XSPI | |
| #define QSPI_DEFAULT_SR (0x40) | |
| #define QSPI_UPDATE_CR (0xC0) /* Configuration register (DC0=1, DC1=1 (Dummy cycle = 10)) */ | |
| #define QSPI_DATA_CR_UPDATE (QSPI_UPDATE_CR << 8 | QSPI_DEFAULT_SR) | |
| #endif /* CONFIG_FLASH_RENESAS_RZ_QSPI_XSPI */ |
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.
Updated.
bd0d144 to
23fd2b5
Compare
23fd2b5 to
ea84bba
Compare
|
First push: Rebase to resolve conflict |
2a86aaf to
585455b
Compare
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.
Sample and tests look ok.
027501e
585455b to
027501e
Compare
Update commit id for hal_renesas to support Flash driver for Renesas RZ/A, T, N series Signed-off-by: Tien Nguyen <[email protected]>
This driver is based on the XSPI driver for Renesas RZ/T2M and N2L, and the SPIBSC driver for Renesas RZ/A3UL from the HAL. Signed-off-by: Tien Nguyen <[email protected]>
Add SPIBSC node for RZ/A3UL Add XSPI node for RZ/T2M, N2L Signed-off-by: Tien Nguyen <[email protected]>
Add flash memory regions for RZ/A3UL Signed-off-by: Tien Nguyen <[email protected]>
Add flash support for RZ/A3UL, N2L, T2M Signed-off-by: Tien Nguyen <[email protected]>
Add Flash driver for RZ/A3UL, T2M, N2L Signed-off-by: Tien Nguyen <[email protected]>
Add Flash driver for RZ/A3UL, T2M, N2L Signed-off-by: Tien Nguyen <[email protected]>
Add Flash driver for RZ/A3UL, T2M, N2L Signed-off-by: Tien Nguyen <[email protected]>
Add a macro to define the 32KB block size in spi_nor.h Signed-off-by: Tien Nguyen <[email protected]>
027501e to
c2adcb0
Compare
|
|
Hi @de-nordic, @binhnguyen2434, @quytranpzz |



This driver is based on the XSPI_QSPI driver for Renesas RZ/T2M and N2L, and the SPIBSC driver for Renesas RZ/A3UL from the HAL.
Need: zephyrproject-rtos/hal_renesas#149 (merged)