Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/3] Enable RZ/G3L SDHI
@ 2026-11-12 18:48 Biju Das
  2026-11-12 18:48 ` [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju Das
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Biju Das @ 2026-11-12 18:48 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Wolfram Sang, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-renesas-soc, devicetree, linux-kernel, Biju Das

This patch series enable eMMC on SDHI0 and SDHI1 on SDHI2

This patch series is depend upon [1]
[1] https://lore.kernel.org/all/20261104-usb_rzg3l-v8-0-ab109c4bd108@bp.renesas.com/

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
Biju Das (3):
      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

 arch/arm64/boot/dts/renesas/r9a08g046.dtsi         |  73 ++++++-
 arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts |  89 ++++++++
 arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi   | 231 +++++++++++++++++++++
 3 files changed, 392 insertions(+), 1 deletion(-)
---
base-commit: e7d07f2ed4b4a14f79bc9fb417d25695cb7679a9
change-id: 20261112-sdhi_rzg3l-e0c7dbf7cfdd

Best regards,
-- 
Biju Das <biju.das.jz@bp.renesas.com>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
  2026-11-12 18:48 [PATCH 0/3] Enable RZ/G3L SDHI Biju Das
@ 2026-11-12 18:48 ` Biju Das
  2026-11-12 19:25   ` sashiko-bot
  2026-11-12 18:48 ` [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju Das
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-11-12 18:48 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Wolfram Sang, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-renesas-soc, devicetree, linux-kernel, 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>
---
 arch/arm64/boot/dts/renesas/r9a08g046.dtsi         | 73 +++++++++++++++++-
 arch/arm64/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 7e379f6ab837..29ce1ab2a57f 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
@@ -1062,9 +1062,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_IACLKM>,
+				 <&cpg CPG_MOD R9A08G046_SDHI0_IACLKS>;
+			clock-names = "core", "clkh", "cd", "aclkm", "aclks";
+			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_IACLKM>,
+				 <&cpg CPG_MOD R9A08G046_SDHI1_IACLKS>;
+			clock-names = "core", "clkh", "cd", "aclkm", "aclks";
+			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_IACLKM>,
+				 <&cpg CPG_MOD R9A08G046_SDHI2_IACLKS>;
+			clock-names = "core", "clkh", "cd", "aclkm", "aclks";
+			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 9ffaead2c6be..2f3266129733 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 {
@@ -195,6 +210,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 */
@@ -255,6 +332,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 = <&reg_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] 13+ messages in thread

* [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0
  2026-11-12 18:48 [PATCH 0/3] Enable RZ/G3L SDHI Biju Das
  2026-11-12 18:48 ` [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju Das
@ 2026-11-12 18:48 ` Biju Das
  2026-11-12 19:07   ` sashiko-bot
  2026-11-12 18:48 ` [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju Das
  2026-11-16 10:05 ` [PATCH 0/3] Enable RZ/G3L SDHI Wolfram Sang
  3 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-11-12 18:48 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Wolfram Sang, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-renesas-soc, devicetree, linux-kernel, 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>
---
 arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts |   1 +
 arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi   | 143 +++++++++++++++++++++
 2 files changed, 144 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
index 2f3266129733..5f5441c47335 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 91b2d0d43104..e84840fa5086 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 = &eth0;
 		ethernet1 = &eth1;
 		i2c0 = &i2c0;
+		mmc0 = &sdhi0;
 	};
 
 	memory@48000000 {
@@ -78,6 +83,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>;
@@ -241,7 +259,132 @@ 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-clk {
+			pins = "SD0_CLK";
+			power-source = <1800>;
+			drive-strength-microamp = <9000>;
+		};
+
+		sd0-cmd {
+			pins = "SD0_CMD";
+			input-enable;
+			drive-strength-microamp = <9000>;
+			power-source = <1800>;
+		};
+
+		sd0-data {
+			pins = "SD0_DAT0", "SD0_DAT1", "SD0_DAT2", "SD0_DAT3",
+			       "SD0_DAT4", "SD0_DAT5", "SD0_DAT6", "SD0_DAT7";
+			input-enable;
+			drive-strength-microamp = <9000>;
+			power-source = <1800>;
+		};
+
+		sd0-rst {
+			pins = "SD0_RST#";
+			drive-strength-microamp = <9000>;
+			power-source = <1800>;
+		};
+
+		sd0-ds {
+			pins = "SD0_DS";
+			input-enable;
+			bias-pull-down;
+			drive-strength-microamp = <9000>;
+			power-source = <1800>;
+		};
+	};
+
+	sdhi0_usd_pins: sd0-usd {
+		sd0-cd {
+			pinmux = <RZG2L_PORT_PINMUX(5, 0, 8)>; /* SD0_CD */
+		};
+
+		sd0-clk {
+			pins = "SD0_CLK";
+			drive-strength-microamp = <8000>;
+			power-source = <3300>;
+		};
+
+		sd0-cmd {
+			pins = "SD0_CMD";
+			input-enable;
+			drive-strength-microamp = <8000>;
+			power-source = <3300>;
+		};
+
+		sd0-data {
+			pins = "SD0_DAT0", "SD0_DAT1", "SD0_DAT2", "SD0_DAT3";
+			input-enable;
+			drive-strength-microamp = <8000>;
+			power-source = <3300>;
+		};
+	};
+
+	sdhi0_usd_uhs_pins: sd0-usd-uhs {
+		sd0-cd {
+			pinmux = <RZG2L_PORT_PINMUX(5, 0, 8)>; /* SD0_CD */
+		};
+
+		sd0-clk {
+			pins = "SD0_CLK";
+			drive-strength-microamp = <9000>;
+			power-source = <1800>;
+		};
+
+		sd0-cmd {
+			pins = "SD0_CMD";
+			input-enable;
+			drive-strength-microamp = <9000>;
+			power-source = <1800>;
+		};
+
+		sd0-data {
+			pins = "SD0_DAT0", "SD0_DAT1", "SD0_DAT2", "SD0_DAT3";
+			input-enable;
+			drive-strength-microamp = <9000>;
+			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 = <&reg_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 = <&reg_3p3v>;
+	vqmmc-supply = <&reg_1p8v>;
+	bus-width = <8>;
+	mmc-hs200-1_8v;
+	non-removable;
+	fixed-emmc-driver-type = <1>;
+	status = "okay";
 };
+#endif
 
 &wdt0 {
 	timeout-sec = <60>;

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2
  2026-11-12 18:48 [PATCH 0/3] Enable RZ/G3L SDHI Biju Das
  2026-11-12 18:48 ` [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju Das
  2026-11-12 18:48 ` [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju Das
@ 2026-11-12 18:48 ` Biju Das
  2026-11-12 19:09   ` sashiko-bot
  2026-11-16 10:05 ` [PATCH 0/3] Enable RZ/G3L SDHI Wolfram Sang
  3 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-11-12 18:48 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Wolfram Sang, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-renesas-soc, devicetree, linux-kernel, 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>
---
 arch/arm64/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 e84840fa5086..a5aec82c0250 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 = &eth1;
 		i2c0 = &i2c0;
 		mmc0 = &sdhi0;
+		mmc2 = &sdhi2;
 	};
 
 	memory@48000000 {
@@ -355,6 +356,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)
@@ -386,6 +455,25 @@ &sdhi0 {
 };
 #endif
 
+#if SW_SD2_EN
+&sdhi2 {
+	pinctrl-0 = <&sdhi2_pins>;
+	pinctrl-1 = <&sdhi2_pins_uhs>;
+	pinctrl-names = "default", "state_uhs";
+
+	vmmc-supply = <&reg_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] 13+ messages in thread

* Re: [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0
  2026-11-12 18:48 ` [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju Das
@ 2026-11-12 19:07   ` sashiko-bot
  2026-11-16 10:37     ` Biju Das
  0 siblings, 1 reply; 13+ messages in thread
From: sashiko-bot @ 2026-11-12 19:07 UTC (permalink / raw)
  To: Biju Das; +Cc: devicetree, robh, conor+dt, wsa+renesas

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] arm64: dts: renesas: rzg3l-smarc-som: sdhi0 pinctrl fails with
  -EINVAL
- [Low] arm64: dts: renesas: rzg3l-smarc-som uses RZG2L_PORT_PINMUX for
  SD0_CD
--

commit e86cb26292885aecdb37f14368a14d0f62f6aee6
Author: Biju Das <biju.das.jz@bp.renesas.com>

arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0

This commit enables SD card or eMMC support on SDHI0 for the RZ/G3L SMARC
SoM, selected via the SW_SD0_DEV_SEL macro.

> diff --git a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> index 091a227233cba..f6f4eed9a2ea6 100644
> --- a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi

[ ... ]

> @@ -216,7 +234,132 @@ 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-clk {
> +			pins = "SD0_CLK";
> +			power-source = <1800>;
> +			drive-strength-microamp = <9000>;
> +		};

[Severity: High]
Does configuring power-source on the SD0_* pins cause sdhi0 probe to fail
with -EINVAL?

In drivers/pinctrl/renesas/pinctrl-rzg2l.c, the SD0_* entries in
rzg3l_dedicated_pins do not set PIN_CFG_IO_VMC_SD0 or PIN_CFG_SOFT_PS:

drivers/pinctrl/renesas/pinctrl-rzg2l.c:rzg3l_dedicated_pins[] {
    ...
	{ "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x9, 0, PIN_CFG_IOLH_B) },
	{ "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x9, 1,
	  (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
    ...
}

When sdhi0 binds its pinctrl states (sdhi0_emmc_pins, sdhi0_usd_pins, or
sdhi0_usd_uhs_pins), rzg2l_pinctrl_pinconf_set() -> rzg2l_set_power_source()
-> rzg2l_caps_to_pwr_reg() returns -EINVAL, preventing SDHI0 from probing in
both eMMC and uSD modes.  (Dropping power-source from DT while keeping
drive-strength-microamp would instead leave the cached power_source at 0,
causing rzg2l_ps_to_iolh_idx(0) to return RZG2L_IOLH_IDX_MAX and read past
the end of hwcfg->iolh_groupb_ua[] in rzg2l_ds_is_supported().)

[ ... ]

> +	sdhi0_usd_pins: sd0-usd {
> +		sd0-cd {
> +			pinmux = <RZG2L_PORT_PINMUX(5, 0, 8)>; /* SD0_CD */
> +		};

[Severity: Low]
This isn't a bug since RZG3L_P5 expands to 5, but sd0-cd in both
sdhi0_usd_pins and sdhi0_usd_uhs_pins uses RZG2L_PORT_PINMUX(5, 0, 8)
instead of RZG3L_PORT_PINMUX(5, 0, 8) like the rest of this file.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-sdhi_rzg3l-v1-0-ca30b209615d@bp.renesas.com?part=2

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2
  2026-11-12 18:48 ` [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju Das
@ 2026-11-12 19:09   ` sashiko-bot
  2026-11-16 10:31     ` Biju Das
  0 siblings, 1 reply; 13+ messages in thread
From: sashiko-bot @ 2026-11-12 19:09 UTC (permalink / raw)
  To: Biju Das; +Cc: devicetree, robh, conor+dt, wsa+renesas

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: renesas: rzg3l-smarc-som: no-op UHS pinctrl
  switch on sdhi2
--

commit fa36790e3b28d4844cd7f51756a420dcdb4538ff
Author: Biju Das <biju.das.jz@bp.renesas.com>

arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2

This commit adds pin control and device tree nodes to enable SDHI2 on the
RZ/G3L SMARC EVK platform when the SW_SD2_EN macro is set.

> diff --git a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> index f6f4eed9a2ea6..e8fc9cddf288f 100644
> --- a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi

[ ... ]

> @@ -330,6 +331,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 */
> +		};
> +	};
>  };

[Severity: Medium]
Does switching sdhi2 between sdhi2_pins and sdhi2_pins_uhs write any hardware
pinctrl registers for the sd2 pins?

sdhi2_pins and sdhi2_pins_uhs differ only by power-source (<3300> vs <1800>),
and neither specifies drive-strength-microamp. In r9a08g046_variable_pin_cfg,
those pins use software power-source tracking instead of a hardware
power-output-control register:

drivers/pinctrl/renesas/pinctrl-rzg2l.c:r9a08g046_variable_pin_cfg[] = {
    ...
	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),
    ...
};

drivers/pinctrl/renesas/pinctrl-rzg2l.c:rzg2l_set_power_source() {
    ...
	if (caps & PIN_CFG_SOFT_PS) {
		pctrl->settings[pin].power_source = ps;
		return 0;
	}
    ...
}

When renesas_sdhi_start_signal_voltage_switch() selects state_uhs,
rzg2l_set_power_source() only updates pctrl->settings[pin].power_source in
memory and returns 0 without writing any pinctrl register while the internal
regulator switches the external signal voltage.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-sdhi_rzg3l-v1-0-ca30b209615d@bp.renesas.com?part=3

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
  2026-11-12 18:48 ` [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju Das
@ 2026-11-12 19:25   ` sashiko-bot
  2026-11-16 10:25     ` Biju Das
  0 siblings, 1 reply; 13+ messages in thread
From: sashiko-bot @ 2026-11-12 19:25 UTC (permalink / raw)
  To: Biju Das; +Cc: devicetree, robh, conor+dt, wsa+renesas

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] arm64: dts: renesas: r9a08g046: undocumented SDHI compatible,
  clocks, and resets
- [Medium] arm64: dts: renesas: r9a08g046l48-smarc: sdhi1 left enabled
  when RZ_BOOT_MODE3=0
- [Medium] arm64: dts: renesas: r9a08g046l48-smarc: missing pull-up and
  no-op UHS pinconf
- [Medium] arm64: dts: renesas: r9a08g046: SDHI power-source not wired
  in pinctrl-rzg2l
--

commit c182c80f2e51018770e032cd10fb901dca56ea0e
Author: Biju Das <biju.das.jz@bp.renesas.com>

arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK

This commit adds device tree nodes for the three SDHI controllers on the
RZ/G3L SoC (r9a08g046) and configures SDHI1 pinmux and voltage regulator
nodes on the RZ/G3L SMARC EVK board.

> diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
> index c63a857f0e5b0..3665ccbdd91be 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_IACLKM>,
> +				 <&cpg CPG_MOD R9A08G046_SDHI0_IACLKS>;
> +			clock-names = "core", "clkh", "cd", "aclkm", "aclks";
> +			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";
> +		};

[Severity: High]
Can sdhi0, sdhi1, and sdhi2 bind to the Renesas SDHI driver or pass
dtbs_check with these properties?

"renesas,sdhi-r9a08g046" has no fallback compatible string and is not present
in renesas_sdhi_internal_dmac_of_match or
Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml.  The binding schema
also restricts clocks and clock-names to at most 4 entries, restricts resets
to 1 entry without reset-names, and only permits the vqmmc-regulator child
node (added under sdhi1 and sdhi2 below) for "renesas,sdhi-r9a09g057".  In
addition, renesas_sdhi_probe() only requests a single unnamed reset via
devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, NULL),
leaving the axim and axis resets unmanaged.

> diff --git a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
> index 5289efd1a430a..0b6b7e109200f 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;

[ ... ]

> @@ -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>;
> +		};

[Severity: Medium]
Should sd1-cmd in sdhi1_uhs_pins also keep bias-pull-up like sd1-cmd in
sdhi1_pins?  Also, neither sdhi1_pins nor sdhi1_uhs_pins specifies
drive-strength-microamp on the PG0..PG5 pins, where PIN_CFG_SOFT_PS only
uses power-source to select the drive-strength table.

> +
> +		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>;
> +		};
> +	};

[Severity: Medium]
Does setting power-source on PG0..PG5 in sdhi1_pins and sdhi1_uhs_pins
actually program the SD_CH1_POC register during signal voltage switching?

In drivers/pinctrl/renesas/pinctrl-rzg2l.c, r9a08g046_variable_pin_cfg
configures RZG3L_PG pins 0..5 (and RZG3L_PH pins 0..5 for SD2) with
RZG3L_MPXED_PIN_FUNCS(B), which sets PIN_CFG_SOFT_PS rather than
PIN_CFG_IO_VMC_SD1:

drivers/pinctrl/renesas/pinctrl-rzg2l.c:rzg2l_set_power_source() {
    ...
	if (caps & PIN_CFG_SOFT_PS) {
		pctrl->settings[pin].power_source = ps;
		return 0;
	}
    ...
}

Because rzg2l_set_power_source() returns early when PIN_CFG_SOFT_PS is set,
switching between sdhi1_pins and sdhi1_uhs_pins never writes to the SD_CH
register at .sd_ch = 0x3004.  Similarly, rzg3l_dedicated_pins defines the
SD0_* pins with neither PIN_CFG_IO_VMC_SD0 nor PIN_CFG_SOFT_PS, so applying
power-source on SD0 pins in commit "arm64: dts: renesas: rzg3l-smarc-som:
Enable SD/eMMC on SDHI0" fails with -EINVAL in rzg2l_caps_to_pwr_reg().

[ ... ]

> @@ -230,6 +307,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 = <&reg_3p3v>;
> +	vqmmc-supply = <&vqmmc_sd1_pvdd>;
> +};
> +#endif

[Severity: Medium]
Does &sdhi1 remain enabled without pinctrl or regulators when RZ_BOOT_MODE3
is 0?

renesas-smarc2.dtsi unconditionally sets status = "okay" on &sdhi1, and mmc1
= &sdhi1 in /aliases above is also outside #if RZ_BOOT_MODE3.  When
RZ_BOOT_MODE3 is set to 0 (routing PJ0..PJ3 to JTAG instead of SD1 CD, IOVS,
and PWEN), &sdhi1 lacks an #else branch setting status = "disabled" and will
probe without pinctrl, sd1-pwr-en-hog, vmmc-supply, or vqmmc-supply.  Also,
SW_SDIO_M2E is defined at the top of the file but never used.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-sdhi_rzg3l-v1-0-ca30b209615d@bp.renesas.com?part=1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/3] Enable RZ/G3L SDHI
  2026-11-12 18:48 [PATCH 0/3] Enable RZ/G3L SDHI Biju Das
                   ` (2 preceding siblings ...)
  2026-11-12 18:48 ` [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju Das
@ 2026-11-16 10:05 ` Wolfram Sang
  2026-11-16 10:09   ` Biju Das
  3 siblings, 1 reply; 13+ messages in thread
From: Wolfram Sang @ 2026-11-16 10:05 UTC (permalink / raw)
  To: Biju Das
  Cc: Geert Uytterhoeven, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-renesas-soc, devicetree, linux-kernel,
	Biju Das

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

Hi Biju,

On Thu, Nov 12, 2026 at 06:48:49PM +0000, Biju Das wrote:
> This patch series enable eMMC on SDHI0 and SDHI1 on SDHI2
> 
> This patch series is depend upon [1]
> [1] https://lore.kernel.org/all/20261104-usb_rzg3l-v8-0-ab109c4bd108@bp.renesas.com/
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

could you comment shortly on the Sashiko reports, please?

Thanks and happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH 0/3] Enable RZ/G3L SDHI
  2026-11-16 10:05 ` [PATCH 0/3] Enable RZ/G3L SDHI Wolfram Sang
@ 2026-11-16 10:09   ` Biju Das
  0 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-11-16 10:09 UTC (permalink / raw)
  To: wsa+renesas, biju.das.au
  Cc: Geert Uytterhoeven, magnus.damm, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-renesas-soc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org

Hi Wolfram,

> -----Original Message-----
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Sent: 16 November 2026 10:05
> Subject: Re: [PATCH 0/3] Enable RZ/G3L SDHI
> 
> Hi Biju,
> 
> On Thu, Nov 12, 2026 at 06:48:49PM +0000, Biju Das wrote:
> > This patch series enable eMMC on SDHI0 and SDHI1 on SDHI2
> >
> > This patch series is depend upon [1]
> > [1] https://lore.kernel.org/all/20261104-usb_rzg3l-v8-0-ab109c4bd108@bp.renesas.com/
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> could you comment shortly on the Sashiko reports, please?

Sure.

Cheers,
Biju

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
  2026-11-12 19:25   ` sashiko-bot
@ 2026-11-16 10:25     ` Biju Das
  2026-11-16 10:25       ` Biju Das
  0 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-11-16 10:25 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: devicetree, robh, conor+dt, wsa+renesas

Hi,

On Thu, Nov 12, 2026 at 7:25 PM <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 4 potential
> issues to consider:
> - [High] arm64: dts: renesas: r9a08g046: undocumented SDHI compatible,
>   clocks, and resets
> - [Medium] arm64: dts: renesas: r9a08g046l48-smarc: sdhi1 left enabled
>   when RZ_BOOT_MODE3=0
> - [Medium] arm64: dts: renesas: r9a08g046l48-smarc: missing pull-up and
>   no-op UHS pinconf
> - [Medium] arm64: dts: renesas: r9a08g046: SDHI power-source not wired
>   in pinctrl-rzg2l
> --
>
> commit c182c80f2e51018770e032cd10fb901dca56ea0e
> Author: Biju Das <biju.das.jz@bp.renesas.com>
>
> arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
>
> This commit adds device tree nodes for the three SDHI controllers on the
> RZ/G3L SoC (r9a08g046) and configures SDHI1 pinmux and voltage regulator
> nodes on the RZ/G3L SMARC EVK board.
>
> > diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
> > index c63a857f0e5b0..3665ccbdd91be 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_IACLKM>,
> > +                              <&cpg CPG_MOD R9A08G046_SDHI0_IACLKS>;
> > +                     clock-names = "core", "clkh", "cd", "aclkm", "aclks";
> > +                     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";
> > +             };
>
> [Severity: High]
> Can sdhi0, sdhi1, and sdhi2 bind to the Renesas SDHI driver or pass
> dtbs_check with these properties?

The dtbs checks are passing.

>
> "renesas,sdhi-r9a08g046" has no fallback compatible string and is not present
> in renesas_sdhi_internal_dmac_of_match or
> Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml.

That is correct.


>The binding schema
> also restricts clocks and clock-names to at most 4 entries, restricts resets
> to 1 entry without reset-names, and only permits the vqmmc-regulator child
> node (added under sdhi1 and sdhi2 below) for "renesas,sdhi-r9a09g057".

Binding clearly specifies 5 clocks/clock-names, 3 resets/reset-names
and optional internal regulators.


> In
> addition, renesas_sdhi_probe() only requests a single unnamed reset via
> devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, NULL),
> leaving the axim and axis resets unmanaged.

These resets are managed. see below

priv->rstc = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
NULL);
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);

>
> > diff --git a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
> > index 5289efd1a430a..0b6b7e109200f 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;
>
> [ ... ]
>
> > @@ -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>;
> > +             };
>
> [Severity: Medium]
> Should sd1-cmd in sdhi1_uhs_pins also keep bias-pull-up like sd1-cmd in
> sdhi1_pins?  Also, neither sdhi1_pins nor sdhi1_uhs_pins specifies
> drive-strength-microamp on the PG0..PG5 pins, where PIN_CFG_SOFT_PS only
> uses power-source to select the drive-strength table.

These all are uses reset values as it is sufficient.

>
> > +
> > +             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>;
> > +             };
> > +     };
>
> [Severity: Medium]
> Does setting power-source on PG0..PG5 in sdhi1_pins and sdhi1_uhs_pins
> actually program the SD_CH1_POC register during signal voltage switching?

yes, it programs  SD_CH1_POC.

 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_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),

>
> In drivers/pinctrl/renesas/pinctrl-rzg2l.c, r9a08g046_variable_pin_cfg
> configures RZG3L_PG pins 0..5 (and RZG3L_PH pins 0..5 for SD2) with
> RZG3L_MPXED_PIN_FUNCS(B), which sets PIN_CFG_SOFT_PS rather than
> PIN_CFG_IO_VMC_SD1:

See above definitions.
>
> drivers/pinctrl/renesas/pinctrl-rzg2l.c:rzg2l_set_power_source() {
>     ...
>         if (caps & PIN_CFG_SOFT_PS) {
>                 pctrl->settings[pin].power_source = ps;
>                 return 0;
>         }
>     ...
> }
>
> Because rzg2l_set_power_source() returns early when PIN_CFG_SOFT_PS is set,
> switching between sdhi1_pins and sdhi1_uhs_pins never writes to the SD_CH
> register at .sd_ch = 0x3004.  Similarly, rzg3l_dedicated_pins defines the
> SD0_* pins with neither PIN_CFG_IO_VMC_SD0 nor PIN_CFG_SOFT_PS, so applying
> power-source on SD0 pins in commit "arm64: dts: renesas: rzg3l-smarc-som:
> Enable SD/eMMC on SDHI0" fails with -EINVAL in rzg2l_caps_to_pwr_reg().
>
> [ ... ]
>
> > @@ -230,6 +307,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 = <&reg_3p3v>;
> > +     vqmmc-supply = <&vqmmc_sd1_pvdd>;
> > +};
> > +#endif
>
> [Severity: Medium]
> Does &sdhi1 remain enabled without pinctrl or regulators when RZ_BOOT_MODE3
> is 0?

Yes, this needs to be fixed. on the else case status should be disabled.

>
> renesas-smarc2.dtsi unconditionally sets status = "okay" on &sdhi1, and mmc1
> = &sdhi1 in /aliases above is also outside #if RZ_BOOT_MODE3.  When
> RZ_BOOT_MODE3 is set to 0 (routing PJ0..PJ3 to JTAG instead of SD1 CD, IOVS,
> and PWEN), &sdhi1 lacks an #else branch setting status = "disabled" and will
> probe without pinctrl, sd1-pwr-en-hog, vmmc-supply, or vqmmc-supply.  Also,
> SW_SDIO_M2E is defined at the top of the file but never used.

yes, it corresponds to default switch setting.

Cheers,
Biju

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
  2026-11-16 10:25     ` Biju Das
@ 2026-11-16 10:25       ` Biju Das
  0 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-11-16 10:25 UTC (permalink / raw)
  To: sashiko-reviews, linux-renesas-soc
  Cc: devicetree, robh, conor+dt, wsa+renesas

+linux-renesas-soc@vger.kernel.org

On Mon, Nov 16, 2026 at 10:25 AM Biju Das <biju.das.au@gmail.com> wrote:
>
> Hi,
>
> On Thu, Nov 12, 2026 at 7:25 PM <sashiko-bot@kernel.org> wrote:
> >
> > Thank you for your contribution! Sashiko AI review found 4 potential
> > issues to consider:
> > - [High] arm64: dts: renesas: r9a08g046: undocumented SDHI compatible,
> >   clocks, and resets
> > - [Medium] arm64: dts: renesas: r9a08g046l48-smarc: sdhi1 left enabled
> >   when RZ_BOOT_MODE3=0
> > - [Medium] arm64: dts: renesas: r9a08g046l48-smarc: missing pull-up and
> >   no-op UHS pinconf
> > - [Medium] arm64: dts: renesas: r9a08g046: SDHI power-source not wired
> >   in pinctrl-rzg2l
> > --
> >
> > commit c182c80f2e51018770e032cd10fb901dca56ea0e
> > Author: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK
> >
> > This commit adds device tree nodes for the three SDHI controllers on the
> > RZ/G3L SoC (r9a08g046) and configures SDHI1 pinmux and voltage regulator
> > nodes on the RZ/G3L SMARC EVK board.
> >
> > > diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
> > > index c63a857f0e5b0..3665ccbdd91be 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_IACLKM>,
> > > +                              <&cpg CPG_MOD R9A08G046_SDHI0_IACLKS>;
> > > +                     clock-names = "core", "clkh", "cd", "aclkm", "aclks";
> > > +                     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";
> > > +             };
> >
> > [Severity: High]
> > Can sdhi0, sdhi1, and sdhi2 bind to the Renesas SDHI driver or pass
> > dtbs_check with these properties?
>
> The dtbs checks are passing.
>
> >
> > "renesas,sdhi-r9a08g046" has no fallback compatible string and is not present
> > in renesas_sdhi_internal_dmac_of_match or
> > Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml.
>
> That is correct.
>
>
> >The binding schema
> > also restricts clocks and clock-names to at most 4 entries, restricts resets
> > to 1 entry without reset-names, and only permits the vqmmc-regulator child
> > node (added under sdhi1 and sdhi2 below) for "renesas,sdhi-r9a09g057".
>
> Binding clearly specifies 5 clocks/clock-names, 3 resets/reset-names
> and optional internal regulators.
>
>
> > In
> > addition, renesas_sdhi_probe() only requests a single unnamed reset via
> > devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, NULL),
> > leaving the axim and axis resets unmanaged.
>
> These resets are managed. see below
>
> priv->rstc = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
> NULL);
> 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);
>
> >
> > > diff --git a/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts b/arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts
> > > index 5289efd1a430a..0b6b7e109200f 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;
> >
> > [ ... ]
> >
> > > @@ -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>;
> > > +             };
> >
> > [Severity: Medium]
> > Should sd1-cmd in sdhi1_uhs_pins also keep bias-pull-up like sd1-cmd in
> > sdhi1_pins?  Also, neither sdhi1_pins nor sdhi1_uhs_pins specifies
> > drive-strength-microamp on the PG0..PG5 pins, where PIN_CFG_SOFT_PS only
> > uses power-source to select the drive-strength table.
>
> These all are uses reset values as it is sufficient.
>
> >
> > > +
> > > +             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>;
> > > +             };
> > > +     };
> >
> > [Severity: Medium]
> > Does setting power-source on PG0..PG5 in sdhi1_pins and sdhi1_uhs_pins
> > actually program the SD_CH1_POC register during signal voltage switching?
>
> yes, it programs  SD_CH1_POC.
>
>  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_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),
>
> >
> > In drivers/pinctrl/renesas/pinctrl-rzg2l.c, r9a08g046_variable_pin_cfg
> > configures RZG3L_PG pins 0..5 (and RZG3L_PH pins 0..5 for SD2) with
> > RZG3L_MPXED_PIN_FUNCS(B), which sets PIN_CFG_SOFT_PS rather than
> > PIN_CFG_IO_VMC_SD1:
>
> See above definitions.
> >
> > drivers/pinctrl/renesas/pinctrl-rzg2l.c:rzg2l_set_power_source() {
> >     ...
> >         if (caps & PIN_CFG_SOFT_PS) {
> >                 pctrl->settings[pin].power_source = ps;
> >                 return 0;
> >         }
> >     ...
> > }
> >
> > Because rzg2l_set_power_source() returns early when PIN_CFG_SOFT_PS is set,
> > switching between sdhi1_pins and sdhi1_uhs_pins never writes to the SD_CH
> > register at .sd_ch = 0x3004.  Similarly, rzg3l_dedicated_pins defines the
> > SD0_* pins with neither PIN_CFG_IO_VMC_SD0 nor PIN_CFG_SOFT_PS, so applying
> > power-source on SD0 pins in commit "arm64: dts: renesas: rzg3l-smarc-som:
> > Enable SD/eMMC on SDHI0" fails with -EINVAL in rzg2l_caps_to_pwr_reg().
> >
> > [ ... ]
> >
> > > @@ -230,6 +307,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 = <&reg_3p3v>;
> > > +     vqmmc-supply = <&vqmmc_sd1_pvdd>;
> > > +};
> > > +#endif
> >
> > [Severity: Medium]
> > Does &sdhi1 remain enabled without pinctrl or regulators when RZ_BOOT_MODE3
> > is 0?
>
> Yes, this needs to be fixed. on the else case status should be disabled.
>
> >
> > renesas-smarc2.dtsi unconditionally sets status = "okay" on &sdhi1, and mmc1
> > = &sdhi1 in /aliases above is also outside #if RZ_BOOT_MODE3.  When
> > RZ_BOOT_MODE3 is set to 0 (routing PJ0..PJ3 to JTAG instead of SD1 CD, IOVS,
> > and PWEN), &sdhi1 lacks an #else branch setting status = "disabled" and will
> > probe without pinctrl, sd1-pwr-en-hog, vmmc-supply, or vqmmc-supply.  Also,
> > SW_SDIO_M2E is defined at the top of the file but never used.
>
> yes, it corresponds to default switch setting.
>
> Cheers,
> Biju

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2
  2026-11-12 19:09   ` sashiko-bot
@ 2026-11-16 10:31     ` Biju Das
  0 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-11-16 10:31 UTC (permalink / raw)
  To: sashiko-reviews
  Cc: devicetree, robh, conor+dt, wsa+renesas, linux-renesas-soc

On Thu, Nov 12, 2026 at 7:09 PM <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Medium] arm64: dts: renesas: rzg3l-smarc-som: no-op UHS pinctrl
>   switch on sdhi2
> --
>
> commit fa36790e3b28d4844cd7f51756a420dcdb4538ff
> Author: Biju Das <biju.das.jz@bp.renesas.com>
>
> arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2
>
> This commit adds pin control and device tree nodes to enable SDHI2 on the
> RZ/G3L SMARC EVK platform when the SW_SD2_EN macro is set.
>
> > diff --git a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> > index f6f4eed9a2ea6..e8fc9cddf288f 100644
> > --- a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
>
> [ ... ]
>
> > @@ -330,6 +331,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 */
> > +             };
> > +     };
> >  };
>
> [Severity: Medium]
> Does switching sdhi2 between sdhi2_pins and sdhi2_pins_uhs write any hardware
> pinctrl registers for the sd2 pins?

yes, it configures POC registers and uses reset values for drive strength.
>
> sdhi2_pins and sdhi2_pins_uhs differ only by power-source (<3300> vs <1800>),
> and neither specifies drive-strength-microamp. In r9a08g046_variable_pin_cfg,
> those pins use software power-source tracking instead of a hardware
> power-output-control register:
>
> drivers/pinctrl/renesas/pinctrl-rzg2l.c:r9a08g046_variable_pin_cfg[] = {
>     ...
>         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_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_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),

AI reviews can be wrong. see the mismatch.

Cheers,
Biju

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0
  2026-11-12 19:07   ` sashiko-bot
@ 2026-11-16 10:37     ` Biju Das
  0 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-11-16 10:37 UTC (permalink / raw)
  To: sashiko-reviews
  Cc: devicetree, robh, conor+dt, wsa+renesas, linux-renesas-soc

On Thu, Nov 12, 2026 at 7:07 PM <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [High] arm64: dts: renesas: rzg3l-smarc-som: sdhi0 pinctrl fails with
>   -EINVAL
> - [Low] arm64: dts: renesas: rzg3l-smarc-som uses RZG2L_PORT_PINMUX for
>   SD0_CD
> --
>
> commit e86cb26292885aecdb37f14368a14d0f62f6aee6
> Author: Biju Das <biju.das.jz@bp.renesas.com>
>
> arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0
>
> This commit enables SD card or eMMC support on SDHI0 for the RZ/G3L SMARC
> SoM, selected via the SW_SD0_DEV_SEL macro.
>
> > diff --git a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> > index 091a227233cba..f6f4eed9a2ea6 100644
> > --- a/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi
>
> [ ... ]
>
> > @@ -216,7 +234,132 @@ 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-clk {
> > +                     pins = "SD0_CLK";
> > +                     power-source = <1800>;
> > +                     drive-strength-microamp = <9000>;
> > +             };
>
> [Severity: High]
> Does configuring power-source on the SD0_* pins cause sdhi0 probe to fail
> with -EINVAL?
>

No. see below

> In drivers/pinctrl/renesas/pinctrl-rzg2l.c, the SD0_* entries in
> rzg3l_dedicated_pins do not set PIN_CFG_IO_VMC_SD0 or PIN_CFG_SOFT_PS:
>
> drivers/pinctrl/renesas/pinctrl-rzg2l.c:rzg3l_dedicated_pins[] {
>     ...
>         { "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x9, 0, PIN_CFG_IOLH_B) },
>         { "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x9, 1,
>           (PIN_CFG_IOLH_B | PIN_CFG_IEN | PIN_CFG_PUPD)) },
>     ...
> }

{ "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 | 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_IO_VMC_SD0)) },
{ "SD0_DAT0", RZG2L_SINGLE_PIN_PACK(0x0a, 0,
 (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_IO_VMC_SD0)) },
{ "SD0_DAT2", RZG2L_SINGLE_PIN_PACK(0x0a, 2,
 (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_IO_VMC_SD0)) },
{ "SD0_DAT4", RZG2L_SINGLE_PIN_PACK(0x0a, 4,
 (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_IO_VMC_SD0)) },
{ "SD0_DAT6", RZG2L_SINGLE_PIN_PACK(0x0a, 6,
 (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_IO_VMC_SD0)) },


>
> When sdhi0 binds its pinctrl states (sdhi0_emmc_pins, sdhi0_usd_pins, or
> sdhi0_usd_uhs_pins), rzg2l_pinctrl_pinconf_set() -> rzg2l_set_power_source()
> -> rzg2l_caps_to_pwr_reg() returns -EINVAL, preventing SDHI0 from probing in
> both eMMC and uSD modes.  (Dropping power-source from DT while keeping
> drive-strength-microamp would instead leave the cached power_source at 0,
> causing rzg2l_ps_to_iolh_idx(0) to return RZG2L_IOLH_IDX_MAX and read past
> the end of hwcfg->iolh_groupb_ua[] in rzg2l_ds_is_supported().)

Drive strength it uses reset values.

>
> [ ... ]
>
> > +     sdhi0_usd_pins: sd0-usd {
> > +             sd0-cd {
> > +                     pinmux = <RZG2L_PORT_PINMUX(5, 0, 8)>; /* SD0_CD */
> > +             };
>
> [Severity: Low]
> This isn't a bug since RZG3L_P5 expands to 5, but sd0-cd in both
> sdhi0_usd_pins and sdhi0_usd_uhs_pins uses RZG2L_PORT_PINMUX(5, 0, 8)
> instead of RZG3L_PORT_PINMUX(5, 0, 8) like the rest of this file.

Will fix this.

Cheers,
Biju

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-11-16 10:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 18:48 [PATCH 0/3] Enable RZ/G3L SDHI Biju Das
2026-11-12 18:48 ` [PATCH 1/3] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju Das
2026-11-12 19:25   ` sashiko-bot
2026-11-16 10:25     ` Biju Das
2026-11-16 10:25       ` Biju Das
2026-11-12 18:48 ` [PATCH 2/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju Das
2026-11-12 19:07   ` sashiko-bot
2026-11-16 10:37     ` Biju Das
2026-11-12 18:48 ` [PATCH 3/3] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju Das
2026-11-12 19:09   ` sashiko-bot
2026-11-16 10:31     ` Biju Das
2026-11-16 10:05 ` [PATCH 0/3] Enable RZ/G3L SDHI Wolfram Sang
2026-11-16 10:09   ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox