aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDzmitry Sankouski <dsankouski@gmail.com>2022-02-22 21:49:52 +0300
committerTom Rini <trini@konsulko.com>2022-04-04 14:53:26 -0400
commit12a3e1ada06c702c403cf1eebb063ef7a34688cd (patch)
treed58972054d39b90b0b0a92d5c9b093d0547264a6 /common
parent5c9b420ada3b4f2a08da4789571f0ea373881565 (diff)
downloadu-boot-12a3e1ada06c702c403cf1eebb063ef7a34688cd.zip
u-boot-12a3e1ada06c702c403cf1eebb063ef7a34688cd.tar.gz
u-boot-12a3e1ada06c702c403cf1eebb063ef7a34688cd.tar.bz2
arm: init: save previous bootloader data
When u-boot is used as a chain-loaded bootloader (replacing OS kernel), previous bootloader leaves data in RAM, that can be reused. For example, on recent arm linux system, when chainloading u-boot, there are initramfs and fdt in RAM prepared for OS booting. Initramfs may be modified to store u-boot's payload, thus providing the ability to use chainloaded u-boot to boot OS without any storage support. Two config options added: - SAVE_PREV_BL_INITRAMFS_START_ADDR saves initramfs start address to 'prevbl_initrd_start_addr' environment variable - SAVE_PREV_BL_FDT_ADDR saves fdt address to 'prevbl_fdt_addr' environment variable Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
-rw-r--r--common/board_r.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/board_r.c b/common/board_r.c
index b92c1bb..8dc87ed 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -445,6 +445,11 @@ static int initr_env(void)
env_set_hex("fdtcontroladdr",
(unsigned long)map_to_sysmem(gd->fdt_blob));
+ #if (CONFIG_IS_ENABLED(SAVE_PREV_BL_INITRAMFS_START_ADDR) || \
+ CONFIG_IS_ENABLED(SAVE_PREV_BL_FDT_ADDR))
+ save_prev_bl_data();
+ #endif
+
/* Initialize from environment */
image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr);