[U-Boot] [PATCH 0/7] Add MMC support for STM32H7 discovery and evaluation

From: Patrice Chotard patrice.chotard@st.com
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(-)

From: Patrice Chotard patrice.chotard@st.com
Add pinctrl and sdmmc nodes to add MMC support for STM32H743 discovery board.
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- 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(+)
diff --git a/arch/arm/dts/stm32h743-pinctrl.dtsi b/arch/arm/dts/stm32h743-pinctrl.dtsi index d3e11d5..d6a79ae 100644 --- a/arch/arm/dts/stm32h743-pinctrl.dtsi +++ b/arch/arm/dts/stm32h743-pinctrl.dtsi @@ -244,6 +244,21 @@ slew-rate = <3>; }; }; + + sdmmc1_pins: sdmmc@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; + }; + }; }; }; }; diff --git a/arch/arm/dts/stm32h743.dtsi b/arch/arm/dts/stm32h743.dtsi index 16e9308..f6965f8 100644 --- a/arch/arm/dts/stm32h743.dtsi +++ b/arch/arm/dts/stm32h743.dtsi @@ -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@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"; + }; }; };
diff --git a/arch/arm/dts/stm32h743i-disco.dts b/arch/arm/dts/stm32h743i-disco.dts index bef7e90..917a859 100644 --- a/arch/arm/dts/stm32h743i-disco.dts +++ b/arch/arm/dts/stm32h743i-disco.dts @@ -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>; +};

On Tue, Oct 03, 2017 at 03:54:56PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Add pinctrl and sdmmc nodes to add MMC support for STM32H743 discovery board.
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!

From: Patrice Chotard patrice.chotard@st.com
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.
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- arch/arm/dts/stm32h743-pinctrl.dtsi | 11 +++++++++++ arch/arm/dts/stm32h743i-eval.dts | 9 +++++++++ 2 files changed, 20 insertions(+)
diff --git a/arch/arm/dts/stm32h743-pinctrl.dtsi b/arch/arm/dts/stm32h743-pinctrl.dtsi index d6a79ae..e4f4aa5 100644 --- a/arch/arm/dts/stm32h743-pinctrl.dtsi +++ b/arch/arm/dts/stm32h743-pinctrl.dtsi @@ -259,6 +259,17 @@ bias-disable; }; }; + + pinctrl_sdmmc1_level_shifter: sdmmc0_ls@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>; + }; + }; }; }; }; diff --git a/arch/arm/dts/stm32h743i-eval.dts b/arch/arm/dts/stm32h743i-eval.dts index 0e01ce5..28c876b 100644 --- a/arch/arm/dts/stm32h743i-eval.dts +++ b/arch/arm/dts/stm32h743i-eval.dts @@ -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; +};

On Tue, Oct 03, 2017 at 03:54:57PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
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.
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!

From: Patrice Chotard patrice.chotard@st.com
Since e7881d85 "dm: mmc: Drop CONFIG_DM_MMC_OPS" DM_MMC_OPS is no more used, remove it from STM32_SDMMC2 dependencies
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- drivers/mmc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 24b4ead..94050836 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -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,

On Tue, Oct 03, 2017 at 03:54:58PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Since e7881d85 "dm: mmc: Drop CONFIG_DM_MMC_OPS" DM_MMC_OPS is no more used, remove it from STM32_SDMMC2 dependencies
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!

From: Patrice Chotard patrice.chotard@st.com
Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- configs/stm32h743-eval_defconfig | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/configs/stm32h743-eval_defconfig b/configs/stm32h743-eval_defconfig index 61e702e..5b02a94 100644 --- a/configs/stm32h743-eval_defconfig +++ b/configs/stm32h743-eval_defconfig @@ -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

On Tue, Oct 03, 2017 at 03:54:59PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!

From: Patrice Chotard patrice.chotard@st.com
Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- configs/stm32h743-disco_defconfig | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/configs/stm32h743-disco_defconfig b/configs/stm32h743-disco_defconfig index eed921d2..74d3a92 100644 --- a/configs/stm32h743-disco_defconfig +++ b/configs/stm32h743-disco_defconfig @@ -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

On Tue, Oct 03, 2017 at 03:55:00PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Enable CMD_MMC, DM_MMC and STM32_SDMMC2 flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!

From: Patrice Chotard patrice.chotard@st.com
Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- configs/stm32h743-disco_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/configs/stm32h743-disco_defconfig b/configs/stm32h743-disco_defconfig index 74d3a92..1716333 100644 --- a/configs/stm32h743-disco_defconfig +++ b/configs/stm32h743-disco_defconfig @@ -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

On Tue, Oct 03, 2017 at 03:55:01PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!

From: Patrice Chotard patrice.chotard@st.com
Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- configs/stm32h743-eval_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/configs/stm32h743-eval_defconfig b/configs/stm32h743-eval_defconfig index 5b02a94..4714ff2 100644 --- a/configs/stm32h743-eval_defconfig +++ b/configs/stm32h743-eval_defconfig @@ -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

On Tue, Oct 03, 2017 at 03:55:02PM +0200, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Enable CMD_GPT/EXT2/EXT4/EXT4_WRITE/FAT_FS_GENERIC flags
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Applied to u-boot/master, thanks!
participants (2)
-
patrice.chotard@st.com
-
Tom Rini