aboutsummaryrefslogtreecommitdiff
path: root/cmd/x86
diff options
context:
space:
mode:
authorSimon Glass2023-12-03 17:29:36 -0700
committerTom Rini2024-04-10 13:49:16 -0600
commit9ad5fdf1a8a10d2c3daad33ba69cd88b7f7ea86b (patch)
tree7d3a8c93d2ca2c72a962f25f523b536c58979b35 /cmd/x86
parentd2c485a0321689bc6becac73b4f49b3e39cb288e (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 'cmd/x86')
-rw-r--r--cmd/x86/zboot.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c
index 572b58a5537..addf28cb4aa 100644
--- a/cmd/x86/zboot.c
+++ b/cmd/x86/zboot.c
@@ -10,26 +10,6 @@
#include <vsprintf.h>
#include <asm/zimage.h>
-static int 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;
-
- return 0;
-}
-
static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
@@ -47,8 +27,10 @@ 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;
- return zboot_start(bzimage_addr, bzimage_size, initrd_addr, initrd_size,
- base_addr, cmdline);
+ zboot_start(bzimage_addr, bzimage_size, initrd_addr, initrd_size,
+ base_addr, cmdline);
+
+ return 0;
}
static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc,
@@ -81,12 +63,6 @@ static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc,
return 0;
}
-static void zboot_info(void)
-{
- printf("Kernel loaded at %08lx, setup_base=%p\n",
- state.load_address, state.base_ptr);
-}
-
static int do_zboot_info(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{