From 59073573227ce7aeae3957744146cdf23849c8b9 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Mon, 12 Jul 2021 11:06:49 +0100 Subject: spl: mmc: extend spl_mmc_boot_mode() to take mmc argument Platforms can overwrite the weak definition of spl_mmc_boot_mode() to determine where to load U-Boot proper from. For most of them this is a trivial decision based on Kconfig variables, but it might be desirable the probe the actual device to answer this question. Pass the pointer to the mmc struct to that function, so implementations can make use of that. Compile-tested for all users changed. Signed-off-by: Andre Przywara Reviewed-by: Stefano Babic Reviewed-by: Ley Foon Tan (for SoCFPGA) Acked-by: Lokesh Vutla (for OMAP and K3) Reviewed-by: Simon Glass --- common/spl/spl_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 1c41d24..1bb785a 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -327,7 +327,7 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, } #endif -u32 __weak spl_mmc_boot_mode(const u32 boot_device) +u32 __weak spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) { #if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) return MMCSD_MODE_FS; @@ -401,7 +401,7 @@ int spl_mmc_load(struct spl_image_info *spl_image, } } - boot_mode = spl_mmc_boot_mode(bootdev->boot_device); + boot_mode = spl_mmc_boot_mode(mmc, bootdev->boot_device); err = -EINVAL; switch (boot_mode) { case MMCSD_MODE_EMMCBOOT: -- cgit v1.1