Commit dc0c9383 authored by Helge Juul's avatar Helge Juul Committed by Carles Cufi
Browse files

boards: arm: stm32f746g_disco: enable sdmmc support



Update dtsi and pinmux macros for stm32f7 family. Add sdmmc1 to dts file
for stm32f746g_disco. Also add board specific configuration file for
fat_fs sample.

Signed-off-by: default avatarHelge Juul <helge@fastmail.com>
parent cf89e999
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -58,6 +58,15 @@ static const struct pin_config pinconf[] = {
	{STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM},
	{STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP},
#endif	/* CONFIG_USB_DC_STM32 */
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(sdmmc1))
	{STM32_PIN_PC8, STM32F7_PINMUX_FUNC_PC8_SDMMC1_D0},
	{STM32_PIN_PC9, STM32F7_PINMUX_FUNC_PC9_SDMMC1_D1},
	{STM32_PIN_PC10, STM32F7_PINMUX_FUNC_PC10_SDMMC1_D2},
	{STM32_PIN_PC11, STM32F7_PINMUX_FUNC_PC11_SDMMC1_D3},
	{STM32_PIN_PC12, STM32F7_PINMUX_FUNC_PC12_SDMMC1_CK},
	{STM32_PIN_PC13, STM32_MODER_INPUT_MODE},
	{STM32_PIN_PD2, STM32F7_PINMUX_FUNC_PD2_SDMMC1_CMD},
#endif
};

static int pinmux_stm32_init(struct device *port)
+5 −0
Original line number Diff line number Diff line
@@ -92,3 +92,8 @@ arduino_serial: &usart6 {};
&rtc {
	status = "okay";
};

&sdmmc1 {
	status = "okay";
	cd-gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
};
+1 −0
Original line number Diff line number Diff line
@@ -16,5 +16,6 @@ supported:
  - gpio
  - pwm
  - counter
  - sdhc
  - usb_device
  - kscan:touch
+18 −2
Original line number Diff line number Diff line
@@ -362,6 +362,9 @@
	(STM32_PINMUX_ALT_FUNC_3 | STM32_PUSHPULL_PULLUP)
#define STM32F7_PINMUX_FUNC_PC8_UART5_RTS  \
	(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)
#define STM32F7_PINMUX_FUNC_PC8_SDMMC1_D0 \
	(STM32_PINMUX_ALT_FUNC_12 | STM32_PUSHPULL_PULLUP | \
	 STM32_OSPEEDR_VERY_HIGH_SPEED)

#define STM32F7_PINMUX_FUNC_PC9_PWM3_CH4 \
	(STM32_PINMUX_ALT_FUNC_2 | STM32_PUSHPULL_PULLUP)
@@ -371,23 +374,33 @@
	(STM32_PINMUX_ALT_FUNC_4 | STM32_OPENDRAIN_PULLUP)
#define STM32F7_PINMUX_FUNC_PC9_UART5_CTS  \
	(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)
#define STM32F7_PINMUX_FUNC_PC9_SDMMC1_D1 \
	(STM32_PINMUX_ALT_FUNC_12 | STM32_PUSHPULL_PULLUP | \
	 STM32_OSPEEDR_VERY_HIGH_SPEED)

#define STM32F7_PINMUX_FUNC_PC10_USART3_TX  \
	(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)
#define STM32F7_PINMUX_FUNC_PC10_LTDC_R2 \
	(STM32_PINMUX_ALT_FUNC_14 | STM32_PUSHPULL_NOPULL)

#define STM32F7_PINMUX_FUNC_PC10_UART4_TX  \
	(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_PULLUP)
#define STM32F7_PINMUX_FUNC_PC10_SDMMC1_D2 \
	(STM32_PINMUX_ALT_FUNC_12 | STM32_PUSHPULL_PULLUP | \
	 STM32_OSPEEDR_VERY_HIGH_SPEED)

#define STM32F7_PINMUX_FUNC_PC11_USART3_RX  \
	(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)

#define STM32F7_PINMUX_FUNC_PC11_UART4_RX   \
	(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_NOPULL)
#define STM32F7_PINMUX_FUNC_PC11_SDMMC1_D3 \
	(STM32_PINMUX_ALT_FUNC_12 | STM32_PUSHPULL_PULLUP | \
	 STM32_OSPEEDR_VERY_HIGH_SPEED)

#define STM32F7_PINMUX_FUNC_PC12_UART5_TX   \
	(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_PULLUP)
#define STM32F7_PINMUX_FUNC_PC12_SDMMC1_CK  \
	(STM32_PINMUX_ALT_FUNC_12 | STM32_PUSHPULL_PULLUP | \
	 STM32_OSPEEDR_VERY_HIGH_SPEED)

/* Port D */
#define STM32F7_PINMUX_FUNC_PD0_CAN_RX \
@@ -397,6 +410,9 @@

#define STM32F7_PINMUX_FUNC_PD2_UART5_RX    \
	(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_NOPULL)
#define STM32F7_PINMUX_FUNC_PD2_SDMMC1_CMD  \
	(STM32_PINMUX_ALT_FUNC_12 | STM32_PUSHPULL_PULLUP | \
	 STM32_OSPEEDR_VERY_HIGH_SPEED)

#define STM32F7_PINMUX_FUNC_PD3_USART2_CTS   \
	(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)
+8 −0
Original line number Diff line number Diff line
@@ -641,6 +641,14 @@
			status = "disabled";
			label = "RNG";
		};

		sdmmc1: sdmmc@40012c00 {
			compatible = "st,stm32-sdmmc";
			reg = <0x40012c00 0x400>;
			clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000800>;
			status = "disabled";
			label = "SDMMC_1";
		};
	};

	otghs_fs_phy: otghs_fs_phy {