update mips_machine stuff

SVN-Revision: 13488
This commit is contained in:
Gabor Juhos 2008-12-02 21:17:31 +00:00
parent 33c19a498a
commit 962170b748
13 changed files with 44 additions and 77 deletions

View file

@ -58,4 +58,4 @@ static void __init ap83_setup(void)
}
MIPS_MACHINE(MACH_AR71XX_AP83, "Atheros AP83", ap83_setup);
MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup);

View file

@ -36,4 +36,4 @@ static void __init aw_nr580_setup(void)
ARRAY_SIZE(aw_nr580_spi_info));
}
MIPS_MACHINE(MACH_AR71XX_AW_NR580, "AzureWave AW-NR580", aw_nr580_setup);
MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AzureWave AW-NR580", aw_nr580_setup);

View file

@ -66,4 +66,4 @@ static void __init ar71xx_generic_init(void)
ar71xx_generic_pci_irqs);
}
MIPS_MACHINE(MACH_AR71XX_GENERIC, "Generic AR71xx board", ar71xx_generic_init);
MIPS_MACHINE(AR71XX_MACH_GENERIC, "Generic AR71xx board", ar71xx_generic_init);

View file

@ -173,7 +173,7 @@ static void __init rb411_setup(void)
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
MIPS_MACHINE(MACH_AR71XX_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);
MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);
static void __init rb433_setup(void)
{
@ -204,7 +204,7 @@ static void __init rb433_setup(void)
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
MIPS_MACHINE(MACH_AR71XX_RB_433, "MikroTik RouterBOARD 433/AH", rb433_setup);
MIPS_MACHINE(AR71XX_MACH_RB_433, "MikroTik RouterBOARD 433/AH", rb433_setup);
static void __init rb450_setup(void)
{
@ -233,7 +233,7 @@ static void __init rb450_setup(void)
platform_device_register(&rb4xx_nand_device);
}
MIPS_MACHINE(MACH_AR71XX_RB_450, "MikroTik RouterBOARD 450", rb450_setup);
MIPS_MACHINE(AR71XX_MACH_RB_450, "MikroTik RouterBOARD 450", rb450_setup);
static void __init rb493_setup(void)
{
@ -264,5 +264,5 @@ static void __init rb493_setup(void)
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
MIPS_MACHINE(MACH_AR71XX_RB_493, "MikroTik RouterBOARD 493/AH", rb493_setup);
MIPS_MACHINE(AR71XX_MACH_RB_493, "MikroTik RouterBOARD 493/AH", rb493_setup);

View file

@ -114,4 +114,4 @@ static void __init wp543_setup(void)
wp543_gpio_buttons);
}
MIPS_MACHINE(MACH_AR71XX_WP543, "Compex WP543", wp543_setup);
MIPS_MACHINE(AR71XX_MACH_WP543, "Compex WP543", wp543_setup);

View file

@ -569,7 +569,7 @@ static int __init ar71xx_machine_setup(void)
ar71xx_add_device_uart();
ar71xx_add_device_wdt();
mips_machine_setup();
mips_machine_setup(ar71xx_mach_type);
return 0;
}

View file

@ -33,22 +33,22 @@ static char **ar71xx_prom_envp __initdata;
static struct board_rec boards[] __initdata = {
{
.name = "411",
.mach_type = MACH_AR71XX_RB_411,
.mach_type = AR71XX_MACH_RB_411,
}, {
.name = "433",
.mach_type = MACH_AR71XX_RB_433,
.mach_type = AR71XX_MACH_RB_433,
}, {
.name = "450",
.mach_type = MACH_AR71XX_RB_450,
.mach_type = AR71XX_MACH_RB_450,
}, {
.name = "493",
.mach_type = MACH_AR71XX_RB_493,
.mach_type = AR71XX_MACH_RB_493,
}, {
.name = "AW-NR580",
.mach_type = MACH_AR71XX_AW_NR580,
.mach_type = AR71XX_MACH_AW_NR580,
}, {
.name = "AP83",
.mach_type = MACH_AR71XX_AP83,
.mach_type = AR71XX_MACH_AP83,
}
};
@ -96,7 +96,7 @@ static __init unsigned long find_board_byname(char *name)
if (strcmp(name, boards[i].name) == 0)
return boards[i].mach_type;
return MACH_AR71XX_GENERIC;
return AR71XX_MACH_GENERIC;
}
static int ar71xx_prom_init_myloader(void)
@ -109,7 +109,7 @@ static int ar71xx_prom_init_myloader(void)
switch (mylo->did) {
case DEVID_COMPEX_WP543:
mips_machtype = MACH_AR71XX_WP543;
ar71xx_mach_type = AR71XX_MACH_WP543;
break;
default:
printk(KERN_WARNING "prom: unknown device id: %x\n",
@ -132,7 +132,7 @@ static void ar71xx_prom_init_generic(void)
if (!p)
p = ar71xx_prom_getargv("board");
if (p)
mips_machtype = find_board_byname(p);
ar71xx_mach_type = find_board_byname(p);
p = ar71xx_prom_getenv("ethaddr");
if (!p)
@ -148,7 +148,7 @@ void __init prom_init(void)
(unsigned int)fw_arg0, (unsigned int)fw_arg1,
(unsigned int)fw_arg2, (unsigned int)fw_arg3);
mips_machtype = MACH_AR71XX_GENERIC;
ar71xx_mach_type = AR71XX_MACH_GENERIC;
if (ar71xx_prom_init_myloader())
return;

View file

@ -35,6 +35,8 @@
#define AR71XX_MEM_SIZE_MIN 0x0200000
#define AR71XX_MEM_SIZE_MAX 0x8000000
unsigned long ar71xx_mach_type;
u32 ar71xx_cpu_freq;
EXPORT_SYMBOL_GPL(ar71xx_cpu_freq);

View file

@ -103,6 +103,17 @@ enum ar71xx_soc_type {
extern enum ar71xx_soc_type ar71xx_soc;
extern unsigned long ar71xx_mach_type;
#define AR71XX_MACH_GENERIC 0
#define AR71XX_MACH_WP543 1 /* Compex WP543 */
#define AR71XX_MACH_RB_411 2 /* MikroTik RouterBOARD 411/411A/411AH */
#define AR71XX_MACH_RB_433 3 /* MikroTik RouterBOARD 433/433AH */
#define AR71XX_MACH_RB_450 4 /* MikroTik RouterBOARD 450 */
#define AR71XX_MACH_RB_493 5 /* Mikrotik RouterBOARD 493/493AH */
#define AR71XX_MACH_AW_NR580 6 /* AzureWave AW-NR580 */
#define AR71XX_MACH_AP83 7 /* Atheros AP83 */
/*
* PLL block
*/

View file

@ -14,27 +14,6 @@
# temporary until string.h is fixed
cflags-y += -ffreestanding
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -79,6 +79,18 @@
#define MACH_LASAT_200 1 /* Masquerade PRO/SP200 */
/*
+ * Valid machtype for Atheros AR71xx based boards
+ */
+#define MACH_AR71XX_GENERIC 0
+#define MACH_AR71XX_WP543 1 /* Compex WP543 */
+#define MACH_AR71XX_RB_411 2 /* MikroTik RouterBOARD 411/411A/411AH */
+#define MACH_AR71XX_RB_433 3 /* MikroTik RouterBOARD 433/433AH */
+#define MACH_AR71XX_RB_450 4 /* MikroTik RouterBOARD 450 */
+#define MACH_AR71XX_RB_493 5 /* Mikrotik RouterBOARD 493/493AH */
+#define MACH_AR71XX_AW_NR580 6 /* AzureWave AW-NR580 */
+#define MACH_AR71XX_AP83 7 /* Atheros AP83 */
+
+/*
* Valid machtype for group NEC EMMA2RH
*/
#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -21,6 +21,24 @@ choice

View file

@ -1,6 +1,6 @@
--- /dev/null
+++ b/include/asm-mips/mips_machine.h
@@ -0,0 +1,49 @@
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
+ *
@ -16,8 +16,6 @@
+#include <linux/init.h>
+#include <linux/list.h>
+
+#include <asm/bootinfo.h>
+
+#define MIPS_MACHINE_NAME_LEN 64
+
+struct mips_machine {
@ -28,7 +26,7 @@
+};
+
+void mips_machine_register(struct mips_machine *) __init;
+void mips_machine_setup(void) __init;
+void mips_machine_setup(unsigned long machtype) __init;
+
+extern unsigned char mips_machine_name[MIPS_MACHINE_NAME_LEN];
+
@ -90,14 +88,14 @@
+ list_add_tail(&mach->list, &mips_machines);
+}
+
+void __init mips_machine_setup(void)
+void __init mips_machine_setup(unsigned long machtype)
+{
+ struct mips_machine *mach;
+
+ mach = mips_machine_find(mips_machtype);
+ mach = mips_machine_find(machtype);
+ if (!mach) {
+ printk(KERN_ALERT "MIPS: no machine registered for "
+ "machtype %lu\n", mips_machtype);
+ "machtype %lu\n", machtype);
+ return;
+ }
+

View file

@ -14,27 +14,6 @@
# temporary until string.h is fixed
cflags-y += -ffreestanding
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -57,6 +57,18 @@
#define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */
#define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */
+/*
+ * Valid machtype for Atheros AR71xx based boards
+ */
+#define MACH_AR71XX_GENERIC 0
+#define MACH_AR71XX_WP543 1 /* Compex WP543 */
+#define MACH_AR71XX_RB_411 2 /* MikroTik RouterBOARD 411/411A/411AH */
+#define MACH_AR71XX_RB_433 3 /* MikroTik RouterBOARD 433/433AH */
+#define MACH_AR71XX_RB_450 4 /* MikroTik RouterBOARD 450 */
+#define MACH_AR71XX_RB_493 5 /* MikroTik RouterBOARD 493 */
+#define MACH_AR71XX_AW_NR580 6 /* AzureWave AW-NR580 */
+#define MACH_AR71XX_AP83 7 /* Atheros AP83 */
+
#define CL_SIZE COMMAND_LINE_SIZE
extern char *system_type;
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -22,6 +22,23 @@ choice

View file

@ -1,6 +1,6 @@
--- /dev/null
+++ b/include/asm-mips/mips_machine.h
@@ -0,0 +1,49 @@
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
+ *
@ -16,8 +16,6 @@
+#include <linux/init.h>
+#include <linux/list.h>
+
+#include <asm/bootinfo.h>
+
+#define MIPS_MACHINE_NAME_LEN 64
+
+struct mips_machine {
@ -28,7 +26,7 @@
+};
+
+void mips_machine_register(struct mips_machine *) __init;
+void mips_machine_setup(void) __init;
+void mips_machine_setup(unsigned long machtype) __init;
+
+extern unsigned char mips_machine_name[MIPS_MACHINE_NAME_LEN];
+
@ -90,14 +88,14 @@
+ list_add_tail(&mach->list, &mips_machines);
+}
+
+void __init mips_machine_setup(void)
+void __init mips_machine_setup(unsigned long machtype)
+{
+ struct mips_machine *mach;
+
+ mach = mips_machine_find(mips_machtype);
+ mach = mips_machine_find(machtype);
+ if (!mach) {
+ printk(KERN_ALERT "MIPS: no machine registered for "
+ "machtype %lu\n", mips_machtype);
+ "machtype %lu\n", machtype);
+ return;
+ }
+
@ -113,7 +111,7 @@
+
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -83,6 +83,7 @@ obj-$(CONFIG_GPIO_TXX9) += gpio_txx9.o
@@ -86,6 +86,7 @@ obj-$(CONFIG_GPIO_TXX9) += gpio_txx9.o
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
@ -123,7 +121,7 @@
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -789,6 +789,9 @@ config MYLOADER
@@ -858,6 +858,9 @@ config MIPS_DISABLE_OBSOLETE_IDE
config SYNC_R4K
bool