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>
This commit is contained in:
Dzmitry Sankouski
2022-02-22 21:49:52 +03:00
committed by Tom Rini
parent 5c9b420ada
commit 12a3e1ada0
5 changed files with 138 additions and 0 deletions

View File

@@ -1192,4 +1192,28 @@ config DEFAULT_FDT_FILE
help
This option is used to set the default fdt file to boot OS.
config SAVE_PREV_BL_FDT_ADDR
depends on ARM
bool "Saves fdt address, passed by the previous bootloader, to env var"
help
When u-boot is used as a chain-loaded bootloader (replacing OS kernel),
enable this option to save fdt address, passed by the
previous bootloader for future use.
Address is saved to `prevbl_fdt_addr` environment variable.
If no fdt was provided by previous bootloader, no env variables
will be created.
config SAVE_PREV_BL_INITRAMFS_START_ADDR
depends on ARM
bool "Saves initramfs address, passed by the previous bootloader, to env var"
help
When u-boot is used as a chain-loaded bootloader(replacing OS kernel),
enable this option to save initramfs address, passed by the
previous bootloader for future use.
Address is saved to `prevbl_initrd_start_addr` environment variable.
If no initramfs was provided by previous bootloader, no env variables
will be created.
endmenu # Booting