-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Support SDHC driver for Renesas RA8 devices #79862
base: main
Are you sure you want to change the base?
Support SDHC driver for Renesas RA8 devices #79862
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. |
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 for the contribution, but this driver is implementing the disk API directly for an SD host controller. New SD host controllers need to be implemented using the SDHC API: https://docs.zephyrproject.org/latest/hardware/peripherals/sdhc.html.
Take a look at the drivers within drivers/sdhc
for some examples of how this would be implemented.
c1bba4d
to
d3fed74
Compare
We noticed a similar implementation for the disk driver on the SDMMC IP in |
Yes, you do- I'm sorry that the STM32 implementation made things unclear. This implementation is present from before the SDHC layer was introduced, and needs to be transitioned to use the SDHC class instead of the disk driver layer. New implementations should not be based off it |
d3fed74
to
1280afe
Compare
d7b2ce3
to
6ca7c1e
Compare
90c0f54
to
36d04d7
Compare
5937771
to
bcdb3a1
Compare
Rebases to update HAL commit ID |
@danieldegrasse : Could you please revisit this PR? Thank you |
bcdb3a1
to
8b4e25b
Compare
8b4e25b
to
5d0f524
Compare
5d0f524
to
ba362f9
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.
Thanks for all your work here!
<RA_PSEL(RA_PSEL_SDHI, 4, 3)>, | ||
<RA_PSEL(RA_PSEL_SDHI, 4, 4)>, | ||
<RA_PSEL(RA_PSEL_SDHI, 4, 5)>, | ||
<RA_PSEL(RA_PSEL_SDHI, 7, 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.
@quytranpzz This pin is conflicting with the spi0_default node
boards/renesas/ek_ra8d1/ek_ra8d1.dts
Outdated
&sdhc1 { | ||
compatible = "renesas,ra-sdhc"; | ||
interrupt-names = "accs", "card", "dma-req"; | ||
interrupts = <60 12>, <61 12>, <62 12>; | ||
pinctrl-0 = <&sdhc1_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
sdmmc { | ||
compatible = "zephyr,sdmmc-disk"; | ||
disk-name = "SD"; | ||
status = "okay"; | ||
}; | ||
}; |
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.
@thaoluonguw , @KhiemNguyenT , @soburi , the EK_RA8M1 and EK_RA8D1 doesn't support SD slot default on board but require external board, should we set its status as "okay" in board.dts?
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 moved the sdhc support with the status "okay" into app overlay for EK_RA8M1 and EK_RA8D1 because it requires external hardware and avoids some pins conflicts as above, keeps only for MCK-RA8T1
@KhiemNguyenT @thaoluonguw @soburi @duynguyenxa: please take a look. Thank you
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.
@danieldegrasse : sorry for inconvenience but could you please take another look? The driver implementation is unchanged, but the DTS support for the EK-RA8D1 and EK-RA8M1 boards has been updated as above discussed. Thank you
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.
So if I understand right, an external board is required for support here, which contains an SD card slot? A few questions:
- Is this external board standardized between multiple EVKs? That is, can it be reused on multiple Renesas EVKs?
- Is this board a product that can be purchased, or a custom rework to connect an SD card?
If the board is a product that can be purchased and is reusable across multiple boards, then I would suggest defining the board as a shield, so that it can be reused across multiple Renesas EVKs. You'll need to define a standard node name for the SDHC controller that exposes the pins the shield connects to- maybe something like renesas_ext_sdhc
? See here for an example of this with NXP EVKs for an LCD interface:
&zephyr_mipi_dbi_parallel { |
@@ -10,3 +10,4 @@ toolchain: | |||
supported: | |||
- gpio | |||
- uart | |||
- sdhc |
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 : Is it necessary to support as default?
drivers/sdhc/Kconfig.renesas_ra
Outdated
select USE_RA_FSP_DTC | ||
select PINCTRL | ||
help | ||
Enables Renesas Host controller 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.
Should it be "Enable Renesas SD Host controller 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.
Yes, I updated it.
drivers/sdhc/sdhc_renesas_ra.c
Outdated
#include <zephyr/drivers/pinctrl.h> | ||
#include <zephyr/drivers/gpio.h> | ||
#include <zephyr/irq.h> | ||
#include <soc.h> | ||
#include <zephyr/drivers/pinctrl.h> |
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.
Duplicated include <zephyr/drivers/pinctrl.h>
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 it, thanks
This is initial commit to support SDHC driver on Renesas RA8 with r_sdhi modules Signed-off-by: Tran Van Quy <[email protected]>
Add node on RA8 dts to support sdhc as channel 0 and channel 1 Signed-off-by: Tran Van Quy <[email protected]>
ba362f9
to
968b50d
Compare
Add board support for SDHC driver on EK-RA8M1, EK-RA8D1 and MCK-RA8T1 Signed-off-by: Tran Van Quy <[email protected]>
Add sdhc property in tests/disk to support SDHC on RA8 boards Signed-off-by: Tran Van Quy <[email protected]>
Add overlay property node to support samples/fs/fs_sample on RA8 boards Signed-off-by: Quy Tran <[email protected]>
Add overlay property node and configs to support tests/subsys/fs/ext2, tests/fs/fat_fs_api and tests/subsys/sd on RA8 boards Signed-off-by: Quy Tran <[email protected]>
968b50d
to
dc724ce
Compare
Add support for SDHC driver running on Renesas RA8