[U-Boot] [PATCH 1/2] sunxi: board: do MMC pinmux setup for DM_MMC builds

Andre Przywara andre.przywara at arm.com
Wed Jan 23 01:48:47 UTC 2019


Enabling DM_MMC skips the call to mmc_pinmux_setup() in board.c, as this
is supposed to be handled by the MMC driver, using DT information.

However we don't have a pinctrl driver yet, but would still like to keep
the working pinmux setup for our MMC devices. So bring this particular
call back to the DM_MMC code flow.

This worked so far when booting from either SD card or eMMC, as the SPL
does the setup for us, but booting from SPI or USB would have rendered
all SD devices unusable.

Signed-off-by: Andre Przywara <andre.przywara at arm.com>
---
 board/sunxi/board.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index ad14837291..8e978e5388 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -208,6 +208,8 @@ enum env_location env_get_location(enum env_operation op, int prio)
 }
 #endif
 
+static void mmc_pinmux_setup(int sdc);
+
 /* add board specific code here */
 int board_init(void)
 {
@@ -269,6 +271,17 @@ int board_init(void)
 	i2c_init_board();
 #endif
 
+#ifdef CONFIG_DM_MMC
+	/*
+	 * Temporary workaround for enabling MMC clocks until a sunxi DM
+	 * pinctrl driver lands.
+	 */
+	mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
+#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
+	mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
+#endif
+#endif	/* CONFIG_DM_MMC */
+
 	/* Uses dm gpio code so do this here and not in i2c_init_board() */
 	return soft_i2c_board_init();
 }
-- 
2.14.5



More information about the U-Boot mailing list