* [PATCH v17 01/17] dt-bindings: mmc: renesas,sdhi: Document RZ/G3L (r9a08g046) SoC
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 02/17] clk: renesas: r9a08g046: Add clock and reset entries for SDHI Biju
` (16 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm
Cc: Biju Das, Wolfram Sang, linux-mmc, devicetree, linux-kernel,
linux-renesas-soc, Prabhakar Mahadev Lad, Biju Das, Conor Dooley
From: Biju Das <biju.das.jz@bp.renesas.com>
Document the RZ/G3L (r9a08g046) SDHI controller. The RZ/G3L SDHI
controller is similar to RZ/G2L but has five clocks (core, clkh,
cd, aclk, aclkm) and three resets (rst, axim, axis), so update the
clocks/clock-names maximum to 5 and resets/reset-names maximum to 3.
It has an internal divider for all modes except HS400, and a 2048-bit
divider compared to 512 on others.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* Collected tag.
---
.../devicetree/bindings/mmc/renesas,sdhi.yaml | 101 +++++++++++++-----
1 file changed, 75 insertions(+), 26 deletions(-)
diff --git a/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml b/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
index 4d66966ce290..16cb395403f6 100644
--- a/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
+++ b/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
@@ -18,6 +18,7 @@ properties:
- renesas,sdhi-r7s9210 # SH-Mobile AG5
- renesas,sdhi-r8a73a4 # R-Mobile APE6
- renesas,sdhi-r8a7740 # R-Mobile A1
+ - renesas,sdhi-r9a08g046 # RZ/G3L
- renesas,sdhi-r9a09g057 # RZ/V2H(P)
- renesas,sdhi-sh73a0 # R-Mobile APE6
- items:
@@ -86,11 +87,11 @@ properties:
clocks:
minItems: 1
- maxItems: 4
+ maxItems: 5
clock-names:
minItems: 1
- maxItems: 4
+ maxItems: 5
dmas:
minItems: 4
@@ -116,7 +117,12 @@ properties:
maxItems: 1
resets:
- maxItems: 1
+ minItems: 1
+ maxItems: 3
+
+ reset-names:
+ minItems: 1
+ maxItems: 3
pinctrl-0:
minItems: 1
@@ -155,60 +161,101 @@ allOf:
properties:
compatible:
contains:
- enum:
- - renesas,sdhi-r9a09g057
- - renesas,rzg2l-sdhi
+ const: renesas,sdhi-r9a08g046
then:
properties:
clocks:
items:
- description: IMCLK, SDHI channel main clock1.
- description: CLK_HS, SDHI channel High speed clock which operates
- 4 times that of SDHI channel main clock1.
+ 2 times that of SDHI channel main clock1.
- description: IMCLK2, SDHI channel main clock2. When this clock is
turned off, external SD card detection cannot be
detected.
- - description: ACLK, SDHI channel bus clock.
+ - description: ACLK/IACLKS, SDHI channel bus clock.
+ - description: IACLKM, SDHI channel bus clock m.
clock-names:
items:
- const: core
- const: clkh
- const: cd
- const: aclk
+ - const: aclkm
+ resets:
+ items:
+ - description: rst, Core reset.
+ - description: axim, SDHI axi bus reset m.
+ - description: axis, SDHI axi bus reset s.
+ reset-names:
+ items:
+ - const: rst
+ - const: axim
+ - const: axis
required:
- clock-names
- resets
+ - reset-names
else:
if:
properties:
compatible:
contains:
enum:
- - renesas,rcar-gen2-sdhi
- - renesas,rcar-gen3-sdhi
- - renesas,rcar-gen4-sdhi
+ - renesas,sdhi-r9a09g057
+ - renesas,rzg2l-sdhi
then:
properties:
clocks:
- minItems: 1
- maxItems: 3
- clock-names:
- minItems: 1
- uniqueItems: true
items:
- - const: core
- - enum: [ clkh, cd ]
- - const: cd
- else:
- properties:
- clocks:
- minItems: 1
- maxItems: 2
+ - description: IMCLK, SDHI channel main clock1.
+ - description: CLK_HS, SDHI channel High speed clock which operates
+ 4 times that of SDHI channel main clock1.
+ - description: IMCLK2, SDHI channel main clock2. When this clock is
+ turned off, external SD card detection cannot be
+ detected.
+ - description: ACLK, SDHI channel bus clock.
clock-names:
- minItems: 1
items:
- const: core
+ - const: clkh
- const: cd
+ - const: aclk
+ resets:
+ maxItems: 1
+ required:
+ - clock-names
+ - resets
+ else:
+ if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,rcar-gen2-sdhi
+ - renesas,rcar-gen3-sdhi
+ - renesas,rcar-gen4-sdhi
+ then:
+ properties:
+ clocks:
+ minItems: 1
+ maxItems: 3
+ clock-names:
+ minItems: 1
+ uniqueItems: true
+ items:
+ - const: core
+ - enum: [ clkh, cd ]
+ - const: cd
+ else:
+ properties:
+ clocks:
+ minItems: 1
+ maxItems: 2
+ clock-names:
+ minItems: 1
+ items:
+ - const: core
+ - const: cd
- if:
properties:
@@ -247,7 +294,9 @@ allOf:
properties:
compatible:
contains:
- const: renesas,sdhi-r9a09g057
+ enum:
+ - renesas,sdhi-r9a08g046
+ - renesas,sdhi-r9a09g057
then:
properties:
vqmmc-regulator:
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 02/17] clk: renesas: r9a08g046: Add clock and reset entries for SDHI
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
2026-06-03 6:57 ` [PATCH v17 01/17] dt-bindings: mmc: renesas,sdhi: Document RZ/G3L (r9a08g046) SoC Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L Biju
` (15 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd
Cc: Biju Das, Brian Masney, linux-renesas-soc, linux-clk,
linux-kernel, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add clock and reset entries for SDHI.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/clk/renesas/r9a08g046-cpg.c | 92 +++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/drivers/clk/renesas/r9a08g046-cpg.c b/drivers/clk/renesas/r9a08g046-cpg.c
index a57638734ce7..272922b76e1e 100644
--- a/drivers/clk/renesas/r9a08g046-cpg.c
+++ b/drivers/clk/renesas/r9a08g046-cpg.c
@@ -17,10 +17,13 @@
/* RZ/G3L Specific registers. */
#define G3L_CPG_PL2_DDIV (0x204)
#define G3L_CPG_PL3_DDIV (0x208)
+#define G3L_CPG_SDHI_DDIV (0x218)
#define G3L_CPG_CA55CORE_DDIV (0x234)
#define G3L_CPG_RSCI_DDIV (0x238)
#define G3L_CPG_RSPI_DDIV (0x23c)
+#define G3L_CPG_SDHI_DSEL (0x244)
#define G3L_CLKDIVSTATUS (0x280)
+#define G3L_CLKSELSTATUS (0x284)
#define G3L_CPG_ETH_SSEL (0x410)
#define G3L_CPG_RSCI_SSEL (0x414)
#define G3L_CPG_RSPI_SSEL (0x418)
@@ -30,6 +33,9 @@
#define G3L_DIVPL2A DDIV_PACK(G3L_CPG_PL2_DDIV, 0, 2)
#define G3L_DIVPL2B DDIV_PACK(G3L_CPG_PL2_DDIV, 4, 2)
#define G3L_DIVPL3A DDIV_PACK(G3L_CPG_PL3_DDIV, 0, 2)
+#define G3L_DIV_SDHI0 DDIV_PACK(G3L_CPG_SDHI_DDIV, 0, 2)
+#define G3L_DIV_SDHI1 DDIV_PACK(G3L_CPG_SDHI_DDIV, 4, 2)
+#define G3L_DIV_SDHI2 DDIV_PACK(G3L_CPG_SDHI_DDIV, 8, 2)
#define G3L_DIV_CA55_CORE0 DDIV_PACK(G3L_CPG_CA55CORE_DDIV, 0, 3)
#define G3L_DIV_CA55_CORE1 DDIV_PACK(G3L_CPG_CA55CORE_DDIV, 4, 3)
#define G3L_DIV_CA55_CORE2 DDIV_PACK(G3L_CPG_CA55CORE_DDIV, 8, 3)
@@ -61,8 +67,18 @@
#define G3L_DIV_RSPI0_STS DDIV_PACK(G3L_CLKDIVSTATUS, 20, 1)
#define G3L_DIV_RSPI1_STS DDIV_PACK(G3L_CLKDIVSTATUS, 21, 1)
#define G3L_DIV_RSPI2_STS DDIV_PACK(G3L_CLKDIVSTATUS, 22, 1)
+#define G3L_DIV_SDHI0_STS DDIV_PACK(G3L_CLKDIVSTATUS, 24, 1)
+#define G3L_DIV_SDHI1_STS DDIV_PACK(G3L_CLKDIVSTATUS, 25, 1)
+#define G3L_DIV_SDHI2_STS DDIV_PACK(G3L_CLKDIVSTATUS, 26, 1)
+
+#define G3L_SEL_SDHI0_STS SEL_PLL_PACK(G3L_CLKSELSTATUS, 16, 1)
+#define G3L_SEL_SDHI1_STS SEL_PLL_PACK(G3L_CLKSELSTATUS, 17, 1)
+#define G3L_SEL_SDHI2_STS SEL_PLL_PACK(G3L_CLKSELSTATUS, 18, 1)
/* RZ/G3L Specific clocks select. */
+#define G3L_SEL_SDHI0 SEL_PLL_PACK(G3L_CPG_SDHI_DSEL, 0, 2)
+#define G3L_SEL_SDHI1 SEL_PLL_PACK(G3L_CPG_SDHI_DSEL, 4, 2)
+#define G3L_SEL_SDHI2 SEL_PLL_PACK(G3L_CPG_SDHI_DSEL, 8, 2)
#define G3L_SEL_ETH0_TX SEL_PLL_PACK(G3L_CPG_ETH_SSEL, 0, 1)
#define G3L_SEL_ETH0_RX SEL_PLL_PACK(G3L_CPG_ETH_SSEL, 1, 1)
#define G3L_SEL_ETH0_RM SEL_PLL_PACK(G3L_CPG_ETH_SSEL, 2, 1)
@@ -94,6 +110,7 @@ enum clk_ids {
/* Internal Core Clocks */
CLK_PLL1,
+ CLK_PLL1_DIV2,
CLK_PLL2,
CLK_PLL2_DIV2,
CLK_PLL2_DIV2_4,
@@ -117,16 +134,29 @@ enum clk_ids {
CLK_SEL_RSPI0,
CLK_SEL_RSPI1,
CLK_SEL_RSPI2,
+ CLK_SEL_SDHI0,
+ CLK_SEL_SDHI1,
+ CLK_SEL_SDHI2,
CLK_ETH0_TR,
CLK_ETH0_RM,
CLK_ETH1_TR,
CLK_ETH1_RM,
+ CLK_SD0_DIV2,
+ CLK_SD1_DIV2,
+ CLK_SD2_DIV2,
/* Module Clocks */
MOD_CLK_BASE,
};
/* Divider tables */
+static const struct clk_div_table dtable_1_4[] = {
+ { 0, 1 },
+ { 1, 2 },
+ { 2, 4 },
+ { 0, 0 },
+};
+
static const struct clk_div_table dtable_1_8[] = {
{ 0, 1 },
{ 1, 2 },
@@ -190,11 +220,15 @@ static const char * const sel_eth1_tx[] = { ".div_eth1_tr", "eth1_txc_tx_clk" };
static const char * const sel_eth1_rx[] = { ".div_eth1_tr", "eth1_rxc_rx_clk" };
static const char * const sel_eth1_rm[] = { ".pll6_div10", "eth1_rxc_rx_clk" };
static const char * const sel_rsci_rspi[] = { ".pll2_div5", ".pll2_div6", ".pll2_div7", ".pll2_div2_4" };
+static const char * const sel_sdhi[] = { ".pll2_div2", ".pll1_div2", ".pll6", ".pll2_div6" };
static const char * const sel_eth0_clk_tx_i[] = { ".sel_eth0_tx", ".div_eth0_rm" };
static const char * const sel_eth0_clk_rx_i[] = { ".sel_eth0_rx", ".div_eth0_rm" };
static const char * const sel_eth1_clk_tx_i[] = { ".sel_eth1_tx", ".div_eth1_rm" };
static const char * const sel_eth1_clk_rx_i[] = { ".sel_eth1_rx", ".div_eth1_rm" };
+/* Mux clock indices tables. */
+static const u32 mtable_sd[] = { 0, 1, 2, 3 };
+
static const struct cpg_core_clk r9a08g046_core_clks[] __initconst = {
/* External Clock Inputs */
DEF_INPUT("extal", CLK_EXTAL),
@@ -210,6 +244,7 @@ static const struct cpg_core_clk r9a08g046_core_clks[] __initconst = {
DEF_FIXED(".pll3", CLK_PLL3, CLK_EXTAL, 200, 3),
DEF_G3L_PLL(".pll6", CLK_PLL6, CLK_EXTAL, CPG_PLL_CONF(0x50, 0),
500000000UL),
+ DEF_FIXED(".pll1_div2", CLK_PLL1_DIV2, CLK_PLL1, 1, 2),
DEF_FIXED(".pll2_div2", CLK_PLL2_DIV2, CLK_PLL2, 1, 2),
DEF_FIXED(".pll2_div2_4", CLK_PLL2_DIV2_4, CLK_PLL2_DIV2, 1, 4),
DEF_FIXED(".pll2_div5", CLK_PLL2_DIV5, CLK_PLL2, 1, 5),
@@ -217,6 +252,12 @@ static const struct cpg_core_clk r9a08g046_core_clks[] __initconst = {
DEF_FIXED(".pll2_div7", CLK_PLL2_DIV7, CLK_PLL2, 1, 7),
DEF_FIXED(".pll3_div2", CLK_PLL3_DIV2, CLK_PLL3, 1, 2),
DEF_FIXED(".pll6_div10", CLK_PLL6_DIV10, CLK_PLL6, 1, 10),
+ DEF_SD_MUX(".sel_sdhi0", CLK_SEL_SDHI0, G3L_SEL_SDHI0, G3L_SEL_SDHI0_STS, sel_sdhi,
+ mtable_sd, 0, NULL),
+ DEF_SD_MUX(".sel_sdhi1", CLK_SEL_SDHI1, G3L_SEL_SDHI1, G3L_SEL_SDHI1_STS, sel_sdhi,
+ mtable_sd, 0, NULL),
+ DEF_SD_MUX(".sel_sdhi2", CLK_SEL_SDHI2, G3L_SEL_SDHI2, G3L_SEL_SDHI2_STS, sel_sdhi,
+ mtable_sd, 0, NULL),
DEF_MUX(".sel_rsci0", CLK_SEL_RSCI0, G3L_SEL_RSCI0, sel_rsci_rspi),
DEF_MUX(".sel_rsci1", CLK_SEL_RSCI1, G3L_SEL_RSCI1, sel_rsci_rspi),
DEF_MUX(".sel_rsci2", CLK_SEL_RSCI2, G3L_SEL_RSCI2, sel_rsci_rspi),
@@ -264,6 +305,18 @@ static const struct cpg_core_clk r9a08g046_core_clks[] __initconst = {
dtable_1_8, 0, 200000000UL, 0, NULL),
DEF_G3S_DIV("P19", R9A08G046_CLK_P19, CLK_SEL_RSPI2, G3L_DIV_RSPI2, G3L_DIV_RSPI2_STS,
dtable_1_8, 0, 200000000UL, 0, NULL),
+ DEF_G3S_DIV("SD0", R9A08G046_CLK_SD0, CLK_SEL_SDHI0, G3L_DIV_SDHI0, G3L_DIV_SDHI0_STS,
+ dtable_1_4, 800000000UL, 600000000UL, CLK_SET_RATE_PARENT,
+ rzg3s_cpg_div_clk_notifier),
+ DEF_G3S_DIV("SD1", R9A08G046_CLK_SD1, CLK_SEL_SDHI1, G3L_DIV_SDHI1, G3L_DIV_SDHI1_STS,
+ dtable_1_4, 800000000UL, 600000000UL, CLK_SET_RATE_PARENT,
+ rzg3s_cpg_div_clk_notifier),
+ DEF_G3S_DIV("SD2", R9A08G046_CLK_SD2, CLK_SEL_SDHI2, G3L_DIV_SDHI2, G3L_DIV_SDHI2_STS,
+ dtable_1_4, 800000000UL, 600000000UL, CLK_SET_RATE_PARENT,
+ rzg3s_cpg_div_clk_notifier),
+ DEF_FIXED(".sd0_div2", CLK_SD0_DIV2, R9A08G046_CLK_SD0, 1, 2),
+ DEF_FIXED(".sd1_div2", CLK_SD1_DIV2, R9A08G046_CLK_SD1, 1, 2),
+ DEF_FIXED(".sd2_div2", CLK_SD2_DIV2, R9A08G046_CLK_SD2, 1, 2),
DEF_FIXED("HP", R9A08G046_CLK_HP, CLK_PLL6_DIV10, 1, 1),
DEF_MUX_FLAGS("ETHTX01", R9A08G046_CLK_ETHTX01, G3L_SEL_ETH0_CLK_TX_I, sel_eth0_clk_tx_i,
CLK_SET_RATE_PARENT),
@@ -297,6 +350,36 @@ static const struct rzg2l_mod_clk r9a08g046_mod_clks[] = {
MSTOP(BUS_REG0, BIT(0))),
DEF_MOD("wdt0_clk", R9A08G046_WDT0_CLK, R9A08G046_OSCCLK, 0x548, 1,
MSTOP(BUS_REG0, BIT(0))),
+ DEF_MOD("sdhi0_imclk", R9A08G046_SDHI0_IMCLK, CLK_SD0_DIV2, 0x554, 0,
+ MSTOP(BUS_PERI_COM, BIT(0))),
+ DEF_MOD("sdhi0_imclk2", R9A08G046_SDHI0_IMCLK2, CLK_SD0_DIV2, 0x554, 1,
+ MSTOP(BUS_PERI_COM, BIT(0))),
+ DEF_MOD("sdhi0_clk_hs", R9A08G046_SDHI0_CLK_HS, R9A08G046_CLK_SD0, 0x554, 2,
+ MSTOP(BUS_PERI_COM, BIT(0))),
+ DEF_MOD("sdhi0_iaclks", R9A08G046_SDHI0_IACLKS, R9A08G046_CLK_P1, 0x554, 3,
+ MSTOP(BUS_PERI_COM, BIT(0))),
+ DEF_MOD("sdhi0_iaclkm", R9A08G046_SDHI0_IACLKM, R9A08G046_CLK_P1, 0x554, 12,
+ MSTOP(BUS_PERI_COM, BIT(0))),
+ DEF_MOD("sdhi1_imclk", R9A08G046_SDHI1_IMCLK, CLK_SD1_DIV2, 0x554, 4,
+ MSTOP(BUS_PERI_COM, BIT(1))),
+ DEF_MOD("sdhi1_imclk2", R9A08G046_SDHI1_IMCLK2, CLK_SD1_DIV2, 0x554, 5,
+ MSTOP(BUS_PERI_COM, BIT(1))),
+ DEF_MOD("sdhi1_clk_hs", R9A08G046_SDHI1_CLK_HS, R9A08G046_CLK_SD1, 0x554, 6,
+ MSTOP(BUS_PERI_COM, BIT(1))),
+ DEF_MOD("sdhi1_iaclks", R9A08G046_SDHI1_IACLKS, R9A08G046_CLK_P1, 0x554, 7,
+ MSTOP(BUS_PERI_COM, BIT(1))),
+ DEF_MOD("sdhi1_iaclkm", R9A08G046_SDHI1_IACLKM, R9A08G046_CLK_P1, 0x554, 13,
+ MSTOP(BUS_PERI_COM, BIT(1))),
+ DEF_MOD("sdhi2_imclk", R9A08G046_SDHI2_IMCLK, CLK_SD2_DIV2, 0x554, 8,
+ MSTOP(BUS_PERI_COM, BIT(11))),
+ DEF_MOD("sdhi2_imclk2", R9A08G046_SDHI2_IMCLK2, CLK_SD2_DIV2, 0x554, 9,
+ MSTOP(BUS_PERI_COM, BIT(11))),
+ DEF_MOD("sdhi2_clk_hs", R9A08G046_SDHI2_CLK_HS, R9A08G046_CLK_SD2, 0x554, 10,
+ MSTOP(BUS_PERI_COM, BIT(11))),
+ DEF_MOD("sdhi2_iaclks", R9A08G046_SDHI2_IACLKS, R9A08G046_CLK_P1, 0x554, 11,
+ MSTOP(BUS_PERI_COM, BIT(11))),
+ DEF_MOD("sdhi2_iaclkm", R9A08G046_SDHI2_IACLKM, R9A08G046_CLK_P1, 0x554, 14,
+ MSTOP(BUS_PERI_COM, BIT(11))),
DEF_MOD("ssi0_pclk2", R9A08G046_SSI0_PCLK2, R9A08G046_CLK_P0, 0x570, 0,
MSTOP(BUS_MCPU1, BIT(10))),
DEF_MOD("ssi0_pclk_sfr", R9A08G046_SSI0_PCLK_SFR, R9A08G046_CLK_P0, 0x570, 1,
@@ -412,6 +495,15 @@ static const struct rzg2l_reset r9a08g046_resets[] = {
DEF_RST(R9A08G046_DMAC_ARESETN, 0x82c, 0),
DEF_RST(R9A08G046_DMAC_RST_ASYNC, 0x82c, 1),
DEF_RST(R9A08G046_WDT0_PRESETN, 0x848, 0),
+ DEF_RST(R9A08G046_SDHI0_IXRST, 0x854, 0),
+ DEF_RST(R9A08G046_SDHI1_IXRST, 0x854, 1),
+ DEF_RST(R9A08G046_SDHI2_IXRST, 0x854, 2),
+ DEF_RST(R9A08G046_SDHI0_IXRSTAXIM, 0x854, 3),
+ DEF_RST(R9A08G046_SDHI0_IXRSTAXIS, 0x854, 4),
+ DEF_RST(R9A08G046_SDHI1_IXRSTAXIM, 0x854, 5),
+ DEF_RST(R9A08G046_SDHI1_IXRSTAXIS, 0x854, 6),
+ DEF_RST(R9A08G046_SDHI2_IXRSTAXIM, 0x854, 7),
+ DEF_RST(R9A08G046_SDHI2_IXRSTAXIS, 0x854, 8),
DEF_RST(R9A08G046_SSI0_RST_M2_REG, 0x870, 0),
DEF_RST(R9A08G046_SSI1_RST_M2_REG, 0x870, 1),
DEF_RST(R9A08G046_SSI2_RST_M2_REG, 0x870, 2),
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
2026-06-03 6:57 ` [PATCH v17 01/17] dt-bindings: mmc: renesas,sdhi: Document RZ/G3L (r9a08g046) SoC Biju
2026-06-03 6:57 ` [PATCH v17 02/17] clk: renesas: r9a08g046: Add clock and reset entries for SDHI Biju
@ 2026-06-03 6:57 ` Biju
2026-06-04 9:32 ` Geert Uytterhoeven
2026-06-03 6:57 ` [PATCH v17 04/17] mmc: renesas_sdhi: Fix whitespace alignment in struct renesas_sdhi_of_data Biju
` (14 subsequent siblings)
17 siblings, 1 reply; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Linus Walleij
Cc: Biju Das, linux-renesas-soc, linux-gpio, linux-kernel,
Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add power-on control (POC) support for SD channels 1 and 2 on the RZ/G3L
SoC (r9a08g046).
Introduce PIN_CFG_IO_VMC_SD2 capability flag (bit 22) and SD_CH2_POC
register offset (0x3024). Extend rzg2l_caps_to_pwr_reg() to return
SD_CH2_POC when PIN_CFG_IO_VMC_SD2 is set.
Replace RZG3L_MPXED_PIN_FUNCS() with RZG2L_MPXED_COMMON_PIN_FUNCS() for
port PG and PH pins, dropping PIN_CFG_SOFT_PS which is inappropriate for
SD pins, and annotate them with PIN_CFG_IO_VMC_SD1 and PIN_CFG_IO_VMC_SD2
respectively.
Annotate all RZ/G3L SD0 dedicated pins (CLK, CMD, RST#, DS, DAT0–DAT7)
with PIN_CFG_IO_VMC_SD0 so that power-source register lookups work
correctly for those pins.
Add sd_ch2 field to rzg2l_register_offsets and rzg2l_pinctrl_reg_cache to
save and restore the SD_CH2_POC register across suspend/resume cycles.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 74 +++++++++++++++++--------
1 file changed, 50 insertions(+), 24 deletions(-)
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 83c61dcb24b1..b1d4b2b9e176 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -69,6 +69,7 @@
#define PIN_CFG_PVDD1833_OTH_AWO_POC BIT(19) /* known on RZ/G3L only */
#define PIN_CFG_PVDD1833_OTH_ISO_POC BIT(20) /* known on RZ/G3L only */
#define PIN_CFG_WDTOVF_N_POC BIT(21) /* known on RZ/G3L only */
+#define PIN_CFG_IO_VMC_SD2 BIT(22) /* known on RZ/G3L only */
#define RZG2L_SINGLE_PIN BIT_ULL(63) /* Dedicated pin */
#define RZG2L_VARIABLE_CFG BIT_ULL(62) /* Variable cfg for port pins */
@@ -258,6 +259,7 @@ static const struct pin_config_item renesas_rzv2h_conf_items[] = {
* @oen: OEN register offset
* @qspi: QSPI register offset
* @other_poc: OTHER_POC register offset
+ * @sd_ch2: SD_CH2_POC register offset
*/
struct rzg2l_register_offsets {
u16 pwpr;
@@ -266,6 +268,7 @@ struct rzg2l_register_offsets {
u16 oen;
u16 qspi;
u16 other_poc;
+ u16 sd_ch2;
};
/**
@@ -372,6 +375,7 @@ struct rzg2l_pinctrl_pin_settings {
* @oen: Output Enable register cache
* @other_poc: OTHER_POC register cache
* @qspi: QSPI registers cache
+ * @sd_ch2: SD_CH2_POC registers cache
*/
struct rzg2l_pinctrl_reg_cache {
u8 *p;
@@ -390,6 +394,7 @@ struct rzg2l_pinctrl_reg_cache {
u8 oen;
u8 other_poc;
u8 qspi;
+ u8 sd_ch2;
};
struct rzg2l_pinctrl {
@@ -474,20 +479,32 @@ static const u64 r9a08g046_variable_pin_cfg[] = {
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PE, 5, RZG3L_MPXED_ETH_PIN_FUNCS(ETH1)),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PE, 6, RZG3L_MPXED_ETH_PIN_FUNCS(ETH1)),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PE, 7, RZG3L_MPXED_ETH_PIN_FUNCS(ETH1)),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 0, RZG3L_MPXED_PIN_FUNCS(B)),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 1, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 2, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 3, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 4, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 5, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 0, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IO_VMC_SD1),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 1, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 2, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 3, RZG2L_MPXED_COMMON_PIN_FUNCS(B) | PIN_CFG_IEN |
+ PIN_CFG_IO_VMC_SD1),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 4, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 5, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 6, RZG3L_MPXED_PIN_FUNCS_POC(B, ISO)),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PG, 7, RZG3L_MPXED_PIN_FUNCS_POC(B, ISO)),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 0, RZG3L_MPXED_PIN_FUNCS(B)),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 1, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 2, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 3, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 4, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
- RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 5, RZG3L_MPXED_PIN_FUNCS(B) | PIN_CFG_IEN),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 0, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IO_VMC_SD2),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 1, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD2),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 2, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD2),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 3, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD2),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 4, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD2),
+ RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PH, 5, RZG2L_MPXED_COMMON_PIN_FUNCS(B) |
+ PIN_CFG_IEN | PIN_CFG_IO_VMC_SD2),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PJ, 0, RZG3L_MPXED_PIN_FUNCS(A) | PIN_CFG_IEN),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PJ, 1, RZG3L_MPXED_PIN_FUNCS(A)),
RZG2L_VARIABLE_PIN_CFG_PACK(RZG3L_PJ, 2, RZG3L_MPXED_PIN_FUNCS(A)),
@@ -1053,6 +1070,8 @@ static int rzg2l_caps_to_pwr_reg(const struct rzg2l_register_offsets *regs,
return SD_CH(regs->sd_ch, 0);
if (caps & PIN_CFG_IO_VMC_SD1)
return SD_CH(regs->sd_ch, 1);
+ if (caps & PIN_CFG_IO_VMC_SD2)
+ return regs->sd_ch2;
if (caps & PIN_CFG_IO_VMC_ETH0)
return ETH_POC(regs->eth_poc, 0);
if (caps & PIN_CFG_IO_VMC_ETH1)
@@ -2677,28 +2696,28 @@ static const struct rzg2l_dedicated_configs rzg3l_dedicated_pins[] = {
(PIN_CFG_IOLH_A | PIN_CFG_PUPD | PIN_CFG_PVDD1833_OTH_AWO_POC)) },
{ "SCIF0_TXD", RZG2L_SINGLE_PIN_PACK(0x6, 1,
(PIN_CFG_IOLH_A | PIN_CFG_PUPD | PIN_CFG_PVDD1833_OTH_AWO_POC)) },
- { "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x9, 0, PIN_CFG_IOLH_B) },
+ { "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x9, 0, PIN_CFG_IOLH_B | PIN_CFG_IO_VMC_SD0) },
{ "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x9, 1,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
- { "SD0_RST#", RZG2L_SINGLE_PIN_PACK(0x9, 2, PIN_CFG_IOLH_B) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
+ { "SD0_RST#", RZG2L_SINGLE_PIN_PACK(0x9, 2, PIN_CFG_IOLH_B | PIN_CFG_IO_VMC_SD0) },
{ "SD0_DS", RZG2L_SINGLE_PIN_PACK(0x9, 5,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT0", RZG2L_SINGLE_PIN_PACK(0x0a, 0,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT1", RZG2L_SINGLE_PIN_PACK(0x0a, 1,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT2", RZG2L_SINGLE_PIN_PACK(0x0a, 2,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT3", RZG2L_SINGLE_PIN_PACK(0x0a, 3,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT4", RZG2L_SINGLE_PIN_PACK(0x0a, 4,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT5", RZG2L_SINGLE_PIN_PACK(0x0a, 5,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT6", RZG2L_SINGLE_PIN_PACK(0x0a, 6,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
{ "SD0_DAT7", RZG2L_SINGLE_PIN_PACK(0x0a, 7,
- (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
+ (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD | PIN_CFG_IO_VMC_SD0)) },
};
static const u32 r9a08g046_clone_channel_data[] = {
@@ -3672,6 +3691,9 @@ static int rzg2l_pinctrl_suspend_noirq(struct device *dev)
cache->eth_poc[i] = readb(pctrl->base + ETH_POC(regs->eth_poc, i));
}
+ if (regs->sd_ch2)
+ cache->sd_ch2 = readb(pctrl->base + regs->sd_ch2);
+
if (regs->qspi)
cache->qspi = readb(pctrl->base + regs->qspi);
cache->oen = readb(pctrl->base + pctrl->data->hwcfg->regs.oen);
@@ -3724,6 +3746,9 @@ static int rzg2l_pinctrl_resume_noirq(struct device *dev)
rzg2l_oen_write_with_pwpr(pctrl, cache->oen);
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
+ if (regs->sd_ch2)
+ writeb(cache->sd_ch2, pctrl->base + regs->sd_ch2);
+
for (u8 i = 0; i < 2; i++) {
if (regs->sd_ch)
writeb(cache->sd_ch[i], pctrl->base + SD_CH(regs->sd_ch, i));
@@ -3794,6 +3819,7 @@ static const struct rzg2l_hwcfg rzg3l_hwcfg = {
.eth_poc = 0x3010,
.oen = 0x3018,
.other_poc = OTHER_POC,
+ .sd_ch2 = 0x3024,
},
.iolh_groupa_ua = {
/* 1v8 power source */
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* Re: [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L
2026-06-03 6:57 ` [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L Biju
@ 2026-06-04 9:32 ` Geert Uytterhoeven
2026-06-04 9:39 ` Biju Das
0 siblings, 1 reply; 30+ messages in thread
From: Geert Uytterhoeven @ 2026-06-04 9:32 UTC (permalink / raw)
To: Biju
Cc: Linus Walleij, Biju Das, linux-renesas-soc, linux-gpio,
linux-kernel, Prabhakar Mahadev Lad
Hi Biju,
On Wed, 3 Jun 2026 at 08:57, Biju <biju.das.au@gmail.com> wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> Add power-on control (POC) support for SD channels 1 and 2 on the RZ/G3L
> SoC (r9a08g046).
>
> Introduce PIN_CFG_IO_VMC_SD2 capability flag (bit 22) and SD_CH2_POC
> register offset (0x3024). Extend rzg2l_caps_to_pwr_reg() to return
> SD_CH2_POC when PIN_CFG_IO_VMC_SD2 is set.
>
> Replace RZG3L_MPXED_PIN_FUNCS() with RZG2L_MPXED_COMMON_PIN_FUNCS() for
> port PG and PH pins, dropping PIN_CFG_SOFT_PS which is inappropriate for
> SD pins, and annotate them with PIN_CFG_IO_VMC_SD1 and PIN_CFG_IO_VMC_SD2
> respectively.
>
> Annotate all RZ/G3L SD0 dedicated pins (CLK, CMD, RST#, DS, DAT0–DAT7)
> with PIN_CFG_IO_VMC_SD0 so that power-source register lookups work
> correctly for those pins.
>
> Add sd_ch2 field to rzg2l_register_offsets and rzg2l_pinctrl_reg_cache to
> save and restore the SD_CH2_POC register across suspend/resume cycles.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Thanks for your patch!
> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> @@ -69,6 +69,7 @@
> #define PIN_CFG_PVDD1833_OTH_AWO_POC BIT(19) /* known on RZ/G3L only */
> #define PIN_CFG_PVDD1833_OTH_ISO_POC BIT(20) /* known on RZ/G3L only */
> #define PIN_CFG_WDTOVF_N_POC BIT(21) /* known on RZ/G3L only */
> +#define PIN_CFG_IO_VMC_SD2 BIT(22) /* known on RZ/G3L only */
>
> #define RZG2L_SINGLE_PIN BIT_ULL(63) /* Dedicated pin */
> #define RZG2L_VARIABLE_CFG BIT_ULL(62) /* Variable cfg for port pins */
> @@ -258,6 +259,7 @@ static const struct pin_config_item renesas_rzv2h_conf_items[] = {
> * @oen: OEN register offset
> * @qspi: QSPI register offset
> * @other_poc: OTHER_POC register offset
> + * @sd_ch2: SD_CH2_POC register offset
> */
> struct rzg2l_register_offsets {
> u16 pwpr;
> @@ -266,6 +268,7 @@ struct rzg2l_register_offsets {
> u16 oen;
> u16 qspi;
> u16 other_poc;
> + u16 sd_ch2;
Nit: your series would cause less conflicts with Claudiu's
"[PATCH v3 0/6] pinctrl: renesas: rzg2l: Add support for RZ/G3S I3C"
if you would add sd_ch2 after the existing sd_ch.
> };
>
> /**
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 30+ messages in thread* RE: [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L
2026-06-04 9:32 ` Geert Uytterhoeven
@ 2026-06-04 9:39 ` Biju Das
0 siblings, 0 replies; 30+ messages in thread
From: Biju Das @ 2026-06-04 9:39 UTC (permalink / raw)
To: geert, biju.das.au
Cc: Linus Walleij, linux-renesas-soc@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Prabhakar Mahadev Lad
Hi Geert,
Thanks for the feedback.
> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 04 June 2026 10:33
> Subject: Re: [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L
>
> Hi Biju,
>
> On Wed, 3 Jun 2026 at 08:57, Biju <biju.das.au@gmail.com> wrote:
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > Add power-on control (POC) support for SD channels 1 and 2 on the
> > RZ/G3L SoC (r9a08g046).
> >
> > Introduce PIN_CFG_IO_VMC_SD2 capability flag (bit 22) and SD_CH2_POC
> > register offset (0x3024). Extend rzg2l_caps_to_pwr_reg() to return
> > SD_CH2_POC when PIN_CFG_IO_VMC_SD2 is set.
> >
> > Replace RZG3L_MPXED_PIN_FUNCS() with RZG2L_MPXED_COMMON_PIN_FUNCS()
> > for port PG and PH pins, dropping PIN_CFG_SOFT_PS which is
> > inappropriate for SD pins, and annotate them with PIN_CFG_IO_VMC_SD1
> > and PIN_CFG_IO_VMC_SD2 respectively.
> >
> > Annotate all RZ/G3L SD0 dedicated pins (CLK, CMD, RST#, DS, DAT0–DAT7)
> > with PIN_CFG_IO_VMC_SD0 so that power-source register lookups work
> > correctly for those pins.
> >
> > Add sd_ch2 field to rzg2l_register_offsets and rzg2l_pinctrl_reg_cache
> > to save and restore the SD_CH2_POC register across suspend/resume cycles.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> > +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
> > @@ -69,6 +69,7 @@
> > #define PIN_CFG_PVDD1833_OTH_AWO_POC BIT(19) /* known on RZ/G3L only */
> > #define PIN_CFG_PVDD1833_OTH_ISO_POC BIT(20) /* known on RZ/G3L only */
> > #define PIN_CFG_WDTOVF_N_POC BIT(21) /* known on RZ/G3L only */
> > +#define PIN_CFG_IO_VMC_SD2 BIT(22) /* known on RZ/G3L only */
> >
> > #define RZG2L_SINGLE_PIN BIT_ULL(63) /* Dedicated pin */
> > #define RZG2L_VARIABLE_CFG BIT_ULL(62) /* Variable cfg for port pins */
> > @@ -258,6 +259,7 @@ static const struct pin_config_item renesas_rzv2h_conf_items[] = {
> > * @oen: OEN register offset
> > * @qspi: QSPI register offset
> > * @other_poc: OTHER_POC register offset
> > + * @sd_ch2: SD_CH2_POC register offset
> > */
> > struct rzg2l_register_offsets {
> > u16 pwpr;
> > @@ -266,6 +268,7 @@ struct rzg2l_register_offsets {
> > u16 oen;
> > u16 qspi;
> > u16 other_poc;
> > + u16 sd_ch2;
>
> Nit: your series would cause less conflicts with Claudiu's "[PATCH v3 0/6] pinctrl: renesas: rzg2l:
> Add support for RZ/G3S I3C"
> if you would add sd_ch2 after the existing sd_ch.
OK, will move sd_ch2 after sd_ch.
Cheers,
Biju
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v17 04/17] mmc: renesas_sdhi: Fix whitespace alignment in struct renesas_sdhi_of_data
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (2 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 05/17] mmc: renesas_sdhi_internal_dmac: Fix whitespace alignment in struct initializer Biju
` (13 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Remove extra spaces in the renesas_sdhi_of_data struct definition,
replacing the tab/space mix used to align tmio_ocr_mask with a single
space, consistent with kernel coding style.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index afc36a407c2c..09bf9b24a8c3 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -25,7 +25,7 @@ struct renesas_sdhi_scc {
struct renesas_sdhi_of_data {
unsigned long tmio_flags;
- u32 tmio_ocr_mask;
+ u32 tmio_ocr_mask;
unsigned long capabilities;
unsigned long capabilities2;
enum dma_slave_buswidth dma_buswidth;
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 05/17] mmc: renesas_sdhi_internal_dmac: Fix whitespace alignment in struct initializer
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (3 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 04/17] mmc: renesas_sdhi: Fix whitespace alignment in struct renesas_sdhi_of_data Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 06/17] mmc: renesas_sdhi: Introduce renesas_sdhi_hw_info to abstract clock mask Biju
` (12 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Remove extra tabs used to align .of_data and .quirks fields in the
of_rza2_compatible struct initializer, replacing them with single space,
consistent with kernel coding style.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 024edc4e5fe6..08cf1604ef1d 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -272,8 +272,8 @@ static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_nohs400_compat
};
static const struct renesas_sdhi_of_data_with_quirks of_rza2_compatible = {
- .of_data = &of_data_rza2,
- .quirks = &sdhi_quirks_fixed_addr,
+ .of_data = &of_data_rza2,
+ .quirks = &sdhi_quirks_fixed_addr,
};
static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 06/17] mmc: renesas_sdhi: Introduce renesas_sdhi_hw_info to abstract clock mask
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (4 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 05/17] mmc: renesas_sdhi_internal_dmac: Fix whitespace alignment in struct initializer Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 07/17] mmc: renesas_sdhi: Add max_divider to renesas_sdhi_hw_info Biju
` (11 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
The RZ/G3L SoC has 11 divider bits and requires a different clock mask in
renesas_sdhi_set_clock().
Add a new renesas_sdhi_hw_info struct to hold hardware-specific
parameters, starting with clk_mask. This replaces the hardcoded constant
in renesas_sdhi_set_clock() with a value sourced from the per-device
hw_info, and widens the clk variable from u32 to u64 accordingly, as
clk_mask for RZ/G3L exceeds 32 bits.
Wire hw_info through renesas_sdhi_of_data_with_quirks (internalDMAC path)
and a new renesas_sdhi_of_data_with_info wrapper (sysDMAC path), and plumb
it into renesas_sdhi_probe() so it is stored in the per-instance
renesas_sdhi struct.
All existing users are assigned sdhi_hw_info_generic, preserving current
behaviour. No functional change.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 12 ++++
drivers/mmc/host/renesas_sdhi_core.c | 7 +-
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 16 ++++-
drivers/mmc/host/renesas_sdhi_sys_dmac.c | 66 ++++++++++++++-----
4 files changed, 81 insertions(+), 20 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 09bf9b24a8c3..a7fc525b7218 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -41,6 +41,15 @@ struct renesas_sdhi_of_data {
#define SDHI_CALIB_TABLE_MAX 32
+struct renesas_sdhi_hw_info {
+ u64 clk_mask;
+};
+
+struct renesas_sdhi_of_data_with_info {
+ const struct renesas_sdhi_of_data *of_data;
+ const struct renesas_sdhi_hw_info *info;
+};
+
#define sdhi_has_quirk(p, q) ((p)->quirks && (p)->quirks->q)
struct renesas_sdhi_quirks {
@@ -57,6 +66,7 @@ struct renesas_sdhi_quirks {
struct renesas_sdhi_of_data_with_quirks {
const struct renesas_sdhi_of_data *of_data;
const struct renesas_sdhi_quirks *quirks;
+ const struct renesas_sdhi_hw_info *info;
};
/* We want both end_flags to be set before we mark DMA as finished */
@@ -79,6 +89,7 @@ struct renesas_sdhi {
struct tmio_mmc_data mmc_data;
struct renesas_sdhi_dma dma_priv;
const struct renesas_sdhi_quirks *quirks;
+ const struct renesas_sdhi_hw_info *info;
struct pinctrl *pinctrl;
struct pinctrl_state *pins_default, *pins_uhs;
void __iomem *scc_ctl;
@@ -106,6 +117,7 @@ struct renesas_sdhi {
int renesas_sdhi_probe(struct platform_device *pdev,
const struct tmio_mmc_dma_ops *dma_ops,
const struct renesas_sdhi_of_data *of_data,
+ const struct renesas_sdhi_hw_info *info,
const struct renesas_sdhi_quirks *quirks);
void renesas_sdhi_remove(struct platform_device *pdev);
int renesas_sdhi_suspend(struct device *dev);
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index f9ec78d699f4..2ff40950f209 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -193,8 +193,9 @@ static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
unsigned int new_clock)
{
+ struct renesas_sdhi *priv = host_to_priv(host);
unsigned int clk_margin;
- u32 clk = 0, clock;
+ u64 clk = 0, clock;
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN &
sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
@@ -213,7 +214,7 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
* provided for actual_clock in renesas_sdhi_clk_update().
*/
clk_margin = new_clock >> 10;
- for (clk = 0x80000080; new_clock + clk_margin >= (clock << 1); clk >>= 1)
+ for (clk = priv->info->clk_mask; new_clock + clk_margin >= (clock << 1); clk >>= 1)
clock <<= 1;
/* 1/1 clock is option */
@@ -1055,6 +1056,7 @@ static const struct regulator_desc renesas_sdhi_vqmmc_regulator = {
int renesas_sdhi_probe(struct platform_device *pdev,
const struct tmio_mmc_dma_ops *dma_ops,
const struct renesas_sdhi_of_data *of_data,
+ const struct renesas_sdhi_hw_info *info,
const struct renesas_sdhi_quirks *quirks)
{
struct tmio_mmc_data *mmd = pdev->dev.platform_data;
@@ -1079,6 +1081,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
if (!priv)
return -ENOMEM;
+ priv->info = info;
priv->quirks = quirks;
mmc_data = &priv->mmc_data;
dma_priv = &priv->dma_priv;
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 08cf1604ef1d..512ed70b3779 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -232,48 +232,61 @@ static const struct soc_device_attribute sdhi_quirks_match[] = {
{ /* Sentinel. */ }
};
+static const struct renesas_sdhi_hw_info sdhi_hw_info_generic = {
+ .clk_mask = 0x80000080,
+};
+
static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_bad_taps2367,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a77961_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_bad_taps1357,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a77965_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_r8a77965,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a77970_compatible = {
.of_data = &of_data_rcar_gen3_no_sdh_fallback,
.quirks = &sdhi_quirks_nohs400,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a77990_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_r8a77990,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_rzg2l_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_rzg2l,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_compatible = {
.of_data = &of_data_rcar_gen3,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_nohs400_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_nohs400,
+ .info = &sdhi_hw_info_generic,
};
static const struct renesas_sdhi_of_data_with_quirks of_rza2_compatible = {
.of_data = &of_data_rza2,
.quirks = &sdhi_quirks_fixed_addr,
+ .info = &sdhi_hw_info_generic,
};
static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
@@ -599,7 +612,8 @@ static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
dma_set_max_seg_size(dev, 0xffffffff);
return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops,
- of_data_quirks->of_data, quirks);
+ of_data_quirks->of_data, of_data_quirks->info,
+ quirks);
}
static const struct dev_pm_ops renesas_sdhi_internal_dmac_dev_pm_ops = {
diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
index 9215600f03a2..1291970c2810 100644
--- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
@@ -73,23 +73,51 @@ static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
.max_blk_count = UINT_MAX / TMIO_MAX_BLK_SIZE,
};
+static const struct renesas_sdhi_hw_info sdhi_hw_info_generic = {
+ .clk_mask = 0x80000080,
+};
+
+static const struct renesas_sdhi_of_data_with_info of_default_cfg_info = {
+ .of_data = &of_default_cfg,
+ .info = &sdhi_hw_info_generic,
+};
+
+static const struct renesas_sdhi_of_data_with_info of_rz_compatible_info = {
+ .of_data = &of_rz_compatible,
+ .info = &sdhi_hw_info_generic,
+};
+
+static const struct renesas_sdhi_of_data_with_info of_rcar_gen1_compatible_info = {
+ .of_data = &of_rcar_gen1_compatible,
+ .info = &sdhi_hw_info_generic,
+};
+
+static const struct renesas_sdhi_of_data_with_info of_rcar_gen2_compatible_info = {
+ .of_data = &of_rcar_gen2_compatible,
+ .info = &sdhi_hw_info_generic,
+};
+
+static const struct renesas_sdhi_of_data_with_info of_shmobile_info = {
+ .info = &sdhi_hw_info_generic,
+};
+
static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
- { .compatible = "renesas,sdhi-sh73a0", .data = &of_default_cfg, },
- { .compatible = "renesas,sdhi-r8a73a4", .data = &of_default_cfg, },
- { .compatible = "renesas,sdhi-r8a7740", .data = &of_default_cfg, },
- { .compatible = "renesas,sdhi-r7s72100", .data = &of_rz_compatible, },
- { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
- { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
- { .compatible = "renesas,sdhi-r8a7743", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-r8a7745", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-r8a7792", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-r8a7793", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-r8a7794", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,rcar-gen1-sdhi", .data = &of_rcar_gen1_compatible, },
- { .compatible = "renesas,rcar-gen2-sdhi", .data = &of_rcar_gen2_compatible, },
- { .compatible = "renesas,sdhi-shmobile" },
+ { .compatible = "renesas,sdhi-sh73a0", .data = &of_default_cfg_info, },
+ { .compatible = "renesas,sdhi-r8a73a4", .data = &of_default_cfg_info, },
+ { .compatible = "renesas,sdhi-r8a7740", .data = &of_default_cfg_info, },
+ { .compatible = "renesas,sdhi-r7s72100", .data = &of_rz_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7743", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7745", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7792", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7793", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-r8a7794", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,rcar-gen1-sdhi", .data = &of_rcar_gen1_compatible_info, },
+ { .compatible = "renesas,rcar-gen2-sdhi", .data = &of_rcar_gen2_compatible_info, },
+ { .compatible = "renesas,sdhi-shmobile", .data = &of_shmobile_info, },
{},
};
MODULE_DEVICE_TABLE(of, renesas_sdhi_sys_dmac_of_match);
@@ -452,8 +480,12 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_sys_dmac_dma_ops = {
static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev)
{
+ const struct renesas_sdhi_of_data_with_info *of_data_info;
+
+ of_data_info = of_device_get_match_data(&pdev->dev);
+
return renesas_sdhi_probe(pdev, &renesas_sdhi_sys_dmac_dma_ops,
- of_device_get_match_data(&pdev->dev), NULL);
+ of_data_info->of_data, of_data_info->info, NULL);
}
static DEFINE_RUNTIME_DEV_PM_OPS(renesas_sdhi_sys_dmac_dev_pm_ops,
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 07/17] mmc: renesas_sdhi: Add max_divider to renesas_sdhi_hw_info
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (5 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 06/17] mmc: renesas_sdhi: Introduce renesas_sdhi_hw_info to abstract clock mask Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 08/17] mmc: renesas_sdhi: Add tuning_delay hw_info flag Biju
` (10 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
The RZ/G3L SoC has a maximum divider value of 2048 compared to 512 on the
rest of the SoCs.
Add a max_divider field to renesas_sdhi_hw_info and replace the hardcoded
value in renesas_sdhi_clk_enable() and renesas_sdhi_set_clock() with
max_divider.
All existing users are assigned max_divider = 512 via sdhi_hw_info_generic
in both the internal and sys DMAC paths, preserving current behaviour.
No functional change.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change
---
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_core.c | 4 ++--
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 +
drivers/mmc/host/renesas_sdhi_sys_dmac.c | 1 +
4 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index a7fc525b7218..a42934e6d49d 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -43,6 +43,7 @@ struct renesas_sdhi_of_data {
struct renesas_sdhi_hw_info {
u64 clk_mask;
+ unsigned int max_divider;
};
struct renesas_sdhi_of_data_with_info {
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 2ff40950f209..16ed6fd8470d 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -117,7 +117,7 @@ static int renesas_sdhi_clk_enable(struct tmio_mmc_host *host)
* Minimum frequency is the minimum input clock frequency
* divided by our maximum divider.
*/
- mmc->f_min = max(clk_round_rate(priv->clk, 1) / 512, 1L);
+ mmc->f_min = max(clk_round_rate(priv->clk, 1) / priv->info->max_divider, 1L);
/* enable 16bit data access on SDBUF as default */
renesas_sdhi_sdbuf_width(host, 16);
@@ -206,7 +206,7 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
}
host->mmc->actual_clock = renesas_sdhi_clk_update(host, new_clock);
- clock = host->mmc->actual_clock / 512;
+ clock = host->mmc->actual_clock / priv->info->max_divider;
/*
* Add a margin of 1/1024 rate higher to the clock rate in order
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 512ed70b3779..84b1b38ca465 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -234,6 +234,7 @@ static const struct soc_device_attribute sdhi_quirks_match[] = {
static const struct renesas_sdhi_hw_info sdhi_hw_info_generic = {
.clk_mask = 0x80000080,
+ .max_divider = 512,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
index 1291970c2810..9d34551c6836 100644
--- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
@@ -75,6 +75,7 @@ static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
static const struct renesas_sdhi_hw_info sdhi_hw_info_generic = {
.clk_mask = 0x80000080,
+ .max_divider = 512,
};
static const struct renesas_sdhi_of_data_with_info of_default_cfg_info = {
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 08/17] mmc: renesas_sdhi: Add tuning_delay hw_info flag
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (6 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 07/17] mmc: renesas_sdhi: Add max_divider to renesas_sdhi_hw_info Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 09/17] mmc: renesas_sdhi: Add internal_divider hw_info flag for clk rate adjustment Biju
` (9 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
As per the RZ/G2L hardware manual, the TMPOUT bit field in the SCC_TMPPORT
register needs to be set to 0 when transferring at 3.3V, and to 1 when
transferring at 1.8V.
Add a tuning_delay bitfield to renesas_sdhi_hw_info to indicate hardware
that requires an adjustment when the signal voltage changes.
Add sdhi_hw_info_rzg2l with tuning_delay = 1 and assign it to
of_rzg2l_compatible, enabling the adjustment for RZ/G2L. All other
platforms retain sdhi_hw_info_generic with tuning_delay = 0 and
are unaffected.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 2 +
drivers/mmc/host/renesas_sdhi_core.c | 83 +++++++++++--------
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 8 +-
3 files changed, 58 insertions(+), 35 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index a42934e6d49d..a3c5fa368242 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -44,6 +44,8 @@ struct renesas_sdhi_of_data {
struct renesas_sdhi_hw_info {
u64 clk_mask;
unsigned int max_divider;
+ /* hardware features */
+ unsigned tuning_delay:1; /* Has tuning delay */
};
struct renesas_sdhi_of_data_with_info {
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 16ed6fd8470d..868ba6a6919e 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -257,40 +257,6 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
TMIO_STAT_DAT0);
}
-static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,
- struct mmc_ios *ios)
-{
- struct tmio_mmc_host *host = mmc_priv(mmc);
- struct renesas_sdhi *priv = host_to_priv(host);
- struct pinctrl_state *pin_state;
- int ret;
-
- switch (ios->signal_voltage) {
- case MMC_SIGNAL_VOLTAGE_330:
- pin_state = priv->pins_default;
- break;
- case MMC_SIGNAL_VOLTAGE_180:
- pin_state = priv->pins_uhs;
- break;
- default:
- return -EINVAL;
- }
-
- /*
- * If anything is missing, assume signal voltage is fixed at
- * 3.3V and succeed/fail accordingly.
- */
- if (IS_ERR(priv->pinctrl) || IS_ERR(pin_state))
- return ios->signal_voltage ==
- MMC_SIGNAL_VOLTAGE_330 ? 0 : -EINVAL;
-
- ret = mmc_regulator_set_vqmmc(host->mmc, ios);
- if (ret < 0)
- return ret;
-
- return pinctrl_select_state(priv->pinctrl, pin_state);
-}
-
/* SCC registers */
#define SH_MOBILE_SDHI_SCC_DTCNTL 0x000
#define SH_MOBILE_SDHI_SCC_TAPSET 0x002
@@ -351,6 +317,55 @@ static inline void sd_scc_write32(struct tmio_mmc_host *host,
writel(val, priv->scc_ctl + (addr << host->bus_shift));
}
+static void renesas_sdhi_set_hw_adjustment_delay(struct tmio_mmc_host *host)
+{
+ struct renesas_sdhi *priv = host_to_priv(host);
+
+ if (!priv->info->tuning_delay)
+ return;
+
+ if (host->mmc->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330)
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x0);
+ else
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x1);
+}
+
+static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,
+ struct mmc_ios *ios)
+{
+ struct tmio_mmc_host *host = mmc_priv(mmc);
+ struct renesas_sdhi *priv = host_to_priv(host);
+ struct pinctrl_state *pin_state;
+ int ret;
+
+ switch (ios->signal_voltage) {
+ case MMC_SIGNAL_VOLTAGE_330:
+ pin_state = priv->pins_default;
+ break;
+ case MMC_SIGNAL_VOLTAGE_180:
+ pin_state = priv->pins_uhs;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /*
+ * If anything is missing, assume signal voltage is fixed at
+ * 3.3V and succeed/fail accordingly.
+ */
+ if (IS_ERR(priv->pinctrl) || IS_ERR(pin_state))
+ return ios->signal_voltage ==
+ MMC_SIGNAL_VOLTAGE_330 ? 0 : -EINVAL;
+
+ ret = mmc_regulator_set_vqmmc(host->mmc, ios);
+ if (ret < 0)
+ return ret;
+
+ renesas_sdhi_set_hw_adjustment_delay(host);
+
+ return pinctrl_select_state(priv->pinctrl, pin_state);
+}
+
static unsigned int renesas_sdhi_init_tuning(struct tmio_mmc_host *host)
{
struct renesas_sdhi *priv;
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 84b1b38ca465..d056c3586e6f 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -237,6 +237,12 @@ static const struct renesas_sdhi_hw_info sdhi_hw_info_generic = {
.max_divider = 512,
};
+static const struct renesas_sdhi_hw_info sdhi_hw_info_rzg2l = {
+ .clk_mask = 0x80000080,
+ .max_divider = 512,
+ .tuning_delay = 1,
+};
+
static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_bad_taps2367,
@@ -270,7 +276,7 @@ static const struct renesas_sdhi_of_data_with_quirks of_r8a77990_compatible = {
static const struct renesas_sdhi_of_data_with_quirks of_rzg2l_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_rzg2l,
- .info = &sdhi_hw_info_generic,
+ .info = &sdhi_hw_info_rzg2l,
};
static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_compatible = {
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 09/17] mmc: renesas_sdhi: Add internal_divider hw_info flag for clk rate adjustment
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (7 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 08/17] mmc: renesas_sdhi: Add tuning_delay hw_info flag Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls Biju
` (8 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
The RZ/G3L SoC has an internal divider for all modes except HS400 mode.
Add an internal_divider bitfield to renesas_sdhi_hw_info and a divider
field to the renesas_sdhi instance struct.
During probe, if internal_divider is set and the device does not
have the mmc-hs400-1_8v property, priv->divider is set to 2;
otherwise it defaults to 1. This divider is then applied in
renesas_sdhi_clk_update() when setting the clk rate relative to
clkh, replacing the implicit divide-by-1 that was previously assumed.
No users set internal_divider yet; this patch only introduces the
infrastructure. No functional change for existing platforms.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 3 +++
drivers/mmc/host/renesas_sdhi_core.c | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index a3c5fa368242..0ca8ec27c320 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -46,6 +46,7 @@ struct renesas_sdhi_hw_info {
unsigned int max_divider;
/* hardware features */
unsigned tuning_delay:1; /* Has tuning delay */
+ unsigned internal_divider:1; /* Has internal divider */
};
struct renesas_sdhi_of_data_with_info {
@@ -112,6 +113,8 @@ struct renesas_sdhi {
struct reset_control *rstc;
struct tmio_mmc_host *host;
struct regulator_dev *rdev;
+
+ unsigned int divider;
};
#define host_to_priv(host) \
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 868ba6a6919e..8e2fb19b994b 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -185,7 +185,7 @@ static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
clk_set_rate(ref_clk, best_freq);
if (priv->clkh)
- clk_set_rate(priv->clk, best_freq >> clkh_shift);
+ clk_set_rate(priv->clk, (best_freq >> clkh_shift) * priv->divider);
return clk_get_rate(priv->clk);
}
@@ -1223,6 +1223,11 @@ int renesas_sdhi_probe(struct platform_device *pdev,
dev_pm_domain_start(&pdev->dev);
+ if (info->internal_divider && !device_property_read_bool(dev, "mmc-hs400-1_8v"))
+ priv->divider = 2;
+ else
+ priv->divider = 1;
+
ret = renesas_sdhi_clk_enable(host);
if (ret)
return ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (8 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 09/17] mmc: renesas_sdhi: Add internal_divider hw_info flag for clk rate adjustment Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 7:47 ` Philipp Zabel
2026-06-03 6:57 ` [PATCH v17 11/17] mmc: renesas_sdhi: Add RZ/G3L SDHI support Biju
` (7 subsequent siblings)
17 siblings, 1 reply; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson, Philipp Zabel
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
The RZ/G3L SoC has axis/axim resets compared to other SoCs.
Add two optional reset controls, rstc_axis and rstc_axim, to the
renesas_sdhi struct. Both are acquired at probe time using
devm_reset_control_get_optional_exclusive_deasserted() with the
"axis" and "axim" reset names respectively.
Include them alongside the existing rstc in bulk reset/assert/deassert
operations: triggered together in renesas_sdhi_reset(), and managed
via reset_control_bulk_assert/deassert() in the suspend and resume
paths, replacing the previous single-control calls.
Being optional, these resets are a no-op on platforms that do not
provide them, so existing behaviour is preserved.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 2 ++
drivers/mmc/host/renesas_sdhi_core.c | 26 +++++++++++++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 0ca8ec27c320..6c024e7f69e1 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -111,6 +111,8 @@ struct renesas_sdhi {
unsigned int tap_set;
struct reset_control *rstc;
+ struct reset_control *rstc_axis;
+ struct reset_control *rstc_axim;
struct tmio_mmc_host *host;
struct regulator_dev *rdev;
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 8e2fb19b994b..699872766f88 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -615,6 +615,8 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host, bool preserve)
sd_status = sd_ctrl_read32(host, CTL_SD_STATUS);
reset_control_reset(priv->rstc);
+ reset_control_reset(priv->rstc_axis);
+ reset_control_reset(priv->rstc_axim);
/* Unknown why but without polling reset status, it will hang */
read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100,
false, priv->rstc);
@@ -1128,6 +1130,14 @@ int renesas_sdhi_probe(struct platform_device *pdev,
if (IS_ERR(priv->rstc))
return PTR_ERR(priv->rstc);
+ priv->rstc_axim = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, "axim");
+ if (IS_ERR(priv->rstc_axim))
+ return PTR_ERR(priv->rstc_axim);
+
+ priv->rstc_axis = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, "axis");
+ if (IS_ERR(priv->rstc_axis))
+ return PTR_ERR(priv->rstc_axis);
+
priv->pinctrl = devm_pinctrl_get(&pdev->dev);
if (!IS_ERR(priv->pinctrl)) {
priv->pins_default = pinctrl_lookup_state(priv->pinctrl,
@@ -1351,13 +1361,18 @@ int renesas_sdhi_suspend(struct device *dev)
{
struct tmio_mmc_host *host = dev_get_drvdata(dev);
struct renesas_sdhi *priv = host_to_priv(host);
+ struct reset_control_bulk_data resets[] = {
+ { .rstc = priv->rstc },
+ { .rstc = priv->rstc_axim },
+ { .rstc = priv->rstc_axis },
+ };
int ret;
ret = pm_runtime_force_suspend(dev);
if (ret)
return ret;
- ret = reset_control_assert(priv->rstc);
+ ret = reset_control_bulk_assert(ARRAY_SIZE(resets), resets);
if (ret)
pm_runtime_force_resume(dev);
@@ -1369,15 +1384,20 @@ int renesas_sdhi_resume(struct device *dev)
{
struct tmio_mmc_host *host = dev_get_drvdata(dev);
struct renesas_sdhi *priv = host_to_priv(host);
+ struct reset_control_bulk_data resets[] = {
+ { .rstc = priv->rstc },
+ { .rstc = priv->rstc_axim },
+ { .rstc = priv->rstc_axis },
+ };
int ret;
- ret = reset_control_deassert(priv->rstc);
+ ret = reset_control_bulk_deassert(ARRAY_SIZE(resets), resets);
if (ret)
return ret;
ret = pm_runtime_force_resume(dev);
if (ret)
- reset_control_assert(priv->rstc);
+ reset_control_bulk_assert(ARRAY_SIZE(resets), resets);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* Re: [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls
2026-06-03 6:57 ` [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls Biju
@ 2026-06-03 7:47 ` Philipp Zabel
2026-06-03 8:02 ` Biju Das
0 siblings, 1 reply; 30+ messages in thread
From: Philipp Zabel @ 2026-06-03 7:47 UTC (permalink / raw)
To: Biju, Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad
On Mi, 2026-06-03 at 07:57 +0100, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> The RZ/G3L SoC has axis/axim resets compared to other SoCs.
>
> Add two optional reset controls, rstc_axis and rstc_axim, to the
> renesas_sdhi struct. Both are acquired at probe time using
> devm_reset_control_get_optional_exclusive_deasserted() with the
> "axis" and "axim" reset names respectively.
>
> Include them alongside the existing rstc in bulk reset/assert/deassert
> operations: triggered together in renesas_sdhi_reset(), and managed
> via reset_control_bulk_assert/deassert() in the suspend and resume
> paths, replacing the previous single-control calls.
>
> Being optional, these resets are a no-op on platforms that do not
> provide them, so existing behaviour is preserved.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * No change.
> ---
> drivers/mmc/host/renesas_sdhi.h | 2 ++
> drivers/mmc/host/renesas_sdhi_core.c | 26 +++++++++++++++++++++++---
> 2 files changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
> index 0ca8ec27c320..6c024e7f69e1 100644
> --- a/drivers/mmc/host/renesas_sdhi.h
> +++ b/drivers/mmc/host/renesas_sdhi.h
> @@ -111,6 +111,8 @@ struct renesas_sdhi {
> unsigned int tap_set;
>
> struct reset_control *rstc;
> + struct reset_control *rstc_axis;
> + struct reset_control *rstc_axim;
> struct tmio_mmc_host *host;
> struct regulator_dev *rdev;
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 8e2fb19b994b..699872766f88 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -615,6 +615,8 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host, bool preserve)
> sd_status = sd_ctrl_read32(host, CTL_SD_STATUS);
>
> reset_control_reset(priv->rstc);
> + reset_control_reset(priv->rstc_axis);
> + reset_control_reset(priv->rstc_axim);
Is this order (rstc, axis, axim) ...
> /* Unknown why but without polling reset status, it will hang */
> read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100,
> false, priv->rstc);
[...]
> @@ -1351,13 +1361,18 @@ int renesas_sdhi_suspend(struct device *dev)
> {
> struct tmio_mmc_host *host = dev_get_drvdata(dev);
> struct renesas_sdhi *priv = host_to_priv(host);
> + struct reset_control_bulk_data resets[] = {
> + { .rstc = priv->rstc },
> + { .rstc = priv->rstc_axim },
> + { .rstc = priv->rstc_axis },
... different from this one (rstc, axim, axis) on purpose?
regards
Philipp
^ permalink raw reply [flat|nested] 30+ messages in thread* RE: [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls
2026-06-03 7:47 ` Philipp Zabel
@ 2026-06-03 8:02 ` Biju Das
0 siblings, 0 replies; 30+ messages in thread
From: Biju Das @ 2026-06-03 8:02 UTC (permalink / raw)
To: Philipp Zabel, biju.das.au, wsa+renesas, Ulf Hansson
Cc: linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad
Hi Philipp Zabel,
Thanks for the feedback.
> -----Original Message-----
> From: Philipp Zabel <p.zabel@pengutronix.de>
> Sent: 03 June 2026 08:47
> Subject: Re: [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls
>
> On Mi, 2026-06-03 at 07:57 +0100, Biju wrote:
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > The RZ/G3L SoC has axis/axim resets compared to other SoCs.
> >
> > Add two optional reset controls, rstc_axis and rstc_axim, to the
> > renesas_sdhi struct. Both are acquired at probe time using
> > devm_reset_control_get_optional_exclusive_deasserted() with the "axis"
> > and "axim" reset names respectively.
> >
> > Include them alongside the existing rstc in bulk reset/assert/deassert
> > operations: triggered together in renesas_sdhi_reset(), and managed
> > via reset_control_bulk_assert/deassert() in the suspend and resume
> > paths, replacing the previous single-control calls.
> >
> > Being optional, these resets are a no-op on platforms that do not
> > provide them, so existing behaviour is preserved.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v1->v2:
> > * No change.
> > ---
> > drivers/mmc/host/renesas_sdhi.h | 2 ++
> > drivers/mmc/host/renesas_sdhi_core.c | 26 +++++++++++++++++++++++---
> > 2 files changed, 25 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mmc/host/renesas_sdhi.h
> > b/drivers/mmc/host/renesas_sdhi.h index 0ca8ec27c320..6c024e7f69e1
> > 100644
> > --- a/drivers/mmc/host/renesas_sdhi.h
> > +++ b/drivers/mmc/host/renesas_sdhi.h
> > @@ -111,6 +111,8 @@ struct renesas_sdhi {
> > unsigned int tap_set;
> >
> > struct reset_control *rstc;
> > + struct reset_control *rstc_axis;
> > + struct reset_control *rstc_axim;
> > struct tmio_mmc_host *host;
> > struct regulator_dev *rdev;
> >
> > diff --git a/drivers/mmc/host/renesas_sdhi_core.c
> > b/drivers/mmc/host/renesas_sdhi_core.c
> > index 8e2fb19b994b..699872766f88 100644
> > --- a/drivers/mmc/host/renesas_sdhi_core.c
> > +++ b/drivers/mmc/host/renesas_sdhi_core.c
> > @@ -615,6 +615,8 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host, bool preserve)
> > sd_status = sd_ctrl_read32(host, CTL_SD_STATUS);
> >
> > reset_control_reset(priv->rstc);
> > + reset_control_reset(priv->rstc_axis);
> > + reset_control_reset(priv->rstc_axim);
>
> Is this order (rstc, axis, axim) ...
There is no order mentioned in the hardware manual.
These are the bit definitions.
Bit 0: rstc, Bit 3: rst_axim, Bit 4: rst_axis
and
Binding lists the resets in the order { rst, axim, axis}
For, consistency I will keep the order { rstc, axim, axis }.
>
> > /* Unknown why but without polling reset status, it will hang */
> > read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100,
> > false, priv->rstc);
> [...]
> > @@ -1351,13 +1361,18 @@ int renesas_sdhi_suspend(struct device *dev)
> > {
> > struct tmio_mmc_host *host = dev_get_drvdata(dev);
> > struct renesas_sdhi *priv = host_to_priv(host);
> > + struct reset_control_bulk_data resets[] = {
> > + { .rstc = priv->rstc },
> > + { .rstc = priv->rstc_axim },
> > + { .rstc = priv->rstc_axis },
>
> ... different from this one (rstc, axim, axis) on purpose?
>
This is OK. Will fix the above reset order for consistency.
Cheers,
Biju
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v17 11/17] mmc: renesas_sdhi: Add RZ/G3L SDHI support
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (9 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 12/17] mmc: renesas_sdhi: Save and restore IOVS across suspend/resume Biju
` (6 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add support for the RZ/G3L (r9a08g046) SDHI controller, which has a
new hardware version register and also has different tuning registers,
internal clk divider, 11 bit divider, 3 resets and 5 clocks compared
to other SoCs. Similar to RZ/G2L SoCs it need tuning delay.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi_core.c | 23 +++++++---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 42 +++++++++++++++++++
2 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 699872766f88..ee1b1f70c9e3 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -59,6 +59,7 @@
#define SDHI_VER_GEN2_SDR104 0xcb0d
#define SDHI_VER_GEN3_SD 0xcc10
#define SDHI_VER_GEN3_SDMMC 0xcd10
+#define SDHI_VER_RZ_G3L_SDMMC 0xce10
#define SDHI_GEN3_MMC0_ADDR 0xee140000
@@ -79,6 +80,7 @@ static void renesas_sdhi_sdbuf_width(struct tmio_mmc_host *host, int width)
break;
case SDHI_VER_GEN3_SD:
case SDHI_VER_GEN3_SDMMC:
+ case SDHI_VER_RZ_G3L_SDMMC:
if (width == 64)
val = HOST_MODE_GEN3_64BIT;
else if (width == 32)
@@ -205,7 +207,8 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
goto out;
}
- host->mmc->actual_clock = renesas_sdhi_clk_update(host, new_clock);
+ host->mmc->actual_clock = renesas_sdhi_clk_update(host, new_clock) /
+ (priv->info->internal_divider ? 2 : 1);
clock = host->mmc->actual_clock / priv->info->max_divider;
/*
@@ -265,12 +268,14 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
#define SH_MOBILE_SDHI_SCC_RVSCNTL 0x008
#define SH_MOBILE_SDHI_SCC_RVSREQ 0x00A
#define SH_MOBILE_SDHI_SCC_SMPCMP 0x00C
-#define SH_MOBILE_SDHI_SCC_TMPPORT2 0x00E
+#define SH_MOBILE_SDHI_SCC_TMPPORT2 0x00E /* G3L: SDm_SCC_HS400MODE1 */
+#define RZG3L_SDHI_SCC_HWADJ2 0x010
#define SH_MOBILE_SDHI_SCC_TMPPORT3 0x014
-#define SH_MOBILE_SDHI_SCC_TMPPORT4 0x016
-#define SH_MOBILE_SDHI_SCC_TMPPORT5 0x018
-#define SH_MOBILE_SDHI_SCC_TMPPORT6 0x01A
-#define SH_MOBILE_SDHI_SCC_TMPPORT7 0x01C
+#define SH_MOBILE_SDHI_SCC_TMPPORT4 0x016 /* R-Car */
+#define SH_MOBILE_SDHI_SCC_TMPPORT5 0x018 /* R-Car */
+#define SH_MOBILE_SDHI_SCC_TMPPORT6 0x01A /* R-Car */
+#define SH_MOBILE_SDHI_SCC_TMPPORT7 0x01C /* R-Car */
+#define RZG3L_SDHI_SCC_HWADJ4 0x022
#define SH_MOBILE_SDHI_SCC_DTCNTL_TAPEN BIT(0)
#define SH_MOBILE_SDHI_SCC_DTCNTL_TAPNUM_SHIFT 16
@@ -393,6 +398,9 @@ static unsigned int renesas_sdhi_init_tuning(struct tmio_mmc_host *host)
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF, priv->scc_tappos);
+ if (priv->info->internal_divider)
+ sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HWADJ4, 0x0);
+
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, CLK_CTL_SCLKEN |
sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
@@ -727,6 +735,9 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
if (!priv->tap_num)
return 0; /* Tuning is not supported */
+ if (priv->info->tuning_delay && priv->tap_num == 8)
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x0);
+
if (priv->tap_num * 2 >= sizeof(priv->taps) * BITS_PER_BYTE) {
dev_err(&host->pdev->dev,
"Too many taps, please update 'taps' in tmio_mmc_host!\n");
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index d056c3586e6f..fb8a70d28eed 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -89,6 +89,13 @@ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
},
};
+static struct renesas_sdhi_scc rzg3l_scc_taps[] = {
+ {
+ .clk_rate = 0,
+ .tap = 0x00000300,
+ },
+};
+
static const struct renesas_sdhi_of_data of_data_rza2 = {
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
TMIO_MMC_HAVE_CBSY,
@@ -104,6 +111,23 @@ static const struct renesas_sdhi_of_data of_data_rza2 = {
.max_segs = 1,
};
+static const struct renesas_sdhi_of_data of_data_rzg3l = {
+ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
+ TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2 |
+ TMIO_MMC_64BIT_DATA_PORT,
+ .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+ MMC_CAP_CMD23 | MMC_CAP_WAIT_WHILE_BUSY,
+ .capabilities2 = MMC_CAP2_NO_WRITE_PROTECT | MMC_CAP2_MERGE_CAPABLE,
+ .bus_shift = 2,
+ .scc_offset = 0x1000,
+ .taps = rzg3l_scc_taps,
+ .taps_num = ARRAY_SIZE(rzg3l_scc_taps),
+ /* DMAC can handle 32bit blk count but only 1 segment */
+ .max_blk_count = UINT_MAX / TMIO_MAX_BLK_SIZE,
+ .max_segs = 1,
+ .sdhi_flags = SDHI_FLAG_NEED_CLKH_FALLBACK,
+};
+
static const struct renesas_sdhi_of_data of_data_rcar_gen3 = {
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2 |
@@ -217,6 +241,10 @@ static const struct renesas_sdhi_quirks sdhi_quirks_rzg2l = {
.hs400_disabled = true,
};
+static const struct renesas_sdhi_quirks sdhi_quirks_rzg3l = {
+ .fixed_addr_mode = true,
+};
+
/*
* Note for r8a7796 / r8a774a1: we can't distinguish ES1.1 and 1.2 as of now.
* So, we want to treat them equally and only have a match for ES1.2 to enforce
@@ -243,6 +271,13 @@ static const struct renesas_sdhi_hw_info sdhi_hw_info_rzg2l = {
.tuning_delay = 1,
};
+static const struct renesas_sdhi_hw_info sdhi_hw_info_rzg3l = {
+ .clk_mask = 0x200000200,
+ .max_divider = 2048,
+ .tuning_delay = 1,
+ .internal_divider = 1,
+};
+
static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_bad_taps2367,
@@ -296,6 +331,12 @@ static const struct renesas_sdhi_of_data_with_quirks of_rza2_compatible = {
.info = &sdhi_hw_info_generic,
};
+static const struct renesas_sdhi_of_data_with_quirks of_rzg3l_compatible = {
+ .of_data = &of_data_rzg3l,
+ .quirks = &sdhi_quirks_rzg3l,
+ .info = &sdhi_hw_info_rzg3l,
+};
+
static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
{ .compatible = "renesas,sdhi-r7s9210", .data = &of_rza2_compatible, },
{ .compatible = "renesas,sdhi-mmc-r8a77470", .data = &of_rcar_gen3_compatible, },
@@ -309,6 +350,7 @@ static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
{ .compatible = "renesas,sdhi-r8a77990", .data = &of_r8a77990_compatible, },
{ .compatible = "renesas,sdhi-r8a77995", .data = &of_rcar_gen3_nohs400_compatible, },
{ .compatible = "renesas,sdhi-r8a779md", .data = &of_rcar_gen3_nohs400_compatible, },
+ { .compatible = "renesas,sdhi-r9a08g046", .data = &of_rzg3l_compatible, },
{ .compatible = "renesas,sdhi-r9a09g011", .data = &of_rzg2l_compatible, },
{ .compatible = "renesas,sdhi-r9a09g057", .data = &of_rzg2l_compatible, },
{ .compatible = "renesas,rzg2l-sdhi", .data = &of_rzg2l_compatible, },
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 12/17] mmc: renesas_sdhi: Save and restore IOVS across suspend/resume
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (10 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 11/17] mmc: renesas_sdhi: Add RZ/G3L SDHI support Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 13/17] mmc: renesas_sdhi: Add RZ/G3L HS400 support Biju
` (5 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
The SD_STATUS register, specifically the IOVS (I/O Voltage Switch) bit, is
not automatically restored after a suspend/resume cycle, causing the
regulator to report an incorrect voltage on resume.
Fix this by caching the CTL_SD_STATUS register value in the renesas_sdhi
private struct at suspend time and writing it back during resume. The
save/restore is only performed when a regulator device (rdev) is present,
as the IOVS bit is only relevant in that context.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_core.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 6c024e7f69e1..10f634349da9 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -117,6 +117,7 @@ struct renesas_sdhi {
struct regulator_dev *rdev;
unsigned int divider;
+ u32 cache_sd_status;
};
#define host_to_priv(host) \
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index ee1b1f70c9e3..974acdf110d3 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -1379,6 +1379,9 @@ int renesas_sdhi_suspend(struct device *dev)
};
int ret;
+ if (priv->rdev)
+ priv->cache_sd_status = sd_ctrl_read32(host, CTL_SD_STATUS);
+
ret = pm_runtime_force_suspend(dev);
if (ret)
return ret;
@@ -1410,6 +1413,9 @@ int renesas_sdhi_resume(struct device *dev)
if (ret)
reset_control_bulk_assert(ARRAY_SIZE(resets), resets);
+ if (priv->rdev)
+ sd_ctrl_write32(host, CTL_SD_STATUS, priv->cache_sd_status);
+
return ret;
}
EXPORT_SYMBOL_GPL(renesas_sdhi_resume);
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 13/17] mmc: renesas_sdhi: Add RZ/G3L HS400 support
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (11 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 12/17] mmc: renesas_sdhi: Save and restore IOVS across suspend/resume Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L Biju
` (4 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add HS400 support for RZ/G3L SoC.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_core.c | 17 +++++++++++++++--
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 +
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 10f634349da9..92b66116f044 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -47,6 +47,7 @@ struct renesas_sdhi_hw_info {
/* hardware features */
unsigned tuning_delay:1; /* Has tuning delay */
unsigned internal_divider:1; /* Has internal divider */
+ unsigned scc_hs400_mode2:1; /* Has scc hs400 mode2 */
};
struct renesas_sdhi_of_data_with_info {
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 974acdf110d3..282107d06114 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -186,8 +186,12 @@ static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
clk_set_rate(ref_clk, best_freq);
- if (priv->clkh)
+ if (priv->clkh) {
+ if (priv->info->internal_divider && host->mmc->ios.timing == MMC_TIMING_MMC_HS400)
+ clkh_shift = 1;
+
clk_set_rate(priv->clk, (best_freq >> clkh_shift) * priv->divider);
+ }
return clk_get_rate(priv->clk);
}
@@ -229,7 +233,7 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
}
clock = clk & CLK_CTL_DIV_MASK;
- if (clock != CLK_CTL_DIV_MASK)
+ if (clock != CLK_CTL_DIV_MASK && clock != 0)
host->mmc->actual_clock /= (1 << (ffs(clock) + 1));
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clock);
@@ -275,6 +279,7 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
#define SH_MOBILE_SDHI_SCC_TMPPORT5 0x018 /* R-Car */
#define SH_MOBILE_SDHI_SCC_TMPPORT6 0x01A /* R-Car */
#define SH_MOBILE_SDHI_SCC_TMPPORT7 0x01C /* R-Car */
+#define RZG3L_SDHI_SCC_HS400MODE2 0x020
#define RZG3L_SDHI_SCC_HWADJ4 0x022
#define SH_MOBILE_SDHI_SCC_DTCNTL_TAPEN BIT(0)
@@ -308,6 +313,7 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
#define SH_MOBILE_SDHI_SCC_TMPPORT_DISABLE_WP_CODE 0xa5000000
#define SH_MOBILE_SDHI_SCC_TMPPORT_CALIB_CODE_MASK 0x1f
#define SH_MOBILE_SDHI_SCC_TMPPORT_MANUAL_MODE BIT(7)
+#define RZG3L_SDHI_SCC_HS400MODE2_HS400EN2 BIT(0)
static inline u32 sd_scc_read32(struct tmio_mmc_host *host,
struct renesas_sdhi *priv, int addr)
@@ -437,6 +443,10 @@ static void renesas_sdhi_hs400_complete(struct mmc_host *mmc)
SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL) |
sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
+ if (priv->info->scc_hs400_mode2)
+ sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HS400MODE2,
+ RZG3L_SDHI_SCC_HS400MODE2_HS400EN2);
+
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DTCNTL,
SH_MOBILE_SDHI_SCC_DTCNTL_TAPEN |
sd_scc_read32(host, priv,
@@ -578,6 +588,9 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL) &
sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
+ if (priv->info->scc_hs400_mode2)
+ sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HS400MODE2, 0x0);
+
if (sdhi_has_quirk(priv, hs400_calib_table) || sdhi_has_quirk(priv, hs400_bad_taps))
renesas_sdhi_adjust_hs400_mode_disable(host);
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index fb8a70d28eed..83d348fb5eeb 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -276,6 +276,7 @@ static const struct renesas_sdhi_hw_info sdhi_hw_info_rzg3l = {
.max_divider = 2048,
.tuning_delay = 1,
.internal_divider = 1,
+ .scc_hs400_mode2 = 1,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (12 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 13/17] mmc: renesas_sdhi: Add RZ/G3L HS400 support Biju
@ 2026-06-03 6:57 ` Biju
2026-06-12 12:47 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 15/17] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju
` (3 subsequent siblings)
17 siblings, 1 reply; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Biju Das, linux-mmc, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add an hs400_es bitfield to renesas_sdhi_hw_info and implement
renesas_sdhi_hs400_enhanced_strobe(), registered as
host->ops.hs400_enhanced_strobe for all SCC-capable controllers.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_core.c | 53 ++++++++++++++++---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 +
3 files changed, 49 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 92b66116f044..1a837d0c9479 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -48,6 +48,7 @@ struct renesas_sdhi_hw_info {
unsigned tuning_delay:1; /* Has tuning delay */
unsigned internal_divider:1; /* Has internal divider */
unsigned scc_hs400_mode2:1; /* Has scc hs400 mode2 */
+ unsigned hs400_es:1; /* Has hs400 enhanced strobe */
};
struct renesas_sdhi_of_data_with_info {
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 282107d06114..2a70a2e64b9c 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -274,7 +274,7 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
#define SH_MOBILE_SDHI_SCC_SMPCMP 0x00C
#define SH_MOBILE_SDHI_SCC_TMPPORT2 0x00E /* G3L: SDm_SCC_HS400MODE1 */
#define RZG3L_SDHI_SCC_HWADJ2 0x010
-#define SH_MOBILE_SDHI_SCC_TMPPORT3 0x014
+#define SH_MOBILE_SDHI_SCC_TMPPORT3 0x014 /* G3L: SDm_SCC_HWADJ3 */
#define SH_MOBILE_SDHI_SCC_TMPPORT4 0x016 /* R-Car */
#define SH_MOBILE_SDHI_SCC_TMPPORT5 0x018 /* R-Car */
#define SH_MOBILE_SDHI_SCC_TMPPORT6 0x01A /* R-Car */
@@ -298,8 +298,9 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
#define SH_MOBILE_SDHI_SCC_SMPCMP_CMD_REQUP BIT(24)
#define SH_MOBILE_SDHI_SCC_SMPCMP_CMD_ERR (BIT(8) | BIT(24))
-#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL BIT(4)
-#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN BIT(31)
+#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL BIT(4)
+#define SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE BIT(30)
+#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN BIT(31)
/* Definitions for values the SH_MOBILE_SDHI_SCC_TMPPORT4 register */
#define SH_MOBILE_SDHI_SCC_TMPPORT4_DLL_ACC_START BIT(0)
@@ -574,6 +575,8 @@ static void renesas_sdhi_adjust_hs400_mode_disable(struct tmio_mmc_host *host)
static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
struct renesas_sdhi *priv)
{
+ unsigned long val;
+
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN &
sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
@@ -583,10 +586,12 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF, priv->scc_tappos);
+ val = ~(SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN | SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL);
+ if (priv->info->hs400_es)
+ val &= ~SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE;
+
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2,
- ~(SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN |
- SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL) &
- sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
+ val & sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
if (priv->info->scc_hs400_mode2)
sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HS400MODE2, 0x0);
@@ -783,6 +788,41 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
return ret;
}
+static void renesas_sdhi_hs400_enhanced_strobe(struct mmc_host *mmc,
+ struct mmc_ios *ios)
+{
+ struct tmio_mmc_host *host = mmc_priv(mmc);
+ struct renesas_sdhi *priv = host_to_priv(host);
+ u32 val = sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2);
+
+ if (!priv->info->hs400_es)
+ return;
+
+ if (ios->enhanced_strobe) {
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_CKSEL,
+ ~SH_MOBILE_SDHI_SCC_CKSEL_DTSEL &
+ sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_CKSEL));
+
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DTCNTL,
+ ~SH_MOBILE_SDHI_SCC_DTCNTL_TAPEN &
+ sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_DTCNTL));
+
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT3, BIT(8) | BIT(9));
+ sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HWADJ2, 0xFF);
+ sd_ctrl_write16(host, CTL_SDIF_MODE, SDIF_MODE_HS400 |
+ sd_ctrl_read16(host, CTL_SDIF_MODE));
+ sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HS400MODE2,
+ RZG3L_SDHI_SCC_HS400MODE2_HS400EN2);
+
+ val |= SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN |
+ SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE;
+ } else {
+ val &= ~SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE;
+ }
+
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, val);
+}
+
static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_4tap)
{
struct renesas_sdhi *priv = host_to_priv(host);
@@ -1333,6 +1373,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
host->ops.prepare_hs400_tuning = renesas_sdhi_prepare_hs400_tuning;
host->ops.hs400_downgrade = renesas_sdhi_disable_scc;
host->ops.hs400_complete = renesas_sdhi_hs400_complete;
+ host->ops.hs400_enhanced_strobe = renesas_sdhi_hs400_enhanced_strobe;
}
sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, host->sdcard_irq_mask_all);
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 83d348fb5eeb..a021ebb46070 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -277,6 +277,7 @@ static const struct renesas_sdhi_hw_info sdhi_hw_info_rzg3l = {
.tuning_delay = 1,
.internal_divider = 1,
.scc_hs400_mode2 = 1,
+ .hs400_es = 1,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* RE: [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L
2026-06-03 6:57 ` [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L Biju
@ 2026-06-12 12:47 ` Biju Das
0 siblings, 0 replies; 30+ messages in thread
From: Biju Das @ 2026-06-12 12:47 UTC (permalink / raw)
To: biju.das.au, wsa+renesas, Ulf Hansson
Cc: linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, Geert Uytterhoeven,
Prabhakar Mahadev Lad, biju.das.au
> -----Original Message-----
> From: Biju <biju.das.au@gmail.com>
> Sent: 03 June 2026 07:57
> Subject: [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L
>
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> Add an hs400_es bitfield to renesas_sdhi_hw_info and implement renesas_sdhi_hs400_enhanced_strobe(),
> registered as
> host->ops.hs400_enhanced_strobe for all SCC-capable controllers.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * No change.
> ---
> drivers/mmc/host/renesas_sdhi.h | 1 +
> drivers/mmc/host/renesas_sdhi_core.c | 53 ++++++++++++++++---
> drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 +
> 3 files changed, 49 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h index
> 92b66116f044..1a837d0c9479 100644
> --- a/drivers/mmc/host/renesas_sdhi.h
> +++ b/drivers/mmc/host/renesas_sdhi.h
> @@ -48,6 +48,7 @@ struct renesas_sdhi_hw_info {
> unsigned tuning_delay:1; /* Has tuning delay */
> unsigned internal_divider:1; /* Has internal divider */
> unsigned scc_hs400_mode2:1; /* Has scc hs400 mode2 */
> + unsigned hs400_es:1; /* Has hs400 enhanced strobe */
> };
>
> struct renesas_sdhi_of_data_with_info { diff --git a/drivers/mmc/host/renesas_sdhi_core.c
> b/drivers/mmc/host/renesas_sdhi_core.c
> index 282107d06114..2a70a2e64b9c 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -274,7 +274,7 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
> #define SH_MOBILE_SDHI_SCC_SMPCMP 0x00C
> #define SH_MOBILE_SDHI_SCC_TMPPORT2 0x00E /* G3L: SDm_SCC_HS400MODE1 */
> #define RZG3L_SDHI_SCC_HWADJ2 0x010
> -#define SH_MOBILE_SDHI_SCC_TMPPORT3 0x014
> +#define SH_MOBILE_SDHI_SCC_TMPPORT3 0x014 /* G3L: SDm_SCC_HWADJ3 */
> #define SH_MOBILE_SDHI_SCC_TMPPORT4 0x016 /* R-Car */
> #define SH_MOBILE_SDHI_SCC_TMPPORT5 0x018 /* R-Car */
> #define SH_MOBILE_SDHI_SCC_TMPPORT6 0x01A /* R-Car */
> @@ -298,8 +298,9 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
> #define SH_MOBILE_SDHI_SCC_SMPCMP_CMD_REQUP BIT(24)
> #define SH_MOBILE_SDHI_SCC_SMPCMP_CMD_ERR (BIT(8) | BIT(24))
>
> -#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL BIT(4)
> -#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN BIT(31)
> +#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL BIT(4)
> +#define SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE BIT(30)
> +#define SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN BIT(31)
>
> /* Definitions for values the SH_MOBILE_SDHI_SCC_TMPPORT4 register */
> #define SH_MOBILE_SDHI_SCC_TMPPORT4_DLL_ACC_START BIT(0)
> @@ -574,6 +575,8 @@ static void renesas_sdhi_adjust_hs400_mode_disable(struct tmio_mmc_host *host)
> static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
> struct renesas_sdhi *priv)
> {
> + unsigned long val;
> +
> sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN &
> sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
>
> @@ -583,10 +586,12 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
>
> sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF, priv->scc_tappos);
>
> + val = ~(SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN | SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL);
SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL- This bit not available in G3L, so need a fix.
Cheers,
Biju
> + if (priv->info->hs400_es)
> + val &= ~SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE;
> +
> sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2,
> - ~(SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN |
> - SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL) &
> - sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
> + val & sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2));
>
> if (priv->info->scc_hs400_mode2)
> sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HS400MODE2, 0x0); @@ -783,6 +788,41 @@ static
> int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
> return ret;
> }
>
> +static void renesas_sdhi_hs400_enhanced_strobe(struct mmc_host *mmc,
> + struct mmc_ios *ios)
> +{
> + struct tmio_mmc_host *host = mmc_priv(mmc);
> + struct renesas_sdhi *priv = host_to_priv(host);
> + u32 val = sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2);
> +
> + if (!priv->info->hs400_es)
> + return;
> +
> + if (ios->enhanced_strobe) {
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_CKSEL,
> + ~SH_MOBILE_SDHI_SCC_CKSEL_DTSEL &
> + sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_CKSEL));
> +
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DTCNTL,
> + ~SH_MOBILE_SDHI_SCC_DTCNTL_TAPEN &
> + sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_DTCNTL));
> +
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT3, BIT(8) | BIT(9));
> + sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HWADJ2, 0xFF);
> + sd_ctrl_write16(host, CTL_SDIF_MODE, SDIF_MODE_HS400 |
> + sd_ctrl_read16(host, CTL_SDIF_MODE));
> + sd_scc_write32(host, priv, RZG3L_SDHI_SCC_HS400MODE2,
> + RZG3L_SDHI_SCC_HS400MODE2_HS400EN2);
> +
> + val |= SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN |
> + SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE;
> + } else {
> + val &= ~SH_MOBILE_SDHI_SCC_HS400MODE1_ENHANCED_STROBE;
> + }
> +
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, val); }
> +
> static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_4tap) {
> struct renesas_sdhi *priv = host_to_priv(host); @@ -1333,6 +1373,7 @@ int
> renesas_sdhi_probe(struct platform_device *pdev,
> host->ops.prepare_hs400_tuning = renesas_sdhi_prepare_hs400_tuning;
> host->ops.hs400_downgrade = renesas_sdhi_disable_scc;
> host->ops.hs400_complete = renesas_sdhi_hs400_complete;
> + host->ops.hs400_enhanced_strobe = renesas_sdhi_hs400_enhanced_strobe;
> }
>
> sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, host->sdcard_irq_mask_all); diff --git
> a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> index 83d348fb5eeb..a021ebb46070 100644
> --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> @@ -277,6 +277,7 @@ static const struct renesas_sdhi_hw_info sdhi_hw_info_rzg3l = {
> .tuning_delay = 1,
> .internal_divider = 1,
> .scc_hs400_mode2 = 1,
> + .hs400_es = 1,
> };
>
> static const struct renesas_sdhi_of_data_with_quirks of_r8a7795_compatible = {
> --
> 2.43.0
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v17 15/17] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (13 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 16/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju
` (2 subsequent siblings)
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Biju Das, linux-renesas-soc, devicetree, linux-kernel,
Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add device tree nodes for the three SDHI controllers (SDHI{0,1,2})
on the RZ/G3L SoC (r9a08g046) and enable SDHI1 on the RZ/G3L SMARC
EVK platform with pincontrol and GPIO-based voltage switching
regulator support.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
arch/arm64/boot/dts/renesas/r9a08g046.dtsi | 73 ++++++++++++++-
.../boot/dts/renesas/r9a08g046l48-smarc.dts | 88 +++++++++++++++++++
2 files changed, 160 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
index c63a857f0e5b..ff2de3f192b5 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
@@ -762,9 +762,80 @@ dmac: dma-controller@11820000 {
dma-channels = <16>;
};
+ sdhi0: mmc@11c00000 {
+ compatible = "renesas,sdhi-r9a08g046";
+ reg = <0x0 0x11c00000 0 0x10000>;
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD R9A08G046_SDHI0_IMCLK>,
+ <&cpg CPG_MOD R9A08G046_SDHI0_CLK_HS>,
+ <&cpg CPG_MOD R9A08G046_SDHI0_IMCLK2>,
+ <&cpg CPG_MOD R9A08G046_SDHI0_IACLKS>,
+ <&cpg CPG_MOD R9A08G046_SDHI0_IACLKM>;
+ clock-names = "core", "clkh", "cd", "aclk", "aclkm";
+ max-frequency = <150000000>;
+ resets = <&cpg R9A08G046_SDHI0_IXRST>,
+ <&cpg R9A08G046_SDHI0_IXRSTAXIM>,
+ <&cpg R9A08G046_SDHI0_IXRSTAXIS>;
+ reset-names = "rst", "axim", "axis";
+ power-domains = <&cpg>;
+ status = "disabled";
+ };
+
sdhi1: mmc@11c10000 {
+ compatible = "renesas,sdhi-r9a08g046";
reg = <0x0 0x11c10000 0 0x10000>;
- /* placeholder */
+ interrupts = <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD R9A08G046_SDHI1_IMCLK>,
+ <&cpg CPG_MOD R9A08G046_SDHI1_CLK_HS>,
+ <&cpg CPG_MOD R9A08G046_SDHI1_IMCLK2>,
+ <&cpg CPG_MOD R9A08G046_SDHI1_IACLKS>,
+ <&cpg CPG_MOD R9A08G046_SDHI1_IACLKM>;
+ clock-names = "core", "clkh", "cd", "aclk", "aclkm";
+ max-frequency = <150000000>;
+ resets = <&cpg R9A08G046_SDHI1_IXRST>,
+ <&cpg R9A08G046_SDHI1_IXRSTAXIM>,
+ <&cpg R9A08G046_SDHI1_IXRSTAXIS>;
+ reset-names = "rst", "axim", "axis";
+ power-domains = <&cpg>;
+ status = "disabled";
+
+ sdhi1_vqmmc: vqmmc-regulator {
+ regulator-name = "SDHI1-VQMMC";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-ramp-delay = <1200>;
+ status = "disabled";
+ };
+ };
+
+ sdhi2: mmc@11c20000 {
+ compatible = "renesas,sdhi-r9a08g046";
+ reg = <0x0 0x11c20000 0 0x10000>;
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD R9A08G046_SDHI2_IMCLK>,
+ <&cpg CPG_MOD R9A08G046_SDHI2_CLK_HS>,
+ <&cpg CPG_MOD R9A08G046_SDHI2_IMCLK2>,
+ <&cpg CPG_MOD R9A08G046_SDHI2_IACLKS>,
+ <&cpg CPG_MOD R9A08G046_SDHI2_IACLKM>;
+ clock-names = "core", "clkh", "cd", "aclk", "aclkm";
+ max-frequency = <150000000>;
+ resets = <&cpg R9A08G046_SDHI2_IXRST>,
+ <&cpg R9A08G046_SDHI2_IXRSTAXIM>,
+ <&cpg R9A08G046_SDHI2_IXRSTAXIS>;
+ reset-names = "rst", "axim", "axis";
+ power-domains = <&cpg>;
+ status = "disabled";
+
+ sdhi2_vqmmc: vqmmc-regulator {
+ regulator-name = "SDHI2-VQMMC";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-ramp-delay = <1200>;
+ status = "disabled";
+ };
};
eth0: ethernet@11c30000 {
diff --git a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
index 624fcaea350f..a4cc07408b3f 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
+++ b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
@@ -14,6 +14,7 @@
#define SW_GPIO4 1
#define SW_I3C_EN 0
#define SW_SER0_PMOD 1
+#define SW_SDIO_M2E 0
#define PMOD_GPIO4 0
#define PMOD_GPIO6 0
@@ -38,6 +39,7 @@ / {
aliases {
i2c2 = &i2c2;
i2c3 = &i2c3;
+ mmc1 = &sdhi1;
serial0 = &rsci2;
serial1 = &rsci3;
serial2 = &rsci1;
@@ -69,6 +71,19 @@ codec_dai: codec {
};
};
#endif
+
+#if RZ_BOOT_MODE3
+ vqmmc_sd1_pvdd: regulator-vqmmc-sd1-pvdd {
+ compatible = "regulator-gpio";
+ regulator-name = "SD1_PVDD";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ gpios = <&pinctrl RZG3L_GPIO(J, 1) GPIO_ACTIVE_HIGH>;
+ gpios-states = <0>;
+ states = <3300000 0>, <1800000 1>;
+ regulator-ramp-delay = <1200>;
+ };
+#endif
};
&i2c2 {
@@ -175,6 +190,68 @@ scif0_pins: scif0 {
power-source = <1800>;
};
+#if RZ_BOOT_MODE3
+ sd1-pwr-en-hog {
+ gpio-hog;
+ gpios = <RZG3L_GPIO(J, 2) GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "sd1_pwr_en";
+ };
+#endif
+
+ sdhi1_pins: sd1 {
+ sd1-cd {
+ pinmux = <RZG3L_PORT_PINMUX(J, 0, 8)>; /* SD1_CD */
+ };
+
+ sd1-clk {
+ pinmux = <RZG3L_PORT_PINMUX(G, 0, 1)>; /* SD1_CLK */
+ power-source = <3300>;
+ };
+
+ sd1-cmd {
+ pinmux = <RZG3L_PORT_PINMUX(G, 1, 1)>; /* SD1_CMD */
+ input-enable;
+ power-source = <3300>;
+ bias-pull-up;
+ };
+
+ sd1-data {
+ pinmux = <RZG3L_PORT_PINMUX(G, 2, 1)>, /* SD1_DAT0 */
+ <RZG3L_PORT_PINMUX(G, 3, 1)>, /* SD1_DAT1 */
+ <RZG3L_PORT_PINMUX(G, 4, 1)>, /* SD1_DAT2 */
+ <RZG3L_PORT_PINMUX(G, 5, 1)>; /* SD1_DAT3 */
+ input-enable;
+ power-source = <3300>;
+ };
+ };
+
+ sdhi1_uhs_pins: sd1-uhs {
+ sd1-cd {
+ pinmux = <RZG3L_PORT_PINMUX(J, 0, 8)>; /* SD1_CD */
+ };
+
+ sd1-clk {
+ pinmux = <RZG3L_PORT_PINMUX(G, 0, 1)>; /* SD1_CLK */
+ power-source = <1800>;
+ };
+
+ sd1-cmd {
+ pinmux = <RZG3L_PORT_PINMUX(G, 1, 1)>; /* SD1_CMD */
+ input-enable;
+ power-source = <1800>;
+ };
+
+ sd1-data {
+ pinmux = <RZG3L_PORT_PINMUX(G, 2, 1)>, /* SD1_DAT0 */
+ <RZG3L_PORT_PINMUX(G, 3, 1)>, /* SD1_DAT1 */
+ <RZG3L_PORT_PINMUX(G, 4, 1)>, /* SD1_DAT2 */
+ <RZG3L_PORT_PINMUX(G, 5, 1)>; /* SD1_DAT3 */
+ input-enable;
+ power-source = <1800>;
+ };
+ };
+
ssi0_pins: ssi0 {
pinmux = <RZG3L_PORT_PINMUX(H, 0, 9)>, /* SSIF0_RXD */
<RZG3L_PORT_PINMUX(H, 1, 9)>, /* SSIF0_BCK */
@@ -219,6 +296,17 @@ &scif0 {
pinctrl-names = "default";
};
+#if RZ_BOOT_MODE3
+&sdhi1 {
+ pinctrl-0 = <&sdhi1_pins>;
+ pinctrl-1 = <&sdhi1_uhs_pins>;
+ pinctrl-names = "default", "state_uhs";
+
+ vmmc-supply = <®_3p3v>;
+ vqmmc-supply = <&vqmmc_sd1_pvdd>;
+};
+#endif
+
#if !SW_SD2_EN
&ssi0 {
clocks = <&cpg CPG_MOD R9A08G046_SSI0_PCLK2>,
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 16/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (14 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 15/17] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 6:57 ` [PATCH v17 17/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju
2026-06-03 7:00 ` [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju Das
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Biju Das, linux-renesas-soc, devicetree, linux-kernel,
Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Add support for enabling SD card or eMMC on SDHI0 on the RZ/G3L SMARC
SoM. The selection between SD and eMMC is controlled by the
SW_SD0_DEV_SEL macro in the board DTS, which must match the position
of switch SYS.1 on the SoM. By default, eMMC is enabled.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
.../boot/dts/renesas/r9a08g046l48-smarc.dts | 1 +
.../boot/dts/renesas/rzg3l-smarc-som.dtsi | 111 ++++++++++++++++++
2 files changed, 112 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
index a4cc07408b3f..2f16a2bb6dc8 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
+++ b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
@@ -9,6 +9,7 @@
/* Switch selection settings */
#define RZ_BOOT_MODE3 1
+#define SW_SD0_DEV_SEL 0
#define SW_SD2_EN 0
#define SW_DPI_EN 0
#define SW_GPIO4 1
diff --git a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
index 091a227233cb..446c7780cb30 100644
--- a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
@@ -9,6 +9,10 @@
* Please set the below switch position on the SoM and the corresponding macro
* on the board DTS:
*
+ * Switch position SYS.1, Macro SW_SD0_DEV_SEL:
+ * 0 - SD0 is connected to eMMC (default)
+ * 1 - SD0 is connected to uSD0 card
+ *
* Switch position SYS.2, Macro SW_I3C_EN:
* 0 - SMARC_I2C_GP is enabled
* 1 - I3C is enabled
@@ -37,6 +41,7 @@ aliases {
ethernet0 = ð0;
ethernet1 = ð1;
i2c0 = &i2c0;
+ mmc0 = &sdhi0;
};
memory@48000000 {
@@ -63,6 +68,19 @@ reg_3p3v: regulator-3p3v {
regulator-always-on;
};
+#if SW_SD0_DEV_SEL
+ vqmmc_sd0_pvdd: vqmmc-sd0-pvdd {
+ compatible = "regulator-gpio";
+ regulator-name = "SD0_PVDD";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ gpios = <&pinctrl RZG3L_GPIO(L, 4) GPIO_ACTIVE_HIGH>;
+ gpios-states = <0>;
+ states = <3300000 0>, <1800000 1>;
+ regulator-ramp-delay = <1200>;
+ };
+#endif
+
x2_clk: x2-clock {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -216,7 +234,100 @@ i2c0_pins: i2c0 {
pinmux = <RZG3L_PORT_PINMUX(L, 2, 4)>, /* RIIC0_SCL */
<RZG3L_PORT_PINMUX(L, 3, 4)>; /* RIIC0_SDA */
};
+
+ sd0-pwr-en-hog {
+ gpio-hog;
+ gpios = <RZG3L_GPIO(5, 1) GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "sd0_pwr_en";
+ };
+
+ sdhi0_emmc_pins: sd0-emmc {
+ sd0-ctrl {
+ pins = "SD0_CLK", "SD0_CMD";
+ power-source = <1800>;
+ };
+
+ sd0-data {
+ pins = "SD0_DAT0", "SD0_DAT1", "SD0_DAT2", "SD0_DAT3",
+ "SD0_DAT4", "SD0_DAT5", "SD0_DAT6", "SD0_DAT7";
+ power-source = <1800>;
+ };
+
+ sd0-rst {
+ pins = "SD0_RST#";
+ power-source = <1800>;
+ };
+
+ sd0-ds {
+ pins = "SD0_DS";
+ power-source = <1800>;
+ };
+ };
+
+ sdhi0_usd_pins: sd0-usd {
+ sd0-cd {
+ pinmux = <RZG2L_PORT_PINMUX(5, 0, 8)>; /* SD0_CD */
+ };
+
+ sd0-ctrl {
+ pins = "SD0_CLK", "SD0_CMD";
+ power-source = <3300>;
+ };
+
+ sd0-data {
+ pins = "SD0_DAT0", "SD0_DAT1", "SD0_DAT2", "SD0_DAT3";
+ power-source = <3300>;
+ };
+ };
+
+ sdhi0_usd_uhs_pins: sd0-usd-uhs {
+ sd0-cd {
+ pinmux = <RZG2L_PORT_PINMUX(5, 0, 8)>; /* SD0_CD */
+ };
+
+ sd0-ctrl {
+ pins = "SD0_CLK", "SD0_CMD";
+ power-source = <1800>;
+ };
+
+ sd0-data {
+ pins = "SD0_DAT0", "SD0_DAT1", "SD0_DAT2", "SD0_DAT3";
+ power-source = <1800>;
+ };
+ };
+};
+
+#if (SW_SD0_DEV_SEL)
+&sdhi0 {
+ pinctrl-0 = <&sdhi0_usd_pins>;
+ pinctrl-1 = <&sdhi0_usd_uhs_pins>;
+ pinctrl-names = "default", "state_uhs";
+
+ vmmc-supply = <®_3p3v>;
+ vqmmc-supply = <&vqmmc_sd0_pvdd>;
+ bus-width = <4>;
+ sd-uhs-sdr50;
+ sd-uhs-sdr104;
+ status = "okay";
+};
+#else
+&sdhi0 {
+ pinctrl-0 = <&sdhi0_emmc_pins>;
+ pinctrl-1 = <&sdhi0_emmc_pins>;
+ pinctrl-names = "default", "state_uhs";
+
+ vmmc-supply = <®_3p3v>;
+ vqmmc-supply = <®_1p8v>;
+ bus-width = <8>;
+ mmc-hs200-1_8v;
+ mmc-hs400-1_8v;
+ mmc-hs400-enhanced-strobe;
+ non-removable;
+ fixed-emmc-driver-type = <1>;
+ status = "okay";
};
+#endif
&wdt0 {
timeout-sec = <60>;
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* [PATCH v17 17/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (15 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 16/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju
@ 2026-06-03 6:57 ` Biju
2026-06-03 7:00 ` [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju Das
17 siblings, 0 replies; 30+ messages in thread
From: Biju @ 2026-06-03 6:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Biju Das, linux-renesas-soc, devicetree, linux-kernel,
Prabhakar Mahadev Lad, Biju Das
From: Biju Das <biju.das.jz@bp.renesas.com>
Enable SDHI2 on the RZ/G3L SMARC EVK platform using the internal
voltage regulator for voltage switching. SDHI2 signals are muxed
with I2S0; the selection is controlled by the SW_SD2_EN macro in
the board DTS, which must match the position of switch SYS.4 on
the SoM. By default, I2S0 is enabled.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* No change.
---
.../boot/dts/renesas/rzg3l-smarc-som.dtsi | 88 +++++++++++++++++++
1 file changed, 88 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
index 446c7780cb30..3d5e6b8489a9 100644
--- a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
@@ -42,6 +42,7 @@ aliases {
ethernet1 = ð1;
i2c0 = &i2c0;
mmc0 = &sdhi0;
+ mmc2 = &sdhi2;
};
memory@48000000 {
@@ -296,6 +297,74 @@ sd0-data {
power-source = <1800>;
};
};
+
+ sdhi2_pins: sd2 {
+ sd2-cd {
+ pinmux = <RZG3L_PORT_PINMUX(K, 0, 1)>; /* SD2_CD */
+ };
+
+ sd2-clk {
+ pinmux = <RZG3L_PORT_PINMUX(H, 0, 1)>; /* SD2_CLK */
+ power-source = <3300>;
+ };
+
+ sd2-cmd {
+ pinmux = <RZG3L_PORT_PINMUX(H, 1, 1)>; /* SD2_CMD */
+ input-enable;
+ power-source = <3300>;
+ };
+
+ sd2-data {
+ pinmux = <RZG3L_PORT_PINMUX(H, 2, 1)>, /* SD2_DAT0 */
+ <RZG3L_PORT_PINMUX(H, 3, 1)>, /* SD2_DAT1 */
+ <RZG3L_PORT_PINMUX(H, 4, 1)>, /* SD2_DAT2 */
+ <RZG3L_PORT_PINMUX(H, 5, 1)>; /* SD2_DAT3 */
+ input-enable;
+ power-source = <3300>;
+ };
+
+ sd2-iovs {
+ pinmux = <RZG3L_PORT_PINMUX(K, 1, 1)>; /* SD2_IOVS */
+ };
+
+ sd2-pwen {
+ pinmux = <RZG3L_PORT_PINMUX(K, 2, 1)>; /* SD2_PWEN */
+ };
+ };
+
+ sdhi2_pins_uhs: sd2-uhs {
+ sd2-cd {
+ pinmux = <RZG3L_PORT_PINMUX(K, 0, 1)>; /* SD2_CD */
+ };
+
+ sd2-clk {
+ pinmux = <RZG3L_PORT_PINMUX(H, 0, 1)>; /* SD2_CLK */
+ power-source = <1800>;
+ };
+
+ sd2-cmd {
+ pinmux = <RZG3L_PORT_PINMUX(H, 1, 1)>; /* SD2_CMD */
+ input-enable;
+ power-source = <1800>;
+ };
+
+ sd2-data {
+ pinmux = <RZG3L_PORT_PINMUX(H, 2, 1)>, /* SD2_DAT0 */
+ <RZG3L_PORT_PINMUX(H, 3, 1)>, /* SD2_DAT1 */
+ <RZG3L_PORT_PINMUX(H, 4, 1)>, /* SD2_DAT2 */
+ <RZG3L_PORT_PINMUX(H, 5, 1)>; /* SD2_DAT3 */
+ input-enable;
+ power-source = <1800>;
+ };
+
+ sd2-iovs {
+ pinmux = <RZG3L_PORT_PINMUX(K, 1, 1)>; /* SD2_IOVS */
+ };
+
+ sd2-pwen {
+ pinmux = <RZG3L_PORT_PINMUX(K, 2, 1)>; /* SD2_PWEN */
+ };
+ };
};
#if (SW_SD0_DEV_SEL)
@@ -329,6 +398,25 @@ &sdhi0 {
};
#endif
+#if SW_SD2_EN
+&sdhi2 {
+ pinctrl-0 = <&sdhi2_pins>;
+ pinctrl-1 = <&sdhi2_pins_uhs>;
+ pinctrl-names = "default", "state_uhs";
+
+ vmmc-supply = <®_3p3v>;
+ vqmmc-supply = <&sdhi2_vqmmc>;
+ bus-width = <4>;
+ sd-uhs-sdr50;
+ sd-uhs-sdr104;
+ status = "okay";
+};
+
+&sdhi2_vqmmc {
+ status = "okay";
+};
+#endif
+
&wdt0 {
timeout-sec = <60>;
status = "okay";
--
2.43.0
^ permalink raw reply related [flat|nested] 30+ messages in thread* RE: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
` (16 preceding siblings ...)
2026-06-03 6:57 ` [PATCH v17 17/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju
@ 2026-06-03 7:00 ` Biju Das
2026-06-03 7:13 ` Geert Uytterhoeven
2026-06-03 7:19 ` wsa+renesas
17 siblings, 2 replies; 30+ messages in thread
From: Biju Das @ 2026-06-03 7:00 UTC (permalink / raw)
To: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm
Cc: wsa+renesas, linux-mmc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad,
biju.das.au
Hi all,
Please ignore this series as by mistake instead of patch series 2
I mentioned it as Patch series 17.
I will fix the issue soon.
Sorry for the inconvenience.
Cheers,
Biju
> -----Original Message-----
> From: Biju <biju.das.au@gmail.com>
> Sent: 03 June 2026 07:57
> Subject: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
>
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> RZ/G3L SoC has:
>
> Channel 0 supports SD and eMMC (including HS400/HS400ES).
> Channel 1 supports SD and eMMC (except for HS400).
> Channel 2 supports SD.
>
> The SoC supports a maximum frequency of 150 MHz. The SD0 interface does not support IOVS and PWEN in
> the SDHI register (no internal regulator), unlike SD1 and SD2. It has an internal divider for all
> modes except HS400.
> It also has a 2048-bit divider compared to 512 on others. Moreover RZ/G3L supports HS400 enhanced
> strobe mode.
>
> v1->v2:
> * Collected tag for binding patch.
> * Resending the series as there is an issue with patch threading from
> patch #14.
>
> Biju Das (17):
> dt-bindings: mmc: renesas,sdhi: Document RZ/G3L (r9a08g046) SoC
> clk: renesas: r9a08g046: Add clock and reset entries for SDHI
> pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L
> mmc: renesas_sdhi: Fix whitespace alignment in struct
> renesas_sdhi_of_data
> mmc: renesas_sdhi_internal_dmac: Fix whitespace alignment in struct
> initializer
> mmc: renesas_sdhi: Introduce renesas_sdhi_hw_info to abstract clock
> mask
> mmc: renesas_sdhi: Add max_divider to renesas_sdhi_hw_info
> mmc: renesas_sdhi: Add tuning_delay hw_info flag
> mmc: renesas_sdhi: Add internal_divider hw_info flag for clk rate
> adjustment
> mmc: renesas_sdhi: Add optional axis/axim reset controls
> mmc: renesas_sdhi: Add RZ/G3L SDHI support
> mmc: renesas_sdhi: Save and restore IOVS across suspend/resume
> mmc: renesas_sdhi: Add RZ/G3L HS400 support
> mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L
> arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and
> SDHI1 pincontrol on SMARC EVK
> arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0
> arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2
>
> .../devicetree/bindings/mmc/renesas,sdhi.yaml | 101 ++++++--
> arch/arm64/boot/dts/renesas/r9a08g046.dtsi | 73 +++++-
> .../boot/dts/renesas/r9a08g046l48-smarc.dts | 89 +++++++
> .../boot/dts/renesas/rzg3l-smarc-som.dtsi | 199 +++++++++++++++
> drivers/clk/renesas/r9a08g046-cpg.c | 92 +++++++
> drivers/mmc/host/renesas_sdhi.h | 25 +-
> drivers/mmc/host/renesas_sdhi_core.c | 226 +++++++++++++-----
> drivers/mmc/host/renesas_sdhi_internal_dmac.c | 71 +++++-
> drivers/mmc/host/renesas_sdhi_sys_dmac.c | 67 ++++--
> drivers/pinctrl/renesas/pinctrl-rzg2l.c | 74 ++++--
> 10 files changed, 889 insertions(+), 128 deletions(-)
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 30+ messages in thread* Re: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-03 7:00 ` [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju Das
@ 2026-06-03 7:13 ` Geert Uytterhoeven
2026-06-03 7:20 ` Biju Das
2026-06-03 7:19 ` wsa+renesas
1 sibling, 1 reply; 30+ messages in thread
From: Geert Uytterhoeven @ 2026-06-03 7:13 UTC (permalink / raw)
To: Biju Das
Cc: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm,
wsa+renesas, linux-mmc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad
Hi Biju,
On Wed, 3 Jun 2026 at 09:00, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Please ignore this series as by mistake instead of patch series 2
> I mentioned it as Patch series 17.
>
> I will fix the issue soon.
How? I am afraid the next revision must be v18, not to confuse b4?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 30+ messages in thread* RE: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-03 7:13 ` Geert Uytterhoeven
@ 2026-06-03 7:20 ` Biju Das
0 siblings, 0 replies; 30+ messages in thread
From: Biju Das @ 2026-06-03 7:20 UTC (permalink / raw)
To: geert
Cc: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm,
wsa+renesas, linux-mmc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad
Hi Geert,
> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 03 June 2026 08:14
> Subject: Re: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
>
> Hi Biju,
>
> On Wed, 3 Jun 2026 at 09:00, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Please ignore this series as by mistake instead of patch series 2 I
> > mentioned it as Patch series 17.
> >
> > I will fix the issue soon.
>
> How? I am afraid the next revision must be v18, not to confuse b4?
Previously patchwork has listed all the patches in order[1] and b4 some
patches went out of order because of a mistake I did while sending out.
As this patch series is v2 version and no patch is being reviewed rather than
binding patch in v1, do we care about b4 tooling?
[1] https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=1103347
Cheers,
Biju
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-03 7:00 ` [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju Das
2026-06-03 7:13 ` Geert Uytterhoeven
@ 2026-06-03 7:19 ` wsa+renesas
2026-06-03 7:27 ` Biju Das
1 sibling, 1 reply; 30+ messages in thread
From: wsa+renesas @ 2026-06-03 7:19 UTC (permalink / raw)
To: Biju Das
Cc: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Prabhakar Mahadev Lad
[-- Attachment #1: Type: text/plain, Size: 63 bytes --]
> I will fix the issue soon.
No need to resend from my POV.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-03 7:19 ` wsa+renesas
@ 2026-06-03 7:27 ` Biju Das
2026-06-12 13:51 ` Biju Das
0 siblings, 1 reply; 30+ messages in thread
From: Biju Das @ 2026-06-03 7:27 UTC (permalink / raw)
To: wsa+renesas
Cc: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Prabhakar Mahadev Lad
Hi Wolfram,
Thanks for the feedback.
> -----Original Message-----
> From: wsa+renesas <wsa+renesas@sang-engineering.com>
> Sent: 03 June 2026 08:19
> Subject: Re: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
>
>
> > I will fix the issue soon.
>
> No need to resend from my POV.
I will wait for review comments then.
Cheers,
Biju
^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-03 7:27 ` Biju Das
@ 2026-06-12 13:51 ` Biju Das
2026-06-12 14:56 ` wsa+renesas
0 siblings, 1 reply; 30+ messages in thread
From: Biju Das @ 2026-06-12 13:51 UTC (permalink / raw)
To: Biju Das, wsa+renesas
Cc: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Prabhakar Mahadev Lad
Hi Wolfram,
I found some bugs in RZ/G3L in between
1) SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL bit is not available in RZ/G3L, but instead used
as timing value 16 instead of 1.
2) RZ/G3L needs to set HWADJ2 delays for 3.3V and 1.8V operation
3) When I added HS400 mode support, forgot to retain HS400 bits (HS400EN and HS400ENHSTRB) in
renesas_sdhi_execute_tuning()
I will send v3 with these changes, if it is ok for you.
Cheers,
Biju
> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: 03 June 2026 08:27
> Subject: RE: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
>
> Hi Wolfram,
>
> Thanks for the feedback.
>
> > -----Original Message-----
> > From: wsa+renesas <wsa+renesas@sang-engineering.com>
> > Sent: 03 June 2026 08:19
> > Subject: Re: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
> >
> >
> > > I will fix the issue soon.
> >
> > No need to resend from my POV.
>
> I will wait for review comments then.
>
> Cheers,
> Biju
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support
2026-06-12 13:51 ` Biju Das
@ 2026-06-12 14:56 ` wsa+renesas
0 siblings, 0 replies; 30+ messages in thread
From: wsa+renesas @ 2026-06-12 14:56 UTC (permalink / raw)
To: Biju Das
Cc: biju.das.au, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Philipp Zabel, magnus.damm,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Prabhakar Mahadev Lad
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
Hi Biju,
> I will send v3 with these changes, if it is ok for you.
Sure, sure. I will review the then latest version once I have time for
it. The more issues already found, the better, of course!
Happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread