summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-02-26 15:38:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2008-02-26 15:38:37 +0100
commit8d8f90036628581217e749827c8008dcb78c6cfc (patch)
tree279c7aac659d47d3862a83c2b3e69ff76067847e /arch/arm
parent066ac7abdbc814d272c294c47b0acc4a642da061 (diff)
downloadbarebox-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')
-rw-r--r--arch/arm/Kconfig12
-rw-r--r--arch/arm/lib/armlinux.c38
2 files changed, 29 insertions, 21 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ac48d3d706..62d0ead6f6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -10,18 +10,6 @@ config ARCH_TEXT_BASE
default 0xa0000000 if MACH_PCM038
default 0xa0000000 if MACH_IMX27ADS
default 0x87f00000 if MACH_PCM037
-#
-#
-#
-config ARCH_NUMBER
- int
- default 160 if MACH_MX1ADS
- default 508 if MACH_SCB9328
- default 905 if MACH_NXDB500
- default 702 if MACH_ECO920
- default 1551 if MACH_PCM038
- default 846 if MACH_IMX27ADS
- default 1147 if MACH_PCM037
config BOARDINFO
default "Synertronixx scb9328" if MACH_SCB9328
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);