Skip to content

Commit 149d23d

Browse files
quytranpzzkartben
authored andcommitted
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 <quy.tran.pz@renesas.com>
1 parent ddf56f5 commit 149d23d

File tree

7 files changed

+93
-2
lines changed

7 files changed

+93
-2
lines changed

boards/renesas/ek_ra8d1/doc/index.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,27 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board:
121121
+--------------+------------+-----------------------------------+
122122
| ADC | on-chip | adc |
123123
+--------------+------------+-----------------------------------+
124+
| SDHC | on-chip | sdhc |
125+
+--------------+------------+-----------------------------------+
126+
127+
**Note:**
124128

125-
**Note:** for using Ethernet on RA8D1 board please set switch SW1 as following configuration:
129+
- For using Ethernet on RA8D1 board please set switch SW1 as following configuration:
126130

127131
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
128132
| SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C |
129133
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
130134
| OFF | OFF | OFF | OFF | ON | OFF | OFF | OFF |
131135
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
132136

137+
- For using SDHC channel 1 on RA8D1 board please set switch SW1 as following configuration:
138+
139+
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
140+
| SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C |
141+
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
142+
| OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
143+
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
144+
133145
**CAUTION:** Do not enable SW1-4 and SW1-5 together
134146

135147
Other hardware features are currently not supported by the port.

boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,22 @@
243243
<RA_PSEL(RA_PSEL_GLCDC, 5, 14)>;
244244
};
245245
};
246+
247+
/* NOTE: pins conflict with ether_default */
248+
sdhc1_default: sdhc1_default {
249+
group1 {
250+
psels = <RA_PSEL(RA_PSEL_SDHI, 4, 6)>, /* SDCD */
251+
<RA_PSEL(RA_PSEL_SDHI, 4, 1)>, /* SDCMD */
252+
<RA_PSEL(RA_PSEL_SDHI, 4, 2)>, /* SDDATA0 */
253+
<RA_PSEL(RA_PSEL_SDHI, 4, 3)>, /* SDDATA1 */
254+
<RA_PSEL(RA_PSEL_SDHI, 4, 4)>, /* SDDATA2 */
255+
<RA_PSEL(RA_PSEL_SDHI, 4, 5)>, /* SDDATA3 */
256+
<RA_PSEL(RA_PSEL_SDHI, 7, 0)>; /* SDWP */
257+
drive-strength = "high";
258+
};
259+
group2 {
260+
psels = <RA_PSEL(RA_PSEL_SDHI, 4, 0)>; /* SDCLK */
261+
drive-strength = "highspeed-high";
262+
};
263+
};
246264
};

boards/renesas/ek_ra8m1/doc/index.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,13 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board:
118118
+-----------+------------+----------------------+
119119
| ADC | on-chip | adc |
120120
+-----------+------------+----------------------+
121+
| SDHC | on-chip | sdhc |
122+
+-----------+------------+----------------------+
123+
124+
**Note:**
121125

122-
**Note:** For using Ethernet module on EK-RA8M1, remove jumper J61 to enable Ethernet B
126+
- For using Ethernet module on EK-RA8M1, remove jumper J61 to enable Ethernet B
127+
- For using SDHC driver on EK-RA8M1, remove jumper J61 to use with channel 0
123128

124129
Other hardware features are currently not supported by the port.
125130

boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,21 @@
121121
drive-strength = "high";
122122
};
123123
};
124+
125+
sdhc0_default: sdhc0_default {
126+
group1 {
127+
psels = <RA_PSEL(RA_PSEL_SDHI, 3, 6)>, /* SDCD */
128+
<RA_PSEL(RA_PSEL_SDHI, 3, 7)>, /* SDCMD */
129+
<RA_PSEL(RA_PSEL_SDHI, 3, 4)>, /* SDDATA0 */
130+
<RA_PSEL(RA_PSEL_SDHI, 3, 3)>, /* SDDATA1 */
131+
<RA_PSEL(RA_PSEL_SDHI, 3, 2)>, /* SDDATA2 */
132+
<RA_PSEL(RA_PSEL_SDHI, 3, 1)>, /* SDDATA3 */
133+
<RA_PSEL(RA_PSEL_SDHI, 3, 5)>; /* SDWP */
134+
drive-strength = "high";
135+
};
136+
group2 {
137+
psels = <RA_PSEL(RA_PSEL_SDHI, 3, 8)>; /* SDCLK */
138+
drive-strength = "highspeed-high";
139+
};
140+
};
124141
};

boards/renesas/mck_ra8t1/doc/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board:
114114
+--------------+------------+----------------------+
115115
| ADC | on-chip | adc |
116116
+--------------+------------+----------------------+
117+
| SDHC | on-chip | sdhc |
118+
+--------------+------------+----------------------+
119+
120+
**Note:** For using SDHC module on EK-RA8M1, Connect microSD Card to microSD Socket (CN12)
117121

118122
Other hardware features are currently not supported by the port.
119123

boards/renesas/mck_ra8t1/mck_ra8t1-pinctrl.dtsi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,21 @@
7878
renesas,analog-enable;
7979
};
8080
};
81+
82+
sdhc0_default: sdhc0_default {
83+
group1 {
84+
psels = <RA_PSEL(RA_PSEL_SDHI, 3, 6)>, /* SDCD */
85+
<RA_PSEL(RA_PSEL_SDHI, 3, 7)>, /* SDCMD */
86+
<RA_PSEL(RA_PSEL_SDHI, 3, 4)>, /* SDDATA0 */
87+
<RA_PSEL(RA_PSEL_SDHI, 3, 3)>, /* SDDATA1 */
88+
<RA_PSEL(RA_PSEL_SDHI, 3, 2)>, /* SDDATA2 */
89+
<RA_PSEL(RA_PSEL_SDHI, 3, 1)>, /* SDDATA3 */
90+
<RA_PSEL(RA_PSEL_SDHI, 3, 5)>; /* SDWP */
91+
drive-strength = "high";
92+
};
93+
group2 {
94+
psels = <RA_PSEL(RA_PSEL_SDHI, 3, 8)>; /* SDCLK */
95+
drive-strength = "highspeed-high";
96+
};
97+
};
8198
};

boards/renesas/mck_ra8t1/mck_ra8t1.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
aliases {
4848
led0 = &led1;
49+
sdhc0 = &sdhc0;
4950
};
5051
};
5152

@@ -87,6 +88,10 @@
8788
status = "okay";
8889
};
8990

91+
&ioport3 {
92+
status = "okay";
93+
};
94+
9095
&ioport6 {
9196
status = "okay";
9297
};
@@ -178,3 +183,16 @@
178183
pinctrl-names = "default";
179184
average-count = <4>;
180185
};
186+
187+
&sdhc0 {
188+
compatible = "renesas,ra-sdhc";
189+
pinctrl-0 = <&sdhc0_default>;
190+
enable-gpios = <&ioport3 11 GPIO_ACTIVE_HIGH>;
191+
pinctrl-names = "default";
192+
status = "okay";
193+
sdmmc {
194+
compatible = "zephyr,sdmmc-disk";
195+
disk-name = "SD";
196+
status = "okay";
197+
};
198+
};

0 commit comments

Comments
 (0)