Skip to contentSkip to conversation

Add MMC support for STM32H7 discovery and evaluation

PATCH New patrice.chotard at st.com 2 participants 15 messages Oct 3, 2017 – Oct 9, 2017

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

cover Add MMC support for STM32H7 discovery and evaluation

From: Patrice Chotard <[email protected]>

Add pinctrl and MMC nodes for both disco and eval boards Enable filesystem related flags to read different type of SD/MMC partition Fix drivers/mmc/Kconfig to remove obsolete DM_MMC_OPS flag

Patrice Chotard (7):
ARM: DTS: stm32: add SDMMC support for stm32h743 disco
ARM: DTS: stm32: add SDMMC support fo stm32h743-eval
dm: mmc: remove DM_MMC_OPS for STM32_SDMMC
configs: stm32h743-eval: enable SDMMC support
configs: stm32h743-disco: enable SDMMC support
configs: stm32h743-disco: enable filesystem related flags
configs: stm32h743-eval: enable filesystem related flags

 arch/arm/dts/stm32h743-pinctrl.dtsi | 26 ++++++++++++++++++++++++++
 arch/arm/dts/stm32h743.dtsi         | 13 +++++++++++++
 arch/arm/dts/stm32h743i-disco.dts   |  9 +++++++++
 arch/arm/dts/stm32h743i-eval.dts    |  9 +++++++++
 configs/stm32h743-disco_defconfig   |  9 +++++++++
 configs/stm32h743-eval_defconfig    |  9 +++++++++
 drivers/mmc/Kconfig                 |  2 +-
 7 files changed, 76 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/7 ARM: DTS: stm32: add SDMMC support for stm32h743 disco

From: Patrice Chotard <[email protected]>

Add pinctrl and sdmmc nodes to add MMC support for STM32H743 discovery board.

---
 arch/arm/dts/stm32h743-pinctrl.dtsi | 15 +++++++++++++++
 arch/arm/dts/stm32h743.dtsi         | 13 +++++++++++++
 arch/arm/dts/stm32h743i-disco.dts   |  9 +++++++++
 3 files changed, 37 insertions(+)
arch/arm/dts/stm32h743-pinctrl.dtsi +15 -0
index d3e11d5..d6a79ae 100644
@@ -244,6 +244,21 @@
 					  slew-rate = <3>;
 				};
 			};
+
+			sdmmc1_pins: sdmmc at 0 {
+				pins {
+					pinmux = <STM32H7_PC8_FUNC_SDMMC1_D0>,
+						 <STM32H7_PC9_FUNC_SDMMC1_D1>,
+						 <STM32H7_PC10_FUNC_SDMMC1_D2>,
+						 <STM32H7_PC11_FUNC_SDMMC1_D3>,
+						 <STM32H7_PC12_FUNC_SDMMC1_CK>,
+						 <STM32H7_PD2_FUNC_SDMMC1_CMD>;
+
+					slew-rate = <3>;
+					drive-push-pull;
+					bias-disable;
+				};
+			};
 		};
 	};
 };
arch/arm/dts/stm32h743.dtsi +13 -0
index 16e9308..f6965f8 100644
@@ -43,6 +43,7 @@
 #include "skeleton.dtsi"
 #include "armv7-m.dtsi"
 #include <dt-bindings/clock/stm32h7-clks.h>
+#include <dt-bindings/mfd/stm32h7-rcc.h>
 
 / {
 	clocks {
@@ -120,6 +121,18 @@
 			compatible = "fixed-clock";
 			clock-frequency = <4000000>;
 		};
+
+		sdmmc1: sdmmc at 52007000 {
+			compatible = "st,stm32-sdmmc2";
+			reg = <0x52007000 0x1000>;
+			interrupts = <49>;
+			clocks = <&rcc SDMMC1_CK>;
+			resets = <&rcc STM32H7_AHB3_RESET(SDMMC1)>;
+			st,idma = <1>;
+			cap-sd-highspeed;
+			cap-mmc-highspeed;
+			status = "disabled";
+		};
 	};
 };
 
arch/arm/dts/stm32h743i-disco.dts +9 -0
index bef7e90..917a859 100644
@@ -60,6 +60,7 @@
 
 	aliases {
 		serial0 = &usart2;
+		mmc0 = &sdmmc1;
 		gpio0 = &gpioa;
 		gpio1 = &gpiob;
 		gpio2 = &gpioc;
@@ -98,3 +99,11 @@
 		st,sdram-refcount = <1539>;
 	};
 };
+
+&sdmmc1 {
+	status = "okay";
+	pinctrl-0 = <&sdmmc1_pins>;
+	pinctrl-names = "default";
+	bus-width = <4>;
+	cd-gpios = <&gpioi 8 1>;
+};
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/7 ARM: DTS: stm32: add SDMMC support for stm32h743 disco

Quoted 6 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Add pinctrl and sdmmc nodes to add MMC support for STM32H743 discovery board.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/7c0782d5/attachment.sig>
#3 lore raw

PATCH 2/7 ARM: DTS: stm32: add SDMMC support fo stm32h743-eval

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Add pinctrl and sdmmc nodes to add MMC support for STM32H743 evaluation board.

Evaluation board needs a second pinctrl node "pinctrl_sdmmc1_level_shifter" to drive a level shifter on MMC bus.

---
 arch/arm/dts/stm32h743-pinctrl.dtsi | 11 +++++++++++
 arch/arm/dts/stm32h743i-eval.dts    |  9 +++++++++
 2 files changed, 20 insertions(+)
arch/arm/dts/stm32h743-pinctrl.dtsi +11 -0
index d6a79ae..e4f4aa5 100644
@@ -259,6 +259,17 @@
 					bias-disable;
 				};
 			};
+
+			pinctrl_sdmmc1_level_shifter: sdmmc0_ls at 0 {
+				pins {
+					pinmux = <STM32H7_PB8_FUNC_SDMMC1_CKIN>,
+						 <STM32H7_PB9_FUNC_SDMMC1_CDIR>,
+						 <STM32H7_PC6_FUNC_SDMMC1_D0DIR>,
+						 <STM32H7_PC7_FUNC_SDMMC1_D123DIR>;
+					drive-push-pull;
+					slew-rate = <3>;
+				};
+			};
 		};
 	};
 };
arch/arm/dts/stm32h743i-eval.dts +9 -0
index 0e01ce5..28c876b 100644
@@ -98,3 +98,12 @@
 		st,sdram-refcount = <1539>;
 	};
 };
+
+&sdmmc1 {
+	status = "okay";
+	pinctrl-0 = <&sdmmc1_pins>,
+		    <&pinctrl_sdmmc1_level_shifter>;
+	pinctrl-names = "default";
+	bus-width = <4>;
+	st,dirpol;
+};
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/7 ARM: DTS: stm32: add SDMMC support fo stm32h743-eval

Quoted 10 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Add pinctrl and sdmmc nodes to add MMC support for STM32H743 evaluation board.

Evaluation board needs a second pinctrl node "pinctrl_sdmmc1_level_shifter" to drive a level shifter on MMC bus.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/27f198b4/attachment.sig>
#5 lore raw

PATCH 3/7 dm: mmc: remove DM_MMC_OPS for STM32_SDMMC

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Since e7881d85 "dm: mmc: Drop CONFIG_DM_MMC_OPS" DM_MMC_OPS is no more used, remove it from STM32_SDMMC2 dependencies

---
 drivers/mmc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/Kconfig +1 -1
index 24b4ead..94050836 100644
@@ -386,7 +386,7 @@ config GENERIC_ATMEL_MCI
 
 config STM32_SDMMC2
 	bool "STMicroelectronics STM32H7 SD/MMC Host Controller support"
-	depends on DM_MMC && BLK && OF_CONTROL && DM_MMC_OPS
+	depends on DM_MMC && BLK && OF_CONTROL
 	help
 	  This selects support for the SD/MMC controller on STM32H7 SoCs.
 	  If you have a board based on such a SoC and with a SD/MMC slot,
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/7 dm: mmc: remove DM_MMC_OPS for STM32_SDMMC

Quoted 6 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Since e7881d85 "dm: mmc: Drop CONFIG_DM_MMC_OPS" DM_MMC_OPS is no more used, remove it from STM32_SDMMC2 dependencies

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/59b1fd68/attachment.sig>
#7 lore raw

PATCH 4/7 configs: stm32h743-eval: enable SDMMC support

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags

---
 configs/stm32h743-eval_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/stm32h743-eval_defconfig +3 -0
index 61e702e..5b02a94 100644
@@ -16,12 +16,15 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
+CONFIG_DM_MMC=y
+CONFIG_STM32_SDMMC2=y
 # CONFIG_PINCTRL_FULL is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_REGEX=y
Signature · 1 line
1.9.1
#8 lore raw

PATCH 4/7 configs: stm32h743-eval: enable SDMMC support

Quoted 5 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/c19728ef/attachment.sig>
#9 lore raw

PATCH 5/7 configs: stm32h743-disco: enable SDMMC support

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags

---
 configs/stm32h743-disco_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/stm32h743-disco_defconfig +3 -0
index eed921d2..74d3a92 100644
@@ -16,12 +16,15 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
+CONFIG_DM_MMC=y
+CONFIG_STM32_SDMMC2=y
 # CONFIG_PINCTRL_FULL is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_REGEX=y
Signature · 1 line
1.9.1
#10 lore raw

PATCH 5/7 configs: stm32h743-disco: enable SDMMC support

Quoted 5 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/9637f018/attachment.sig>
#11 lore raw

PATCH 6/7 configs: stm32h743-disco: enable filesystem related flags

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags

---
 configs/stm32h743-disco_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)
configs/stm32h743-disco_defconfig +6 -0
index 74d3a92..1716333 100644
@@ -16,11 +16,17 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_DM_MMC=y
Signature · 1 line
1.9.1
#12 lore raw

PATCH 6/7 configs: stm32h743-disco: enable filesystem related flags

Quoted 5 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/d43c3ad0/attachment.sig>
#13 lore raw

PATCH 7/7 configs: stm32h743-eval: enable filesystem related flags

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags

---
 configs/stm32h743-eval_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)
configs/stm32h743-eval_defconfig +6 -0
index 5b02a94..4714ff2 100644
@@ -16,11 +16,17 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_DM_MMC=y
Signature · 1 line
1.9.1
#14 lore raw

PATCH 7/7 configs: stm32h743-eval: enable filesystem related flags

Quoted 5 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/50c6bada/attachment.sig>