board:samsung: check the boot device and init the right mmc driver.
It is possible to boot device using a micro SD or eMMC slots. In this situation, boot device should be registered as a block device 0 in the MMC framework, because CONFIG_SYS_MMC_ENV_DEV is usually set to "0" in the most config cases. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
parent
4fb4d55a35
commit
33a4fcf637
|
@ -240,22 +240,39 @@ int board_eth_init(bd_t *bis)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_GENERIC_MMC
|
#ifdef CONFIG_GENERIC_MMC
|
||||||
|
static int init_mmc(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_SDHCI
|
||||||
|
return exynos_mmc_init(gd->fdt_blob);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int init_dwmmc(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_DWMMC
|
||||||
|
return exynos_dwmmc_init(gd->fdt_blob);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int board_mmc_init(bd_t *bis)
|
int board_mmc_init(bd_t *bis)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
#ifdef CONFIG_DWMMC
|
|
||||||
/* dwmmc initializattion for available channels */
|
|
||||||
ret = exynos_dwmmc_init(gd->fdt_blob);
|
|
||||||
if (ret)
|
|
||||||
debug("dwmmc init failed\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SDHCI
|
if (get_boot_mode() == BOOT_MODE_SD) {
|
||||||
/* mmc initializattion for available channels */
|
ret = init_mmc();
|
||||||
ret = exynos_mmc_init(gd->fdt_blob);
|
ret |= init_dwmmc();
|
||||||
|
} else {
|
||||||
|
ret = init_dwmmc();
|
||||||
|
ret |= init_mmc();
|
||||||
|
}
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
debug("mmc init failed\n");
|
debug("mmc init failed\n");
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue