From: Andre Przywara Date: Tue, 29 Jan 2019 15:54:14 +0000 (+0000) Subject: sunxi: board: do MMC pinmux setup for DM_MMC builds X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=a7ae159978a5e6de5587389fc099efbe8c238771;p=u-boot.git sunxi: board: do MMC pinmux setup for DM_MMC builds 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. When booting from either SD card or eMMC, the SPL does the setup for us, but when booting from SPI or USB we must not skip this part. Fixes, boot via FEL or SPI flash, where the SPL won't setup the pinmux Signed-off-by: Andre Przywara Acked-by: Jagan Teki [jagan: add Fix details on commit message] Signed-off-by: Jagan Teki --- diff --git a/board/sunxi/board.c b/board/sunxi/board.c index ad14837291..98bc3cd0c1 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -208,6 +208,10 @@ enum env_location env_get_location(enum env_operation op, int prio) } #endif +#ifdef CONFIG_DM_MMC +static void mmc_pinmux_setup(int sdc); +#endif + /* add board specific code here */ int board_init(void) { @@ -269,6 +273,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(); }