Skip to contentSkip to conversation

gen3: dts: enable on-board eMMC

PATCH In review Wolfram Sang 2 participants 4 messages Sep 14, 2016 – Sep 16, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover gen3: dts: enable on-board eMMC

From: Wolfram Sang <[email protected]>

Here are the DTS changes to enable the on-board eMMC memory at 8 bit bus widths on R-Car Gen3 Salvator-X boards.

Note that 'non-removable' is not supported yet because of Runtime PM issues. It seems we need to overhaul Runtime PM handling for other reasons as well, so I suggest the basic support goes in like this and DTS do not use 'non-removable' for now.

Note also that I decided to use the pattern that pinctrl-0 is 3.3v and pinctrl-1 is 1.8v, although the eMMC is fixed at 1.8v. I tried a few ways to only use pinctrl-0 being 1.8v here, but they all ended up to be confusing for users IMO, so I sticked to the most consistent solution after all.

These patches are based on top of Simon's sdr104-v7 patches and the accompanied driver patches sent a minute ago. A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/sdhi-8bit-emmc

Please review, comment, apply...

Wolfram

Wolfram Sang (2):
arm64: dts: r8a7795: salvator: enable on-board eMMC
arm64: dts: r8a7796: salvator: enable on board eMMC

 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 43 +++++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 44 +++++++++++++++++++++-
 2 files changed, 86 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/2 arm64: dts: r8a7795: salvator: enable on-board eMMC

---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +43 -0
index 8964b1ea3cea69..c299919e5e2fdc 100644
@@ -62,6 +62,24 @@
 		clock-frequency = <24576000>;
 	};
 
+	reg_1p8v: regulator0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator1 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
 	vcc_sdhi0: regulator-vcc-sdhi0 {
 		compatible = "regulator-fixed";
 
@@ -246,6 +264,18 @@
 		power-source = <1800>;
 	};
 
+	sdhi2_pins: sd2 {
+		groups = "sdhi2_data8", "sdhi2_ctrl";
+		function = "sdhi2";
+		power-source = <3300>;
+	};
+
+	sdhi2_pins_uhs: sd2 {
+		groups = "sdhi2_data8", "sdhi2_ctrl";
+		function = "sdhi2";
+		power-source = <1800>;
+	};
+
 	sdhi3_pins: sd3 {
 		groups = "sdhi3_data4", "sdhi3_ctrl";
 		function = "sdhi3";
@@ -398,6 +428,19 @@
 	status = "okay";
 };
 
+&sdhi2 {
+	/* used for on-board 8bit eMMC */
+	pinctrl-0 = <&sdhi2_pins>;
+	pinctrl-1 = <&sdhi2_pins_uhs>;
+	pinctrl-names = "default", "state_uhs";
+
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&reg_1p8v>;
+	bus-width = <8>;
+	status = "okay";
+	/* 'non-removable;' does not work currently. Needs PM fixes. */
+};
+
 &sdhi3 {
 	pinctrl-0 = <&sdhi3_pins>;
 	pinctrl-1 = <&sdhi3_pins_uhs>;
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/2 arm64: dts: r8a7796: salvator: enable on board eMMC

In reply to Wolfram Sang
---
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 44 +++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts +43 -1
index 91440eb2237e72..db27615fc6ff9f 100644
@@ -31,6 +31,24 @@
 		reg = <0x0 0x48000000 0x0 0x78000000>;
 	};
 
+	reg_1p8v: regulator0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator1 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
 	vcc_sdhi0: regulator-vcc-sdhi0 {
 		compatible = "regulator-fixed";
 
@@ -78,7 +96,6 @@
 		states = <3300000 1
 			  1800000 0>;
 	};
-
 };
 
 &pfc {
@@ -106,6 +123,18 @@
 		power-source = <1800>;
 	};
 
+	sdhi2_pins: sd2 {
+		groups = "sdhi2_data8", "sdhi2_ctrl";
+		function = "sdhi2";
+		power-source = <3300>;
+	};
+
+	sdhi2_pins_uhs: sd2 {
+		groups = "sdhi2_data8", "sdhi2_ctrl";
+		function = "sdhi2";
+		power-source = <1800>;
+	};
+
 	sdhi3_pins: sd3 {
 		groups = "sdhi3_data4", "sdhi3_ctrl";
 		function = "sdhi3";
@@ -138,6 +167,19 @@
 	status = "okay";
 };
 
+&sdhi2 {
+	/* used for on-board 8bit eMMC */
+	pinctrl-0 = <&sdhi2_pins>;
+	pinctrl-1 = <&sdhi2_pins_uhs>;
+	pinctrl-names = "default", "state_uhs";
+
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&reg_1p8v>;
+	bus-width = <8>;
+	status = "okay";
+	/* 'non-removable;' does not work currently. Needs PM fixes. */
+};
+
 &sdhi3 {
 	pinctrl-0 = <&sdhi3_pins>;
 	pinctrl-1 = <&sdhi3_pins_uhs>;
Signature · 1 line
2.9.3
#3 lore raw
In reply to Wolfram Sang
Quoted 10 lines · Wolfram Sang

From: Wolfram Sang <[email protected]>

Here are the DTS changes to enable the on-board eMMC memory at 8 bit bus widths on R-Car Gen3 Salvator-X boards.

Note that 'non-removable' is not supported yet because of Runtime PM issues. It seems we need to overhaul Runtime PM handling for other reasons as well, so I suggest the basic support goes in like this and DTS do not use 'non-removable' for now.

Quoted 7 lines

Note also that I decided to use the pattern that pinctrl-0 is 3.3v and pinctrl-1 is 1.8v, although the eMMC is fixed at 1.8v. I tried a few ways to only use pinctrl-0 being 1.8v here, but they all ended up to be confusing for users IMO, so I sticked to the most consistent solution after all.

These patches are based on top of Simon's sdr104-v7 patches and the accompanied driver patches sent a minute ago. A branch can be found here:

Please ping me / repost once these patches are ready to be merged.