aboutsummaryrefslogtreecommitdiff
path: root/common/spl/spl.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl.c')
-rw-r--r--common/spl/spl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index a09ada3..a1e7b9f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -80,6 +80,11 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end)
}
#endif
+/* Weak default function for arch/board-specific fixups to the spl_image_info */
+void __weak spl_perform_fixups(struct spl_image_info *spl_image)
+{
+}
+
void spl_fixup_fdt(void)
{
#if defined(CONFIG_SPL_OF_LIBFDT) && defined(CONFIG_SYS_SPL_ARGS_ADDR)
@@ -445,8 +450,10 @@ static int boot_from_devices(struct spl_image_info *spl_image,
else
puts("SPL: Unsupported Boot Device!\n");
#endif
- if (loader && !spl_load_image(spl_image, loader))
+ if (loader && !spl_load_image(spl_image, loader)) {
+ spl_image->boot_device = spl_boot_list[i];
return 0;
+ }
}
return -ENODEV;
@@ -498,6 +505,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
#ifdef CONFIG_SYS_SPL_ARGS_ADDR
spl_image.arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
#endif
+ spl_image.boot_device = BOOT_DEVICE_NONE;
board_boot_order(spl_boot_list);
if (boot_from_devices(&spl_image, spl_boot_list,
@@ -506,6 +514,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
hang();
}
+ spl_perform_fixups(&spl_image);
+
#ifdef CONFIG_CPU_V7M
spl_image.entry_point |= 0x1;
#endif