From 149d23d4f0611e48dc4d7a721e0f5780e1400ff4 Mon Sep 17 00:00:00 2001 From: Tran Van Quy Date: Mon, 18 Nov 2024 09:40:47 +0700 Subject: [PATCH] boards: renesas: Add board support for SDHC driver Add board support for SDHC driver on EK-RA8M1, EK-RA8D1 and MCK-RA8T1 Signed-off-by: Tran Van Quy --- boards/renesas/ek_ra8d1/doc/index.rst | 14 +++++++++++++- boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi | 18 ++++++++++++++++++ boards/renesas/ek_ra8m1/doc/index.rst | 7 ++++++- boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi | 17 +++++++++++++++++ boards/renesas/mck_ra8t1/doc/index.rst | 4 ++++ .../renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi | 17 +++++++++++++++++ boards/renesas/mck_ra8t1/mck_ra8t1.dts | 18 ++++++++++++++++++ 7 files changed, 93 insertions(+), 2 deletions(-) diff --git a/boards/renesas/ek_ra8d1/doc/index.rst b/boards/renesas/ek_ra8d1/doc/index.rst index 34797638263..183ed37acbd 100644 --- a/boards/renesas/ek_ra8d1/doc/index.rst +++ b/boards/renesas/ek_ra8d1/doc/index.rst @@ -121,8 +121,12 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board: +--------------+------------+-----------------------------------+ | ADC | on-chip | adc | +--------------+------------+-----------------------------------+ +| SDHC | on-chip | sdhc | ++--------------+------------+-----------------------------------+ -**Note:** for using Ethernet on RA8D1 board please set switch SW1 as following configuration: +**Note:** + +- For using Ethernet on RA8D1 board please set switch SW1 as following configuration: +-------------+-------------+--------------+------------+------------+------------+-------------+-----------+ | SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C | @@ -130,6 +134,14 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board: | OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF | +-------------+-------------+--------------+------------+------------+------------+-------------+-----------+ +- For using SDHC channel 1 on RA8D1 board please set switch SW1 as following configuration: + ++-------------+-------------+--------------+------------+------------+------------+-------------+-----------+ +| SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C | ++-------------+-------------+--------------+------------+------------+------------+-------------+-----------+ +| OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ++-------------+-------------+--------------+------------+------------+------------+-------------+-----------+ + **CAUTION:** Do not enable SW1-4 and SW1-5 together Other hardware features are currently not supported by the port. diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi b/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi index 3fd8b3028da..b4d3168b903 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi +++ b/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi @@ -243,4 +243,22 @@ ; }; }; + + /* NOTE: pins conflict with ether_default */ + sdhc1_default: sdhc1_default { + group1 { + psels = , /* SDCD */ + , /* SDCMD */ + , /* SDDATA0 */ + , /* SDDATA1 */ + , /* SDDATA2 */ + , /* SDDATA3 */ + ; /* SDWP */ + drive-strength = "high"; + }; + group2 { + psels = ; /* SDCLK */ + drive-strength = "highspeed-high"; + }; + }; }; diff --git a/boards/renesas/ek_ra8m1/doc/index.rst b/boards/renesas/ek_ra8m1/doc/index.rst index e9770a2753e..55890ac3fcc 100644 --- a/boards/renesas/ek_ra8m1/doc/index.rst +++ b/boards/renesas/ek_ra8m1/doc/index.rst @@ -118,8 +118,13 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board: +-----------+------------+----------------------+ | ADC | on-chip | adc | +-----------+------------+----------------------+ +| SDHC | on-chip | sdhc | ++-----------+------------+----------------------+ -**Note:** For using Ethernet module on EK-RA8M1, remove jumper J61 to enable Ethernet B +**Note:** + +- For using Ethernet module on EK-RA8M1, remove jumper J61 to enable Ethernet B +- For using SDHC driver on EK-RA8M1, remove jumper J61 to use with channel 0 Other hardware features are currently not supported by the port. diff --git a/boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi b/boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi index baaa8b9f241..f3c3ec3ebd9 100644 --- a/boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi +++ b/boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi @@ -121,4 +121,21 @@ drive-strength = "high"; }; }; + + sdhc0_default: sdhc0_default { + group1 { + psels = , /* SDCD */ + , /* SDCMD */ + , /* SDDATA0 */ + , /* SDDATA1 */ + , /* SDDATA2 */ + , /* SDDATA3 */ + ; /* SDWP */ + drive-strength = "high"; + }; + group2 { + psels = ; /* SDCLK */ + drive-strength = "highspeed-high"; + }; + }; }; diff --git a/boards/renesas/mck_ra8t1/doc/index.rst b/boards/renesas/mck_ra8t1/doc/index.rst index 7d7c824b01e..e80028da83b 100644 --- a/boards/renesas/mck_ra8t1/doc/index.rst +++ b/boards/renesas/mck_ra8t1/doc/index.rst @@ -114,6 +114,10 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board: +--------------+------------+----------------------+ | ADC | on-chip | adc | +--------------+------------+----------------------+ +| SDHC | on-chip | sdhc | ++--------------+------------+----------------------+ + +**Note:** For using SDHC module on EK-RA8M1, Connect microSD Card to microSD Socket (CN12) Other hardware features are currently not supported by the port. diff --git a/boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi b/boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi index 8f3d28e6491..5bb55bb8a0d 100644 --- a/boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi +++ b/boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi @@ -78,4 +78,21 @@ renesas,analog-enable; }; }; + + sdhc0_default: sdhc0_default { + group1 { + psels = , /* SDCD */ + , /* SDCMD */ + , /* SDDATA0 */ + , /* SDDATA1 */ + , /* SDDATA2 */ + , /* SDDATA3 */ + ; /* SDWP */ + drive-strength = "high"; + }; + group2 { + psels = ; /* SDCLK */ + drive-strength = "highspeed-high"; + }; + }; }; diff --git a/boards/renesas/mck_ra8t1/mck_ra8t1.dts b/boards/renesas/mck_ra8t1/mck_ra8t1.dts index 47d1628894e..d20ad5ecc4e 100644 --- a/boards/renesas/mck_ra8t1/mck_ra8t1.dts +++ b/boards/renesas/mck_ra8t1/mck_ra8t1.dts @@ -46,6 +46,7 @@ aliases { led0 = &led1; + sdhc0 = &sdhc0; }; }; @@ -87,6 +88,10 @@ status = "okay"; }; +&ioport3 { + status = "okay"; +}; + &ioport6 { status = "okay"; }; @@ -178,3 +183,16 @@ pinctrl-names = "default"; average-count = <4>; }; + +&sdhc0 { + compatible = "renesas,ra-sdhc"; + pinctrl-0 = <&sdhc0_default>; + enable-gpios = <&ioport3 11 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + status = "okay"; + sdmmc { + compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; + status = "okay"; + }; +};