]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
x86: zboot: Use zboot_start() in zboot_run()
authorSimon Glass <sjg@chromium.org>
Mon, 4 Dec 2023 00:29:37 +0000 (17:29 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 10 Apr 2024 19:49:16 +0000 (13:49 -0600)
Now that we have a function to start the process of booting a zimage,
use it in zboot_run() to avoid duplicated logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/lib/zimage.c

index f2d4f3b501621d256b04200c20605ea6a61f7d43..d7403876c13d4232fef942aee3fa089f3c47912a 100644 (file)
@@ -442,19 +442,7 @@ int zboot_run(ulong addr, ulong size, ulong initrd, ulong initrd_size,
 {
        int ret;
 
-       memset(&state, '\0', sizeof(state));
-
-       if (base) {
-               state.base_ptr = map_sysmem(base, 0);
-               state.load_address = addr;
-       } else {
-               state.bzimage_addr = addr;
-       }
-       state.bzimage_size = size;
-       state.initrd_addr = initrd;
-       state.initrd_size = initrd_size;
-       state.cmdline = cmdline;
-
+       zboot_start(addr, size, initrd, initrd_size, base, cmdline);
        ret = zboot_load();
        if (ret)
                return log_msg_ret("ld", ret);