adm5120: add 3.3 support
[openwrt/staging/yousong.git] / target / linux / adm5120 / patches-3.3 / a03-adm5120-remove-CONFIG_MTD_PARTITIONS.patch
1 --- a/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
2 +++ b/arch/mips/include/asm/mach-adm5120/adm5120_platform.h
3 @@ -28,10 +28,8 @@ struct adm5120_flash_platform_data {
4 void (*set_vpp)(struct map_info *, int);
5 void (*switch_bank)(unsigned);
6 u32 window_size;
7 -#ifdef CONFIG_MTD_PARTITIONS
8 unsigned int nr_parts;
9 struct mtd_partition *parts;
10 -#endif
11 };
12
13 struct adm5120_switch_platform_data {
14 --- a/arch/mips/adm5120/infineon/infineon.c
15 +++ b/arch/mips/adm5120/infineon/infineon.c
16 @@ -16,7 +16,6 @@
17 #define EASY_CONFIG_OFFSET 0x10000
18 #define EASY_CONFIG_SIZE 0x1000
19
20 -#ifdef CONFIG_MTD_PARTITIONS
21 static struct mtd_partition easy_partitions[] = {
22 {
23 .name = "admboot",
24 @@ -33,7 +32,6 @@ static struct mtd_partition easy_partiti
25 .size = MTDPART_SIZ_FULL,
26 }
27 };
28 -#endif /* CONFIG_MTD_PARTITIONS */
29
30 static __init void easy_setup_mac(void)
31 {
32 @@ -68,10 +66,8 @@ void __init easy_setup_pqfp(void)
33 gpio_direction_output(ADM5120_GPIO_PIN3, 0);
34 adm5120_flash0_data.switch_bank = switch_bank_gpio3;
35
36 -#ifdef CONFIG_MTD_PARTITIONS
37 adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
38 adm5120_flash0_data.parts = easy_partitions;
39 -#endif /* CONFIG_MTD_PARTITIONS */
40
41 adm5120_add_device_uart(0);
42 adm5120_add_device_uart(1);
43 @@ -100,10 +96,8 @@ void __init easy_setup_bga(void)
44 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
45 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
46
47 -#ifdef CONFIG_MTD_PARTITIONS
48 adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
49 adm5120_flash0_data.parts = easy_partitions;
50 -#endif /* CONFIG_MTD_PARTITIONS */
51
52 adm5120_add_device_uart(0);
53 adm5120_add_device_uart(1);
54 --- a/arch/mips/adm5120/cellvision/cellvision.c
55 +++ b/arch/mips/adm5120/cellvision/cellvision.c
56 @@ -19,7 +19,6 @@
57 #define CELLVISION_CONFIG_OFFSET 0x8000
58 #define CELLVISION_CONFIG_SIZE 0x1000
59
60 -#ifdef CONFIG_MTD_PARTITIONS
61 static struct mtd_partition cas6xx_partitions[] = {
62 {
63 .name = "admboot",
64 @@ -65,7 +64,6 @@ static struct mtd_partition cas7xx_parti
65 .size = MTDPART_SIZ_FULL,
66 }
67 };
68 -#endif /* CONFIG_MTD_PARTITIONS */
69
70 static void switch_bank_gpio5(unsigned bank)
71 {
72 @@ -105,20 +103,16 @@ void __init cellvision_mac_setup(void)
73
74 void __init cas6xx_flash_setup(void)
75 {
76 -#ifdef CONFIG_MTD_PARTITIONS
77 adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas6xx_partitions);
78 adm5120_flash0_data.parts = cas6xx_partitions;
79 -#endif /* CONFIG_MTD_PARTITIONS */
80
81 cellvision_flash_setup();
82 }
83
84 void __init cas7xx_flash_setup(void)
85 {
86 -#ifdef CONFIG_MTD_PARTITIONS
87 adm5120_flash0_data.nr_parts = ARRAY_SIZE(cas7xx_partitions);
88 adm5120_flash0_data.parts = cas7xx_partitions;
89 -#endif /* CONFIG_MTD_PARTITIONS */
90
91 cellvision_flash_setup();
92 }
93 --- a/arch/mips/adm5120/edimax/br-61xx.c
94 +++ b/arch/mips/adm5120/edimax/br-61xx.c
95 @@ -18,7 +18,6 @@
96 #define BR61XX_CONFIG_OFFSET 0x8000
97 #define BR61XX_CONFIG_SIZE 0x1000
98
99 -#ifdef CONFIG_MTD_PARTITIONS
100 static struct mtd_partition br61xx_partitions[] = {
101 {
102 .name = "admboot",
103 @@ -35,7 +34,6 @@ static struct mtd_partition br61xx_parti
104 .size = MTDPART_SIZ_FULL,
105 }
106 };
107 -#endif /* CONFIG_MTD_PARTITIONS */
108
109 static struct gpio_button br61xx_gpio_buttons[] __initdata = {
110 {
111 @@ -68,10 +66,8 @@ static void __init br61xx_mac_setup(void
112 void __init br61xx_generic_setup(void)
113 {
114
115 -#ifdef CONFIG_MTD_PARTITIONS
116 adm5120_flash0_data.nr_parts = ARRAY_SIZE(br61xx_partitions);
117 adm5120_flash0_data.parts = br61xx_partitions;
118 -#endif /* CONFIG_MTD_PARTITIONS */
119 adm5120_add_device_flash(0);
120
121 adm5120_add_device_gpio(BR61XX_GPIO_DEV_MASK);
122 --- a/arch/mips/adm5120/mikrotik/rb-1xx.c
123 +++ b/arch/mips/adm5120/mikrotik/rb-1xx.c
124 @@ -25,7 +25,6 @@ static struct adm5120_pci_irq rb1xx_pci_
125 PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI2)
126 };
127
128 -#ifdef CONFIG_MTD_PARTITIONS
129 static struct mtd_partition rb1xx_nor_parts[] = {
130 {
131 .name = "booter",
132 @@ -50,7 +49,6 @@ static struct mtd_partition rb1xx_nand_p
133 .size = MTDPART_SIZ_FULL
134 }
135 };
136 -#endif /* CONFIG_MTD_PARTITIONS */
137
138 /*
139 * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
140 @@ -79,10 +77,8 @@ static int rb1xx_nand_fixup(struct mtd_i
141 struct platform_nand_data rb1xx_nand_data __initdata = {
142 .chip = {
143 .nr_chips = 1,
144 -#ifdef CONFIG_MTD_PARTITIONS
145 .nr_partitions = ARRAY_SIZE(rb1xx_nand_parts),
146 .partitions = rb1xx_nand_parts,
147 -#endif /* CONFIG_MTD_PARTITIONS */
148 .chip_delay = RB1XX_NAND_CHIP_DELAY,
149 .options = NAND_NO_AUTOINCR,
150 .chip_fixup = rb1xx_nand_fixup,
151 @@ -114,10 +110,8 @@ static void __init rb1xx_mac_setup(void)
152 void __init rb1xx_add_device_flash(void)
153 {
154 /* setup data for flash0 device */
155 -#ifdef CONFIG_MTD_PARTITIONS
156 adm5120_flash0_data.nr_parts = ARRAY_SIZE(rb1xx_nor_parts);
157 adm5120_flash0_data.parts = rb1xx_nor_parts;
158 -#endif /* CONFIG_MTD_PARTITIONS */
159 adm5120_flash0_data.window_size = 128*1024;
160
161 adm5120_add_device_flash(0);
162 --- a/arch/mips/adm5120/compex/wp54.c
163 +++ b/arch/mips/adm5120/compex/wp54.c
164 @@ -11,7 +11,6 @@
165
166 #include "compex.h"
167
168 -#ifdef CONFIG_MTD_PARTITIONS
169 static struct mtd_partition wp54g_wrt_partitions[] = {
170 {
171 .name = "cfe",
172 @@ -28,7 +27,6 @@ static struct mtd_partition wp54g_wrt_pa
173 .size = 0x010000,
174 }
175 };
176 -#endif /* CONFIG_MTD_PARTITIONS */
177
178 static struct adm5120_pci_irq wp54_pci_irqs[] __initdata = {
179 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
180 @@ -83,10 +81,8 @@ MIPS_MACHINE(MACH_ADM5120_WP54, "WP54",
181
182 static void __init wp54_wrt_setup(void)
183 {
184 -#ifdef CONFIG_MTD_PARTITIONS
185 adm5120_flash0_data.nr_parts = ARRAY_SIZE(wp54g_wrt_partitions);
186 adm5120_flash0_data.parts = wp54g_wrt_partitions;
187 -#endif
188
189 wp54_setup();
190 }
191 --- a/arch/mips/adm5120/zyxel/p-33x.c
192 +++ b/arch/mips/adm5120/zyxel/p-33x.c
193 @@ -16,7 +16,6 @@
194 #define P33X_GPIO_FLASH_A20 ADM5120_GPIO_PIN5
195 #define P33X_GPIO_DEV_MASK (1 << P33X_GPIO_FLASH_A20)
196
197 -#ifdef CONFIG_MTD_PARTITIONS
198 static struct mtd_partition p33x_partitions[] = {
199 {
200 .name = "bootbase",
201 @@ -46,7 +45,6 @@ static struct mtd_partition p33x_partiti
202 .size = MTDPART_SIZ_FULL,
203 }
204 };
205 -#endif /* CONFIG_MTD_PARTITIONS */
206
207 static struct adm5120_pci_irq p33x_pci_irqs[] __initdata = {
208 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
209 @@ -75,10 +73,8 @@ void __init p33x_generic_setup(void)
210 gpio_request(P33X_GPIO_FLASH_A20, NULL); /* for flash A20 line */
211 gpio_direction_output(P33X_GPIO_FLASH_A20, 0);
212 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
213 -#ifdef CONFIG_MTD_PARTITIONS
214 adm5120_flash0_data.nr_parts = ARRAY_SIZE(p33x_partitions);
215 adm5120_flash0_data.parts = p33x_partitions;
216 -#endif /* CONFIG_MTD_PARTITIONS */
217 adm5120_add_device_flash(0);
218
219 adm5120_add_device_uart(0);
220 --- a/arch/mips/adm5120/generic/eb-214a.c
221 +++ b/arch/mips/adm5120/generic/eb-214a.c
222 @@ -28,7 +28,6 @@
223 #define EB214A_GPIO_DEV_MASK 0
224 #define EB214A_CONFIG_OFFSET 0x4000
225
226 -#ifdef CONFIG_MTD_PARTITIONS
227 static struct mtd_partition eb214a_partitions[] = {
228 {
229 .name = "bootloader",
230 @@ -45,7 +44,6 @@ static struct mtd_partition eb214a_parti
231 .size = MTDPART_SIZ_FULL,
232 }
233 };
234 -#endif /* CONFIG_MTD_PARTITIONS */
235
236 static struct adm5120_pci_irq eb214a_pci_irqs[] __initdata = {
237 PCIIRQ(4, 0, 1, ADM5120_IRQ_PCI0),
238 @@ -94,10 +92,8 @@ static void __init eb214a_mac_setup(void
239
240 static void __init eb214a_setup(void)
241 {
242 -#ifdef CONFIG_MTD_PARTITIONS
243 adm5120_flash0_data.nr_parts = ARRAY_SIZE(eb214a_partitions);
244 adm5120_flash0_data.parts = eb214a_partitions;
245 -#endif /* CONFIG_MTD_PARTITIONS */
246 adm5120_add_device_flash(0);
247
248 adm5120_add_device_gpio(EB214A_GPIO_DEV_MASK);
249 --- a/arch/mips/adm5120/motorola/pmugw.c
250 +++ b/arch/mips/adm5120/motorola/pmugw.c
251 @@ -26,7 +26,6 @@
252 #define PMUGW_CONFIG_OFFSET 0x10000
253 #define PMUGW_CONFIG_SIZE 0x1000
254
255 -#ifdef CONFIG_MTD_PARTITIONS
256 static struct mtd_partition pmugw_partitions[] = {
257 {
258 .name = "admboot",
259 @@ -43,7 +42,6 @@ static struct mtd_partition pmugw_partit
260 .size = MTDPART_SIZ_FULL,
261 }
262 };
263 -#endif /* CONFIG_MTD_PARTITIONS */
264
265 static u8 pmugw_vlans[6] __initdata = {
266 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
267 @@ -82,10 +80,8 @@ void __init pmugw_setup(void)
268 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
269 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
270
271 -#ifdef CONFIG_MTD_PARTITIONS
272 adm5120_flash0_data.nr_parts = ARRAY_SIZE(pmugw_partitions);
273 adm5120_flash0_data.parts = pmugw_partitions;
274 -#endif /* CONFIG_MTD_PARTITIONS */
275
276 adm5120_add_device_uart(1); /* ttyS0 */
277 adm5120_add_device_uart(0); /* ttyS1 */
278 --- a/arch/mips/adm5120/osbridge/5gxi.c
279 +++ b/arch/mips/adm5120/osbridge/5gxi.c
280 @@ -20,7 +20,6 @@
281 #include <asm/mach-adm5120/adm5120_platform.h>
282 #include <asm/mach-adm5120/adm5120_info.h>
283
284 -#ifdef CONFIG_MTD_PARTITIONS
285 static struct mtd_partition osbridge_5gxi_partitions[] = {
286 {
287 .name = "bootloader",
288 @@ -37,7 +36,6 @@ static struct mtd_partition osbridge_5gx
289 .size = MTDPART_SIZ_FULL,
290 }
291 };
292 -#endif /* CONFIG_MTD_PARTITIONS */
293
294 static struct gpio_led osbridge_5gxi_gpio_leds[] __initdata = {
295 GPIO_LED_INV(ADM5120_GPIO_PIN6, "5gxi:green:user", NULL),
296 @@ -54,10 +52,8 @@ static u8 osbridge_5gxi_vlans[6] __initd
297
298 static void __init osbridge_5gxi_setup(void)
299 {
300 -#ifdef CONFIG_MTD_PARTITIONS
301 adm5120_flash0_data.nr_parts = ARRAY_SIZE(osbridge_5gxi_partitions);
302 adm5120_flash0_data.parts = osbridge_5gxi_partitions;
303 -#endif /* CONFIG_MTD_PARTITIONS */
304
305 adm5120_add_device_uart(0);
306 adm5120_add_device_uart(1);