diff options
| author | Patrick Delaunay <[email protected]> | 2018-03-20 10:54:51 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2018-04-06 20:45:28 -0400 |
| commit | 35a66960cd7358588bd678b4b3dfedb27226fe3e (patch) | |
| tree | 5ac022abdcdc415468d0a8f7562c7a205f579e18 /common | |
| parent | 52280315a4c58647906a56af8ce79b7ee0c28571 (diff) | |
spl: spl_mmc: provide one weak function spl_boot_partition
The spl_boot_partition function has been added in order to have
the possibility to boot on a same binary from different mmc devices
with different partitions.
By default keep the current behavior, SPL use the partition defined
by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.
Signed-off-by: Patrick Delaunay <[email protected]>
Signed-off-by: Christophe KERELLO <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
Diffstat (limited to 'common')
| -rw-r--r-- | common/spl/spl_mmc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 351f4edd41e..4aa0b2caf39 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 |
