-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add support ospi driver for Renesas RA8 devices #80799
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: main
Are you sure you want to change the base?
Add support ospi driver for Renesas RA8 devices #80799
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. |
8f49aa6
to
ae8e589
Compare
ae8e589
to
a585f29
Compare
a585f29
to
7d172b6
Compare
Rebase with main to solve conflicts. |
Hello @GeorgeCGV : Could you please help us review again? Thank you so much. |
5d1aa9e
to
a4db958
Compare
rebase main to solve conflicts |
I understand. I will remove the formatting for the entire file and only format our additions |
Add additional define macro and reformat spi_nor.h Signed-off-by: Khoa Nguyen <[email protected]>
Add ospi node on Renesas RA8 devicetree to support QSPI flash driver Signed-off-by: Quy Tran <[email protected]>
a4db958
to
b3ba2a9
Compare
Add support for OSPI flash driver on EK-RA8D1 and EK-RA8M1 Signed-off-by: Quy Tran <[email protected]>
4b87e5c
to
896904e
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.
Copilot reviewed 23 out of 37 changed files in this pull request and generated no comments.
Files not reviewed (14)
- boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi: Language not supported
- boards/renesas/ek_ra8d1/ek_ra8d1.dts: Language not supported
- boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi: Language not supported
- boards/renesas/ek_ra8m1/ek_ra8m1.dts: Language not supported
- drivers/flash/CMakeLists.txt: Language not supported
- drivers/flash/Kconfig: Language not supported
- drivers/flash/Kconfig.renesas_ra_ospi: Language not supported
- dts/arm/renesas/ra/ra8/ra8x1.dtsi: Language not supported
- modules/Kconfig.renesas_fsp: Language not supported
- tests/drivers/flash/common/boards/ek_ra4e2.conf: Language not supported
- tests/drivers/flash/common/boards/ek_ra4m2.conf: Language not supported
- tests/drivers/flash/common/boards/ek_ra4m3.conf: Language not supported
- tests/drivers/flash/common/boards/ek_ra6e2.conf: Language not supported
- tests/drivers/flash/common/boards/ek_ra6m1.conf: Language not supported
Comments suppressed due to low confidence (2)
samples/drivers/spi_flash/src/main.c:68
- Please verify that the test’s expected data for CONFIG_FLASH_RENESAS_RA_OSPI_B accurately reflects the device’s actual flash memory behavior to avoid false negatives during testing.
const uint8_t expected[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
drivers/flash/flash_renesas_ra_ospi_b.h:72
- [nitpick] Consider declaring erase_command_list as a const array if these command definitions are not expected to change at runtime, to enforce immutability.
static spi_flash_erase_command_t erase_command_list[] = {
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!
if (data != NULL) { | ||
p_src = data; | ||
} else { | ||
return -EINVAL; | ||
} |
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.
Why not directly use data
and get rid of the p_src
?
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
We use p_src
to cast from const void *
to const uint8_t *
as input for the HAL API
LOG_ERR("address or size exceeds expected values: " | ||
"addr 0x%lx, size %zu", | ||
(long)offset, 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.
That is probably for vendor to decided, but I would put here LOG_DBG. Reason is that the message takes space, and chances that this will be logged, on well tested platform, is really low, which means that the log is only important for debugging the issue and it does not actually log any fault, from the perspective of hardware, that has randomly occurred during run-time, rather problem with software that used the device.
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.
Thank you. After consideration, we use LOG_DBG
in the child functions and LOG_ERR
in the driver API.
&ospi_b_data->ospi_b_ctrl, p_src, | ||
(uint8_t *)(BSP_FEATURE_OSPI_B_DEVICE_1_START_ADDRESS + offset), size); | ||
if (err != FSP_SUCCESS) { | ||
err = -EIO; |
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.
Here you may consider LOG_DBG, again decision on vendor, but in here you have two places that return -EIO
from different calls, so after user gets -EIO
, it is not known which operation failed.
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.
Thank you, I have added a LOG_DBG
in here
if (err != FSP_SUCCESS) { | ||
return 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.
Don't you want to do LOG_DBG
on each of these returns?
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 the code to add LOG_DBG
for all return err
statements.
Add support test app "flash/common" for testing Renesas RA OSPI_B on ek_ra8m1, ek_ra8d1 Signed-off-by: Khoa Nguyen <[email protected]>
Add support OSPI for Renesas ek_ra8m1, ek_ra8d1 to run sample jesd216 Signed-off-by: Khoa Nguyen <[email protected]> Signed-off-by: Tri Nguyen <[email protected]> Signed-off-by: Thao Luong <[email protected]>
Add support OSPI for Renesas ek_ra8m1, ek_ra8d1 to run sample spi_flash Signed-off-by: Khoa Nguyen <[email protected]> Signed-off-by: Tri Nguyen <[email protected]> Signed-off-by: Thao Luong <[email protected]>
cfe422d
896904e
to
cfe422d
Compare
Add support for ospi driver running on Renesas RA8 (RA8M1 and RA8D1)
Note: This PR requires #79766 is merged