summaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c2
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c2
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c2
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c8
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c2
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/platform.c2
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/prom.c20
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/setup.c2
-rw-r--r--target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h11
-rw-r--r--target/linux/ar71xx/patches-2.6.26/001-ar71xx_core.patch21
-rw-r--r--target/linux/ar71xx/patches-2.6.26/900-mips_multi_machine_support.patch12
-rw-r--r--target/linux/ar71xx/patches-2.6.27/001-ar71xx_core.patch21
-rw-r--r--target/linux/ar71xx/patches-2.6.27/900-mips_multi_machine_support.patch16
13 files changed, 44 insertions, 77 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c
index 1ca847b4b..23d245f9f 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c
@@ -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);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c
index 0e22bf5fe..d1e224429 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c
@@ -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);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c
index 55fc61c92..e0664fdec 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c
@@ -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);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
index 956f95904..864de882d 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
@@ -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);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
index c1fe33e16..52959017c 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
@@ -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);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
index 09e6b2b78..e41fcd646 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
@@ -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;
}
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
index ad6a3a49d..c77d4186f 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
@@ -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;
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
index a5d26e72c..3fc67c33d 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
@@ -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);
diff --git a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
index e9a69cd56..78cf1ca24 100644
--- a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
+++ b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
@@ -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
*/
diff --git a/target/linux/ar71xx/patches-2.6.26/001-ar71xx_core.patch b/target/linux/ar71xx/patches-2.6.26/001-ar71xx_core.patch
index c5871c8c5..0ead6d29b 100644
--- a/target/linux/ar71xx/patches-2.6.26/001-ar71xx_core.patch
+++ b/target/linux/ar71xx/patches-2.6.26/001-ar71xx_core.patch
@@ -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
diff --git a/target/linux/ar71xx/patches-2.6.26/900-mips_multi_machine_support.patch b/target/linux/ar71xx/patches-2.6.26/900-mips_multi_machine_support.patch
index abcdfb581..331ae4c27 100644
--- a/target/linux/ar71xx/patches-2.6.26/900-mips_multi_machine_support.patch
+++ b/target/linux/ar71xx/patches-2.6.26/900-mips_multi_machine_support.patch
@@ -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;
+ }
+
diff --git a/target/linux/ar71xx/patches-2.6.27/001-ar71xx_core.patch b/target/linux/ar71xx/patches-2.6.27/001-ar71xx_core.patch
index 1b1368bbc..bba83bcab 100644
--- a/target/linux/ar71xx/patches-2.6.27/001-ar71xx_core.patch
+++ b/target/linux/ar71xx/patches-2.6.27/001-ar71xx_core.patch
@@ -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
diff --git a/target/linux/ar71xx/patches-2.6.27/900-mips_multi_machine_support.patch b/target/linux/ar71xx/patches-2.6.27/900-mips_multi_machine_support.patch
index dced43021..e1fc84f65 100644
--- a/target/linux/ar71xx/patches-2.6.27/900-mips_multi_machine_support.patch
+++ b/target/linux/ar71xx/patches-2.6.27/900-mips_multi_machine_support.patch
@@ -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