[ar71xx] update mips_machine stuff
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 2 Dec 2008 21:17:31 +0000 (21:17 +0000)
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 2 Dec 2008 21:17:31 +0000 (21:17 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13488 3c298f89-4303-0410-b956-a3cf2f4a3e73

13 files changed:
target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
target/linux/ar71xx/patches-2.6.26/001-ar71xx_core.patch
target/linux/ar71xx/patches-2.6.26/900-mips_multi_machine_support.patch
target/linux/ar71xx/patches-2.6.27/001-ar71xx_core.patch
target/linux/ar71xx/patches-2.6.27/900-mips_multi_machine_support.patch

index 1ca847b..23d245f 100644 (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);
index 0e22bf5..d1e2244 100644 (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);
index 55fc61c..e0664fd 100644 (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);
index 956f959..864de88 100644 (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);
 
index c1fe33e..5295901 100644 (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);
index 09e6b2b..e41fcd6 100644 (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;
 }
 
index ad6a3a4..c77d418 100644 (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;
index a5d26e7..3fc67c3 100644 (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);
 
index e9a69cd..78cf1ca 100644 (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
  */
index c5871c8..0ead6d2 100644 (file)
  # 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
index abcdfb5..331ae4c 100644 (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];
 +
 +      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;
 +      }
 +
index 1b1368b..bba83bc 100644 (file)
  # 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
index dced430..e1fc84f 100644 (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];
 +
 +      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
  
This page took 0.055077 seconds and 4 git commands to generate.