}
-MIPS_MACHINE(MACH_AR71XX_AP83, "Atheros AP83", ap83_setup);
+MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup);
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);
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);
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)
{
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)
{
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)
{
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);
wp543_gpio_buttons);
}
-MIPS_MACHINE(MACH_AR71XX_WP543, "Compex WP543", wp543_setup);
+MIPS_MACHINE(AR71XX_MACH_WP543, "Compex WP543", wp543_setup);
ar71xx_add_device_uart();
ar71xx_add_device_wdt();
- mips_machine_setup();
+ mips_machine_setup(ar71xx_mach_type);
return 0;
}
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,
}
};
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)
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",
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)
(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;
#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);
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
*/
# 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
--- /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>
+ *
+#include <linux/init.h>
+#include <linux/list.h>
+
-+#include <asm/bootinfo.h>
-+
+#define MIPS_MACHINE_NAME_LEN 64
+
+struct mips_machine {
+};
+
+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];
+
+ 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;
+ }
+
# 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
--- /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>
+ *
+#include <linux/init.h>
+#include <linux/list.h>
+
-+#include <asm/bootinfo.h>
-+
+#define MIPS_MACHINE_NAME_LEN 64
+
+struct mips_machine {
+};
+
+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];
+
+ 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;
+ }
+
+
--- 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
--- 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