mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 16:01:27 +00:00
spl: mmc: move fs boot into its own function
Move the code that handles fs boot out of spl_mmc_load_image() and into its own function to reduce the #ifdef complexity of spl_mmc_load_image(). No functional changes. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
d074ebb936
commit
f52b729393
1 changed files with 51 additions and 30 deletions
|
@ -171,6 +171,55 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION
|
||||||
|
int spl_mmc_do_fs_boot(struct mmc *mmc)
|
||||||
|
{
|
||||||
|
int err = -ENOSYS;
|
||||||
|
|
||||||
|
#ifdef CONFIG_SPL_FAT_SUPPORT
|
||||||
|
if (!spl_start_uboot()) {
|
||||||
|
err = spl_load_image_fat_os(&mmc->block_dev,
|
||||||
|
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
|
||||||
|
if (!err)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
#ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
|
||||||
|
err = spl_load_image_fat(&mmc->block_dev,
|
||||||
|
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
|
||||||
|
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
|
||||||
|
if (!err)
|
||||||
|
return err;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SPL_EXT_SUPPORT
|
||||||
|
if (!spl_start_uboot()) {
|
||||||
|
err = spl_load_image_ext_os(&mmc->block_dev,
|
||||||
|
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
|
||||||
|
if (!err)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
#ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
|
||||||
|
err = spl_load_image_ext(&mmc->block_dev,
|
||||||
|
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
|
||||||
|
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
|
||||||
|
if (!err)
|
||||||
|
return err;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
|
||||||
|
err = -ENOENT;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
int spl_mmc_do_fs_boot(struct mmc *mmc)
|
||||||
|
{
|
||||||
|
return -ENOSYS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void spl_mmc_load_image(void)
|
void spl_mmc_load_image(void)
|
||||||
{
|
{
|
||||||
struct mmc *mmc;
|
struct mmc *mmc;
|
||||||
|
@ -214,38 +263,10 @@ void spl_mmc_load_image(void)
|
||||||
case MMCSD_MODE_FS:
|
case MMCSD_MODE_FS:
|
||||||
debug("spl: mmc boot mode: fs\n");
|
debug("spl: mmc boot mode: fs\n");
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION
|
err = spl_mmc_do_fs_boot(mmc);
|
||||||
#ifdef CONFIG_SPL_FAT_SUPPORT
|
|
||||||
if (!spl_start_uboot()) {
|
|
||||||
err = spl_load_image_fat_os(&mmc->block_dev,
|
|
||||||
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
|
|
||||||
if (!err)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
|
|
||||||
err = spl_load_image_fat(&mmc->block_dev,
|
|
||||||
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
|
|
||||||
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
|
|
||||||
if (!err)
|
if (!err)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_SPL_EXT_SUPPORT
|
|
||||||
if (!spl_start_uboot()) {
|
|
||||||
err = spl_load_image_ext_os(&mmc->block_dev,
|
|
||||||
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION);
|
|
||||||
if (!err)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifdef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
|
|
||||||
err = spl_load_image_ext(&mmc->block_dev,
|
|
||||||
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
|
|
||||||
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
|
|
||||||
if (!err)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_SUPPORT_EMMC_BOOT
|
#ifdef CONFIG_SUPPORT_EMMC_BOOT
|
||||||
case MMCSD_MODE_EMMCBOOT:
|
case MMCSD_MODE_EMMCBOOT:
|
||||||
|
|
Loading…
Add table
Reference in a new issue