summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-09-24 18:20:13 -0600
committerTom Rini <trini@konsulko.com>2016-10-06 15:08:52 -0400
commit2a2ee2ac35f26f6b4dae11a225c2803291dff10e (patch)
treecdb362cf377e85a635bb54dc7bf7f54991914cd3 /arch
parent97d9df0a91f1c68695913518d8dfaf26c41dbb32 (diff)
downloadu-boot-imx-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.zip
u-boot-imx-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.tar.gz
u-boot-imx-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.tar.bz2
spl: Pass spl_image as a parameter to load_image() methods
Rather than having a global variable, pass the spl_image as a parameter. This avoids BSS use, and makes it clearer what the function is actually doing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-sunxi/board.c3
-rw-r--r--arch/arm/mach-uniphier/boot-mode/spl_board.c9
-rw-r--r--arch/sandbox/cpu/spl.c3
3 files changed, 9 insertions, 6 deletions
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 22f3e3c..7713813 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -134,7 +134,8 @@ static int gpio_init(void)
}
#ifdef CONFIG_SPL_BUILD
-static int spl_board_load_image(struct spl_boot_device *bootdev)
+static int spl_board_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
debug("Returning to FEL sp=%x, lr=%x\n", fel_stash.sp, fel_stash.lr);
return_to_fel(fel_stash.sp, fel_stash.lr);
diff --git a/arch/arm/mach-uniphier/boot-mode/spl_board.c b/arch/arm/mach-uniphier/boot-mode/spl_board.c
index e2b202e..854ab05 100644
--- a/arch/arm/mach-uniphier/boot-mode/spl_board.c
+++ b/arch/arm/mach-uniphier/boot-mode/spl_board.c
@@ -65,7 +65,8 @@ int uniphier_rom_get_mmc_funcptr(int (**send_cmd)(u32, u32),
return 0;
}
-static int spl_board_load_image(struct spl_boot_device *bootdev)
+static int spl_board_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
int (*send_cmd)(u32 cmd, u32 arg);
int (*card_blockaddr)(u32 rca);
@@ -113,12 +114,12 @@ static int spl_board_load_image(struct spl_boot_device *bootdev)
return ret;
}
- ret = spl_parse_image_header(&spl_image, (void *)CONFIG_SYS_TEXT_BASE);
+ ret = spl_parse_image_header(spl_image, (void *)CONFIG_SYS_TEXT_BASE);
if (ret)
return ret;
- ret = (*load_image)(dev_addr, spl_image.load_addr,
- spl_image.size / 512);
+ ret = (*load_image)(dev_addr, spl_image->load_addr,
+ spl_image->size / 512);
if (ret) {
printf("failed to load image\n");
return ret;
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 2c45354..1ad7fb6 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -38,7 +38,8 @@ void spl_board_announce_boot_device(void)
printf("%s\n", fname);
}
-static int spl_board_load_image(struct spl_boot_device *bootdev)
+static int spl_board_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
char fname[256];
int ret;