summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/spl/spl_mmc.c15
-rw-r--r--include/spl.h1
2 files changed, 14 insertions, 2 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 351f4edd41..4aa0b2caf3 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -292,6 +292,14 @@ u32 __weak spl_boot_mode(const u32 boot_device)
#endif
}
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
+__weak
+int spl_boot_partition(const u32 boot_device)
+{
+ return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION;
+}
+#endif
+
int spl_mmc_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
@@ -347,8 +355,11 @@ int spl_mmc_load_image(struct spl_image_info *spl_image,
return err;
}
#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
- err = mmc_load_image_raw_partition(spl_image, mmc,
- CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
+ err = spl_boot_partition(bootdev->boot_device);
+ if (!err)
+ return err;
+
+ err = mmc_load_image_raw_partition(spl_image, mmc, err);
if (!err)
return err;
#endif
diff --git a/include/spl.h b/include/spl.h
index c14448b8fc..5754012cd0 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -82,6 +82,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
void preloader_console_init(void);
u32 spl_boot_device(void);
u32 spl_boot_mode(const u32 boot_device);
+int spl_boot_partition(const u32 boot_device);
void spl_set_bd(void);
/**