From 8b59688e1c0ae1956210b9ecd4080f344152b220 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 6 Feb 2009 14:30:34 +0100 Subject: ARM: Add a bootz command Signed-off-by: Sascha Hauer --- arch/arm/lib/armlinux.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index ed40846111..ce86ff859a 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -340,3 +341,51 @@ __setup_end_tag (void) params->hdr.size = 0; } +static int do_bootz(cmd_tbl_t *cmdtp, int argc, char *argv[]) +{ + void (*theKernel)(int zero, int arch, void *params); + const char *commandline = getenv("bootargs"); + size_t size; + + if (argc != 2) { + u_boot_cmd_usage(cmdtp); + return 1; + } + + theKernel = read_file(argv[1], &size); + if (!theKernel) { + printf("could not read %s\n", argv[1]); + return 1; + } + + printf("loaded zImage from %s with size %d\n", argv[1], size); + + setup_start_tag(); + setup_serial_tag(¶ms); + setup_revision_tag(¶ms); + setup_memory_tags(); + setup_commandline_tag(commandline); +#if 0 + if (initrd_start && initrd_end) + setup_initrd_tag (initrd_start, initrd_end); +#endif + setup_videolfb_tag((gd_t *) gd); + setup_end_tag(); + + cleanup_before_linux(); + theKernel (0, armlinux_architecture, armlinux_bootparams); + + return 0; +} + +static const __maybe_unused char cmd_ls_help[] = +"Usage: bootz [FILE]\n" +"Boot a Linux zImage\n"; + +U_BOOT_CMD_START(bootz) + .maxargs = 2, + .cmd = do_bootz, + .usage = "bootz - start a zImage", +U_BOOT_CMD_END + + -- cgit v1.2.3