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 a7b702681da37a50377ebb637d1d3ebea6acd79f..6aee4dc5cbadf0946c93d781e69f3f57a9932330 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 1b0b06c7a78b3a9d6ab78d6696065aab4f49648f..daf7dcf9f57b44cbc02151645c909bb55d07e302 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 e72574ac0912ebf2c21bb6a3154a592301156bec..cd4746ba7004bc66175e0a3143b73753fc086d40 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 6052e37e53972096e2d5465e1cc62a7204fb8313..5cee4c6ea8ecc76fc9963c27c788a73b85608483 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 e3b6aabeb0bc0c1d0b03d5492ea11332ec4776a9..d6f1fa75dae860396c722a79f0bd9262999ac2fc 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 93a01fd773370c8646333667af3a0519e81a4cbc..7762b5cdc5f5cf64eab1b5cb04f5885912e6836a 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 49882051e0c760c33be2af1b71ec26c246be917e..8dfa6405ecbdeddd182c811aa695f1bf3fda523b 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 bc755022f3359d4df0f1f2c7640bdf346edd5d15..6af5dd4cdf9c12aa839173c277b22a90a082d14b 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 0e55888523b0ee274a2501932bf03cfcd7a4809d..88a3bd17b64a1912dad0b09510f84c97109eec09 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 0f70d9525b888cd367a8af251bb67d8c3b176e5c..44bf38991c1957da7b9482954cb6cc07919d4c0f 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 aad5d0af94ced81298eb843783516e0ecf8d4256..7cace674b837a68b0966963de0e7285d288f4007 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 8b6f34e960caf60e31f83b4bacb91d476fff1099..ab3d65be942ca7b1caea73b2eeff08bf5160b269 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 bb4cee677e55d82d4ab3bf50c59a777d1b5f4a6f..c92cb00ebf79a6419b4591e204cb7a692ec0fd0a 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 9c6f65e93b245c98585a776d24357e12c524d1e5..79bb227131e02c749779284909633c1e065fda24 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 ecedbb5a82309c165fc260fabfc26dac845924ee..b2d33c0d7775b79f181ca670705f64779fdd8fff 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 10d00c41ed8115bfbc3fb94254f73db5047f7d20..3bc063ae51cc843eff00f48c7a7aea2d3774803c 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 7fe5a1cbc54277d7928a17806f89829711b32a85..af83116a7a2555c4d7096593c11fae69ace3f6bd 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 1a63b99d6ac0f0c6d79d5ee526185c8127d29a6d..37151ab02ce981f8fafa222af981b931ec9d90a0 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 4220e61cd10f0fdc78d9e1772aa0077e2e3df4a0..14cde55d276e9a88ae29166e1b75cf05c24854b5 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 c07619c163123fa82ddc03954926eb4046f047b6..778e99d7109317bdce6f9a6a27bb74ca64481826 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 d20800ea544c249f7c0c6c1346fe795e72063d49..a2669f17a13a9a2bb1b39b6e08bd6bb4e85f7713 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 2caddf880a752bde5c9055b5af2716fe399bb4ec..9c85235eae0e4edef2e83e0537ff520d59cfe91b 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 a563268851e59f343124c9f717a9065335fc48b6..005828f324779fa82240039d111dd823ee681f02 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 34d77024028156a3b1ba76810f193f3b479dd842..91907f4db2e832712957bf04f0ff71ce72b3e7a0 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 f522d1ff39dab24b0c989407a0a0572d3ba0fdce..5b47d6bfe2ab4c146e51e378f7ac418d64891099 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 7ea29ed8bd9f4e2046b3427a1e4b799ddae4e21e..f23592223aef68045fc1aa06cddc3955a7ef04bc 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,                               \
+ };                                                            \