diff options
Diffstat (limited to 'cmd/x86/zboot.c')
-rw-r--r-- | cmd/x86/zboot.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c index ee099ca041b..94e602b8a5b 100644 --- a/cmd/x86/zboot.c +++ b/cmd/x86/zboot.c @@ -7,15 +7,11 @@ #define LOG_CATEGORY LOGC_BOOT -#include <bootm.h> #include <command.h> #include <mapmem.h> #include <vsprintf.h> #include <asm/zimage.h> -/* Current state of the boot */ -static struct bootm_info bmi; - static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -24,8 +20,6 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, ulong base_addr; int i; - bootm_init(&bmi); - log_debug("argc %d:", argc); for (i = 0; i < argc; i++) log_debug(" %s", argv[i]); @@ -41,7 +35,7 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, base_addr = argc > 5 ? hextoul(argv[5], NULL) : 0; cmdline = argc > 6 ? env_get(argv[6]) : NULL; - zboot_start(&bmi, bzimage_addr, bzimage_size, initrd_addr, initrd_size, + zboot_start(bzimage_addr, bzimage_size, initrd_addr, initrd_size, base_addr, cmdline); return 0; @@ -52,7 +46,7 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc, { int ret; - ret = zboot_load(&bmi); + ret = zboot_load(); if (ret) return ret; @@ -62,17 +56,16 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc, static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - if (!bmi.base_ptr) { + if (!state.base_ptr) { printf("base is not set: use 'zboot load' first\n"); return CMD_RET_FAILURE; } - - if (zboot_setup(&bmi)) { + if (zboot_setup()) { puts("Setting up boot parameters failed ...\n"); return CMD_RET_FAILURE; } - if (zboot_setup(&bmi)) + if (zboot_setup()) return CMD_RET_FAILURE; return 0; @@ -81,7 +74,7 @@ static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc, static int do_zboot_info(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - zboot_info(&bmi); + zboot_info(); return 0; } @@ -91,7 +84,7 @@ static int do_zboot_go(struct cmd_tbl *cmdtp, int flag, int argc, { int ret; - ret = zboot_go(&bmi); + ret = zboot_go(); if (ret) { printf("Kernel returned! (err=%d)\n", ret); return CMD_RET_FAILURE; @@ -103,13 +96,15 @@ static int do_zboot_go(struct cmd_tbl *cmdtp, int flag, int argc, static int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + struct boot_params *base_ptr = state.base_ptr; + if (argc > 1) - bmi.base_ptr = (void *)hextoul(argv[1], NULL); - if (!bmi.base_ptr) { + base_ptr = (void *)hextoul(argv[1], NULL); + if (!base_ptr) { printf("No zboot setup_base\n"); return CMD_RET_FAILURE; } - zimage_dump(&bmi, true); + zimage_dump(base_ptr, true); return 0; } @@ -124,8 +119,8 @@ U_BOOT_SUBCMDS(zboot, U_BOOT_CMD_MKENT(dump, 2, 1, do_zboot_dump, "", ""), ) -static int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[], int state_mask) +int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[], int state_mask) { int ret = 0; |