linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add SD-card support on STM32MP25
@ 2023-09-04 13:22 Yann Gautier
  2023-09-04 13:22 ` [PATCH 1/3] arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file Yann Gautier
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yann Gautier @ 2023-09-04 13:22 UTC (permalink / raw)
  To: Alexandre Torgue, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Maxime Coquelin, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, Christophe Kerello, Yann Gautier

Add sdmmc1 node in SoC DT file, then the pins used on STM32MP257F-EV1
board, and then the node in board file for SD-card support.

Yann Gautier (3):
  arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file
  arm64: dts: st: add sdmmc1 pins for stm32mp25
  arm64: dts: st: add SD-card support on STM32MP257F-EV1 board

 arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi | 54 +++++++++++++++++++
 arch/arm64/boot/dts/st/stm32mp251.dtsi        | 13 +++++
 arch/arm64/boot/dts/st/stm32mp257f-ev1.dts    | 22 ++++++++
 3 files changed, 89 insertions(+)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/3] arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file
  2023-09-04 13:22 [PATCH 0/3] Add SD-card support on STM32MP25 Yann Gautier
@ 2023-09-04 13:22 ` Yann Gautier
  2023-09-04 13:22 ` [PATCH 2/3] arm64: dts: st: add sdmmc1 pins for stm32mp25 Yann Gautier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Yann Gautier @ 2023-09-04 13:22 UTC (permalink / raw)
  To: Alexandre Torgue, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Maxime Coquelin, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, Christophe Kerello, Yann Gautier

The SDMMC1 peripheral is used for SD-cards (default on ST boards), or
eMMC cards. For the moment it uses the fixed clock ck_flexgen_51, until
clock driver is available.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
---
 arch/arm64/boot/dts/st/stm32mp251.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index 5268a43218415..d7cb05d534ac9 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -119,6 +119,19 @@ usart2: serial@400e0000 {
 				clocks = <&ck_flexgen_08>;
 				status = "disabled";
 			};
+
+			sdmmc1: mmc@48220000 {
+				compatible = "st,stm32mp25-sdmmc2", "arm,pl18x", "arm,primecell";
+				arm,primecell-periphid = <0x00353180>;
+				reg = <0x48220000 0x400>, <0x44230400 0x8>;
+				interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&ck_flexgen_51>;
+				clock-names = "apb_pclk";
+				cap-sd-highspeed;
+				cap-mmc-highspeed;
+				max-frequency = <120000000>;
+				status = "disabled";
+			};
 		};
 
 		syscfg: syscon@44230000 {
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/3] arm64: dts: st: add sdmmc1 pins for stm32mp25
  2023-09-04 13:22 [PATCH 0/3] Add SD-card support on STM32MP25 Yann Gautier
  2023-09-04 13:22 ` [PATCH 1/3] arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file Yann Gautier
@ 2023-09-04 13:22 ` Yann Gautier
  2023-09-04 13:22 ` [PATCH 3/3] arm64: dts: st: add SD-card support on STM32MP257F-EV1 board Yann Gautier
  2023-09-22  7:27 ` [PATCH 0/3] Add SD-card support on STM32MP25 Alexandre TORGUE
  3 siblings, 0 replies; 5+ messages in thread
From: Yann Gautier @ 2023-09-04 13:22 UTC (permalink / raw)
  To: Alexandre Torgue, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Maxime Coquelin, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, Christophe Kerello, Yann Gautier

Add the pins used for SD-card on STM32MP257F-EV1 board.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
---
 arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi b/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi
index d34a1d5e79c06..66791a974f8f2 100644
--- a/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi
@@ -6,6 +6,60 @@
 #include <dt-bindings/pinctrl/stm32-pinfunc.h>
 
 &pinctrl {
+	sdmmc1_b4_pins_a: sdmmc1-b4-0 {
+		pins1 {
+			pinmux = <STM32_PINMUX('E', 4, AF10)>, /* SDMMC1_D0 */
+				 <STM32_PINMUX('E', 5, AF10)>, /* SDMMC1_D1 */
+				 <STM32_PINMUX('E', 0, AF10)>, /* SDMMC1_D2 */
+				 <STM32_PINMUX('E', 1, AF10)>, /* SDMMC1_D3 */
+				 <STM32_PINMUX('E', 2, AF10)>; /* SDMMC1_CMD */
+			slew-rate = <2>;
+			drive-push-pull;
+			bias-disable;
+		};
+		pins2 {
+			pinmux = <STM32_PINMUX('E', 3, AF10)>; /* SDMMC1_CK */
+			slew-rate = <3>;
+			drive-push-pull;
+			bias-disable;
+		};
+	};
+
+	sdmmc1_b4_od_pins_a: sdmmc1-b4-od-0 {
+		pins1 {
+			pinmux = <STM32_PINMUX('E', 4, AF10)>, /* SDMMC1_D0 */
+				 <STM32_PINMUX('E', 5, AF10)>, /* SDMMC1_D1 */
+				 <STM32_PINMUX('E', 0, AF10)>, /* SDMMC1_D2 */
+				 <STM32_PINMUX('E', 1, AF10)>; /* SDMMC1_D3 */
+			slew-rate = <2>;
+			drive-push-pull;
+			bias-disable;
+		};
+		pins2 {
+			pinmux = <STM32_PINMUX('E', 3, AF10)>; /* SDMMC1_CK */
+			slew-rate = <3>;
+			drive-push-pull;
+			bias-disable;
+		};
+		pins3 {
+			pinmux = <STM32_PINMUX('E', 2, AF10)>; /* SDMMC1_CMD */
+			slew-rate = <2>;
+			drive-open-drain;
+			bias-disable;
+		};
+	};
+
+	sdmmc1_b4_sleep_pins_a: sdmmc1-b4-sleep-0 {
+		pins {
+			pinmux = <STM32_PINMUX('E', 4, ANALOG)>, /* SDMMC1_D0 */
+				 <STM32_PINMUX('E', 5, ANALOG)>, /* SDMMC1_D1 */
+				 <STM32_PINMUX('E', 0, ANALOG)>, /* SDMMC1_D2 */
+				 <STM32_PINMUX('E', 1, ANALOG)>, /* SDMMC1_D3 */
+				 <STM32_PINMUX('E', 3, ANALOG)>, /* SDMMC1_CK */
+				 <STM32_PINMUX('E', 2, ANALOG)>; /* SDMMC1_CMD */
+		};
+	};
+
 	usart2_pins_a: usart2-0 {
 		pins1 {
 			pinmux = <STM32_PINMUX('A', 4, AF6)>; /* USART2_TX */
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/3] arm64: dts: st: add SD-card support on STM32MP257F-EV1 board
  2023-09-04 13:22 [PATCH 0/3] Add SD-card support on STM32MP25 Yann Gautier
  2023-09-04 13:22 ` [PATCH 1/3] arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file Yann Gautier
  2023-09-04 13:22 ` [PATCH 2/3] arm64: dts: st: add sdmmc1 pins for stm32mp25 Yann Gautier
@ 2023-09-04 13:22 ` Yann Gautier
  2023-09-22  7:27 ` [PATCH 0/3] Add SD-card support on STM32MP25 Alexandre TORGUE
  3 siblings, 0 replies; 5+ messages in thread
From: Yann Gautier @ 2023-09-04 13:22 UTC (permalink / raw)
  To: Alexandre Torgue, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Maxime Coquelin, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, Christophe Kerello, Yann Gautier

Add the configuration node for SD-card support on STM32MP257F-EV1 board.
For the moment it uses a fixed regulator for vmmc, and vqmmc is skipped
until regulator driver is available.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
---
 arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
index 39b4726cc0986..6c3b83c2b48fa 100644
--- a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
+++ b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
@@ -6,6 +6,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
 #include "stm32mp257.dtsi"
 #include "stm32mp25xf.dtsi"
 #include "stm32mp25-pinctrl.dtsi"
@@ -39,6 +40,27 @@ fw@80000000 {
 			no-map;
 		};
 	};
+
+	vdd_sdcard: vdd-sdcard {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd_sdcard";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+};
+
+&sdmmc1 {
+	pinctrl-names = "default", "opendrain", "sleep";
+	pinctrl-0 = <&sdmmc1_b4_pins_a>;
+	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
+	cd-gpios = <&gpiod 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+	disable-wp;
+	st,neg-edge;
+	bus-width = <4>;
+	vmmc-supply = <&vdd_sdcard>;
+	status = "okay";
 };
 
 &usart2 {
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/3] Add SD-card support on STM32MP25
  2023-09-04 13:22 [PATCH 0/3] Add SD-card support on STM32MP25 Yann Gautier
                   ` (2 preceding siblings ...)
  2023-09-04 13:22 ` [PATCH 3/3] arm64: dts: st: add SD-card support on STM32MP257F-EV1 board Yann Gautier
@ 2023-09-22  7:27 ` Alexandre TORGUE
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre TORGUE @ 2023-09-22  7:27 UTC (permalink / raw)
  To: Yann Gautier, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Maxime Coquelin, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, Christophe Kerello

Hi Yann

On 9/4/23 15:22, Yann Gautier wrote:
> Add sdmmc1 node in SoC DT file, then the pins used on STM32MP257F-EV1
> board, and then the node in board file for SD-card support.
> 
> Yann Gautier (3):
>    arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file
>    arm64: dts: st: add sdmmc1 pins for stm32mp25
>    arm64: dts: st: add SD-card support on STM32MP257F-EV1 board
> 
>   arch/arm64/boot/dts/st/stm32mp25-pinctrl.dtsi | 54 +++++++++++++++++++
>   arch/arm64/boot/dts/st/stm32mp251.dtsi        | 13 +++++
>   arch/arm64/boot/dts/st/stm32mp257f-ev1.dts    | 22 ++++++++
>   3 files changed, 89 insertions(+)
> 

Series applied on stm32-next.

Regards
Alex

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-09-22  7:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-04 13:22 [PATCH 0/3] Add SD-card support on STM32MP25 Yann Gautier
2023-09-04 13:22 ` [PATCH 1/3] arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file Yann Gautier
2023-09-04 13:22 ` [PATCH 2/3] arm64: dts: st: add sdmmc1 pins for stm32mp25 Yann Gautier
2023-09-04 13:22 ` [PATCH 3/3] arm64: dts: st: add SD-card support on STM32MP257F-EV1 board Yann Gautier
2023-09-22  7:27 ` [PATCH 0/3] Add SD-card support on STM32MP25 Alexandre TORGUE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).