diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-12 10:43:33 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-15 10:26:03 +0100 |
commit | 296cd8d6380f775d0f7b59bd78d3421327ebbe9e (patch) | |
tree | 5c7f5eb5e99e9cc41babcda2675637710918bf66 /arch/arm | |
parent | 4c41e245cfaf9f85af31c26394cf6549392f89f5 (diff) | |
download | barebox-296cd8d6380f775d0f7b59bd78d3421327ebbe9e.tar.gz barebox-296cd8d6380f775d0f7b59bd78d3421327ebbe9e.tar.xz |
ARM: call start_linux directly with initrd start/size and oftree
whoever calls this function is not necessarily aware of a struct
image_data, so remove the dependency from the function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/armlinux.h | 3 | ||||
-rw-r--r-- | arch/arm/lib/armlinux.c | 20 | ||||
-rw-r--r-- | arch/arm/lib/bootm.c | 3 | ||||
-rw-r--r-- | arch/arm/lib/bootu.c | 8 | ||||
-rw-r--r-- | arch/arm/lib/bootz.c | 7 |
5 files changed, 27 insertions, 14 deletions
diff --git a/arch/arm/include/asm/armlinux.h b/arch/arm/include/asm/armlinux.h index ba3a424e26..9ca1e4b6db 100644 --- a/arch/arm/include/asm/armlinux.h +++ b/arch/arm/include/asm/armlinux.h @@ -29,6 +29,7 @@ static inline void armlinux_set_serial(u64 serial) struct image_data; -void start_linux(void *adr, int swap, struct image_data *data); +void start_linux(void *adr, int swap, unsigned long initrd_address, + unsigned long initrd_size, void *oftree); #endif /* __ARCH_ARMLINUX_H */ diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index bd9b72a8ac..1d210d1a4c 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -224,7 +224,8 @@ static void setup_end_tag (void) params->hdr.size = 0; } -static void setup_tags(struct image_data *data, int swap) +static void setup_tags(unsigned long initrd_address, + unsigned long initrd_size, int swap) { const char *commandline = getenv("bootargs"); @@ -232,8 +233,8 @@ static void setup_tags(struct image_data *data, int swap) setup_memory_tags(); setup_commandline_tag(commandline, swap); - if (data && (data->initrd_size > 0)) - setup_initrd_tag(data->initrd_address, data->initrd_size); + if (initrd_size) + setup_initrd_tag(initrd_address, initrd_size); setup_revision_tag(); setup_serial_tag(); @@ -249,17 +250,16 @@ void armlinux_set_bootparams(void *params) armlinux_bootparams = params; } -void start_linux(void *adr, int swap, struct image_data *data) +void start_linux(void *adr, int swap, unsigned long initrd_address, + unsigned long initrd_size, void *oftree) { void (*kernel)(int zero, int arch, void *params) = adr; void *params = NULL; -#ifdef CONFIG_OFTREE - params = of_get_fixed_tree(); - if (params) + + if (oftree) { printf("booting Linux kernel with devicetree\n"); -#endif - if (!params) { - setup_tags(data, swap); + } else { + setup_tags(initrd_address, initrd_size, swap); params = armlinux_bootparams; } diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 031a2698ec..1de22bf81c 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -31,7 +31,8 @@ static int do_bootm_linux(struct image_data *data) /* we assume that the kernel is in place */ printf("\nStarting kernel %s...\n\n", data->initrd ? "with initrd " : ""); - start_linux(theKernel, 0, data); + start_linux((void *)theKernel, 0, data->initrd_address, data->initrd_size, + data->oftree); return -1; } diff --git a/arch/arm/lib/bootu.c b/arch/arm/lib/bootu.c index e97ded0e47..89d793af9a 100644 --- a/arch/arm/lib/bootu.c +++ b/arch/arm/lib/bootu.c @@ -3,12 +3,14 @@ #include <fs.h> #include <fcntl.h> #include <errno.h> +#include <of.h> #include <asm/armlinux.h> static int do_bootu(struct command *cmdtp, int argc, char *argv[]) { int fd; void *kernel = NULL; + void *oftree = NULL; if (argc != 2) { barebox_cmd_usage(cmdtp); @@ -22,7 +24,11 @@ static int do_bootu(struct command *cmdtp, int argc, char *argv[]) if (!kernel) kernel = (void *)simple_strtoul(argv[1], NULL, 0); - start_linux(kernel, 0, NULL); +#ifdef CONFIG_OFTREE + oftree = of_get_fixed_tree(); +#endif + + start_linux(kernel, 0, 0, 0, oftree); return 1; } diff --git a/arch/arm/lib/bootz.c b/arch/arm/lib/bootz.c index 956ea82862..40facf6776 100644 --- a/arch/arm/lib/bootz.c +++ b/arch/arm/lib/bootz.c @@ -1,6 +1,7 @@ #include <common.h> #include <command.h> #include <fs.h> +#include <of.h> #include <fcntl.h> #include <errno.h> #include <malloc.h> @@ -25,6 +26,7 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) int fd, ret, swap = 0; struct zimage_header __header, *header; void *zimage; + void *oftree = NULL; u32 end; int usemap = 0; struct memory_bank *bank = list_first_entry(&memory_banks, struct memory_bank, list); @@ -105,8 +107,11 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) } printf("loaded zImage from %s with size %d\n", argv[1], end); +#ifdef CONFIG_OFTREE + oftree = of_get_fixed_tree(); +#endif - start_linux(zimage, swap, NULL); + start_linux(zimage, swap, 0, 0, oftree); return 0; |