[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.
This commit is contained in:
parent
066ac7abdb
commit
8d8f900366
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
printf("commandline: %s\n"
|
||||
"arch_number: %d\n", commandline, arm_architecture);
|
||||
if (armlinux_architecture == 0) {
|
||||
printf("arm architecture not set. Please specify with -a option\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
theKernel = (void (*)(int, int, uint))ntohl((unsigned long)(os_header->ih_ep));
|
||||
if (!armlinux_bootparams) {
|
||||
printf("Bootparams not set. Please fix your board code\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("commandline: %s\n"
|
||||
"arch_number: %d\n", commandline, armlinux_architecture);
|
||||
|
||||
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);
|
||||
|
|
|
@ -27,14 +27,12 @@
|
|||
#include <dm9161.h>
|
||||
#include <miiphy.h>
|
||||
#include <splash.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <s1d13706fb.h>
|
||||
#include <net.h>
|
||||
#include <cfi_flash.h>
|
||||
#include <init.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/*
|
||||
* Miscelaneous platform dependent initialisations
|
||||
*/
|
||||
|
@ -73,6 +71,9 @@ static int devices_init (void)
|
|||
register_device(&sdram_dev);
|
||||
register_device(&at91_ath_dev);
|
||||
|
||||
armlinux_set_bootparams((void *)(PHYS_SDRAM + 0x100));
|
||||
armlinux_set_architecture(MACH_TYPE_ECO920);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <init.h>
|
||||
#include <environment.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <asm/io.h>
|
||||
#include <fec.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
|
@ -136,6 +137,9 @@ static int pcm038_devices_init(void)
|
|||
dev_add_partition(&cfi_dev, 0x20000, 0x20000, PARTITION_FIXED, "env");
|
||||
dev_protect(&cfi_dev, 0x20000, 0, 1);
|
||||
|
||||
armlinux_set_bootparams((void *)0xa0000100);
|
||||
armlinux_set_architecture(MACH_TYPE_MX27ADS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <environment.h>
|
||||
#include <asm/arch/netx-regs.h>
|
||||
#include <partition.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <fs.h>
|
||||
#include <fcntl.h>
|
||||
#include <asm/arch/netx-eth.h>
|
||||
|
@ -81,6 +82,9 @@ static int netx_devices_init(void) {
|
|||
/* Do not overwrite primary env for now */
|
||||
dev_add_partition(&cfi_dev, 0xc0000, 0x80000, PARTITION_FIXED, "env");
|
||||
|
||||
armlinux_set_bootparams((void *)0x80000100);
|
||||
armlinux_set_architecture(MACH_TYPE_NXDB500);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <driver.h>
|
||||
#include <environment.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/io.h>
|
||||
#include <partition.h>
|
||||
|
@ -123,6 +124,9 @@ static int imx31_devices_init(void)
|
|||
|
||||
register_device(&sdram_dev);
|
||||
|
||||
armlinux_set_bootparams((void *)0x08000100);
|
||||
armlinux_set_architecture(1147);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <asm/arch/imx-regs.h>
|
||||
#include <fec.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <partition.h>
|
||||
#include <fs.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -100,6 +101,9 @@ static int pcm038_devices_init(void)
|
|||
dev_add_partition(&cfi_dev, 0x20000, 0x20000, PARTITION_FIXED, "env");
|
||||
dev_protect(&cfi_dev, 0x20000, 0, 1);
|
||||
|
||||
armlinux_set_bootparams((void *)0xa0000100);
|
||||
armlinux_set_architecture(MACH_TYPE_PCM038);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <init.h>
|
||||
#include <environment.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/io.h>
|
||||
#include <partition.h>
|
||||
|
@ -95,6 +96,9 @@ static int scb9328_devices_init(void) {
|
|||
dev_add_partition(&cfi_dev, 0x40000, 0x20000, PARTITION_FIXED, "env");
|
||||
dev_protect(&cfi_dev, 0x20000, 0, 1);
|
||||
|
||||
armlinux_set_bootparams((void *)0x08000100);
|
||||
armlinux_set_architecture(MACH_TYPE_SCB9328);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,9 +133,6 @@
|
|||
#define CFG_SPLASH 1
|
||||
#define CFG_S1D13706FB 1
|
||||
|
||||
#define CONFIG_ARCH_NUMBER MACH_TYPE_ECO920
|
||||
#define CONFIG_BOOT_PARAMS PHYS_SDRAM + 0x100
|
||||
|
||||
#define CFG_USB_OHCI_MAX_ROOT_PORTS 15
|
||||
#define CFG_USB_OHCI_SLOT_NAME "at91rm9200"
|
||||
#define LITTLEENDIAN
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#define CONFIG_BOOT_PARAMS 0xa0000100
|
||||
#define CFG_MALLOC_LEN (4096 << 10)
|
||||
#define CONFIG_STACKSIZE ( 120 << 10) /* stack size */
|
||||
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
#define CONFIG_BOOT_PARAMS 0x0 /* FIXME */
|
||||
#define CONFIG_ARCH_NUMBER 0 /* FIXME */
|
||||
#define CFG_MALLOC_LEN (4096 << 10)
|
||||
#define CONFIG_STACKSIZE (120<<10) /* stack size */
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#define CONFIG_BOOT_PARAMS 0x08000100
|
||||
|
||||
/*
|
||||
* Definitions related to passing arguments to kernel.
|
||||
*/
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
|
||||
/* FIXME: ugly....should be simply part of the BSP file */
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#define CONFIG_BOOT_PARAMS 0xa0000100
|
||||
#define CFG_MALLOC_LEN (4096 << 10)
|
||||
#define CONFIG_STACKSIZE ( 120 << 10) /* stack size */
|
||||
|
||||
|
|
|
@ -24,14 +24,6 @@
|
|||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#define CONFIG_BOOT_PARAMS 0x08000100
|
||||
|
||||
/*
|
||||
* Definitions related to passing arguments to kernel.
|
||||
*/
|
||||
|
||||
#define CFG_MALLOC_LEN (4096 << 10)
|
||||
|
||||
#define CONFIG_STACKSIZE (120<<10) /* stack size */
|
||||
|
|
Loading…
Reference in New Issue