Commit a7ae1599 authored by Andre Przywara's avatar Andre Przywara Committed by Jagan Teki

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: default avatarAndre Przywara <andre.przywara@arm.com>
Acked-by: default avatarJagan Teki <jagan@openedev.com>
[jagan: add Fix details on commit message]
Signed-off-by: Jagan Teki's avatarJagan Teki <jagan@amarulasolutions.com>
parent c57572eb
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment