diff options
author | Simon Glass <sjg@chromium.org> | 2023-12-03 17:29:36 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-04-10 13:49:16 -0600 |
commit | 9ad5fdf1a8a10d2c3daad33ba69cd88b7f7ea86b (patch) | |
tree | 7d3a8c93d2ca2c72a962f25f523b536c58979b35 /arch/x86/lib | |
parent | d2c485a0321689bc6becac73b4f49b3e39cb288e (diff) |
x86: zboot: Separate logic functions from commands
Move zboot_start() and zboot_info() in with the other logic functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/zimage.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index e8a1849947e..f2d4f3b5016 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -652,3 +652,26 @@ void zimage_dump(struct boot_params *base_ptr, bool show_cmdline) if (get_boot_protocol(hdr, false) >= 0x215) print_num("Kernel info offset", hdr->kernel_info_offset); } + +void zboot_start(ulong bzimage_addr, ulong bzimage_size, ulong initrd_addr, + ulong initrd_size, ulong base_addr, const char *cmdline) +{ + memset(&state, '\0', sizeof(state)); + + state.bzimage_size = bzimage_size; + state.initrd_addr = initrd_addr; + state.initrd_size = initrd_size; + if (base_addr) { + state.base_ptr = map_sysmem(base_addr, 0); + state.load_address = bzimage_addr; + } else { + state.bzimage_addr = bzimage_addr; + } + state.cmdline = cmdline; +} + +void zboot_info(void) +{ + printf("Kernel loaded at %08lx, setup_base=%p\n", + state.load_address, state.base_ptr); +} |