summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-09-24 18:20:14 -0600
committerTom Rini <trini@konsulko.com>2016-10-06 15:08:53 -0400
commitb4a6c2aae6165782dd9fa4944b38c2c2a7419af1 (patch)
treeca27b960cc3ba435180412905f4d1e6c3d16f4b4 /common/spl
parent2a2ee2ac35f26f6b4dae11a225c2803291dff10e (diff)
downloadu-boot-imx-b4a6c2aae6165782dd9fa4944b38c2c2a7419af1.zip
u-boot-imx-b4a6c2aae6165782dd9fa4944b38c2c2a7419af1.tar.gz
u-boot-imx-b4a6c2aae6165782dd9fa4944b38c2c2a7419af1.tar.bz2
spl: Update ext functions to take an spl_image parameter
Update the ext loader to avoid using the spl_image global variable. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl_ext.c21
-rw-r--r--common/spl/spl_mmc.c4
2 files changed, 14 insertions, 11 deletions
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index e5af24e..b93e1ea 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -10,9 +10,9 @@
#include <image.h>
#ifdef CONFIG_SPL_EXT_SUPPORT
-int spl_load_image_ext(struct blk_desc *block_dev,
- int partition,
- const char *filename)
+int spl_load_image_ext(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition,
+ const char *filename)
{
s32 err;
struct image_header *header;
@@ -48,13 +48,13 @@ int spl_load_image_ext(struct blk_desc *block_dev,
goto end;
}
- err = spl_parse_image_header(&spl_image, header);
+ err = spl_parse_image_header(spl_image, header);
if (err < 0) {
puts("spl: ext: failed to parse image header\n");
goto end;
}
- err = ext4fs_read((char *)spl_image.load_addr, filelen, &actlen);
+ err = ext4fs_read((char *)spl_image->load_addr, filelen, &actlen);
end:
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
@@ -67,7 +67,8 @@ end:
}
#ifdef CONFIG_SPL_OS_BOOT
-int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
+int spl_load_image_ext_os(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition)
{
int err;
__maybe_unused loff_t filelen, actlen;
@@ -104,7 +105,8 @@ int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
}
file = getenv("falcon_image_file");
if (file) {
- err = spl_load_image_ext(block_dev, partition, file);
+ err = spl_load_image_ext(spl_image, block_dev,
+ partition, file);
if (err != 0) {
puts("spl: falling back to default\n");
goto defaults;
@@ -134,11 +136,12 @@ defaults:
return -1;
}
- return spl_load_image_ext(block_dev, partition,
+ return spl_load_image_ext(spl_image, block_dev, partition,
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#else
-int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
+int spl_load_image_ext_os(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition)
{
return -ENOSYS;
}
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 6536e66..5f5d9d0 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -245,13 +245,13 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, struct mmc *mmc)
#endif
#ifdef CONFIG_SPL_EXT_SUPPORT
if (!spl_start_uboot()) {
- err = spl_load_image_ext_os(&mmc->block_dev,
+ err = spl_load_image_ext_os(spl_image, &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,
+ err = spl_load_image_ext(spl_image, &mmc->block_dev,
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION,
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
if (!err)