From d695d6627803dbb78a226e04b0436a01633a9936 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Sat, 3 Feb 2018 08:29:52 +0100 Subject: spl: eMMC/SD: Provide one __weak spl_boot_mode() function The goal of this patch is to clean up the code related to choosing SPL MMC boot mode. The spl_boot_mode() now is called only in spl_mmc_load_image() function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT is enabled. To achieve the goal, all per mach/arch implementations eligible for unification has been replaced with one __weak implementation. Signed-off-by: Lukasz Majewski Reviewed-by: Marek Vasut Reviewed-by: Stefano Babic Acked-by: Michal Simek (For ZynqMP) Reviewed-by: Fabio Estevam --- common/spl/spl_mmc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/spl') diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index b57e0b04e4..351f4edd41 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -281,6 +281,17 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, struct mmc *mmc) } #endif +u32 __weak spl_boot_mode(const u32 boot_device) +{ +#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT) + return MMCSD_MODE_FS; +#elif defined(CONFIG_SUPPORT_EMMC_BOOT) + return MMCSD_MODE_EMMCBOOT; +#else + return MMCSD_MODE_RAW; +#endif +} + int spl_mmc_load_image(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { -- cgit v1.2.1