ar71xx: update mips multi-machine stuff
authorGabor Juhos <juhosg@openwrt.org>
Fri, 1 Jan 2010 11:28:19 +0000 (11:28 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Fri, 1 Jan 2010 11:28:19 +0000 (11:28 +0000)
SVN-Revision: 18985

29 files changed:
target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c
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-dir-615-c1.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-825-b1.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-generic.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-mzk-w04nu.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-mzk-w300nh.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb42.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr1043nd.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wnr2000.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt400n.c
target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
target/linux/ar71xx/patches-2.6.30/400-mips-multi-machine-update.patch [new file with mode: 0644]
target/linux/ar71xx/patches-2.6.31/400-mips-multi-machine-update.patch [new file with mode: 0644]
target/linux/ar71xx/patches-2.6.32/400-mips-multi-machine-update.patch [new file with mode: 0644]

index a7b7026..6aee4dc 100644 (file)
@@ -545,3 +545,17 @@ void __init ar71xx_parse_mac_addr(char *mac_str)
                printk(KERN_DEBUG "ar71xx: failed to parse mac address "
                                "\"%s\"\n", mac_str);
 }
+
+static int __init ar71xx_ethaddr_setup(char *str)
+{
+       ar71xx_parse_mac_addr(str);
+       return 1;
+}
+__setup("ethaddr=", ar71xx_ethaddr_setup);
+
+static int __init ar71xx_kmac_setup(char *str)
+{
+       ar71xx_parse_mac_addr(str);
+       return 1;
+}
+__setup("kmac=", ar71xx_kmac_setup);
index 1b0b06c..daf7dcf 100644 (file)
@@ -138,4 +138,4 @@ static void __init ap81_setup(void)
        ar913x_add_device_wmac(eeprom, NULL);
 }
 
-MIPS_MACHINE(AR71XX_MACH_AP81, "Atheros AP81", ap81_setup);
+MIPS_MACHINE(AR71XX_MACH_AP81, "AP81", "Atheros AP81", ap81_setup);
index e72574a..cd4746b 100644 (file)
@@ -264,4 +264,4 @@ static void __init ap83_setup(void)
        }
 }
 
-MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup);
+MIPS_MACHINE(AR71XX_MACH_AP83, "AP83", "Atheros AP83", ap83_setup);
index 6052e37..5cee4c6 100644 (file)
@@ -98,4 +98,5 @@ static void __init aw_nr580_setup(void)
                                        aw_nr580_gpio_buttons);
 }
 
-MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AzureWave AW-NR580", aw_nr580_setup);
+MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AW-NR580", "AzureWave AW-NR580",
+            aw_nr580_setup);
index e3b6aab..d6f1fa7 100644 (file)
@@ -166,4 +166,5 @@ static void __init dir_615c1_setup(void)
        ar913x_add_device_wmac(eeprom, wlan_mac);
 }
 
-MIPS_MACHINE(AR71XX_MACH_DIR_615_C1, "D-Link DIR-615 rev. C1", dir_615c1_setup);
+MIPS_MACHINE(AR71XX_MACH_DIR_615_C1, "DIR-615-C1", "D-Link DIR-615 rev. C1",
+            dir_615c1_setup);
index 93a01fd..7762b5c 100644 (file)
@@ -183,4 +183,5 @@ static void __init dir825b1_setup(void)
                      (u8 *) KSEG1ADDR(DIR825B1_MAC_LOCATION_1));
 }
 
-MIPS_MACHINE(AR71XX_MACH_DIR_825_B1, "D-Link DIR-825 rev. B1", dir825b1_setup);
+MIPS_MACHINE(AR71XX_MACH_DIR_825_B1, "DIR-825-B1", "D-Link DIR-825 rev. B1",
+            dir825b1_setup);
index 4988205..8dfa640 100644 (file)
@@ -19,4 +19,5 @@ static void __init ar71xx_generic_init(void)
        /* Nothing to do */
 }
 
-MIPS_MACHINE(AR71XX_MACH_GENERIC, "Generic AR71xx board", ar71xx_generic_init);
+MIPS_MACHINE(AR71XX_MACH_GENERIC, "Generic", "Generic AR71xx board",
+            ar71xx_generic_init);
index bc75502..6af5dd4 100644 (file)
@@ -159,4 +159,5 @@ static void __init mzk_w04nu_setup(void)
        ar913x_add_device_wmac(eeprom, NULL);
 }
 
-MIPS_MACHINE(AR71XX_MACH_MZK_W04NU, "Planex MZK-W04NU", mzk_w04nu_setup);
+MIPS_MACHINE(AR71XX_MACH_MZK_W04NU, "MZK-W04NU", "Planex MZK-W04NU",
+            mzk_w04nu_setup);
index 0e55888..88a3bd1 100644 (file)
@@ -156,4 +156,5 @@ static void __init mzk_w300nh_setup(void)
        ar913x_add_device_wmac(eeprom, NULL);
 }
 
-MIPS_MACHINE(AR71XX_MACH_MZK_W300NH, "Planex MZK-W300NH", mzk_w300nh_setup);
+MIPS_MACHINE(AR71XX_MACH_MZK_W300NH, "MZK-W300NH", "Planex MZK-W300NH",
+            mzk_w300nh_setup);
index 0f70d95..44bf389 100644 (file)
@@ -69,4 +69,4 @@ static void __init pb42_init(void)
        pb42_pci_init();
 }
 
-MIPS_MACHINE(AR71XX_MACH_PB42, "Atheros PB42", pb42_init);
+MIPS_MACHINE(AR71XX_MACH_PB42, "PB42", "Atheros PB42", pb42_init);
index aad5d0a..7cace67 100644 (file)
@@ -205,4 +205,4 @@ static void __init pb44_init(void)
                                       pb44_gpio_buttons);
 }
 
-MIPS_MACHINE(AR71XX_MACH_PB44, "Atheros PB44", pb44_init);
+MIPS_MACHINE(AR71XX_MACH_PB44, "PB44", "Atheros PB44", pb44_init);
index 8b6f34e..ab3d65b 100644 (file)
@@ -183,7 +183,8 @@ static void __init rb411_setup(void)
        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_411, "411", "MikroTik RouterBOARD 411/A/AH",
+            rb411_setup);
 
 static void __init rb411u_setup(void)
 {
@@ -200,7 +201,8 @@ static void __init rb411u_setup(void)
        ar71xx_add_device_usb();
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_411U, "MikroTik RouterBOARD 411U", rb411u_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_411U, "411U", "MikroTik RouterBOARD 411U",
+            rb411u_setup);
 
 static void __init rb433_setup(void)
 {
@@ -223,7 +225,8 @@ static void __init rb433_setup(void)
        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_433, "MikroTik RouterBOARD 433/AH", rb433_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_433, "433", "MikroTik RouterBOARD 433/AH",
+            rb433_setup);
 
 static void __init rb433u_setup(void)
 {
@@ -231,7 +234,8 @@ static void __init rb433u_setup(void)
        ar71xx_add_device_usb();
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_433U, "MikroTik RouterBOARD 433UAH", rb433u_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_433U, "433U", "MikroTik RouterBOARD 433UAH",
+            rb433u_setup);
 
 static void __init rb450_generic_setup(int gige)
 {
@@ -257,14 +261,16 @@ static void __init rb450_setup(void)
        rb450_generic_setup(0);
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_450, "MikroTik RouterBOARD 450", rb450_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_450, "450", "MikroTik RouterBOARD 450",
+            rb450_setup);
 
 static void __init rb450g_setup(void)
 {
        rb450_generic_setup(1);
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_450G, "MikroTik RouterBOARD 450G", rb450g_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_450G, "450G", "MikroTik RouterBOARD 450G",
+            rb450g_setup);
 
 static void __init rb493_setup(void)
 {
@@ -287,4 +293,5 @@ static void __init rb493_setup(void)
        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
 }
 
-MIPS_MACHINE(AR71XX_MACH_RB_493, "MikroTik RouterBOARD 493/AH", rb493_setup);
+MIPS_MACHINE(AR71XX_MACH_RB_493, "493", "MikroTik RouterBOARD 493/AH",
+            rb493_setup);
index bb4cee6..c92cb00 100644 (file)
@@ -142,4 +142,5 @@ static void __init tew_632brp_setup(void)
        ar913x_add_device_wmac(eeprom, wlan_mac);
 }
 
-MIPS_MACHINE(AR71XX_MACH_TEW_632BRP, "TRENDnet TEW-632BRP", tew_632brp_setup);
+MIPS_MACHINE(AR71XX_MACH_TEW_632BRP, "TEW-632BRP", "TRENDnet TEW-632BRP",
+            tew_632brp_setup);
index 9c6f65e..79bb227 100644 (file)
@@ -133,4 +133,5 @@ static void __init tl_wr1043nd_setup(void)
        ar913x_add_device_wmac(eeprom, NULL);
 }
 
-MIPS_MACHINE(AR71XX_MACH_TL_WR1043ND, "TP-LINK TL-WR1043ND", tl_wr1043nd_setup);
+MIPS_MACHINE(AR71XX_MACH_TL_WR1043ND, "TL-WR1043ND", "TP-LINK TL-WR1043ND",
+            tl_wr1043nd_setup);
index ecedbb5..b2d33c0 100644 (file)
@@ -133,4 +133,5 @@ static void __init tl_wr741nd_setup(void)
 
        ap91_pci_init(ee, NULL);
 }
-MIPS_MACHINE(AR71XX_MACH_TL_WR741ND, "TP-LINK TL-WR741ND", tl_wr741nd_setup);
+MIPS_MACHINE(AR71XX_MACH_TL_WR741ND, "TL-WR741ND", "TP-LINK TL-WR741ND",
+            tl_wr741nd_setup);
index 10d00c4..3bc063a 100644 (file)
@@ -140,5 +140,5 @@ static void __init tl_wr841n_v1_setup(void)
        pb42_pci_init();
 }
 
-MIPS_MACHINE(AR71XX_MACH_TL_WR841N_V1, "TP-LINK TL-WR841N v1",
+MIPS_MACHINE(AR71XX_MACH_TL_WR841N_V1, "TL-WR841N-v1.5", "TP-LINK TL-WR841N v1",
             tl_wr841n_v1_setup);
index 7fe5a1c..af83116 100644 (file)
@@ -136,4 +136,5 @@ static void __init tl_wr941nd_setup(void)
        ar913x_add_device_wmac(eeprom, mac);
 }
 
-MIPS_MACHINE(AR71XX_MACH_TL_WR941ND, "TP-LINK TL-WR941ND", tl_wr941nd_setup);
+MIPS_MACHINE(AR71XX_MACH_TL_WR941ND, "TL-WR941ND", "TP-LINK TL-WR941ND",
+            tl_wr941nd_setup);
index 1a63b99..37151ab 100644 (file)
@@ -163,7 +163,11 @@ static void __init ubnt_rs_setup(void)
                                        ubnt_rs_leds_gpio);
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_RS, "Ubiquiti RouterStation", ubnt_rs_setup);
+MIPS_MACHINE(AR71XX_MACH_UBNT_RS, "UBNT-RS", "Ubiquiti RouterStation",
+            ubnt_rs_setup);
+
+MIPS_MACHINE(AR71XX_MACH_UBNT_AR71XX, "Ubiquiti AR71xx-based board",
+            "Ubiquiti RouterStation", ubnt_rs_setup);
 
 static void __init ubnt_rspro_setup(void)
 {
@@ -189,7 +193,7 @@ static void __init ubnt_rspro_setup(void)
                                        ubnt_rs_leds_gpio);
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_RSPRO, "Ubiquiti RouterStation Pro",
+MIPS_MACHINE(AR71XX_MACH_UBNT_RSPRO, "UBNT-RSPRO", "Ubiquiti RouterStation Pro",
             ubnt_rspro_setup);
 
 static void __init ubnt_lsx_setup(void)
@@ -197,7 +201,7 @@ static void __init ubnt_lsx_setup(void)
        ubnt_generic_setup();
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_LSX, "Ubiquiti LSX", ubnt_lsx_setup);
+MIPS_MACHINE(AR71XX_MACH_UBNT_LSX, "UBNT-LSX", "Ubiquiti LSX", ubnt_lsx_setup);
 
 #define UBNT_LSSR71_PHY_MASK   (1 << 1)
 
@@ -216,7 +220,8 @@ static void __init ubnt_lssr71_setup(void)
                                        ubnt_ls_sr71_leds_gpio);
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_LSSR71, "Ubiquiti LS-SR71", ubnt_lssr71_setup);
+MIPS_MACHINE(AR71XX_MACH_UBNT_LSSR71, "UBNT-LS-SR71", "Ubiquiti LS-SR71",
+            ubnt_lssr71_setup);
 
 static void __init ubnt_m_setup(void)
 {
@@ -255,8 +260,10 @@ static void __init ubnt_rocket_m_setup(void)
        ar71xx_add_device_usb();
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_BULLET_M, "Ubiquiti Bullet M", ubnt_m_setup);
-MIPS_MACHINE(AR71XX_MACH_UBNT_ROCKET_M, "Ubiquiti Rocket M", ubnt_rocket_m_setup);
+MIPS_MACHINE(AR71XX_MACH_UBNT_BULLET_M, "UBNT-BM", "Ubiquiti Bullet M",
+            ubnt_m_setup);
+MIPS_MACHINE(AR71XX_MACH_UBNT_ROCKET_M, "UBNT-RM", "Ubiquiti Rocket M",
+            ubnt_rocket_m_setup);
 
 /* TODO detect the second ethernet port and use one
    init function for all Ubiquiti MIMO series products */
@@ -275,4 +282,5 @@ static void __init ubnt_nano_m_setup(void)
        ar71xx_add_device_eth(1);
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_NANO_M, "Ubiquiti Nanostation M", ubnt_nano_m_setup);
+MIPS_MACHINE(AR71XX_MACH_UBNT_NANO_M, "UBNT-NM", "Ubiquiti Nanostation M",
+            ubnt_nano_m_setup);
index 4220e61..14cde55 100644 (file)
@@ -197,4 +197,5 @@ static void __init wndr3700_setup(void)
                      art + WNDR3700_WMAC1_MAC_OFFSET);
 }
 
-MIPS_MACHINE(AR71XX_MACH_WNDR3700, "NETGEAR WNDR3700", wndr3700_setup);
+MIPS_MACHINE(AR71XX_MACH_WNDR3700, "WNDR3700", "NETGEAR WNDR3700",
+            wndr3700_setup);
index c07619c..778e99d 100644 (file)
@@ -146,4 +146,4 @@ static void __init wnr2000_setup(void)
        ar913x_add_device_wmac(eeprom, NULL);
 }
 
-MIPS_MACHINE(AR71XX_MACH_WNR2000, "NETGEAR WNR2000", wnr2000_setup);
+MIPS_MACHINE(AR71XX_MACH_WNR2000, "WNR2000", "NETGEAR WNR2000", wnr2000_setup);
index d20800e..a2669f1 100644 (file)
@@ -96,4 +96,4 @@ static void __init wp543_setup(void)
                                        wp543_gpio_buttons);
 }
 
-MIPS_MACHINE(AR71XX_MACH_WP543, "Compex WP543", wp543_setup);
+MIPS_MACHINE(AR71XX_MACH_WP543, "WP543", "Compex WP543", wp543_setup);
index 2caddf8..9c85235 100644 (file)
@@ -154,4 +154,5 @@ static void __init wrt160nl_setup(void)
 
 }
 
-MIPS_MACHINE(AR71XX_MACH_WRT160NL, "Linksys WRT160NL", wrt160nl_setup);
+MIPS_MACHINE(AR71XX_MACH_WRT160NL, "WRT160NL", "Linksys WRT160NL",
+            wrt160nl_setup);
index a563268..005828f 100644 (file)
@@ -151,4 +151,4 @@ static void __init wrt400n_setup(void)
        /* TODO: PCI support */
 }
 
-MIPS_MACHINE(AR71XX_MACH_WRT400N, "Linksys WRT400N", wrt400n_setup);
+MIPS_MACHINE(AR71XX_MACH_WRT400N, "WRT400N", "Linksys WRT400N", wrt400n_setup);
index 34d7702..91907f4 100644 (file)
@@ -40,6 +40,7 @@ enum ar71xx_mach_type {
        AR71XX_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
        AR71XX_MACH_UBNT_LSX,   /* Ubiquiti LSX */
        AR71XX_MACH_UBNT_RS,    /* Ubiquiti RouterStation */
+       AR71XX_MACH_UBNT_AR71XX, /* Ubiquiti AR71xx-based board */
        AR71XX_MACH_UBNT_RSPRO, /* Ubiquiti RouterStation Pro */
        AR71XX_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
        AR71XX_MACH_UBNT_ROCKET_M, /* Ubiquiti Rocket M */
@@ -51,6 +52,4 @@ enum ar71xx_mach_type {
        AR71XX_MACH_WRT400N,    /* Linksys WRT400N */
 };
 
-extern enum ar71xx_mach_type ar71xx_mach;
-
 #endif /* _AR71XX_MACHTYPE_H */
index f522d1f..5b47d6b 100644 (file)
 
 #include <asm/mach-ar71xx/ar71xx.h>
 
-#include "machtype.h"
-#include "devices.h"
-
-struct board_rec {
-       char                    *name;
-       enum ar71xx_mach_type   mach_type;
-};
-
-static struct board_rec boards[] __initdata = {
-       {
-               .name           = "411",
-               .mach_type      = AR71XX_MACH_RB_411,
-       }, {
-               .name           = "411U",
-               .mach_type      = AR71XX_MACH_RB_411U,
-       }, {
-               .name           = "433",
-               .mach_type      = AR71XX_MACH_RB_433,
-       }, {
-               .name           = "433U",
-               .mach_type      = AR71XX_MACH_RB_433U,
-       }, {
-               .name           = "450",
-               .mach_type      = AR71XX_MACH_RB_450,
-       }, {
-               .name           = "450G",
-               .mach_type      = AR71XX_MACH_RB_450G,
-       }, {
-               .name           = "493",
-               .mach_type      = AR71XX_MACH_RB_493,
-       }, {
-               .name           = "AP81",
-               .mach_type      = AR71XX_MACH_AP81,
-       }, {
-               .name           = "AP83",
-               .mach_type      = AR71XX_MACH_AP83,
-       }, {
-               .name           = "AW-NR580",
-               .mach_type      = AR71XX_MACH_AW_NR580,
-       }, {
-               .name           = "DIR-825-B1",
-               .mach_type      = AR71XX_MACH_DIR_825_B1,
-       }, {
-               .name           = "TEW-632BRP",
-               .mach_type      = AR71XX_MACH_TEW_632BRP,
-       }, {
-               .name           = "DIR-615-C1",
-               .mach_type      = AR71XX_MACH_DIR_615_C1,
-       }, {
-               .name           = "TL-WR741ND",
-               .mach_type      = AR71XX_MACH_TL_WR741ND,
-       }, {
-               .name           = "TL-WR841N-v1.5",
-               .mach_type      = AR71XX_MACH_TL_WR841N_V1,
-       }, {
-               .name           = "TL-WR941ND",
-               .mach_type      = AR71XX_MACH_TL_WR941ND,
-       }, {
-               .name           = "TL-WR1043ND",
-               .mach_type      = AR71XX_MACH_TL_WR1043ND,
-       }, {
-               .name           = "UBNT-RS",
-               .mach_type      = AR71XX_MACH_UBNT_RS,
-       }, {
-               .name           = "UBNT-RSPRO",
-               .mach_type      = AR71XX_MACH_UBNT_RSPRO,
-       }, {
-               .name           = "Ubiquiti AR71xx-based board",
-               .mach_type      = AR71XX_MACH_UBNT_RS,
-       }, {
-               .name           = "UBNT-LS-SR71",
-               .mach_type      = AR71XX_MACH_UBNT_LSSR71,
-       }, {
-               .name           = "UBNT-LSX",
-               .mach_type      = AR71XX_MACH_UBNT_LSX,
-       }, {
-               .name           = "UBNT-BM",
-               .mach_type      = AR71XX_MACH_UBNT_BULLET_M,
-       }, {
-               .name           = "UBNT-RM",
-               .mach_type      = AR71XX_MACH_UBNT_ROCKET_M,
-       }, {
-               .name           = "UBNT-NM",
-               .mach_type      = AR71XX_MACH_UBNT_NANO_M,
-       }, {
-               .name           = "WNDR3700",
-               .mach_type      = AR71XX_MACH_WNDR3700,
-       }, {
-               .name           = "WNR2000",
-               .mach_type      = AR71XX_MACH_WNR2000,
-       }, {
-               .name           = "WRT160NL",
-               .mach_type      = AR71XX_MACH_WRT160NL,
-       }, {
-               .name           = "WP543",
-               .mach_type      = AR71XX_MACH_WP543,
-       }, {
-               .name           = "WRT400N",
-               .mach_type      = AR71XX_MACH_WRT400N,
-       }, {
-               .name           = "PB42",
-               .mach_type      = AR71XX_MACH_PB42,
-       }, {
-               .name           = "PB44",
-               .mach_type      = AR71XX_MACH_PB44,
-       }, {
-               .name           = "MZK-W300NH",
-               .mach_type      = AR71XX_MACH_MZK_W300NH,
-       }, {
-               .name           = "MZK-W04NU",
-               .mach_type      = AR71XX_MACH_MZK_W04NU,
-       }
-};
-
-static int __init ar71xx_board_setup(char *name)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(boards); i++)
-               if (strcmp(name, boards[i].name) == 0) {
-                       ar71xx_mach = boards[i].mach_type;
-                       break;
-               }
-
-       return 1;
-}
-__setup("board=", ar71xx_board_setup);
-
-static int __init ar71xx_ethaddr_setup(char *str)
-{
-       ar71xx_parse_mac_addr(str);
-       return 1;
-}
-__setup("ethaddr=", ar71xx_ethaddr_setup);
-
-static int __init ar71xx_kmac_setup(char *str)
-{
-       ar71xx_parse_mac_addr(str);
-       return 1;
-}
-__setup("kmac=", ar71xx_kmac_setup);
-
 static inline int is_valid_ram_addr(void *addr)
 {
        if (((u32) addr > KSEG0) &&
@@ -292,8 +150,6 @@ void __init prom_init(void)
                        (unsigned int)fw_arg2, (unsigned int)fw_arg3);
 
 
-       ar71xx_mach = AR71XX_MACH_GENERIC;
-
        if (ar71xx_prom_init_myloader())
                return;
 
index 7ea29ed..f235922 100644 (file)
@@ -32,8 +32,6 @@
 #define AR91XX_BASE_FREQ       5000000
 #define AR724X_BASE_FREQ       5000000
 
-enum ar71xx_mach_type ar71xx_mach;
-
 u32 ar71xx_cpu_freq;
 EXPORT_SYMBOL_GPL(ar71xx_cpu_freq);
 
@@ -276,6 +274,8 @@ void __init plat_time_init(void)
        mips_hpt_frequency = ar71xx_cpu_freq / 2;
 }
 
+__setup("board=", mips_machtype_setup);
+
 static int __init ar71xx_machine_setup(void)
 {
        ar71xx_gpio_init();
@@ -283,7 +283,7 @@ static int __init ar71xx_machine_setup(void)
        ar71xx_add_device_uart();
        ar71xx_add_device_wdt();
 
-       mips_machine_setup(ar71xx_mach);
+       mips_machine_setup();
        return 0;
 }
 
diff --git a/target/linux/ar71xx/patches-2.6.30/400-mips-multi-machine-update.patch b/target/linux/ar71xx/patches-2.6.30/400-mips-multi-machine-update.patch
new file mode 100644 (file)
index 0000000..62903c8
--- /dev/null
@@ -0,0 +1,127 @@
+--- a/arch/mips/kernel/mips_machine.c
++++ b/arch/mips/kernel/mips_machine.c
+@@ -7,12 +7,13 @@
+  *
+  */
+ #include <linux/mm.h>
++#include <linux/string.h>
+ #include <asm/mips_machine.h>
+-#include <asm/bootinfo.h>
+ static struct list_head mips_machines __initdata =
+               LIST_HEAD_INIT(mips_machines);
++static char *mips_machid __initdata;
+ char *mips_machine_name = "Unknown";
+@@ -55,20 +56,64 @@ void __init mips_machine_set_name(char *
+       }
+ }
+-void __init mips_machine_setup(unsigned long machtype)
++void __init mips_machine_setup(void)
+ {
+       struct mips_machine *mach;
+-      mach = mips_machine_find(machtype);
++      mach = mips_machine_find(mips_machtype);
+       if (!mach) {
+-              printk(KERN_ALERT "MIPS: no machine registered for "
+-                      "machtype %lu\n", machtype);
++              printk(KERN_WARNING "MIPS: no machine registered for "
++                      "machtype %lu\n", mips_machtype);
+               return;
+       }
+       mips_machine_set_name(mach->mach_name);
+-      printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
++      printk(KERN_NOTICE "MIPS: machine is %s\n", mips_machine_name);
+       if (mach->mach_setup)
+               mach->mach_setup();
+ }
++
++int __init mips_machtype_setup(char *id)
++{
++      if (mips_machid == NULL)
++              mips_machid = id;
++
++      return 1;
++}
++
++__setup("machtype=", mips_machtype_setup);
++
++static int __init mips_machtype_init(void)
++{
++      struct list_head *this;
++      struct mips_machine *mach;
++
++      if (mips_machid == NULL)
++              return 0;
++
++      list_for_each(this, &mips_machines) {
++              mach = list_entry(this, struct mips_machine, list);
++              if (strncmp(mach->mach_id, mips_machid,
++                          strlen(mips_machid)) == 0
++              ) {
++                      mips_machtype = mach->mach_type;
++                      return 0;
++              }
++      }
++
++      printk(KERN_WARNING
++             "MIPS: no machine found for id: '%s', registered machines:\n",
++             mips_machid);
++      printk(KERN_WARNING "%32s %s\n", "id", "name");
++
++      list_for_each(this, &mips_machines) {
++              mach = list_entry(this, struct mips_machine, list);
++              printk(KERN_WARNING "%32s %s\n",
++                     mach->mach_id, mach->mach_name);
++      }
++
++      return 0;
++}
++
++core_initcall(mips_machtype_init);
+--- a/include/asm-mips/mips_machine.h
++++ b/include/asm-mips/mips_machine.h
+@@ -13,24 +13,32 @@
+ #include <linux/init.h>
+ #include <linux/list.h>
++#include <asm/bootinfo.h>
++
+ struct mips_machine {
+       unsigned long           mach_type;
+-      void                    (*mach_setup)(void);
++      char                    *mach_id;
+       char                    *mach_name;
++      void                    (*mach_setup)(void);
+       struct list_head        list;
+ };
+ void mips_machine_register(struct mips_machine *) __init;
+-void mips_machine_setup(unsigned long machtype) __init;
++void mips_machine_setup(void) __init;
++int  mips_machtype_setup(char *id) __init;
+ void mips_machine_set_name(char *name) __init;
+ extern char *mips_machine_name;
+-#define MIPS_MACHINE(_type, _name, _setup)                    \
+-static char machine_name_##_type[] __initdata = _name;                \
+-static struct mips_machine machine_##_type __initdata =               \
++#define MIPS_MACHINE(_type, _id, _name, _setup)               \
++static char machine_name_##_type[] __initconst                        \
++                      __aligned(1) = _name;                   \
++static char machine_id_##_type[] __initconst                  \
++                      __aligned(1) = _id;                     \
++static struct mips_machine machine_##_type __initconst =      \
+ {                                                             \
+       .mach_type      = _type,                                \
++      .mach_id        = machine_id_##_type,                   \
+       .mach_name      = machine_name_##_type,                 \
+       .mach_setup     = _setup,                               \
+ };                                                            \
diff --git a/target/linux/ar71xx/patches-2.6.31/400-mips-multi-machine-update.patch b/target/linux/ar71xx/patches-2.6.31/400-mips-multi-machine-update.patch
new file mode 100644 (file)
index 0000000..62903c8
--- /dev/null
@@ -0,0 +1,127 @@
+--- a/arch/mips/kernel/mips_machine.c
++++ b/arch/mips/kernel/mips_machine.c
+@@ -7,12 +7,13 @@
+  *
+  */
+ #include <linux/mm.h>
++#include <linux/string.h>
+ #include <asm/mips_machine.h>
+-#include <asm/bootinfo.h>
+ static struct list_head mips_machines __initdata =
+               LIST_HEAD_INIT(mips_machines);
++static char *mips_machid __initdata;
+ char *mips_machine_name = "Unknown";
+@@ -55,20 +56,64 @@ void __init mips_machine_set_name(char *
+       }
+ }
+-void __init mips_machine_setup(unsigned long machtype)
++void __init mips_machine_setup(void)
+ {
+       struct mips_machine *mach;
+-      mach = mips_machine_find(machtype);
++      mach = mips_machine_find(mips_machtype);
+       if (!mach) {
+-              printk(KERN_ALERT "MIPS: no machine registered for "
+-                      "machtype %lu\n", machtype);
++              printk(KERN_WARNING "MIPS: no machine registered for "
++                      "machtype %lu\n", mips_machtype);
+               return;
+       }
+       mips_machine_set_name(mach->mach_name);
+-      printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
++      printk(KERN_NOTICE "MIPS: machine is %s\n", mips_machine_name);
+       if (mach->mach_setup)
+               mach->mach_setup();
+ }
++
++int __init mips_machtype_setup(char *id)
++{
++      if (mips_machid == NULL)
++              mips_machid = id;
++
++      return 1;
++}
++
++__setup("machtype=", mips_machtype_setup);
++
++static int __init mips_machtype_init(void)
++{
++      struct list_head *this;
++      struct mips_machine *mach;
++
++      if (mips_machid == NULL)
++              return 0;
++
++      list_for_each(this, &mips_machines) {
++              mach = list_entry(this, struct mips_machine, list);
++              if (strncmp(mach->mach_id, mips_machid,
++                          strlen(mips_machid)) == 0
++              ) {
++                      mips_machtype = mach->mach_type;
++                      return 0;
++              }
++      }
++
++      printk(KERN_WARNING
++             "MIPS: no machine found for id: '%s', registered machines:\n",
++             mips_machid);
++      printk(KERN_WARNING "%32s %s\n", "id", "name");
++
++      list_for_each(this, &mips_machines) {
++              mach = list_entry(this, struct mips_machine, list);
++              printk(KERN_WARNING "%32s %s\n",
++                     mach->mach_id, mach->mach_name);
++      }
++
++      return 0;
++}
++
++core_initcall(mips_machtype_init);
+--- a/include/asm-mips/mips_machine.h
++++ b/include/asm-mips/mips_machine.h
+@@ -13,24 +13,32 @@
+ #include <linux/init.h>
+ #include <linux/list.h>
++#include <asm/bootinfo.h>
++
+ struct mips_machine {
+       unsigned long           mach_type;
+-      void                    (*mach_setup)(void);
++      char                    *mach_id;
+       char                    *mach_name;
++      void                    (*mach_setup)(void);
+       struct list_head        list;
+ };
+ void mips_machine_register(struct mips_machine *) __init;
+-void mips_machine_setup(unsigned long machtype) __init;
++void mips_machine_setup(void) __init;
++int  mips_machtype_setup(char *id) __init;
+ void mips_machine_set_name(char *name) __init;
+ extern char *mips_machine_name;
+-#define MIPS_MACHINE(_type, _name, _setup)                    \
+-static char machine_name_##_type[] __initdata = _name;                \
+-static struct mips_machine machine_##_type __initdata =               \
++#define MIPS_MACHINE(_type, _id, _name, _setup)               \
++static char machine_name_##_type[] __initconst                        \
++                      __aligned(1) = _name;                   \
++static char machine_id_##_type[] __initconst                  \
++                      __aligned(1) = _id;                     \
++static struct mips_machine machine_##_type __initconst =      \
+ {                                                             \
+       .mach_type      = _type,                                \
++      .mach_id        = machine_id_##_type,                   \
+       .mach_name      = machine_name_##_type,                 \
+       .mach_setup     = _setup,                               \
+ };                                                            \
diff --git a/target/linux/ar71xx/patches-2.6.32/400-mips-multi-machine-update.patch b/target/linux/ar71xx/patches-2.6.32/400-mips-multi-machine-update.patch
new file mode 100644 (file)
index 0000000..62903c8
--- /dev/null
@@ -0,0 +1,127 @@
+--- a/arch/mips/kernel/mips_machine.c
++++ b/arch/mips/kernel/mips_machine.c
+@@ -7,12 +7,13 @@
+  *
+  */
+ #include <linux/mm.h>
++#include <linux/string.h>
+ #include <asm/mips_machine.h>
+-#include <asm/bootinfo.h>
+ static struct list_head mips_machines __initdata =
+               LIST_HEAD_INIT(mips_machines);
++static char *mips_machid __initdata;
+ char *mips_machine_name = "Unknown";
+@@ -55,20 +56,64 @@ void __init mips_machine_set_name(char *
+       }
+ }
+-void __init mips_machine_setup(unsigned long machtype)
++void __init mips_machine_setup(void)
+ {
+       struct mips_machine *mach;
+-      mach = mips_machine_find(machtype);
++      mach = mips_machine_find(mips_machtype);
+       if (!mach) {
+-              printk(KERN_ALERT "MIPS: no machine registered for "
+-                      "machtype %lu\n", machtype);
++              printk(KERN_WARNING "MIPS: no machine registered for "
++                      "machtype %lu\n", mips_machtype);
+               return;
+       }
+       mips_machine_set_name(mach->mach_name);
+-      printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
++      printk(KERN_NOTICE "MIPS: machine is %s\n", mips_machine_name);
+       if (mach->mach_setup)
+               mach->mach_setup();
+ }
++
++int __init mips_machtype_setup(char *id)
++{
++      if (mips_machid == NULL)
++              mips_machid = id;
++
++      return 1;
++}
++
++__setup("machtype=", mips_machtype_setup);
++
++static int __init mips_machtype_init(void)
++{
++      struct list_head *this;
++      struct mips_machine *mach;
++
++      if (mips_machid == NULL)
++              return 0;
++
++      list_for_each(this, &mips_machines) {
++              mach = list_entry(this, struct mips_machine, list);
++              if (strncmp(mach->mach_id, mips_machid,
++                          strlen(mips_machid)) == 0
++              ) {
++                      mips_machtype = mach->mach_type;
++                      return 0;
++              }
++      }
++
++      printk(KERN_WARNING
++             "MIPS: no machine found for id: '%s', registered machines:\n",
++             mips_machid);
++      printk(KERN_WARNING "%32s %s\n", "id", "name");
++
++      list_for_each(this, &mips_machines) {
++              mach = list_entry(this, struct mips_machine, list);
++              printk(KERN_WARNING "%32s %s\n",
++                     mach->mach_id, mach->mach_name);
++      }
++
++      return 0;
++}
++
++core_initcall(mips_machtype_init);
+--- a/include/asm-mips/mips_machine.h
++++ b/include/asm-mips/mips_machine.h
+@@ -13,24 +13,32 @@
+ #include <linux/init.h>
+ #include <linux/list.h>
++#include <asm/bootinfo.h>
++
+ struct mips_machine {
+       unsigned long           mach_type;
+-      void                    (*mach_setup)(void);
++      char                    *mach_id;
+       char                    *mach_name;
++      void                    (*mach_setup)(void);
+       struct list_head        list;
+ };
+ void mips_machine_register(struct mips_machine *) __init;
+-void mips_machine_setup(unsigned long machtype) __init;
++void mips_machine_setup(void) __init;
++int  mips_machtype_setup(char *id) __init;
+ void mips_machine_set_name(char *name) __init;
+ extern char *mips_machine_name;
+-#define MIPS_MACHINE(_type, _name, _setup)                    \
+-static char machine_name_##_type[] __initdata = _name;                \
+-static struct mips_machine machine_##_type __initdata =               \
++#define MIPS_MACHINE(_type, _id, _name, _setup)               \
++static char machine_name_##_type[] __initconst                        \
++                      __aligned(1) = _name;                   \
++static char machine_id_##_type[] __initconst                  \
++                      __aligned(1) = _id;                     \
++static struct mips_machine machine_##_type __initconst =      \
+ {                                                             \
+       .mach_type      = _type,                                \
++      .mach_id        = machine_id_##_type,                   \
+       .mach_name      = machine_name_##_type,                 \
+       .mach_setup     = _setup,                               \
+ };                                                            \