diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-02-26 15:38:37 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-02-26 15:38:37 +0100 |
commit | 8d8f90036628581217e749827c8008dcb78c6cfc (patch) | |
tree | 279c7aac659d47d3862a83c2b3e69ff76067847e /arch/arm/lib/armlinux.c | |
parent | 066ac7abdbc814d272c294c47b0acc4a642da061 (diff) | |
download | barebox-8d8f90036628581217e749827c8008dcb78c6cfc.tar.gz barebox-8d8f90036628581217e749827c8008dcb78c6cfc.tar.xz |
[ARM] Remove CONFIG_ARCH_NUMBER from Kconfig system. Putting too many
values into kconfig which are not user configurable at all only
encourages people to put even more stuff in there. This is not
good because people tend to have board patches lying around and
these patches won't apply regularly if they all change the same
file (arch/arm/Kconfig)
Instead, introduce a function armlinux_set_architecture() which
everyone can call during board setup.
Similarly introduce armlinux_set_bootparams() for the boot
parameter pointer.
Diffstat (limited to 'arch/arm/lib/armlinux.c')
-rw-r--r-- | arch/arm/lib/armlinux.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index f5dd4854a5..ed40846111 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -108,12 +108,22 @@ void __setup_serial_tag(struct tag **tmp); # define SHOW_BOOT_PROGRESS(arg) #endif -static int arm_architecture = CONFIG_ARCH_NUMBER; +static int armlinux_architecture = 0; +static void *armlinux_bootparams = NULL; -int -do_bootm_linux(struct image_data *data) +void armlinux_set_bootparams(void *params) { - void (*theKernel)(int zero, int arch, uint params); + armlinux_bootparams = params; +} + +void armlinux_set_architecture(int architecture) +{ + armlinux_architecture = architecture; +} + +int do_bootm_linux(struct image_data *data) +{ + void (*theKernel)(int zero, int arch, void *params); image_header_t *os_header = &data->os->header; const char *commandline = getenv ("bootargs"); @@ -122,10 +132,20 @@ do_bootm_linux(struct image_data *data) 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; + } + printf("commandline: %s\n" - "arch_number: %d\n", commandline, arm_architecture); + "arch_number: %d\n", commandline, armlinux_architecture); - theKernel = (void (*)(int, int, uint))ntohl((unsigned long)(os_header->ih_ep)); + theKernel = (void (*)(int, int, void *))ntohl((unsigned long)(os_header->ih_ep)); debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong) theKernel); @@ -149,7 +169,7 @@ do_bootm_linux(struct image_data *data) printf ("\nStarting kernel ...\n\n"); cleanup_before_linux(); - theKernel (0, arm_architecture, CONFIG_BOOT_PARAMS); + theKernel (0, armlinux_architecture, armlinux_bootparams); return -1; } @@ -159,7 +179,7 @@ static int image_handle_cmdline_parse(struct image_data *data, int opt, { switch (opt) { case 'a': - arm_architecture = simple_strtoul(optarg, NULL, 0); + armlinux_architecture = simple_strtoul(optarg, NULL, 0); return 0; default: return 1; @@ -185,7 +205,7 @@ late_initcall(armlinux_register_image_handler); void __setup_start_tag(void) { - params = (struct tag *)CONFIG_BOOT_PARAMS; + params = (struct tag *)armlinux_bootparams; params->hdr.tag = ATAG_CORE; params->hdr.size = tag_size(tag_core); |