summaryrefslogtreecommitdiff
path: root/board/sunxi
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2019-01-29 15:54:14 +0000
committerJagan Teki <jagan@amarulasolutions.com>2019-01-29 23:46:14 +0530
commita7ae159978a5e6de5587389fc099efbe8c238771 (patch)
tree1f0879f9c349dba2bdc5971b6ba6d4c6f974e9b3 /board/sunxi
parentc57572eb5aac7191026a069e8980a0faf01f2455 (diff)
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 <andre.przywara@arm.com> Acked-by: Jagan Teki <jagan@openedev.com> [jagan: add Fix details on commit message] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'board/sunxi')
-rw-r--r--board/sunxi/board.c15
1 files changed, 15 insertions, 0 deletions
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();
}