diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-01 14:18:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-04 16:27:57 +0200 |
commit | bb7fff04afdddaa63c2f519221df07abf8a8467d (patch) | |
tree | 77c181063f1268fedf0ec9e2259c9a151c758231 /arch/arm/lib/armlinux.c | |
parent | 4ade5f86705c93fd5b9512658aff014ee0ee5121 (diff) | |
download | barebox-bb7fff04afdddaa63c2f519221df07abf8a8467d.tar.gz barebox-bb7fff04afdddaa63c2f519221df07abf8a8467d.tar.xz |
ARM: move bootm code to its own file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib/armlinux.c')
-rw-r--r-- | arch/arm/lib/armlinux.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index 15b92f9156..a37f7108a8 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -232,86 +232,6 @@ void start_linux(void *adr, int swap, struct image_data *data) kernel(0, armlinux_architecture, armlinux_bootparams); } -#ifdef CONFIG_CMD_BOOTM -static int do_bootm_linux(struct image_data *data) -{ - void (*theKernel)(int zero, int arch, void *params); - image_header_t *os_header = &data->os->header; - - if (image_get_type(os_header) == IH_TYPE_MULTI) { - printf("Multifile images not handled at the moment\n"); - return -1; - } - - if (armlinux_architecture == 0) { - printf("arm architecture not set. Please specify with -a option\n"); - return -1; - } - - if (!armlinux_bootparams) { - printf("Bootparams not set. Please fix your board code\n"); - return -1; - } - - theKernel = (void *)image_get_ep(os_header); - - debug("## Transferring control to Linux (at address 0x%p) ...\n", - theKernel); - - if (relocate_image(data->os, (void *)image_get_load(os_header))) - return -1; - - if (data->initrd) - if (relocate_image(data->initrd, (void *)image_get_load(&data->initrd->header))) - return -1; - - /* we assume that the kernel is in place */ - printf("\nStarting kernel %s...\n\n", data->initrd ? "with initrd " : ""); - - start_linux(theKernel, 0, data); - - return -1; -} - -static int image_handle_cmdline_parse(struct image_data *data, int opt, - char *optarg) -{ - int ret = 1; - - switch (opt) { - case 'a': - armlinux_architecture = simple_strtoul(optarg, NULL, 0); - ret = 0; - break; - case 'R': - system_rev = simple_strtoul(optarg, NULL, 0); - ret = 0; - break; - default: - break; - } - - return ret; -} - -static struct image_handler handler = { - .cmdline_options = "a:R:", - .cmdline_parse = image_handle_cmdline_parse, - .help_string = " -a <arch> use architecture number <arch>\n" - " -R <system_rev> use system revison <system_rev>\n", - - .bootm = do_bootm_linux, - .image_type = IH_OS_LINUX, -}; - -static int armlinux_register_image_handler(void) -{ - return register_image_handler(&handler); -} - -late_initcall(armlinux_register_image_handler); -#endif /* CONFIG_CMD_BOOTM */ - #ifdef CONFIG_CMD_BOOTZ struct zimage_header { u32 unused[9]; |