adm5120: convert to use the new mips multimachine stuff
authorGabor Juhos <juhosg@openwrt.org>
Sat, 5 Jun 2010 18:26:40 +0000 (18:26 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 5 Jun 2010 18:26:40 +0000 (18:26 +0000)
SVN-Revision: 21680

28 files changed:
target/linux/adm5120/files/arch/mips/adm5120/cellvision/cas-771.c
target/linux/adm5120/files/arch/mips/adm5120/cellvision/cellvision.c
target/linux/adm5120/files/arch/mips/adm5120/cellvision/nfs-101.c
target/linux/adm5120/files/arch/mips/adm5120/common/setup.c
target/linux/adm5120/files/arch/mips/adm5120/compex/np27g.c
target/linux/adm5120/files/arch/mips/adm5120/compex/np28g.c
target/linux/adm5120/files/arch/mips/adm5120/compex/wp54.c
target/linux/adm5120/files/arch/mips/adm5120/edimax/br-6104k.c
target/linux/adm5120/files/arch/mips/adm5120/edimax/br-6104kp.c
target/linux/adm5120/files/arch/mips/adm5120/edimax/br-61x4wg.c
target/linux/adm5120/files/arch/mips/adm5120/infineon/easy5120-rt.c
target/linux/adm5120/files/arch/mips/adm5120/infineon/easy5120-wvoip.c
target/linux/adm5120/files/arch/mips/adm5120/infineon/easy5120p-ata.c
target/linux/adm5120/files/arch/mips/adm5120/infineon/easy83000.c
target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-11x.c
target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-133.c
target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-133c.c
target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-150.c
target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-153.c
target/linux/adm5120/files/arch/mips/adm5120/mikrotik/rb-192.c
target/linux/adm5120/files/arch/mips/adm5120/motorola/pmugw.c
target/linux/adm5120/files/arch/mips/adm5120/osbridge/5gxi.c
target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-334wt.c
target/linux/adm5120/files/arch/mips/adm5120/zyxel/p-335.c
target/linux/adm5120/patches-2.6.32/400-revert-mips-machine-update.patch [deleted file]
target/linux/adm5120/patches-2.6.33/400-revert-mips-machine-update.patch [deleted file]
target/linux/adm5120/patches-2.6.34/400-revert-mips-machine-update.patch [deleted file]
target/linux/adm5120/patches-2.6.34/401-include-slab-h-in-mips_machine.patch [deleted file]

index 5854f074a134d697e52122148be6f17417607391..5033e02469e95bc3a680727dcd1db2fef4c8ceca 100644 (file)
@@ -33,4 +33,5 @@ static void __init cas771_setup(void)
        adm5120_pci_set_irq_map(ARRAY_SIZE(cas771_pci_irqs), cas771_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_CAS771, "Cellvision CAS-771/771W", cas771_setup);
+MIPS_MACHINE(MACH_ADM5120_CAS771, "CAS-771", "Cellvision CAS-771/771W",
+            cas771_setup);
index 245a54d50a2984fb4cca26c1a2a9af5076ca64dc..eceef1312f21b06c1126fc5bf6a9ce06ff3d9e19 100644 (file)
@@ -131,8 +131,10 @@ void __init cas6xx_setup(void)
        adm5120_add_device_switch(1, NULL);
 }
 
-MIPS_MACHINE(MACH_ADM5120_CAS630, "Cellvision CAS-630/630W", cas6xx_setup);
-MIPS_MACHINE(MACH_ADM5120_CAS670, "Cellvision CAS-670/670W", cas6xx_setup);
+MIPS_MACHINE(MACH_ADM5120_CAS630, "CAS-630", "Cellvision CAS-630/630W",
+            cas6xx_setup);
+MIPS_MACHINE(MACH_ADM5120_CAS670, "CAS-670", "Cellvision CAS-670/670W",
+            cas6xx_setup);
 
 void __init cas7xx_setup(void)
 {
@@ -143,8 +145,9 @@ void __init cas7xx_setup(void)
        adm5120_add_device_switch(1, NULL);
 }
 
-#if 0
-MIPS_MACHINE(MACH_ADM5120_CAS700, "Cellvision CAS-700/700W", cas7xx_setup);
-MIPS_MACHINE(MACH_ADM5120_CAS790, "Cellvision CAS-790", cas7xx_setup);
-MIPS_MACHINE(MACH_ADM5120_CAS861, "Cellvision CAS-861/861W", cas7xx_setup);
-#endif
+MIPS_MACHINE(MACH_ADM5120_CAS700, "CAS-700", "Cellvision CAS-700/700W",
+            cas7xx_setup);
+MIPS_MACHINE(MACH_ADM5120_CAS790, "CAS-790", "Cellvision CAS-790",
+            cas7xx_setup);
+MIPS_MACHINE(MACH_ADM5120_CAS861, "CAS-861", "Cellvision CAS-861/861W",
+            cas7xx_setup);
index 022b9f1b24d5fdda2f8bd3c25cda18e5e23db898..7d214c0909e2afc3914bc8b6fae28de125ac1520 100644 (file)
@@ -43,4 +43,5 @@ static void __init nfs101_setup(void)
                                nfs101_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_NFS101U, "Cellvision NFS-101U/101WU", nfs101_setup);
+MIPS_MACHINE(MACH_ADM5120_NFS101U, "NFS-101U", "Cellvision NFS-101U/101WU",
+            nfs101_setup);
index 843a616bbee8b4303c5144b096dca87fa73e0915..41956c8f8cbfc6297200b7f9a1b7a6147f547e39 100644 (file)
@@ -107,7 +107,7 @@ static int __init adm5120_board_setup(void)
 {
        adm5120_gpio_init();
 
-       mips_machine_setup(mips_machtype);
+       mips_machine_setup();
 
        return 0;
 }
@@ -122,5 +122,5 @@ static void __init adm5120_generic_board_setup(void)
        adm5120_add_device_switch(6, NULL);
 }
 
-MIPS_MACHINE(MACH_ADM5120_GENERIC, "Generic ADM5120 board",
-               adm5120_generic_board_setup);
+MIPS_MACHINE(MACH_ADM5120_GENERIC, "Generic", "Generic ADM5120 board",
+            adm5120_generic_board_setup);
index 8a70bf82ce8536c9e4afd75c78d3d80c20688c3f..82da46d1c70ce1ae119aac40f8bc88d9f33741f9 100644 (file)
@@ -25,4 +25,4 @@ static void __init np27g_setup(void)
        /* TODO: add PCI IRQ map */
 }
 
-MIPS_MACHINE(MACH_ADM5120_NP27G, "Compex NetPassage 27G", np27g_setup);
+MIPS_MACHINE(MACH_ADM5120_NP27G, "NP27G", "Compex NetPassage 27G", np27g_setup);
index f1f54abad0eb9523f49265b5f0bc699b05972914..a541439998b118f2ebbe0f58fafd33d057911a12 100644 (file)
@@ -60,4 +60,4 @@ static void __init np28g_setup(void)
        adm5120_pci_set_irq_map(ARRAY_SIZE(np28g_pci_irqs), np28g_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_NP28G, "Compex NetPassage 28G", np28g_setup);
+MIPS_MACHINE(MACH_ADM5120_NP28G, "NP28G", "Compex NetPassage 28G", np28g_setup);
index d56656d50301a78cd2cbdf054027da8d55a97be4..ef7130277929e5fd49f7a80c4bc0f6cebb845ed3 100644 (file)
@@ -79,7 +79,7 @@ static void __init wp54_setup(void)
        adm5120_pci_set_irq_map(ARRAY_SIZE(wp54_pci_irqs), wp54_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_WP54, "Compex WP54 family", wp54_setup);
+MIPS_MACHINE(MACH_ADM5120_WP54, "WP54", "Compex WP54 family", wp54_setup);
 
 static void __init wp54_wrt_setup(void)
 {
@@ -91,4 +91,5 @@ static void __init wp54_wrt_setup(void)
        wp54_setup();
 }
 
-MIPS_MACHINE(MACH_ADM5120_WP54G_WRT, "Compex WP54G-WRT", wp54_wrt_setup);
+MIPS_MACHINE(MACH_ADM5120_WP54G_WRT, "WP54G-WRT", "Compex WP54G-WRT",
+            wp54_wrt_setup);
index e5ede5e55b6c78b27e19f039872e7369109d9154..8b2b445506a04ad7dd2d9203b596ca77c18779d7 100644 (file)
@@ -32,4 +32,5 @@ static void __init br6104k_setup(void)
                                        br6104k_gpio_leds);
 }
 
-MIPS_MACHINE(MACH_ADM5120_BR6104K, "Edimax BR-6104K", br6104k_setup);
+MIPS_MACHINE(MACH_ADM5120_BR6104K, "BR-6104K", "Edimax BR-6104K",
+            br6104k_setup);
index f4e9f6c09fd35bffdc6490a9223a06831f2865d3..034575d6b266d7587c523ac41cf9c176c69b3553 100644 (file)
@@ -35,4 +35,5 @@ static void __init br6104kp_setup(void)
        adm5120_add_device_usb();
 }
 
-MIPS_MACHINE(MACH_ADM5120_BR6104KP, "Edimax BR-6104KP", br6104kp_setup);
+MIPS_MACHINE(MACH_ADM5120_BR6104KP, "BR-6104KP", "Edimax BR-6104KP",
+            br6104kp_setup);
index b9a208b603515a450be73d141d10a72cfa37c770..5d575071019b40dc46b91d8fb71a734f0819ceb3 100644 (file)
@@ -39,4 +39,5 @@ static void __init br61x4wg_setup(void)
                                        br61x4wg_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_BR61X4WG, "Edimax BR-6104WG/6114WG", br61x4wg_setup);
+MIPS_MACHINE(MACH_ADM5120_BR61X4WG, "BR-6104WG", "Edimax BR-6104WG/6114WG",
+            br61x4wg_setup);
index aa01f4e2e6093029380a8995bc1de2c45b4f0241..31eaee7721dc87785d98da31965fa2fc93df1ef8 100644 (file)
@@ -44,6 +44,5 @@ static void __init easy5120_rt_setup(void)
                                easy5120_rt_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_EASY5120RT,
-               "Infineon EASY 5120-RT Reference Board",
-               easy5120_rt_setup);
+MIPS_MACHINE(MACH_ADM5120_EASY5120RT, "EASY5120-RT",
+            "Infineon EASY 5120-RT Reference Board", easy5120_rt_setup);
index bf8e15d37f7400d6e38c267dcb1863f16f4c4725..0bf404cc2609d4de2dd84085edb32532074c1f82 100644 (file)
@@ -20,6 +20,5 @@ static void __init easy5120wvoip_setup(void)
        /* TODO: setup PCI IRQ map */
 }
 
-MIPS_MACHINE(MACH_ADM5120_EASY5120WVOIP,
-               "Infineon EASY 5120-WVoIP Reference Board",
-               easy5120wvoip_setup);
+MIPS_MACHINE(MACH_ADM5120_EASY5120WVOIP, "EASY5120WVoIP",
+            "Infineon EASY 5120-WVoIP Reference Board", easy5120wvoip_setup);
index fa9b0aca3cd40f8eceb70714a744d48162d4f224..fafe0238bdfadcee3c9a4690f6c9c8a44198ebe0 100644 (file)
@@ -18,6 +18,5 @@ static void __init easy5120pata_setup(void)
        adm5120_add_device_switch(6, NULL);
 }
 
-MIPS_MACHINE(MACH_ADM5120_EASY5120PATA,
-               "Infineon EASY 5120P-ATA Reference Board",
-               easy5120pata_setup);
+MIPS_MACHINE(MACH_ADM5120_EASY5120PATA, "EASY5120P-ATA",
+            "Infineon EASY 5120P-ATA Reference Board", easy5120pata_setup);
index 709d0a8230d69108ae335ce3b91aa0206ce7e5b1..051b852749018d85c628d67e06dc1d9496fc1f4b 100644 (file)
@@ -19,6 +19,5 @@ static void __init easy83000_setup(void)
        /* TODO: add VINAX device */
 }
 
-MIPS_MACHINE(MACH_ADM5120_EASY83000,
-               "Infineon EASY 83000 Reference Board",
-               easy83000_setup);
+MIPS_MACHINE(MACH_ADM5120_EASY83000, "EASY8300",
+            "Infineon EASY 83000 Reference Board", easy83000_setup);
index b74c2ca0c93bfeeb9be5c4fc3500d798ed51a62f..9adf633dfdf30bfd0d545611b582c3ef4748df84 100644 (file)
@@ -32,4 +32,5 @@ static void __init rb11x_setup(void)
                                        rb11x_gpio_leds);
 }
 
-MIPS_MACHINE(MACH_ADM5120_RB_11X, "Mikrotik RouterBOARD 111/112", rb11x_setup);
+MIPS_MACHINE(MACH_ADM5120_RB_11X, "11x", "Mikrotik RouterBOARD 111/112",
+            rb11x_setup);
index 46fcc24331c90528a4b7f41c23e9a331bd471a67..5045b2b9d03726cc94fa9044e3ab7e9717ddf474 100644 (file)
@@ -37,4 +37,5 @@ static void __init rb133_setup(void)
                                        rb133_gpio_leds);
 }
 
-MIPS_MACHINE(MACH_ADM5120_RB_133, "Mikrotik RouterBOARD 133", rb133_setup);
+MIPS_MACHINE(MACH_ADM5120_RB_133, "133", "Mikrotik RouterBOARD 133",
+            rb133_setup);
index 9fcbeb7b9bf1634f2fdaaa939df6f1ceae3f126f..b5caa485caaf26fa9f1008dd8279665f080eb811 100644 (file)
@@ -33,4 +33,5 @@ static void __init rb133c_setup(void)
                                        rb133c_gpio_leds);
 }
 
-MIPS_MACHINE(MACH_ADM5120_RB_133C, "Mikrotik RouterBOARD 133C", rb133c_setup);
+MIPS_MACHINE(MACH_ADM5120_RB_133C, "133C", "Mikrotik RouterBOARD 133C",
+            rb133c_setup);
index 8c6caf82fe4679e636c65e0326243c78a3ea9688..35d4300d29f239dbd7f33d428efbd5be4e95a3f7 100644 (file)
@@ -133,4 +133,5 @@ static void __init rb150_setup(void)
        adm5120_add_device_switch(5, rb150_vlans);
 }
 
-MIPS_MACHINE(MACH_ADM5120_RB_150, "Mikrotik RouterBOARD 150", rb150_setup);
+MIPS_MACHINE(MACH_ADM5120_RB_150, "miniROUTER", "Mikrotik RouterBOARD 150",
+            rb150_setup);
index 3b520470a15aefd6ae80cd5790376d4d7dca4809..decf98bb270c5d2b44e6cf9ac9cdc92a3533f1a1 100644 (file)
@@ -71,4 +71,5 @@ static void __init rb153_setup(void)
        adm5120_add_device_switch(5, rb153_vlans);
 }
 
-MIPS_MACHINE(MACH_ADM5120_RB_153, "Mikrotik RouterBOARD 153", rb153_setup);
+MIPS_MACHINE(MACH_ADM5120_RB_153, "150", "Mikrotik RouterBOARD 153",
+            rb153_setup);
index b9f47d3284779cb954ffd26f803bd2fbc71c9b7d..8cf8941b75464ebc9c0ec4db4ba7a90e2a6ca3de 100644 (file)
@@ -24,4 +24,5 @@ static void __init rb192_setup(void)
        adm5120_add_device_switch(6, rb192_vlans);
 }
 
-MIPS_MACHINE(MACH_ADM5120_RB_192, "Mikrotik RouterBOARD 192", rb192_setup);
+MIPS_MACHINE(MACH_ADM5120_RB_192, "192", "Mikrotik RouterBOARD 192",
+            rb192_setup);
index d0f14160464361465e69b4657a2ca61b0f9b1df2..1e82bd8d4db1f5ef87d84e741986e2bd7e667c3d 100644 (file)
@@ -96,6 +96,5 @@ void __init pmugw_setup(void)
        adm5120_add_device_switch(5, pmugw_vlans);
 }
 
-MIPS_MACHINE(MACH_ADM5120_PMUGW,
-               "Motorola Powerline MU Gateway",
-               pmugw_setup);
+MIPS_MACHINE(MACH_ADM5120_PMUGW, "PMUGW", "Motorola Powerline MU Gateway",
+            pmugw_setup);
index 94228b371d7f525e12a75fa7c2ee50e400221f2c..0fd449aecf695927519385b0c178050170f734dc 100644 (file)
@@ -71,5 +71,5 @@ static void __init osbridge_5gxi_setup(void)
                                osbridge_5gxi_pci_irqs);
 }
 
-MIPS_MACHINE(MACH_ADM5120_5GXI, "OSBRiDGE 5GXi/5XLi board",
+MIPS_MACHINE(MACH_ADM5120_5GXI, "5GXi", "OSBRiDGE 5GXi/5XLi board",
             osbridge_5gxi_setup);
index c08650db97b49b134c0de5656feb30f992aa0eb5..c4e4dfec1a5b9242ede095b68f7e3f4653dc8c17 100644 (file)
@@ -30,4 +30,5 @@ static void __init p334wt_setup(void)
                                        p334wt_gpio_leds);
 }
 
-MIPS_MACHINE(MACH_ADM5120_P334WT, "ZyXEL Prestige 334WT", p334wt_setup);
+MIPS_MACHINE(MACH_ADM5120_P334WT, "P-334WT" "ZyXEL Prestige 334WT",
+            p334wt_setup);
index 0b56e1b77211a8d39f280b932328a59b6cf8533e..6ac2b09158787f8b685d0dfc6f3747986501fd53 100644 (file)
@@ -17,4 +17,5 @@ static void __init p335_setup(void)
        adm5120_add_device_usb();
 }
 
-MIPS_MACHINE(MACH_ADM5120_P335, "ZyXEL Prestige 335/335WT", p335_setup);
+MIPS_MACHINE(MACH_ADM5120_P335, "P-335", "ZyXEL Prestige 335/335WT",
+            p335_setup);
diff --git a/target/linux/adm5120/patches-2.6.32/400-revert-mips-machine-update.patch b/target/linux/adm5120/patches-2.6.32/400-revert-mips-machine-update.patch
deleted file mode 100644 (file)
index ae997ec..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
---- a/arch/mips/include/asm/mips_machine.h
-+++ b/arch/mips/include/asm/mips_machine.h
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
-  *
-  *  This program is free software; you can redistribute it and/or modify it
-  *  under the terms of the GNU General Public License version 2 as published
-@@ -13,42 +13,35 @@
- #include <linux/init.h>
- #include <linux/list.h>
--#include <asm/bootinfo.h>
--
- struct mips_machine {
-       unsigned long           mach_type;
--      const char              *mach_id;
--      const char              *mach_name;
-       void                    (*mach_setup)(void);
-+      char                    *mach_name;
-+      struct list_head        list;
- };
--#define MIPS_MACHINE(_type, _id, _name, _setup)               \
--static const char machine_name_##_type[] __initconst          \
--                      __aligned(1) = _name;                   \
--static const char machine_id_##_type[] __initconst            \
--                      __aligned(1) = _id;                     \
--static struct mips_machine machine_##_type                    \
--              __used __section(.mips.machines.init) =         \
-+void mips_machine_register(struct mips_machine *) __init;
-+void mips_machine_setup(unsigned long machtype) __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 =               \
- {                                                             \
-       .mach_type      = _type,                                \
--      .mach_id        = machine_id_##_type,                   \
-       .mach_name      = machine_name_##_type,                 \
-       .mach_setup     = _setup,                               \
--};
--
--extern long __mips_machines_start;
--extern long __mips_machines_end;
--
--#ifdef CONFIG_MIPS_MACHINE
--int  mips_machtype_setup(char *id) __init;
--void mips_machine_setup(void) __init;
--void mips_set_machine_name(const char *name) __init;
--char *mips_get_machine_name(void);
--#else
--static inline int mips_machtype_setup(char *id) { return 1; }
--static inline void mips_machine_setup(void) { }
--static inline void mips_set_machine_name(const char *name) { }
--static inline char *mips_get_machine_name(void) { return NULL; }
--#endif /* CONFIG_MIPS_MACHINE */
-+};                                                            \
-+                                                              \
-+static int __init register_machine_##_type(void)              \
-+{                                                             \
-+      mips_machine_register(&machine_##_type);                \
-+      return 0;                                               \
-+}                                                             \
-+                                                              \
-+pure_initcall(register_machine_##_type)
- #endif /* __ASM_MIPS_MACHINE_H */
-+
---- a/arch/mips/kernel/mips_machine.c
-+++ b/arch/mips/kernel/mips_machine.c
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
-  *
-  *  This program is free software; you can redistribute it and/or modify it
-  *  under the terms of the GNU General Public License version 2 as published
-@@ -7,77 +7,68 @@
-  *
-  */
- #include <linux/mm.h>
--#include <linux/string.h>
--#include <linux/slab.h>
- #include <asm/mips_machine.h>
-+#include <asm/bootinfo.h>
--static struct mips_machine *mips_machine __initdata;
--static char *mips_machine_name = "Unknown";
-+static struct list_head mips_machines __initdata =
-+              LIST_HEAD_INIT(mips_machines);
--#define for_each_machine(mach) \
--      for ((mach) = (struct mips_machine *)&__mips_machines_start; \
--           (mach) && \
--           (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \
--           (mach)++)
-+char *mips_machine_name = "Unknown";
--__init void mips_set_machine_name(const char *name)
-+static struct mips_machine * __init mips_machine_find(unsigned long machtype)
- {
--      char *p;
-+      struct list_head *this;
--      if (name == NULL)
--              return;
-+      list_for_each(this, &mips_machines) {
-+              struct mips_machine *mach;
--      p = kstrdup(name, GFP_KERNEL);
--      if (!p)
--              pr_err("MIPS: no memory for machine_name\n");
-+              mach = list_entry(this, struct mips_machine, list);
-+              if (mach->mach_type == machtype)
-+                      return mach;
-+      }
--      mips_machine_name = p;
-+      return NULL;
- }
--char *mips_get_machine_name(void)
-+void __init mips_machine_register(struct mips_machine *mach)
- {
--      return mips_machine_name;
-+      list_add_tail(&mach->list, &mips_machines);
- }
--__init int mips_machtype_setup(char *id)
-+void __init mips_machine_set_name(char *name)
- {
--      struct mips_machine *mach;
-+      unsigned int len;
-+      char *p;
--      for_each_machine(mach) {
--              if (mach->mach_id == NULL)
--                      continue;
--
--              if (strcmp(mach->mach_id, id) == 0) {
--                      mips_machine = mach;
--                      break;
--              }
--      }
-+      if (name == NULL)
-+              return;
--      if (!mips_machine) {
--              pr_err("MIPS: no machine found for id '%s', supported machines:\n",
--                     id);
--              pr_err("%32s %s\n", "id", "name");
--              for_each_machine(mach)
--                      pr_err("%32s %s\n", mach->mach_id, mach->mach_name);
--              return 1;
-+      len = strlen(name);
-+      p = kmalloc(len + 1, GFP_KERNEL);
-+      if (p) {
-+              strncpy(p, name, len);
-+              p[len] = '\0';
-+              mips_machine_name = p;
-+      } else {
-+              printk(KERN_WARNING "MIPS: no memory for machine_name\n");
-       }
--
--      mips_machtype = mips_machine->mach_type;
--
--      return 0;
- }
--__setup("machtype=", mips_machtype_setup);
--
--__init void mips_machine_setup(void)
-+void __init mips_machine_setup(unsigned long machtype)
- {
--      if (!mips_machine)
-+      struct mips_machine *mach;
-+
-+      mach = mips_machine_find(machtype);
-+      if (!mach) {
-+              printk(KERN_ALERT "MIPS: no machine registered for "
-+                      "machtype %lu\n", machtype);
-               return;
-+      }
--      mips_set_machine_name(mips_machine->mach_name);
--      pr_info("MIPS: machine is %s\n", mips_machine_name);
-+      mips_machine_set_name(mach->mach_name);
-+      printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
--      if (mips_machine->mach_setup)
--              mips_machine->mach_setup();
-+      if (mach->mach_setup)
-+              mach->mach_setup();
- }
---- a/arch/mips/kernel/proc.c
-+++ b/arch/mips/kernel/proc.c
-@@ -34,9 +34,9 @@ static int show_cpuinfo(struct seq_file 
-        */
-       if (n == 0) {
-               seq_printf(m, "system type\t\t: %s\n", get_system_type());
--              if (mips_get_machine_name())
--                      seq_printf(m, "machine\t\t\t: %s\n",
--                                 mips_get_machine_name());
-+#ifdef CONFIG_MIPS_MACHINE
-+              seq_printf(m, "machine\t\t\t: %s\n", mips_machine_name);
-+#endif
-       }
-       seq_printf(m, "processor\t\t: %ld\n", n);
---- a/arch/mips/kernel/vmlinux.lds.S
-+++ b/arch/mips/kernel/vmlinux.lds.S
-@@ -97,13 +97,6 @@ SECTIONS
-       INIT_TEXT_SECTION(PAGE_SIZE)
-       INIT_DATA_SECTION(16)
--      . = ALIGN(4);
--      .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
--              __mips_machines_start = .;
--              *(.mips.machines.init)
--              __mips_machines_end = .;
--      }
--
-       /* .exit.text is discarded at runtime, not link time, to deal with
-        * references from .rodata
-        */
diff --git a/target/linux/adm5120/patches-2.6.33/400-revert-mips-machine-update.patch b/target/linux/adm5120/patches-2.6.33/400-revert-mips-machine-update.patch
deleted file mode 100644 (file)
index 0eea369..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
---- a/arch/mips/include/asm/mips_machine.h
-+++ b/arch/mips/include/asm/mips_machine.h
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
-  *
-  *  This program is free software; you can redistribute it and/or modify it
-  *  under the terms of the GNU General Public License version 2 as published
-@@ -13,42 +13,35 @@
- #include <linux/init.h>
- #include <linux/list.h>
--#include <asm/bootinfo.h>
--
- struct mips_machine {
-       unsigned long           mach_type;
--      const char              *mach_id;
--      const char              *mach_name;
-       void                    (*mach_setup)(void);
-+      char                    *mach_name;
-+      struct list_head        list;
- };
--#define MIPS_MACHINE(_type, _id, _name, _setup)               \
--static const char machine_name_##_type[] __initconst          \
--                      __aligned(1) = _name;                   \
--static const char machine_id_##_type[] __initconst            \
--                      __aligned(1) = _id;                     \
--static struct mips_machine machine_##_type                    \
--              __used __section(.mips.machines.init) =         \
-+void mips_machine_register(struct mips_machine *) __init;
-+void mips_machine_setup(unsigned long machtype) __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 =               \
- {                                                             \
-       .mach_type      = _type,                                \
--      .mach_id        = machine_id_##_type,                   \
-       .mach_name      = machine_name_##_type,                 \
-       .mach_setup     = _setup,                               \
--};
--
--extern long __mips_machines_start;
--extern long __mips_machines_end;
--
--#ifdef CONFIG_MIPS_MACHINE
--int  mips_machtype_setup(char *id) __init;
--void mips_machine_setup(void) __init;
--void mips_set_machine_name(const char *name) __init;
--char *mips_get_machine_name(void);
--#else
--static inline int mips_machtype_setup(char *id) { return 1; }
--static inline void mips_machine_setup(void) { }
--static inline void mips_set_machine_name(const char *name) { }
--static inline char *mips_get_machine_name(void) { return NULL; }
--#endif /* CONFIG_MIPS_MACHINE */
-+};                                                            \
-+                                                              \
-+static int __init register_machine_##_type(void)              \
-+{                                                             \
-+      mips_machine_register(&machine_##_type);                \
-+      return 0;                                               \
-+}                                                             \
-+                                                              \
-+pure_initcall(register_machine_##_type)
- #endif /* __ASM_MIPS_MACHINE_H */
-+
---- a/arch/mips/kernel/mips_machine.c
-+++ b/arch/mips/kernel/mips_machine.c
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
-  *
-  *  This program is free software; you can redistribute it and/or modify it
-  *  under the terms of the GNU General Public License version 2 as published
-@@ -7,77 +7,68 @@
-  *
-  */
- #include <linux/mm.h>
--#include <linux/string.h>
--#include <linux/slab.h>
- #include <asm/mips_machine.h>
-+#include <asm/bootinfo.h>
--static struct mips_machine *mips_machine __initdata;
--static char *mips_machine_name = "Unknown";
-+static struct list_head mips_machines __initdata =
-+              LIST_HEAD_INIT(mips_machines);
--#define for_each_machine(mach) \
--      for ((mach) = (struct mips_machine *)&__mips_machines_start; \
--           (mach) && \
--           (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \
--           (mach)++)
-+char *mips_machine_name = "Unknown";
--__init void mips_set_machine_name(const char *name)
-+static struct mips_machine * __init mips_machine_find(unsigned long machtype)
- {
--      char *p;
-+      struct list_head *this;
--      if (name == NULL)
--              return;
-+      list_for_each(this, &mips_machines) {
-+              struct mips_machine *mach;
--      p = kstrdup(name, GFP_KERNEL);
--      if (!p)
--              pr_err("MIPS: no memory for machine_name\n");
-+              mach = list_entry(this, struct mips_machine, list);
-+              if (mach->mach_type == machtype)
-+                      return mach;
-+      }
--      mips_machine_name = p;
-+      return NULL;
- }
--char *mips_get_machine_name(void)
-+void __init mips_machine_register(struct mips_machine *mach)
- {
--      return mips_machine_name;
-+      list_add_tail(&mach->list, &mips_machines);
- }
--__init int mips_machtype_setup(char *id)
-+void __init mips_machine_set_name(char *name)
- {
--      struct mips_machine *mach;
-+      unsigned int len;
-+      char *p;
--      for_each_machine(mach) {
--              if (mach->mach_id == NULL)
--                      continue;
--
--              if (strcmp(mach->mach_id, id) == 0) {
--                      mips_machine = mach;
--                      break;
--              }
--      }
-+      if (name == NULL)
-+              return;
--      if (!mips_machine) {
--              pr_err("MIPS: no machine found for id '%s', supported machines:\n",
--                     id);
--              pr_err("%32s %s\n", "id", "name");
--              for_each_machine(mach)
--                      pr_err("%32s %s\n", mach->mach_id, mach->mach_name);
--              return 1;
-+      len = strlen(name);
-+      p = kmalloc(len + 1, GFP_KERNEL);
-+      if (p) {
-+              strncpy(p, name, len);
-+              p[len] = '\0';
-+              mips_machine_name = p;
-+      } else {
-+              printk(KERN_WARNING "MIPS: no memory for machine_name\n");
-       }
--
--      mips_machtype = mips_machine->mach_type;
--
--      return 0;
- }
--__setup("machtype=", mips_machtype_setup);
--
--__init void mips_machine_setup(void)
-+void __init mips_machine_setup(unsigned long machtype)
- {
--      if (!mips_machine)
-+      struct mips_machine *mach;
-+
-+      mach = mips_machine_find(machtype);
-+      if (!mach) {
-+              printk(KERN_ALERT "MIPS: no machine registered for "
-+                      "machtype %lu\n", machtype);
-               return;
-+      }
--      mips_set_machine_name(mips_machine->mach_name);
--      pr_info("MIPS: machine is %s\n", mips_machine_name);
-+      mips_machine_set_name(mach->mach_name);
-+      printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
--      if (mips_machine->mach_setup)
--              mips_machine->mach_setup();
-+      if (mach->mach_setup)
-+              mach->mach_setup();
- }
---- a/arch/mips/kernel/proc.c
-+++ b/arch/mips/kernel/proc.c
-@@ -34,9 +34,9 @@ static int show_cpuinfo(struct seq_file 
-        */
-       if (n == 0) {
-               seq_printf(m, "system type\t\t: %s\n", get_system_type());
--              if (mips_get_machine_name())
--                      seq_printf(m, "machine\t\t\t: %s\n",
--                                 mips_get_machine_name());
-+#ifdef CONFIG_MIPS_MACHINE
-+              seq_printf(m, "machine\t\t\t: %s\n", mips_machine_name);
-+#endif
-       }
-       seq_printf(m, "processor\t\t: %ld\n", n);
---- a/arch/mips/kernel/vmlinux.lds.S
-+++ b/arch/mips/kernel/vmlinux.lds.S
-@@ -98,13 +98,6 @@ SECTIONS
-       INIT_TEXT_SECTION(PAGE_SIZE)
-       INIT_DATA_SECTION(16)
--      . = ALIGN(4);
--      .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
--              __mips_machines_start = .;
--              *(.mips.machines.init)
--              __mips_machines_end = .;
--      }
--
-       /* .exit.text is discarded at runtime, not link time, to deal with
-        * references from .rodata
-        */
diff --git a/target/linux/adm5120/patches-2.6.34/400-revert-mips-machine-update.patch b/target/linux/adm5120/patches-2.6.34/400-revert-mips-machine-update.patch
deleted file mode 100644 (file)
index 0eea369..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
---- a/arch/mips/include/asm/mips_machine.h
-+++ b/arch/mips/include/asm/mips_machine.h
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
-  *
-  *  This program is free software; you can redistribute it and/or modify it
-  *  under the terms of the GNU General Public License version 2 as published
-@@ -13,42 +13,35 @@
- #include <linux/init.h>
- #include <linux/list.h>
--#include <asm/bootinfo.h>
--
- struct mips_machine {
-       unsigned long           mach_type;
--      const char              *mach_id;
--      const char              *mach_name;
-       void                    (*mach_setup)(void);
-+      char                    *mach_name;
-+      struct list_head        list;
- };
--#define MIPS_MACHINE(_type, _id, _name, _setup)               \
--static const char machine_name_##_type[] __initconst          \
--                      __aligned(1) = _name;                   \
--static const char machine_id_##_type[] __initconst            \
--                      __aligned(1) = _id;                     \
--static struct mips_machine machine_##_type                    \
--              __used __section(.mips.machines.init) =         \
-+void mips_machine_register(struct mips_machine *) __init;
-+void mips_machine_setup(unsigned long machtype) __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 =               \
- {                                                             \
-       .mach_type      = _type,                                \
--      .mach_id        = machine_id_##_type,                   \
-       .mach_name      = machine_name_##_type,                 \
-       .mach_setup     = _setup,                               \
--};
--
--extern long __mips_machines_start;
--extern long __mips_machines_end;
--
--#ifdef CONFIG_MIPS_MACHINE
--int  mips_machtype_setup(char *id) __init;
--void mips_machine_setup(void) __init;
--void mips_set_machine_name(const char *name) __init;
--char *mips_get_machine_name(void);
--#else
--static inline int mips_machtype_setup(char *id) { return 1; }
--static inline void mips_machine_setup(void) { }
--static inline void mips_set_machine_name(const char *name) { }
--static inline char *mips_get_machine_name(void) { return NULL; }
--#endif /* CONFIG_MIPS_MACHINE */
-+};                                                            \
-+                                                              \
-+static int __init register_machine_##_type(void)              \
-+{                                                             \
-+      mips_machine_register(&machine_##_type);                \
-+      return 0;                                               \
-+}                                                             \
-+                                                              \
-+pure_initcall(register_machine_##_type)
- #endif /* __ASM_MIPS_MACHINE_H */
-+
---- a/arch/mips/kernel/mips_machine.c
-+++ b/arch/mips/kernel/mips_machine.c
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
-  *
-  *  This program is free software; you can redistribute it and/or modify it
-  *  under the terms of the GNU General Public License version 2 as published
-@@ -7,77 +7,68 @@
-  *
-  */
- #include <linux/mm.h>
--#include <linux/string.h>
--#include <linux/slab.h>
- #include <asm/mips_machine.h>
-+#include <asm/bootinfo.h>
--static struct mips_machine *mips_machine __initdata;
--static char *mips_machine_name = "Unknown";
-+static struct list_head mips_machines __initdata =
-+              LIST_HEAD_INIT(mips_machines);
--#define for_each_machine(mach) \
--      for ((mach) = (struct mips_machine *)&__mips_machines_start; \
--           (mach) && \
--           (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \
--           (mach)++)
-+char *mips_machine_name = "Unknown";
--__init void mips_set_machine_name(const char *name)
-+static struct mips_machine * __init mips_machine_find(unsigned long machtype)
- {
--      char *p;
-+      struct list_head *this;
--      if (name == NULL)
--              return;
-+      list_for_each(this, &mips_machines) {
-+              struct mips_machine *mach;
--      p = kstrdup(name, GFP_KERNEL);
--      if (!p)
--              pr_err("MIPS: no memory for machine_name\n");
-+              mach = list_entry(this, struct mips_machine, list);
-+              if (mach->mach_type == machtype)
-+                      return mach;
-+      }
--      mips_machine_name = p;
-+      return NULL;
- }
--char *mips_get_machine_name(void)
-+void __init mips_machine_register(struct mips_machine *mach)
- {
--      return mips_machine_name;
-+      list_add_tail(&mach->list, &mips_machines);
- }
--__init int mips_machtype_setup(char *id)
-+void __init mips_machine_set_name(char *name)
- {
--      struct mips_machine *mach;
-+      unsigned int len;
-+      char *p;
--      for_each_machine(mach) {
--              if (mach->mach_id == NULL)
--                      continue;
--
--              if (strcmp(mach->mach_id, id) == 0) {
--                      mips_machine = mach;
--                      break;
--              }
--      }
-+      if (name == NULL)
-+              return;
--      if (!mips_machine) {
--              pr_err("MIPS: no machine found for id '%s', supported machines:\n",
--                     id);
--              pr_err("%32s %s\n", "id", "name");
--              for_each_machine(mach)
--                      pr_err("%32s %s\n", mach->mach_id, mach->mach_name);
--              return 1;
-+      len = strlen(name);
-+      p = kmalloc(len + 1, GFP_KERNEL);
-+      if (p) {
-+              strncpy(p, name, len);
-+              p[len] = '\0';
-+              mips_machine_name = p;
-+      } else {
-+              printk(KERN_WARNING "MIPS: no memory for machine_name\n");
-       }
--
--      mips_machtype = mips_machine->mach_type;
--
--      return 0;
- }
--__setup("machtype=", mips_machtype_setup);
--
--__init void mips_machine_setup(void)
-+void __init mips_machine_setup(unsigned long machtype)
- {
--      if (!mips_machine)
-+      struct mips_machine *mach;
-+
-+      mach = mips_machine_find(machtype);
-+      if (!mach) {
-+              printk(KERN_ALERT "MIPS: no machine registered for "
-+                      "machtype %lu\n", machtype);
-               return;
-+      }
--      mips_set_machine_name(mips_machine->mach_name);
--      pr_info("MIPS: machine is %s\n", mips_machine_name);
-+      mips_machine_set_name(mach->mach_name);
-+      printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
--      if (mips_machine->mach_setup)
--              mips_machine->mach_setup();
-+      if (mach->mach_setup)
-+              mach->mach_setup();
- }
---- a/arch/mips/kernel/proc.c
-+++ b/arch/mips/kernel/proc.c
-@@ -34,9 +34,9 @@ static int show_cpuinfo(struct seq_file 
-        */
-       if (n == 0) {
-               seq_printf(m, "system type\t\t: %s\n", get_system_type());
--              if (mips_get_machine_name())
--                      seq_printf(m, "machine\t\t\t: %s\n",
--                                 mips_get_machine_name());
-+#ifdef CONFIG_MIPS_MACHINE
-+              seq_printf(m, "machine\t\t\t: %s\n", mips_machine_name);
-+#endif
-       }
-       seq_printf(m, "processor\t\t: %ld\n", n);
---- a/arch/mips/kernel/vmlinux.lds.S
-+++ b/arch/mips/kernel/vmlinux.lds.S
-@@ -98,13 +98,6 @@ SECTIONS
-       INIT_TEXT_SECTION(PAGE_SIZE)
-       INIT_DATA_SECTION(16)
--      . = ALIGN(4);
--      .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
--              __mips_machines_start = .;
--              *(.mips.machines.init)
--              __mips_machines_end = .;
--      }
--
-       /* .exit.text is discarded at runtime, not link time, to deal with
-        * references from .rodata
-        */
diff --git a/target/linux/adm5120/patches-2.6.34/401-include-slab-h-in-mips_machine.patch b/target/linux/adm5120/patches-2.6.34/401-include-slab-h-in-mips_machine.patch
deleted file mode 100644 (file)
index fa466a7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/mips/kernel/mips_machine.c
-+++ b/arch/mips/kernel/mips_machine.c
-@@ -6,7 +6,7 @@
-  *  by the Free Software Foundation.
-  *
-  */
--#include <linux/mm.h>
-+#include <linux/slab.h>
- #include <asm/mips_machine.h>
- #include <asm/bootinfo.h>