public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Add RZ/G3E SDHI support
@ 2025-01-31 11:24 Biju Das
  2025-01-31 11:24 ` [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support Biju Das
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Biju Das @ 2025-01-31 11:24 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, Wolfram Sang,
	linux-mmc, devicetree, linux-renesas-soc, Prabhakar Mahadev Lad,
	Biju Das

The SD/MMC block on the RZ/G3E ("R9A09G047") SoC is similar to that
of the RZ/V2H, but the SD0 channel has only dedicated pins, so we must
use SD_STATUS register to control voltage and power enable (internal
regulator).

For SD1 and SD2 channel we can either use gpio regulator or internal
regulator (using SD_STATUS register) for voltage switching.

For SD0, fixed voltage(eMMC) uses fixed regulator and non-fixed voltage
(SD) uses internal regulator.

v1->v2:
 * Collected tags.
 * Documented internal regulator as optional property for both RZ/G3E and
   RZ/V2H SoCs.
 * Updated commit description for regulator used in SD0 fixed and
   non-fixed voltage case in patch#3.
 * As the node enabling of internal regulator is controlled through status,
   added a check for device availability.
 * Status of internal regulator is disabled in the SoC .dtsi. Override
   the status in the board DTS when needed.
 * Added support for enabling SDHI internal regulator in RZ/V2H
 * Added missing header file gpio.h
 * Used fixed regulator for eMMC on SD0 and dropped sd0-iovs pins for
   eMMC.
 * Sorted pinctrl nodes for sd2
 * Enabled internal regulator for SD2.
 * Added support for enabling SD on SDHI0
 * Replaced the regulator usd_vdd_3p3v->reg_3p3v.
 * Renamed the gpio-hog node sd1-pwr-en->sd1-pwr-en-hog.
 * Sorted sd1 pin ctrl nodes.

Biju Das (8):
  dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support
  mmc: renesas_sdhi: Arrange local variables in reverse xmas tree order
  mmc: renesas_sdhi: Add support for RZ/G3E SoC
  arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
  arm64: dts: renesas: r9a09g057: Add support for enabling SDHI internal
    regulator
  arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on
    SDHI0
  arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1

 .../devicetree/bindings/mmc/renesas,sdhi.yaml |  16 ++
 arch/arm64/boot/dts/renesas/r9a09g047.dtsi    |  60 +++++++
 .../boot/dts/renesas/r9a09g047e57-smarc.dts   |  49 ++++++
 arch/arm64/boot/dts/renesas/r9a09g057.dtsi    |  21 +++
 .../dts/renesas/r9a09g057h44-rzv2h-evk.dts    |   4 +-
 .../boot/dts/renesas/renesas-smarc2.dtsi      |  18 ++
 .../boot/dts/renesas/rzg3e-smarc-som.dtsi     | 158 ++++++++++++++++++
 drivers/mmc/host/renesas_sdhi.h               |   1 +
 drivers/mmc/host/renesas_sdhi_core.c          | 136 ++++++++++++++-
 drivers/mmc/host/tmio_mmc.h                   |   5 +
 10 files changed, 465 insertions(+), 3 deletions(-)

-- 
2.43.0


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

* [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support
  2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
@ 2025-01-31 11:24 ` Biju Das
  2025-01-31 17:17   ` Conor Dooley
  2025-02-06  8:47   ` Geert Uytterhoeven
  2025-01-31 11:24 ` [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes Biju Das
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 22+ messages in thread
From: Biju Das @ 2025-01-31 11:24 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, Wolfram Sang,
	linux-mmc, devicetree, linux-renesas-soc, Prabhakar Mahadev Lad,
	Biju Das

The SD/MMC block on the RZ/G3E ("R9A09G047") SoC is similar to that
of the RZ/V2H, but the SD0 channel has only dedicated pins, so we must
use SD_STATUS register to control voltage and power enable (internal
regulator), for non-fixed voltage (SD) MMC interface. However, it is
optional for fixed voltage MMC interface (eMMC).

For SD1 and SD2 channels, we can either use gpio regulator or internal
regulator (using SD_STATUS register) for voltage switching.

Document RZ/G3E SDHI IP support with optional internal regulator for
both RZ/G3E and RZ/V2H SoC.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Dropped tags.
 * Documented internal regulator as optional property for both RZ/G3E and
   RZ/V2H SoCs.
---
 .../devicetree/bindings/mmc/renesas,sdhi.yaml    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml b/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
index af378b9ff3f4..773baa6c2656 100644
--- a/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
+++ b/Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml
@@ -68,6 +68,9 @@ properties:
               - renesas,sdhi-r9a08g045 # RZ/G3S
               - renesas,sdhi-r9a09g011 # RZ/V2M
           - const: renesas,rzg2l-sdhi
+      - items:
+          - const: renesas,sdhi-r9a09g047 # RZ/G3E
+          - const: renesas,sdhi-r9a09g057 # RZ/V2H(P)
 
   reg:
     maxItems: 1
@@ -211,6 +214,19 @@ allOf:
         sectioned off to be run by a separate second clock source to allow
         the main core clock to be turned off to save power.
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,sdhi-r9a09g057
+    then:
+      properties:
+        vqmmc-regulator:
+          type: object
+          description: VQMMC SD regulator
+          $ref: /schemas/regulator/regulator.yaml#
+          unevaluatedProperties: false
+
 required:
   - compatible
   - reg
-- 
2.43.0


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

* [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
  2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
  2025-01-31 11:24 ` [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support Biju Das
@ 2025-01-31 11:24 ` Biju Das
  2025-02-05  8:16   ` Geert Uytterhoeven
  2025-01-31 11:24 ` [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2} Biju Das
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Biju Das @ 2025-01-31 11:24 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Prabhakar Mahadev Lad, Biju Das

Add SDHI0-SDHI2 nodes to RZ/G3E ("R9A09G047") SoC DTSI.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Status of internal regulator is disabled in the SoC .dtsi. Override
   the status in the board DTS when needed.
---
 arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 60 ++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index c93aa16d0a6e..8d4717d4cf14 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -410,6 +410,66 @@ gic: interrupt-controller@14900000 {
 			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
 		};
+
+		sdhi0: mmc@15c00000  {
+			compatible = "renesas,sdhi-r9a09g047", "renesas,sdhi-r9a09g057";
+			reg = <0x0 0x15c00000 0 0x10000>;
+			interrupts = <GIC_SPI 735 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 736 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 0xa3>, <&cpg CPG_MOD 0xa5>,
+				 <&cpg CPG_MOD 0xa4>, <&cpg CPG_MOD 0xa6>;
+			clock-names = "core", "clkh", "cd", "aclk";
+			resets = <&cpg 0xa7>;
+			power-domains = <&cpg>;
+			status = "disabled";
+
+			vqmmc_sdhi0: vqmmc-regulator {
+				regulator-name = "SDHI0-VQMMC";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				status = "disabled";
+			};
+		};
+
+		sdhi1: mmc@15c10000 {
+			compatible = "renesas,sdhi-r9a09g047", "renesas,sdhi-r9a09g057";
+			reg = <0x0 0x15c10000 0 0x10000>;
+			interrupts = <GIC_SPI 737 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 738 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 0xa7>, <&cpg CPG_MOD 0xa9>,
+				 <&cpg CPG_MOD 0xa8>, <&cpg CPG_MOD 0xaa>;
+			clock-names = "core", "clkh", "cd", "aclk";
+			resets = <&cpg 0xa8>;
+			power-domains = <&cpg>;
+			status = "disabled";
+
+			vqmmc_sdhi1: vqmmc-regulator {
+				regulator-name = "SDHI1-VQMMC";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				status = "disabled";
+			};
+		};
+
+		sdhi2: mmc@15c20000 {
+			compatible = "renesas,sdhi-r9a09g047", "renesas,sdhi-r9a09g057";
+			reg = <0x0 0x15c20000 0 0x10000>;
+			interrupts = <GIC_SPI 739 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 740 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 0xab>, <&cpg CPG_MOD 0xad>,
+				 <&cpg CPG_MOD 0xac>, <&cpg CPG_MOD 0xae>;
+			clock-names = "core", "clkh", "cd", "aclk";
+			resets = <&cpg 0xa9>;
+			power-domains = <&cpg>;
+			status = "disabled";
+
+			vqmmc_sdhi2: vqmmc-regulator {
+				regulator-name = "SDHI2-VQMMC";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				status = "disabled";
+			};
+		};
 	};
 
 	timer {
-- 
2.43.0


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

* [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
  2025-01-31 11:24 ` [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support Biju Das
  2025-01-31 11:24 ` [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes Biju Das
@ 2025-01-31 11:24 ` Biju Das
  2025-02-06  9:35   ` Geert Uytterhoeven
  2025-02-06  9:48   ` Geert Uytterhoeven
  2025-01-31 11:24 ` [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0 Biju Das
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 22+ messages in thread
From: Biju Das @ 2025-01-31 11:24 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Prabhakar Mahadev Lad, Biju Das

Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Added missing header file gpio.h
 * Used fixed regulator for eMMC on SD0 and dropped sd0-iovs pins for
   eMMC.
 * Sorted pinctrl nodes for sd2
 * Enabled internal regulator for SD2.
---
 .../boot/dts/renesas/r9a09g047e57-smarc.dts   |   1 +
 .../boot/dts/renesas/rzg3e-smarc-som.dtsi     | 101 ++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
index c063d47e2952..f9248037de9e 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
 #include "r9a09g047e57.dtsi"
 #include "rzg3e-smarc-som.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
index f4ba050beb0d..9b5e5fd76c29 100644
--- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
@@ -8,17 +8,86 @@
 / {
 	compatible = "renesas,rzg3e-smarcm", "renesas,r9a09g047e57", "renesas,r9a09g047";
 
+	aliases {
+		mmc0 = &sdhi0;
+		mmc2 = &sdhi2;
+	};
+
 	memory@48000000 {
 		device_type = "memory";
 		/* First 128MB is reserved for secure area. */
 		reg = <0x0 0x48000000 0x0 0xf8000000>;
 	};
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
 };
 
 &audio_extal_clk {
 	clock-frequency = <48000000>;
 };
 
+&pinctrl {
+	sdhi0_emmc_pins: sd0emmc {
+		sd0-emmc-ctrl {
+			pins = "SD0CLK", "SD0CMD";
+			renesas,output-impedance = <3>;
+		};
+
+		sd0-emmc-data {
+			pins = "SD0DAT0", "SD0DAT1", "SD0DAT2", "SD0DAT3",
+			       "SD0DAT4", "SD0DAT5", "SD0DAT6", "SD0DAT7";
+			renesas,output-impedance = <3>;
+		};
+
+		sd0-emmc-rst {
+			pins = "SD0RSTN";
+			renesas,output-impedance = <3>;
+		};
+	};
+
+	sdhi2_pins: sd2 {
+		sd2-cd {
+			pinmux = <RZG3E_PORT_PINMUX(K, 0, 1)>; /* SD2CD */
+		};
+
+		sd2-ctrl {
+			pinmux = <RZG3E_PORT_PINMUX(H, 0, 1)>, /* SD2CLK */
+				 <RZG3E_PORT_PINMUX(H, 1, 1)>; /* SD2CMD */
+		};
+
+		sd2-data {
+			pinmux = <RZG3E_PORT_PINMUX(H, 2, 1)>, /* SD2DAT0 */
+				 <RZG3E_PORT_PINMUX(H, 3, 1)>, /* SD2DAT1 */
+				 <RZG3E_PORT_PINMUX(H, 4, 1)>, /* SD2DAT2 */
+				 <RZG3E_PORT_PINMUX(H, 5, 1)>; /* SD2DAT3 */
+		};
+
+		sd2-iovs {
+			pinmux = <RZG3E_PORT_PINMUX(K, 1, 1)>; /* SD2IOVS */
+		};
+
+		sd2-pwen {
+			pinmux = <RZG3E_PORT_PINMUX(K, 2, 1)>; /* SD2PWEN */
+		};
+	};
+};
+
 &qextal_clk {
 	clock-frequency = <24000000>;
 };
@@ -27,6 +96,38 @@ &rtxin_clk {
 	clock-frequency = <32768>;
 };
 
+&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";
+};
+
+&sdhi2 {
+	pinctrl-0 = <&sdhi2_pins>;
+	pinctrl-1 = <&sdhi2_pins>;
+	pinctrl-names = "default", "state_uhs";
+
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&vqmmc_sdhi2>;
+	bus-width = <4>;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+	status = "okay";
+};
+
+&vqmmc_sdhi2 {
+	regulator-name = "SD2_PVDD";
+	status = "okay";
+};
+
 &wdt1 {
 	status = "okay";
 };
-- 
2.43.0


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

* [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0
  2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
                   ` (2 preceding siblings ...)
  2025-01-31 11:24 ` [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2} Biju Das
@ 2025-01-31 11:24 ` Biju Das
  2025-02-06  9:47   ` Geert Uytterhoeven
  2025-01-31 11:24 ` [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1 Biju Das
  2025-02-06  8:50 ` [PATCH v2 0/8] Add RZ/G3E SDHI support Geert Uytterhoeven
  5 siblings, 1 reply; 22+ messages in thread
From: Biju Das @ 2025-01-31 11:24 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Prabhakar Mahadev Lad, Biju Das

Add support for enabling SD on SDHI0 on RZ/G3E SMARC SoM. It is enabled
by setting the macro SW_SD0_DEV_SEL to 1 in board DTS and setting the
switch SYS.1 to ON position on the SoM.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
 * New patch
---
 .../boot/dts/renesas/r9a09g047e57-smarc.dts   |  3 +
 .../boot/dts/renesas/rzg3e-smarc-som.dtsi     | 57 +++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
index f9248037de9e..fe67bce26d75 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
@@ -7,6 +7,9 @@
 
 /dts-v1/;
 
+/* Switch selection settings */
+#define SW_SD0_DEV_SEL		0
+
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
 #include "r9a09g047e57.dtsi"
diff --git a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
index 9b5e5fd76c29..d3b47c792454 100644
--- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
@@ -5,6 +5,15 @@
  * Copyright (C) 2024 Renesas Electronics Corp.
  */
 
+/*
+ * Please set the switch position SYS.1 on the SoM and the corresponding macro
+ * SW_SD0_DEV_SEL on the board DTS:
+ *
+ * SW_SD0_DEV_SEL:
+ *      0 - SD0 is connected to eMMC (default)
+ *      1 - SD0 is connected to uSD0 card
+ */
+
 / {
 	compatible = "renesas,rzg3e-smarcm", "renesas,r9a09g047e57", "renesas,r9a09g047";
 
@@ -43,6 +52,34 @@ &audio_extal_clk {
 };
 
 &pinctrl {
+#if (SW_SD0_DEV_SEL)
+	sdhi0_pins: sd0 {
+		sd0-cd {
+			pinmux = <RZG3E_PORT_PINMUX(5, 0, 8)>;
+		};
+
+		sd0-ctrl {
+			pins = "SD0CLK", "SD0CMD";
+			renesas,output-impedance = <3>;
+		};
+
+		sd0-data {
+			pins = "SD0DAT0", "SD0DAT1", "SD0DAT2", "SD0DAT3";
+			renesas,output-impedance = <3>;
+		};
+
+		sd0-iovs {
+			pins = "SD0IOVS";
+			renesas,output-impedance = <3>;
+		};
+
+		sd0-pwen {
+			pins = "SD0PWEN";
+			renesas,output-impedance = <3>;
+		};
+	};
+#endif
+
 	sdhi0_emmc_pins: sd0emmc {
 		sd0-emmc-ctrl {
 			pins = "SD0CLK", "SD0CMD";
@@ -96,6 +133,25 @@ &rtxin_clk {
 	clock-frequency = <32768>;
 };
 
+#if (SW_SD0_DEV_SEL)
+&sdhi0 {
+	pinctrl-0 = <&sdhi0_pins>;
+	pinctrl-1 = <&sdhi0_pins>;
+	pinctrl-names = "default", "state_uhs";
+
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&vqmmc_sdhi0>;
+	bus-width = <4>;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+	status = "okay";
+};
+
+&vqmmc_sdhi0 {
+	regulator-name = "SD0_PVDD";
+	status = "okay";
+};
+#else
 &sdhi0 {
 	pinctrl-0 = <&sdhi0_emmc_pins>;
 	pinctrl-1 = <&sdhi0_emmc_pins>;
@@ -109,6 +165,7 @@ &sdhi0 {
 	fixed-emmc-driver-type = <1>;
 	status = "okay";
 };
+#endif
 
 &sdhi2 {
 	pinctrl-0 = <&sdhi2_pins>;
-- 
2.43.0


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

* [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1
  2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
                   ` (3 preceding siblings ...)
  2025-01-31 11:24 ` [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0 Biju Das
@ 2025-01-31 11:24 ` Biju Das
  2025-02-06 10:04   ` Geert Uytterhoeven
  2025-02-06  8:50 ` [PATCH v2 0/8] Add RZ/G3E SDHI support Geert Uytterhoeven
  5 siblings, 1 reply; 22+ messages in thread
From: Biju Das @ 2025-01-31 11:24 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Prabhakar Mahadev Lad, Biju Das

Enable SDHI1 on the RZ/G3E SMARC EVK platform using gpio regulator for
voltage switching.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Replaced the regulator usd_vdd_3p3v->reg_3p3v.
 * Renamed the gpio-hog node sd1-pwr-en->sd1-pwr-en-hog.
 * Sorted sd1 pin ctrl nodes.
---
 .../boot/dts/renesas/r9a09g047e57-smarc.dts   | 45 +++++++++++++++++++
 .../boot/dts/renesas/renesas-smarc2.dtsi      | 18 ++++++++
 2 files changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
index fe67bce26d75..5d7983812c70 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
@@ -9,6 +9,7 @@
 
 /* Switch selection settings */
 #define SW_SD0_DEV_SEL		0
+#define SW_SDIO_M2E		0
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
@@ -20,6 +21,16 @@ / {
 	model = "Renesas SMARC EVK version 2 based on r9a09g047e57";
 	compatible = "renesas,smarc2-evk", "renesas,rzg3e-smarcm",
 		     "renesas,r9a09g047e57", "renesas,r9a09g047";
+
+	vqmmc_sd1_pvdd: regulator-vqmmc-sd1-pvdd {
+		compatible = "regulator-gpio";
+		regulator-name = "SD1_PVDD";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+		gpios = <&pinctrl RZG3E_GPIO(1, 5) GPIO_ACTIVE_HIGH>;
+		gpios-states = <0>;
+		states = <3300000 0>, <1800000 1>;
+	};
 };
 
 &pinctrl {
@@ -27,9 +38,43 @@ scif_pins: scif {
 		pins = "SCIF_TXD", "SCIF_RXD";
 		renesas,output-impedance = <1>;
 	};
+
+	sd1-pwr-en-hog {
+		gpio-hog;
+		gpios = <RZG3E_GPIO(1, 6) GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "sd1_pwr_en";
+	};
+
+	sdhi1_pins: sd1 {
+		sd1-cd {
+			pinmux = <RZG3E_PORT_PINMUX(1, 4, 8)>; /* SD1CD */
+		};
+
+		sd1-ctrl {
+			pinmux = <RZG3E_PORT_PINMUX(G, 0, 1)>, /* SD1CLK */
+				 <RZG3E_PORT_PINMUX(G, 1, 1)>; /* SD1CMD */
+		};
+
+		sd1-data {
+			pinmux = <RZG3E_PORT_PINMUX(G, 2, 1)>, /* SD1DAT0 */
+				 <RZG3E_PORT_PINMUX(G, 3, 1)>, /* SD1DAT1 */
+				 <RZG3E_PORT_PINMUX(G, 4, 1)>, /* SD1DAT2 */
+				 <RZG3E_PORT_PINMUX(G, 5, 1)>; /* SD1DAT3 */
+		};
+	};
 };
 
 &scif0 {
 	pinctrl-0 = <&scif_pins>;
 	pinctrl-names = "default";
 };
+
+&sdhi1 {
+	pinctrl-0 = <&sdhi1_pins>;
+	pinctrl-1 = <&sdhi1_pins>;
+	pinctrl-names = "default", "state_uhs";
+
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&vqmmc_sd1_pvdd>;
+};
diff --git a/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi b/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
index e378d55e6e9b..fd82df8adc1e 100644
--- a/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
+++ b/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
@@ -5,6 +5,15 @@
  * Copyright (C) 2024 Renesas Electronics Corp.
  */
 
+/*
+ * Please set the switch position SW_OPT_MUX.1 on the carrier board and the
+ * corresponding macro SW_SDIO_M2E on the board DTS:
+ *
+ * SW_SDIO_M2E:
+ *     0 - SMARC SDIO signal is connected to uSD1
+ *     1 - SMARC SDIO signal is connected to M.2 Key E connector
+ */
+
 / {
 	model = "Renesas RZ SMARC Carrier-II Board";
 	compatible = "renesas,smarc2-evk";
@@ -16,9 +25,18 @@ chosen {
 
 	aliases {
 		serial3 = &scif0;
+		mmc1 = &sdhi1;
 	};
 };
 
 &scif0 {
 	status = "okay";
 };
+
+&sdhi1 {
+	bus-width = <4>;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+
+	status = "okay";
+};
-- 
2.43.0


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

* Re: [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support
  2025-01-31 11:24 ` [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support Biju Das
@ 2025-01-31 17:17   ` Conor Dooley
  2025-02-06  8:47   ` Geert Uytterhoeven
  1 sibling, 0 replies; 22+ messages in thread
From: Conor Dooley @ 2025-01-31 17:17 UTC (permalink / raw)
  To: Biju Das
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, Wolfram Sang, linux-mmc,
	devicetree, linux-renesas-soc, Prabhakar Mahadev Lad, Biju Das

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

On Fri, Jan 31, 2025 at 11:24:16AM +0000, Biju Das wrote:
> The SD/MMC block on the RZ/G3E ("R9A09G047") SoC is similar to that
> of the RZ/V2H, but the SD0 channel has only dedicated pins, so we must
> use SD_STATUS register to control voltage and power enable (internal
> regulator), for non-fixed voltage (SD) MMC interface. However, it is
> optional for fixed voltage MMC interface (eMMC).
> 
> For SD1 and SD2 channels, we can either use gpio regulator or internal
> regulator (using SD_STATUS register) for voltage switching.
> 
> Document RZ/G3E SDHI IP support with optional internal regulator for
> both RZ/G3E and RZ/V2H SoC.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

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

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

* Re: [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
  2025-01-31 11:24 ` [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes Biju Das
@ 2025-02-05  8:16   ` Geert Uytterhoeven
  2025-02-05  9:19     ` Biju Das
  0 siblings, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-05  8:16 UTC (permalink / raw)
  To: Biju Das
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Add SDHI0-SDHI2 nodes to RZ/G3E ("R9A09G047") SoC DTSI.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  * Status of internal regulator is disabled in the SoC .dtsi. Override
>    the status in the board DTS when needed.

Thanks for the update!

> --- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
> @@ -410,6 +410,66 @@ gic: interrupt-controller@14900000 {
>                         interrupt-controller;
>                         interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
>                 };
> +
> +               sdhi0: mmc@15c00000  {
> +                       compatible = "renesas,sdhi-r9a09g047", "renesas,sdhi-r9a09g057";
> +                       reg = <0x0 0x15c00000 0 0x10000>;
> +                       interrupts = <GIC_SPI 735 IRQ_TYPE_LEVEL_HIGH>,
> +                                    <GIC_SPI 736 IRQ_TYPE_LEVEL_HIGH>;
> +                       clocks = <&cpg CPG_MOD 0xa3>, <&cpg CPG_MOD 0xa5>,
> +                                <&cpg CPG_MOD 0xa4>, <&cpg CPG_MOD 0xa6>;
> +                       clock-names = "core", "clkh", "cd", "aclk";
> +                       resets = <&cpg 0xa7>;
> +                       power-domains = <&cpg>;
> +                       status = "disabled";
> +
> +                       vqmmc_sdhi0: vqmmc-regulator {

sdhi0_vqmmc? (same for the others)

> +                               regulator-name = "SDHI0-VQMMC";
> +                               regulator-min-microvolt = <1800000>;
> +                               regulator-max-microvolt = <3300000>;
> +                               status = "disabled";
> +                       };
> +               };

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] 22+ messages in thread

* RE: [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
  2025-02-05  8:16   ` Geert Uytterhoeven
@ 2025-02-05  9:19     ` Biju Das
  0 siblings, 0 replies; 22+ messages in thread
From: Biju Das @ 2025-02-05  9:19 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert Uytterhoeven,

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 05 February 2025 08:17
> Subject: Re: [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
> 
> Hi Biju,
> 
> On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Add SDHI0-SDHI2 nodes to RZ/G3E ("R9A09G047") SoC DTSI.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v1->v2:
> >  * Status of internal regulator is disabled in the SoC .dtsi. Override
> >    the status in the board DTS when needed.
> 
> Thanks for the update!
> 
> > --- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
> > @@ -410,6 +410,66 @@ gic: interrupt-controller@14900000 {
> >                         interrupt-controller;
> >                         interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
> >                 };
> > +
> > +               sdhi0: mmc@15c00000  {
> > +                       compatible = "renesas,sdhi-r9a09g047", "renesas,sdhi-r9a09g057";
> > +                       reg = <0x0 0x15c00000 0 0x10000>;
> > +                       interrupts = <GIC_SPI 735 IRQ_TYPE_LEVEL_HIGH>,
> > +                                    <GIC_SPI 736 IRQ_TYPE_LEVEL_HIGH>;
> > +                       clocks = <&cpg CPG_MOD 0xa3>, <&cpg CPG_MOD 0xa5>,
> > +                                <&cpg CPG_MOD 0xa4>, <&cpg CPG_MOD 0xa6>;
> > +                       clock-names = "core", "clkh", "cd", "aclk";
> > +                       resets = <&cpg 0xa7>;
> > +                       power-domains = <&cpg>;
> > +                       status = "disabled";
> > +
> > +                       vqmmc_sdhi0: vqmmc-regulator {
> 
> sdhi0_vqmmc? (same for the others)

It is ok to me.

Cheers,
Biju

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

* Re: [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support
  2025-01-31 11:24 ` [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support Biju Das
  2025-01-31 17:17   ` Conor Dooley
@ 2025-02-06  8:47   ` Geert Uytterhoeven
  1 sibling, 0 replies; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06  8:47 UTC (permalink / raw)
  To: Biju Das
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Magnus Damm, Wolfram Sang, linux-mmc, devicetree,
	linux-renesas-soc, Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:24, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> The SD/MMC block on the RZ/G3E ("R9A09G047") SoC is similar to that
> of the RZ/V2H, but the SD0 channel has only dedicated pins, so we must
> use SD_STATUS register to control voltage and power enable (internal
> regulator), for non-fixed voltage (SD) MMC interface. However, it is
> optional for fixed voltage MMC interface (eMMC).
>
> For SD1 and SD2 channels, we can either use gpio regulator or internal
> regulator (using SD_STATUS register) for voltage switching.
>
> Document RZ/G3E SDHI IP support with optional internal regulator for
> both RZ/G3E and RZ/V2H SoC.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  * Dropped tags.
>  * Documented internal regulator as optional property for both RZ/G3E and
>    RZ/V2H SoCs.

Thanks for the update!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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] 22+ messages in thread

* Re: [PATCH v2 0/8] Add RZ/G3E SDHI support
  2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
                   ` (4 preceding siblings ...)
  2025-01-31 11:24 ` [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1 Biju Das
@ 2025-02-06  8:50 ` Geert Uytterhoeven
  2025-02-06  9:26   ` Biju Das
  5 siblings, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06  8:50 UTC (permalink / raw)
  To: Biju Das
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, Wolfram Sang, linux-mmc,
	devicetree, linux-renesas-soc, Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:24, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> The SD/MMC block on the RZ/G3E ("R9A09G047") SoC is similar to that
> of the RZ/V2H, but the SD0 channel has only dedicated pins, so we must
> use SD_STATUS register to control voltage and power enable (internal
> regulator).
>
> For SD1 and SD2 channel we can either use gpio regulator or internal
> regulator (using SD_STATUS register) for voltage switching.
>
> For SD0, fixed voltage(eMMC) uses fixed regulator and non-fixed voltage
> (SD) uses internal regulator.

Thanks for your series!

> Biju Das (8):
>   dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support
>   mmc: renesas_sdhi: Arrange local variables in reverse xmas tree order
>   mmc: renesas_sdhi: Add support for RZ/G3E SoC
>   arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
>   arm64: dts: renesas: r9a09g057: Add support for enabling SDHI internal
>     regulator
>   arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
>   arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on
>     SDHI0
>   arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1

Note that this was not sent as a single series: patches 2 and 5 were
sent as a separate series.

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] 22+ messages in thread

* RE: [PATCH v2 0/8] Add RZ/G3E SDHI support
  2025-02-06  8:50 ` [PATCH v2 0/8] Add RZ/G3E SDHI support Geert Uytterhoeven
@ 2025-02-06  9:26   ` Biju Das
  0 siblings, 0 replies; 22+ messages in thread
From: Biju Das @ 2025-02-06  9:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, Wolfram Sang,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad,
	biju.das.au

Hi Geert,

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 06 February 2025 08:50
> Subject: Re: [PATCH v2 0/8] Add RZ/G3E SDHI support
> 
> Hi Biju,
> 
> On Fri, 31 Jan 2025 at 12:24, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > The SD/MMC block on the RZ/G3E ("R9A09G047") SoC is similar to that of
> > the RZ/V2H, but the SD0 channel has only dedicated pins, so we must
> > use SD_STATUS register to control voltage and power enable (internal
> > regulator).
> >
> > For SD1 and SD2 channel we can either use gpio regulator or internal
> > regulator (using SD_STATUS register) for voltage switching.
> >
> > For SD0, fixed voltage(eMMC) uses fixed regulator and non-fixed
> > voltage
> > (SD) uses internal regulator.
> 
> Thanks for your series!
> 
> > Biju Das (8):
> >   dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support
> >   mmc: renesas_sdhi: Arrange local variables in reverse xmas tree order
> >   mmc: renesas_sdhi: Add support for RZ/G3E SoC
> >   arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes
> >   arm64: dts: renesas: r9a09g057: Add support for enabling SDHI internal
> >     regulator
> >   arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
> >   arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on
> >     SDHI0
> >   arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1
> 
> Note that this was not sent as a single series: patches 2 and 5 were sent as a separate series.

There was some issue happened while sending v2. I forgot to add email addresses for 2 and 5. I need to resend
that patches with To and CC fixed. On patchwork[1] I see it as a single series.

I will fix this issue while sending V3 with v2 review comments addressed.

https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=929475

Cheers,
Biju



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

* Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-01-31 11:24 ` [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2} Biju Das
@ 2025-02-06  9:35   ` Geert Uytterhoeven
  2025-02-06  9:47     ` Biju Das
  2025-02-06  9:48   ` Geert Uytterhoeven
  1 sibling, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06  9:35 UTC (permalink / raw)
  To: Biju Das
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  * Added missing header file gpio.h
>  * Used fixed regulator for eMMC on SD0 and dropped sd0-iovs pins for
>    eMMC.
>  * Sorted pinctrl nodes for sd2
>  * Enabled internal regulator for SD2.

Thanks for the update!

> --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> @@ -7,6 +7,7 @@
>
>  /dts-v1/;
>
> +#include <dt-bindings/gpio/gpio.h>

Not needed in this patch.

>  #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
>  #include "r9a09g047e57.dtsi"
>  #include "rzg3e-smarc-som.dtsi"

> --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi

> +&vqmmc_sdhi2 {
> +       regulator-name = "SD2_PVDD";

Why override the name?

> +       status = "okay";
> +};
> +
>  &wdt1 {
>         status = "okay";
>  };

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] 22+ messages in thread

* Re: [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0
  2025-01-31 11:24 ` [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0 Biju Das
@ 2025-02-06  9:47   ` Geert Uytterhoeven
  2025-02-06 10:58     ` Biju Das
  0 siblings, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06  9:47 UTC (permalink / raw)
  To: Biju Das
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Add support for enabling SD on SDHI0 on RZ/G3E SMARC SoM. It is enabled
> by setting the macro SW_SD0_DEV_SEL to 1 in board DTS and setting the
> switch SYS.1 to ON position on the SoM.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> @@ -5,6 +5,15 @@
>   * Copyright (C) 2024 Renesas Electronics Corp.
>   */
>
> +/*
> + * Please set the switch position SYS.1 on the SoM and the corresponding macro
> + * SW_SD0_DEV_SEL on the board DTS:
> + *
> + * SW_SD0_DEV_SEL:
> + *      0 - SD0 is connected to eMMC (default)
> + *      1 - SD0 is connected to uSD0 card
> + */
> +
>  / {
>         compatible = "renesas,rzg3e-smarcm", "renesas,r9a09g047e57", "renesas,r9a09g047";
>
> @@ -43,6 +52,34 @@ &audio_extal_clk {
>  };
>
>  &pinctrl {
> +#if (SW_SD0_DEV_SEL)

No need to make this conditional.

> +       sdhi0_pins: sd0 {

sdhi0_usd_pins: sd0-usd {

> +               sd0-cd {
> +                       pinmux = <RZG3E_PORT_PINMUX(5, 0, 8)>;
> +               };
> +
> +               sd0-ctrl {
> +                       pins = "SD0CLK", "SD0CMD";
> +                       renesas,output-impedance = <3>;
> +               };
> +
> +               sd0-data {
> +                       pins = "SD0DAT0", "SD0DAT1", "SD0DAT2", "SD0DAT3";
> +                       renesas,output-impedance = <3>;
> +               };
> +
> +               sd0-iovs {
> +                       pins = "SD0IOVS";
> +                       renesas,output-impedance = <3>;
> +               };
> +
> +               sd0-pwen {
> +                       pins = "SD0PWEN";
> +                       renesas,output-impedance = <3>;
> +               };
> +       };
> +#endif
> +
>         sdhi0_emmc_pins: sd0emmc {
>                 sd0-emmc-ctrl {
>                         pins = "SD0CLK", "SD0CMD";
> @@ -96,6 +133,25 @@ &rtxin_clk {
>         clock-frequency = <32768>;
>  };
>
> +#if (SW_SD0_DEV_SEL)
> +&sdhi0 {
> +       pinctrl-0 = <&sdhi0_pins>;
> +       pinctrl-1 = <&sdhi0_pins>;
> +       pinctrl-names = "default", "state_uhs";
> +
> +       vmmc-supply = <&reg_3p3v>;
> +       vqmmc-supply = <&vqmmc_sdhi0>;
> +       bus-width = <4>;
> +       sd-uhs-sdr50;
> +       sd-uhs-sdr104;
> +       status = "okay";
> +};
> +
> +&vqmmc_sdhi0 {
> +       regulator-name = "SD0_PVDD";

Why override the name?

> +       status = "okay";
> +};
> +#else
>  &sdhi0 {
>         pinctrl-0 = <&sdhi0_emmc_pins>;
>         pinctrl-1 = <&sdhi0_emmc_pins>;

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] 22+ messages in thread

* RE: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-02-06  9:35   ` Geert Uytterhoeven
@ 2025-02-06  9:47     ` Biju Das
  2025-02-06  9:52       ` Geert Uytterhoeven
  0 siblings, 1 reply; 22+ messages in thread
From: Biju Das @ 2025-02-06  9:47 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert,

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 06 February 2025 09:36
> Subject: Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
> 
> Hi Biju,
> 
> On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v1->v2:
> >  * Added missing header file gpio.h
> >  * Used fixed regulator for eMMC on SD0 and dropped sd0-iovs pins for
> >    eMMC.
> >  * Sorted pinctrl nodes for sd2
> >  * Enabled internal regulator for SD2.
> 
> Thanks for the update!
> 
> > --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > @@ -7,6 +7,7 @@
> >
> >  /dts-v1/;
> >
> > +#include <dt-bindings/gpio/gpio.h>
> 
> Not needed in this patch.
> 
> >  #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
> >  #include "r9a09g047e57.dtsi"
> >  #include "rzg3e-smarc-som.dtsi"
> 
> > --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> 
> > +&vqmmc_sdhi2 {
> > +       regulator-name = "SD2_PVDD";
> 
> Why override the name?

I just used the label used in RZ/G3E SoM Schematics. So that it appears 
as 

cat /sys/class/regulator/regulator.4/name
SD2_PVDD

I can revert this change, if needed. 

Cheers,
Biju


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

* Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-01-31 11:24 ` [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2} Biju Das
  2025-02-06  9:35   ` Geert Uytterhoeven
@ 2025-02-06  9:48   ` Geert Uytterhoeven
  2025-02-06 11:06     ` Biju Das
  1 sibling, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06  9:48 UTC (permalink / raw)
  To: Biju Das
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

> --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi

>
> +&pinctrl {
> +       sdhi0_emmc_pins: sd0emmc {

sdhi0_emmc_pins: sd0-emmc {

> +               sd0-emmc-ctrl {

and drop the "-emmc" here and below, to align with sd0-usd in the next patch.

> +                       pins = "SD0CLK", "SD0CMD";
> +                       renesas,output-impedance = <3>;
> +               };
> +
> +               sd0-emmc-data {
> +                       pins = "SD0DAT0", "SD0DAT1", "SD0DAT2", "SD0DAT3",
> +                              "SD0DAT4", "SD0DAT5", "SD0DAT6", "SD0DAT7";
> +                       renesas,output-impedance = <3>;
> +               };
> +
> +               sd0-emmc-rst {
> +                       pins = "SD0RSTN";
> +                       renesas,output-impedance = <3>;
> +               };
> +       };
> +


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] 22+ messages in thread

* Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-02-06  9:47     ` Biju Das
@ 2025-02-06  9:52       ` Geert Uytterhoeven
  2025-02-06 11:07         ` Biju Das
  0 siblings, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06  9:52 UTC (permalink / raw)
  To: Biju Das
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Biju,

On Thu, 6 Feb 2025 at 10:47, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: 06 February 2025 09:36
> > Subject: Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
> >
> > On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.
> > >
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

> > > --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > > +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> >
> > > +&vqmmc_sdhi2 {
> > > +       regulator-name = "SD2_PVDD";
> >
> > Why override the name?
>
> I just used the label used in RZ/G3E SoM Schematics. So that it appears
> as
>
> cat /sys/class/regulator/regulator.4/name
> SD2_PVDD

I think this makes it harder to notice that it uses the internal regulator.

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] 22+ messages in thread

* Re: [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1
  2025-01-31 11:24 ` [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1 Biju Das
@ 2025-02-06 10:04   ` Geert Uytterhoeven
  2025-02-06 11:08     ` Biju Das
  0 siblings, 1 reply; 22+ messages in thread
From: Geert Uytterhoeven @ 2025-02-06 10:04 UTC (permalink / raw)
  To: Biju Das
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
	linux-renesas-soc, devicetree, Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Enable SDHI1 on the RZ/G3E SMARC EVK platform using gpio regulator for
> voltage switching.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  * Replaced the regulator usd_vdd_3p3v->reg_3p3v.
>  * Renamed the gpio-hog node sd1-pwr-en->sd1-pwr-en-hog.
>  * Sorted sd1 pin ctrl nodes.

Thanks for the update!

> --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> @@ -9,6 +9,7 @@
>
>  /* Switch selection settings */
>  #define SW_SD0_DEV_SEL         0
> +#define SW_SDIO_M2E            0
>
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
> @@ -20,6 +21,16 @@ / {
>         model = "Renesas SMARC EVK version 2 based on r9a09g047e57";
>         compatible = "renesas,smarc2-evk", "renesas,rzg3e-smarcm",
>                      "renesas,r9a09g047e57", "renesas,r9a09g047";
> +
> +       vqmmc_sd1_pvdd: regulator-vqmmc-sd1-pvdd {
> +               compatible = "regulator-gpio";
> +               regulator-name = "SD1_PVDD";
> +               regulator-min-microvolt = <1800000>;
> +               regulator-max-microvolt = <3300000>;
> +               gpios = <&pinctrl RZG3E_GPIO(1, 5) GPIO_ACTIVE_HIGH>;

This is the patch that needs to add #include <dt-bindings/gpio/gpio.h>.

> +               gpios-states = <0>;
> +               states = <3300000 0>, <1800000 1>;
> +       };
>  };

The rest LGTM.

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] 22+ messages in thread

* RE: [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0
  2025-02-06  9:47   ` Geert Uytterhoeven
@ 2025-02-06 10:58     ` Biju Das
  0 siblings, 0 replies; 22+ messages in thread
From: Biju Das @ 2025-02-06 10:58 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 06 February 2025 09:47
> Subject: Re: [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0
> 
> Hi Biju,
> 
> On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Add support for enabling SD on SDHI0 on RZ/G3E SMARC SoM. It is
> > enabled by setting the macro SW_SD0_DEV_SEL to 1 in board DTS and
> > setting the switch SYS.1 to ON position on the SoM.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > @@ -5,6 +5,15 @@
> >   * Copyright (C) 2024 Renesas Electronics Corp.
> >   */
> >
> > +/*
> > + * Please set the switch position SYS.1 on the SoM and the
> > +corresponding macro
> > + * SW_SD0_DEV_SEL on the board DTS:
> > + *
> > + * SW_SD0_DEV_SEL:
> > + *      0 - SD0 is connected to eMMC (default)
> > + *      1 - SD0 is connected to uSD0 card
> > + */
> > +
> >  / {
> >         compatible = "renesas,rzg3e-smarcm", "renesas,r9a09g047e57",
> > "renesas,r9a09g047";
> >
> > @@ -43,6 +52,34 @@ &audio_extal_clk {
> >  };
> >
> >  &pinctrl {
> > +#if (SW_SD0_DEV_SEL)
> 
> No need to make this conditional.

OK.

> 
> > +       sdhi0_pins: sd0 {
> 
> sdhi0_usd_pins: sd0-usd {

OK.

> 
> > +               sd0-cd {
> > +                       pinmux = <RZG3E_PORT_PINMUX(5, 0, 8)>;
> > +               };
> > +
> > +               sd0-ctrl {
> > +                       pins = "SD0CLK", "SD0CMD";
> > +                       renesas,output-impedance = <3>;
> > +               };
> > +
> > +               sd0-data {
> > +                       pins = "SD0DAT0", "SD0DAT1", "SD0DAT2", "SD0DAT3";
> > +                       renesas,output-impedance = <3>;
> > +               };
> > +
> > +               sd0-iovs {
> > +                       pins = "SD0IOVS";
> > +                       renesas,output-impedance = <3>;
> > +               };
> > +
> > +               sd0-pwen {
> > +                       pins = "SD0PWEN";
> > +                       renesas,output-impedance = <3>;
> > +               };
> > +       };
> > +#endif
> > +
> >         sdhi0_emmc_pins: sd0emmc {
> >                 sd0-emmc-ctrl {
> >                         pins = "SD0CLK", "SD0CMD"; @@ -96,6 +133,25 @@
> > &rtxin_clk {
> >         clock-frequency = <32768>;
> >  };
> >
> > +#if (SW_SD0_DEV_SEL)
> > +&sdhi0 {
> > +       pinctrl-0 = <&sdhi0_pins>;
> > +       pinctrl-1 = <&sdhi0_pins>;
> > +       pinctrl-names = "default", "state_uhs";
> > +
> > +       vmmc-supply = <&reg_3p3v>;
> > +       vqmmc-supply = <&vqmmc_sdhi0>;
> > +       bus-width = <4>;
> > +       sd-uhs-sdr50;
> > +       sd-uhs-sdr104;
> > +       status = "okay";
> > +};
> > +
> > +&vqmmc_sdhi0 {
> > +       regulator-name = "SD0_PVDD";
> 
> Why override the name?

Will remove as you suggested.

Cheers,
Biju

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

* RE: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-02-06  9:48   ` Geert Uytterhoeven
@ 2025-02-06 11:06     ` Biju Das
  0 siblings, 0 replies; 22+ messages in thread
From: Biju Das @ 2025-02-06 11:06 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 06 February 2025 09:49
> Subject: Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
> 
> Hi Biju,
> 
> On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> > --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> 
> >
> > +&pinctrl {
> > +       sdhi0_emmc_pins: sd0emmc {
> 
> sdhi0_emmc_pins: sd0-emmc {

OK.

> 
> > +               sd0-emmc-ctrl {
> 
> and drop the "-emmc" here and below, to align with sd0-usd in the next patch.

Agreed will fix this in next version.

Cheers,
Biju

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

* RE: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
  2025-02-06  9:52       ` Geert Uytterhoeven
@ 2025-02-06 11:07         ` Biju Das
  0 siblings, 0 replies; 22+ messages in thread
From: Biju Das @ 2025-02-06 11:07 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert,

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 06 February 2025 09:53
> Subject: Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2}
> 
> Hi Biju,
> 
> On Thu, 6 Feb 2025 at 10:47, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > -----Original Message-----
> > > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > > Sent: 06 February 2025 09:36
> > > Subject: Re: [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som:
> > > Enable SDHI{0,2}
> > >
> > > On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > > Enable eMMC on SDHI0 and SD on SDHI2 on RZ/G3E SMARC SoM.
> > > >
> > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> > > > --- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > > > +++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
> > >
> > > > +&vqmmc_sdhi2 {
> > > > +       regulator-name = "SD2_PVDD";
> > >
> > > Why override the name?
> >
> > I just used the label used in RZ/G3E SoM Schematics. So that it
> > appears as
> >
> > cat /sys/class/regulator/regulator.4/name
> > SD2_PVDD
> 
> I think this makes it harder to notice that it uses the internal regulator.

Agreed. Won't override.

Cheers,
Biju

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

* RE: [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1
  2025-02-06 10:04   ` Geert Uytterhoeven
@ 2025-02-06 11:08     ` Biju Das
  0 siblings, 0 replies; 22+ messages in thread
From: Biju Das @ 2025-02-06 11:08 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
	linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 06 February 2025 10:04
> Subject: Re: [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1
> 
> Hi Biju,
> 
> On Fri, 31 Jan 2025 at 12:25, Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Enable SDHI1 on the RZ/G3E SMARC EVK platform using gpio regulator for
> > voltage switching.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v1->v2:
> >  * Replaced the regulator usd_vdd_3p3v->reg_3p3v.
> >  * Renamed the gpio-hog node sd1-pwr-en->sd1-pwr-en-hog.
> >  * Sorted sd1 pin ctrl nodes.
> 
> Thanks for the update!
> 
> > --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > @@ -9,6 +9,7 @@
> >
> >  /* Switch selection settings */
> >  #define SW_SD0_DEV_SEL         0
> > +#define SW_SDIO_M2E            0
> >
> >  #include <dt-bindings/gpio/gpio.h>
> >  #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
> > @@ -20,6 +21,16 @@ / {
> >         model = "Renesas SMARC EVK version 2 based on r9a09g047e57";
> >         compatible = "renesas,smarc2-evk", "renesas,rzg3e-smarcm",
> >                      "renesas,r9a09g047e57", "renesas,r9a09g047";
> > +
> > +       vqmmc_sd1_pvdd: regulator-vqmmc-sd1-pvdd {
> > +               compatible = "regulator-gpio";
> > +               regulator-name = "SD1_PVDD";
> > +               regulator-min-microvolt = <1800000>;
> > +               regulator-max-microvolt = <3300000>;
> > +               gpios = <&pinctrl RZG3E_GPIO(1, 5) GPIO_ACTIVE_HIGH>;
> 
> This is the patch that needs to add #include <dt-bindings/gpio/gpio.h>.

OK. Will move it here.

Cheers,
Biju

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

end of thread, other threads:[~2025-02-06 11:08 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-31 11:24 [PATCH v2 0/8] Add RZ/G3E SDHI support Biju Das
2025-01-31 11:24 ` [PATCH v2 1/8] dt-bindings: mmc: renesas,sdhi: Document RZ/G3E support Biju Das
2025-01-31 17:17   ` Conor Dooley
2025-02-06  8:47   ` Geert Uytterhoeven
2025-01-31 11:24 ` [PATCH v2 4/8] arm64: dts: renesas: r9a09g047: Add SDHI0-SDHI2 nodes Biju Das
2025-02-05  8:16   ` Geert Uytterhoeven
2025-02-05  9:19     ` Biju Das
2025-01-31 11:24 ` [PATCH v2 6/8] arm64: dts: renesas: rzg3e-smarc-som: Enable SDHI{0,2} Biju Das
2025-02-06  9:35   ` Geert Uytterhoeven
2025-02-06  9:47     ` Biju Das
2025-02-06  9:52       ` Geert Uytterhoeven
2025-02-06 11:07         ` Biju Das
2025-02-06  9:48   ` Geert Uytterhoeven
2025-02-06 11:06     ` Biju Das
2025-01-31 11:24 ` [PATCH v2 7/8] arm64: dts: renesas: rzg3e-smarc-som: Add support for enable SD on SDHI0 Biju Das
2025-02-06  9:47   ` Geert Uytterhoeven
2025-02-06 10:58     ` Biju Das
2025-01-31 11:24 ` [PATCH v2 8/8] arm64: dts: renesas: r9a09g047e57-smarc: Enable SDHI1 Biju Das
2025-02-06 10:04   ` Geert Uytterhoeven
2025-02-06 11:08     ` Biju Das
2025-02-06  8:50 ` [PATCH v2 0/8] Add RZ/G3E SDHI support Geert Uytterhoeven
2025-02-06  9:26   ` Biju Das

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