Skip to contentSkip to conversation

arm: dts: stm32mp157c-odyssey-som: sync SDMMC2 with Linux and TF‑A

PATCH Superseded Grzegorz Szymaszek 2 participants 12 messages May 28, 2021 – Aug 5, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm: dts: stm32mp157c-odyssey-som: sync SDMMC2 with Linux and TF‑A

This patchset updates the properties of the SDMMC2 device tree node so that they match their Linux kernel and Trusted Firmware A counterparts. Two differences will remain:
— in the Linux kernel device tree, the VQMMC supply is incorrectly set
to v3v3 (buck4) instead of vdd (buck3);
— in the TF‑A device tree, only the “default” pinctrl is configured.

Additionally, this patchset enables SDMMC2 in SPL.

Grzegorz Szymaszek (5):
arm: dts: stm32mp157c-odyssey-som: fix the basic SDMMC2 properties
arm: dts: stm32mp157c-odyssey-som: enable all SDMMC2 data lanes
arm: dts: stm32mp157c-odyssey-som: set the SDMMC2 VQMMC supply
arm: dts: stm32mp157c-odyssey-som: enable the SDMMC2 eMMC HS DDR mode
arm: dts: stm32mp157c-odyssey-som: enable SDMMC2 in SPL

 .../dts/stm32mp157c-odyssey-som-u-boot.dtsi   | 21 +++++++++++++++++++
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi     | 15 +++++++------
 2 files changed, 30 insertions(+), 6 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/5 arm: dts: stm32mp157c-odyssey-som: fix the basic SDMMC2 properties

The SDMMC2 interface hosts an eMMC. Replace the interface properties that would only apply to SD cards—“broken-cd” and “disable-wp”—with relevant ones: “non-removable”, “no-sd” and “no-sdio”.

Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +3 -2
index 83ff2e7ce1..5c758b0f72 100644
@@ -263,8 +263,9 @@
 	pinctrl-0 = <&sdmmc2_b4_pins_a>;
 	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
 	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
-	broken-cd;
-	disable-wp;
+	non-removable;
+	no-sd;
+	no-sdio;
 	st,neg-edge;
 	bus-width = <4>;
 	vmmc-supply = <&v3v3>;
Signature · 1 line
2.30.2
#3 lore raw

PATCH 2/5 arm: dts: stm32mp157c-odyssey-som: enable all SDMMC2 data lanes

In reply to Grzegorz Szymaszek

Add the “sdmmc2_d47_pins_d” pins to the SDMMC2 pinctrls. Increase the bus width from four to eight.

Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +4 -4
index 5c758b0f72..5801b7a968 100644
@@ -260,14 +260,14 @@
 
 &sdmmc2 {
 	pinctrl-names = "default", "opendrain", "sleep";
-	pinctrl-0 = <&sdmmc2_b4_pins_a>;
-	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
-	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_d>;
+	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_d>;
+	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_d>;
 	non-removable;
 	no-sd;
 	no-sdio;
 	st,neg-edge;
-	bus-width = <4>;
+	bus-width = <8>;
 	vmmc-supply = <&v3v3>;
 	status = "okay";
 };
Signature · 1 line
2.30.2
#5 lore raw

PATCH 3/5 arm: dts: stm32mp157c-odyssey-som: set the SDMMC2 VQMMC supply

In reply to Grzegorz Szymaszek

Set the SDMMC2 VQMMC supply to vdd (buck3). Note that in the corresponding Linux kernel device tree, the supply is set to v3v3 (buck4), which is wrong.

Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +1 -0
index 5801b7a968..76a364d4ca 100644
@@ -269,6 +269,7 @@
 	st,neg-edge;
 	bus-width = <8>;
 	vmmc-supply = <&v3v3>;
+	vqmmc-supply = <&vdd>;
 	status = "okay";
 };
 
Signature · 1 line
2.30.2
#8 lore raw

PATCH 4/5 arm: dts: stm32mp157c-odyssey-som: enable the SDMMC2 eMMC HS DDR mode

In reply to Grzegorz Szymaszek
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +1 -0
index 76a364d4ca..0dfdc29db6 100644
@@ -270,6 +270,7 @@
 	bus-width = <8>;
 	vmmc-supply = <&v3v3>;
 	vqmmc-supply = <&vdd>;
+	mmc-ddr-3_3v;
 	status = "okay";
 };
 
Signature · 1 line
2.30.2
#10 lore raw

PATCH 5/5 arm: dts: stm32mp157c-odyssey-som: enable SDMMC2 in SPL

In reply to Grzegorz Szymaszek
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 .../dts/stm32mp157c-odyssey-som-u-boot.dtsi   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/dts/stm32mp157c-odyssey-som-u-boot.dtsi +21 -0
index 6be728846e..4ff848350d 100644
@@ -123,3 +123,24 @@
 		u-boot,dm-pre-reloc;
 	};
 };
+
+&sdmmc2 {
+	u-boot,dm-spl;
+};
+
+&sdmmc2_b4_pins_a {
+	u-boot,dm-spl;
+	pins1 {
+		u-boot,dm-spl;
+	};
+	pins2 {
+		u-boot,dm-spl;
+	};
+};
+
+&sdmmc2_d47_pins_d {
+	u-boot,dm-spl;
+	pins {
+		u-boot,dm-spl;
+	};
+};
Signature · 1 line
2.30.2
Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] arm: dts: stm32mp157c-odyssey-som: fix the basic SDMMC2 properties

In reply to Grzegorz Szymaszek

Hi Grzegorz

Quoted 18 lines · Grzegorz Szymaszek

The SDMMC2 interface hosts an eMMC. Replace the interface properties that would only apply to SD cards—“broken-cd” and “disable-wp”—with relevant ones: “non-removable”, “no-sd” and “no-sdio”.

Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +0 -0
index 83ff2e7ce1..5c758b0f72 100644
@@ -263,8 +263,9 @@
 	pinctrl-0 = <&sdmmc2_b4_pins_a>;

arch/arm/dts/stm32mp157c-odyssey-som.dtsi line 271

Quoted 10 lines
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +3 -2
 	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
 	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
-	broken-cd;
-	disable-wp;
+	non-removable;
+	no-sd;
+	no-sdio;
 	st,neg-edge;
 	bus-width = <4>;
 	vmmc-supply = <&v3v3>;

Thanks
Patrice

Reviewed-by on v1 2/5
#4 lore raw

Re: [PATCH 2/5] arm: dts: stm32mp157c-odyssey-som: enable all SDMMC2 data lanes

In reply to Grzegorz Szymaszek

Hi Grzegorz

Quoted 24 lines · Grzegorz Szymaszek

Add the “sdmmc2_d47_pins_d” pins to the SDMMC2 pinctrls. Increase the bus width from four to eight.

Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +2 -3
index 5c758b0f72..5801b7a968 100644
@@ -260,14 +260,14 @@
 
 &sdmmc2 {
 	pinctrl-names = "default", "opendrain", "sleep";
-	pinctrl-0 = <&sdmmc2_b4_pins_a>;
-	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
-	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_d>;
+	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_d>;

arch/arm/dts/stm32mp157c-odyssey-som.dtsi line 273

Quoted 10 lines
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +2 -1
+	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_d>;
 	non-removable;
 	no-sd;
 	no-sdio;
 	st,neg-edge;
-	bus-width = <4>;
+	bus-width = <8>;
 	vmmc-supply = <&v3v3>;
 	status = "okay";
 };

Thanks
Patrice

Reviewed-by on v1 3/5
#6 lore raw

Re: [PATCH 3/5] arm: dts: stm32mp157c-odyssey-som: set the SDMMC2 VQMMC supply

In reply to Grzegorz Szymaszek

Hi Grzegorz

Quoted 3 lines · Grzegorz Szymaszek

Set the SDMMC2 VQMMC supply to vdd (buck3). Note that in the corresponding Linux kernel device tree, the supply is set to v3v3 (buck4), which is wrong.

Do you intend to send similar patch to kernel mailing list to fix it ?

Quoted 14 lines
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +0 -0
index 5801b7a968..76a364d4ca 100644

arch/arm/dts/stm32mp157c-odyssey-som.dtsi line 275

Quoted 7 lines
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +1 -0
@@ -269,6 +269,7 @@
 	st,neg-edge;
 	bus-width = <8>;
 	vmmc-supply = <&v3v3>;
+	vqmmc-supply = <&vdd>;
 	status = "okay";
 };
 

Thanks
Patrice

#9 lore raw

Re: [PATCH 4/5] arm: dts: stm32mp157c-odyssey-som: enable the SDMMC2 eMMC HS DDR mode

In reply to Grzegorz Szymaszek

Your commit message is missing

Quoted 20 lines · Grzegorz Szymaszek
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp157c-odyssey-som.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/stm32mp157c-odyssey-som.dtsi +1 -0
index 76a364d4ca..0dfdc29db6 100644
@@ -270,6 +270,7 @@
 	bus-width = <8>;
 	vmmc-supply = <&v3v3>;
 	vqmmc-supply = <&vdd>;
+	mmc-ddr-3_3v;
 	status = "okay";
 };
 
#11 lore raw

Re: [PATCH 5/5] arm: dts: stm32mp157c-odyssey-som: enable SDMMC2 in SPL

In reply to Grzegorz Szymaszek

Your commit message is missing

Quoted 37 lines · Grzegorz Szymaszek
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 .../dts/stm32mp157c-odyssey-som-u-boot.dtsi   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/dts/stm32mp157c-odyssey-som-u-boot.dtsi +21 -0
index 6be728846e..4ff848350d 100644
@@ -123,3 +123,24 @@
 		u-boot,dm-pre-reloc;
 	};
 };
+
+&sdmmc2 {
+	u-boot,dm-spl;
+};
+
+&sdmmc2_b4_pins_a {
+	u-boot,dm-spl;
+	pins1 {
+		u-boot,dm-spl;
+	};
+	pins2 {
+		u-boot,dm-spl;
+	};
+};
+
+&sdmmc2_d47_pins_d {
+	u-boot,dm-spl;
+	pins {
+		u-boot,dm-spl;
+	};
+};
#7 lore raw

Re: [PATCH 3/5] arm: dts: stm32mp157c-odyssey-som: set the SDMMC2 VQMMC supply

In reply to Patrice CHOTARD

Hi,

Quoted 6 lines · Patrice Chotard
Quoted 3 lines · Grzegorz Szymaszek

Set the SDMMC2 VQMMC supply to vdd (buck3). Note that in the corresponding Linux kernel device tree, the supply is set to v3v3 (buck4), which is wrong.

Do you intend to send similar patch to kernel mailing list to fix it ?

I’m sorry for not replying, I missed this question. FWIW, yes, I’ve had sent a patch[1] and it has since been applied at least on stm32-next and some stable branches.

[1]: https://lore.kernel.org/linux-arm-kernel/YLj4AMTCi84yO9GO@nx64de-df6d00/

All the best!

Signature · 1 line
Grzegorz