-
Notifications
You must be signed in to change notification settings - Fork 18
hal: renesas: rz: Add Flash support for RZ/A, T, N series #149
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
hal: renesas: rz: Add Flash support for RZ/A, T, N series #149
Conversation
tiennguyenzg
commented
Sep 30, 2025
- Add HAL FSP XSPI_QSPI files to support Flash driver for RZ/T, N series
- Add HAL FSP SPIBSC files to support Flash driver for RZ/A series
@quytranpzz please take a look. |
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.
LGTM
drivers/rz/CMakeLists.txt
Outdated
if(CONFIG_DT_HAS_RENESAS_RZ_QSPI_SPIBSC_ENABLED) | ||
zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_QSPI | ||
fsp/src/${SOC_SERIES_PREFIX}/r_spibsc/r_spibsc.c) | ||
else() | ||
zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_QSPI | ||
fsp/src/${SOC_SERIES_PREFIX}/r_xspi_qspi/r_xspi_qspi.c) |
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 a question,
Why don't we add 2 configs for 2 sources? , like config USE_RZ_FSP_QSPI_SPIBC
, config USE_RZ_FSP_QSPI_XSPI
then select from flash driver Kconfig instead of using a common select USE_RZ_FSP_QSPI
for 2 hal sources?
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.
@tiennguyenzg can you answer the question ?
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.
@KhiemNguyenT, @quytranpzz
Sorry for my late response,
We should use two different configs because, from HAL's perspective, these are two different modules rather than another version.
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.
from HAL's perspective, these are two different modules rather than another version.
Yes, since they are 2 different modules, I was wondering why we don't use 2 configs to select lib source from HAL instead of one (config USE_RZ_FSP_QSPI)
https://github.com/renesas/zephyr/blob/rz_support_flash/drivers/flash/Kconfig.renesas_rz_qspi#L13 and https://github.com/renesas/zephyr/blob/rz_support_flash/drivers/flash/Kconfig.renesas_rz_qspi#L26
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 update to use two configs in the Zephyr branch. And please help me check the latest updates of this branch. Thanks.
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.
@quytranpzz please help to check again the update.
7f2d562
to
50d36f4
Compare
#define XSPI_QSPI_CFG_UNIT_0_CS_0_END_ADDRESS (0x600FFFFF) | ||
#define XSPI_QSPI_CFG_UNIT_0_CS_1_START_ADDRESS (0x64000000) | ||
#define XSPI_QSPI_CFG_UNIT_0_CS_1_END_ADDRESS (0x640FFFFF) | ||
#define XSPI_QSPI_CFG_UNIT_1_CS_0_END_ADDRESS (0x680FFFFF) | ||
#define XSPI_QSPI_CFG_UNIT_1_CS_1_START_ADDRESS (0x6C000000) | ||
#define XSPI_QSPI_CFG_UNIT_1_CS_1_END_ADDRESS (0x6C0FFFFF) |
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.
Hello @tiennguyenzg ,
Is the address space partitioning fixed? I mean, can't we divide chip select region 0 and 1 with another value?
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.
Thanks for clarifying.
#define XSPI_QSPI_CFG_UNIT_0_CS_0_END_ADDRESS (0x600FFFFF) | ||
#define XSPI_QSPI_CFG_UNIT_0_CS_1_START_ADDRESS (0x64000000) | ||
#define XSPI_QSPI_CFG_UNIT_0_CS_1_END_ADDRESS (0x640FFFFF) | ||
#define XSPI_QSPI_CFG_UNIT_1_CS_0_END_ADDRESS (0x680FFFFF) | ||
#define XSPI_QSPI_CFG_UNIT_1_CS_1_START_ADDRESS (0x6C000000) | ||
#define XSPI_QSPI_CFG_UNIT_1_CS_1_END_ADDRESS (0x6C0FFFFF) |
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 clarifying.
#define XSPI_QSPI_CFG_UNIT_0_IOVOLTAGE (0) | ||
#define XSPI_QSPI_CFG_UNIT_1_IOVOLTAGE (0) | ||
#define XSPI_QSPI_CFG_DMAC_SUPPORT_ENABLE (0) | ||
#define XSPI_QSPI_CFG_UNIT_0_CS_0_END_ADDRESS (0x600FFFFF) |
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.
The macro XSPI_QSPI_CFG_UNIT_0_CS_0_END_ADDRESS
is only used when the Custom Address Space
configuration is enabled. The value 0x600FFFFF
is the default in the current FSP configuration.
That said, updating it to 0x63FFFFFF
would better align with the FSP documentation (https://renesas.github.io/rzt-fsp/group___x_s_p_i___q_s_p_i.html). I will update it to make consistency.
Thank you for your review!
Add XSPI QSPI FSP HAL driver to support Zephyr Flash driver for RZ/T2M Signed-off-by: Tien Nguyen <[email protected]>
Add XSPI_QSPI FSP HAL driver to support Zephyr Flash driver for RZ/N2L Signed-off-by: Tien Nguyen <[email protected]>
Add SPIBSC FSP HAL driver to support Zephyr Flash driver for RZ/A3UL Signed-off-by: Tien Nguyen <[email protected]>
50d36f4
to
46918b5
Compare
Thanks, LGTM |