提交 3ba0a25c 编写于 作者: S Samuel Holland 提交者: Andre Przywara

sunxi: Skip MMC0 init when its pinmux conflicts with UART0

Currently, selecting UART0_PORT_F entirely disables MMC support on sunxi
platforms. But this is a bigger hammer then needed. Muxing UART0 to the
pins on port F only causes a conflict with MMC0, so minimize the impact
by specifically skipping MMC0 init. We can continue to use MMC1/2 if
those are enabled.

Let's also remove the preprocessor check while refacting this function.
Signed-off-by: NSamuel Holland <samuel@sholland.org>
Reviewed-by: NAndre Przywara <andre.przywara@arm.com>
Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
上级 92373de0
......@@ -516,19 +516,17 @@ static void mmc_pinmux_setup(int sdc)
int board_mmc_init(struct bd_info *bis)
{
__maybe_unused struct mmc *mmc0, *mmc1;
mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
mmc0 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT);
if (!mmc0)
return -1;
if (!IS_ENABLED(CONFIG_UART0_PORT_F)) {
mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
if (!sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT))
return -1;
}
#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
mmc1 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA);
if (!mmc1)
return -1;
#endif
if (CONFIG_MMC_SUNXI_SLOT_EXTRA != -1) {
mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
if (!sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA))
return -1;
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册