b08ada5e3ff1cddef9935ba338809e8034c27b3b
[lede.git] / target / linux / lantiq / files-3.1 / arch / mips / lantiq / xway / mach-arv45xx.c
1 /*
2  *  This program is free software; you can redistribute it and/or modify it
3  *  under the terms of the GNU General Public License version 2 as published
4  *  by the Free Software Foundation.
5  *
6  *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
7  */
8
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/leds.h>
12 #include <linux/gpio.h>
13 #include <linux/gpio_buttons.h>
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mtd/physmap.h>
17 #include <linux/input.h>
18 #include <linux/etherdevice.h>
19 #include <linux/ath5k_platform.h>
20 #include <linux/pci.h>
21
22 #include <lantiq_soc.h>
23 #include <lantiq_platform.h>
24 #include <dev-gpio-leds.h>
25
26 #include "../machtypes.h"
27 #include "../dev-wifi-rt2x00.h"
28 #include "devices.h"
29 #include "dev-dwc_otg.h"
30
31 static struct mtd_partition arv4510_partitions[] =
32 {
33         {
34                 .name   = "uboot",
35                 .offset = 0x0,
36                 .size   = 0x20000,
37         },
38         {
39                 .name   = "uboot_env",
40                 .offset = 0x20000,
41                 .size   = 0x120000,
42         },
43         {
44                 .name   = "linux",
45                 .offset = 0x40000,
46                 .size   = 0xfa0000,
47         },
48         {
49                 .name   = "board_config",
50                 .offset = 0xfe0000,
51                 .size   = 0x20000,
52         },
53 };
54
55 static struct mtd_partition arv45xx_partitions[] =
56 {
57         {
58                 .name   = "uboot",
59                 .offset = 0x0,
60                 .size   = 0x20000,
61         },
62         {
63                 .name   = "uboot_env",
64                 .offset = 0x20000,
65                 .size   = 0x10000,
66         },
67         {
68                 .name   = "linux",
69                 .offset = 0x30000,
70                 .size   = 0x3c0000,
71         },
72         {
73                 .name   = "board_config",
74                 .offset = 0x3f0000,
75                 .size   = 0x10000,
76         },
77 };
78
79 static struct mtd_partition arv7525_partitions[] =
80 {
81         {
82                 .name   = "uboot",
83                 .offset = 0x0,
84                 .size   = 0x10000,
85         },
86         {
87                 .name   = "uboot_env",
88                 .offset = 0x10000,
89                 .size   = 0x10000,
90         },
91         {
92                 .name   = "linux",
93                 .offset = 0x20000,
94                 .size   = 0x3d0000,
95         },
96         {
97                 .name   = "board_config",
98                 .offset = 0x3f0000,
99                 .size   = 0x10000,
100         },
101 };
102
103 static struct mtd_partition arv75xx_partitions[] =
104 {
105         {
106                 .name   = "uboot",
107                 .offset = 0x0,
108                 .size   = 0x10000,
109         },
110         {
111                 .name   = "uboot_env",
112                 .offset = 0x10000,
113                 .size   = 0x10000,
114         },
115         {
116                 .name   = "linux",
117                 .offset = 0x20000,
118                 .size   = 0x7d0000,
119         },
120         {
121                 .name   = "board_config",
122                 .offset = 0x7f0000,
123                 .size   = 0x10000,
124         },
125 };
126
127 static struct physmap_flash_data arv4510_flash_data = {
128         .nr_parts       = ARRAY_SIZE(arv4510_partitions),
129         .parts          = arv4510_partitions,
130 };
131
132 static struct physmap_flash_data arv45xx_flash_data = {
133         .nr_parts       = ARRAY_SIZE(arv45xx_partitions),
134         .parts          = arv45xx_partitions,
135 };
136
137 static struct physmap_flash_data arv7525_flash_data = {
138         .nr_parts       = ARRAY_SIZE(arv7525_partitions),
139         .parts          = arv7525_partitions,
140 };
141
142 static struct physmap_flash_data arv75xx_flash_data = {
143         .nr_parts       = ARRAY_SIZE(arv75xx_partitions),
144         .parts          = arv75xx_partitions,
145 };
146
147 static struct ltq_pci_data ltq_pci_data = {
148         .clock  = PCI_CLOCK_EXT,
149         .gpio   = PCI_GNT1 | PCI_REQ1,
150         .irq    = {
151                 [14] = INT_NUM_IM0_IRL0 + 22,
152         },
153 };
154
155 static struct ltq_eth_data ltq_eth_data = {
156         .mii_mode       = PHY_INTERFACE_MODE_RMII,
157 };
158
159 static struct gpio_led
160 arv4510pw_gpio_leds[] __initdata = {
161         { .name = "soc:green:foo", .gpio = 4, .active_low = 1, },
162 };
163
164 static struct gpio_led
165 arv4518pw_gpio_leds[] __initdata = {
166         { .name = "soc:green:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
167         { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
168         { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
169         { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
170         { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
171         { .name = "soc:red:fail", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
172         { .name = "soc:green:usb", .gpio = 19, .active_low = 1, .default_trigger = "default-on" },
173         { .name = "soc:green:voip", .gpio = 100, .active_low = 1, .default_trigger = "default-on" },
174         { .name = "soc:green:fxs1", .gpio = 101, .active_low = 1, .default_trigger = "default-on" },
175         { .name = "soc:green:fxs2", .gpio = 102, .active_low = 1, .default_trigger = "default-on" },
176         { .name = "soc:green:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
177 };
178
179 static struct gpio_button
180 arv4518pw_gpio_buttons[] __initdata = {
181         { .desc = "wlan", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, },
182         { .desc = "wps", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 29, .active_low = 1, },
183         { .desc = "reset", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 30, .active_low = 1, },
184 };
185
186 static struct gpio_led
187 arv4520pw_gpio_leds[] __initdata = {
188         { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
189         { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
190         { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
191         { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
192         { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, },
193         { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
194         { .name = "soc:blue:voip", .gpio = 100, .active_low = 1, },
195         { .name = "soc:blue:fxs1", .gpio = 101, .active_low = 1, },
196         { .name = "soc:blue:fxs2", .gpio = 102, .active_low = 1, },
197         { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, },
198         { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, },
199         { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, },
200         { .name = "soc:blue:wlan", .gpio = 106, .active_low = 1, },
201 };
202
203 static struct gpio_led
204 arv452cpw_gpio_leds[] __initdata = {
205         { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
206         { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
207         { .name = "soc:blue:isdn", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
208         { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
209         { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
210         { .name = "soc:red:wps", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
211         { .name = "soc:blue:fxs1", .gpio = 100, .active_low = 1, .default_trigger = "default-on" },
212         { .name = "soc:blue:fxs2", .gpio = 101, .active_low = 1, .default_trigger = "default-on" },
213         { .name = "soc:blue:wps", .gpio = 102, .active_low = 1, .default_trigger = "default-on" },
214         { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
215         { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" },
216         { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" },
217         { .name = "soc:blue:wlan", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
218         { .name = "soc:blue:internet", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
219         { .name = "soc:red:internet", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
220 };
221
222 static struct gpio_led
223 arv4525pw_gpio_leds[] __initdata = {
224         { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
225         { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
226         { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
227         { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
228         { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
229 };
230
231 static struct gpio_led
232 arv752dpw22_gpio_leds[] __initdata = {
233         { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
234         { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
235         { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
236         { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
237         { .name = "soc:red:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
238         { .name = "soc:red:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" },
239         { .name = "soc:green:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" },
240         { .name = "soc:green:wlan", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
241         { .name = "soc:green:wlan1", .gpio = 107, .active_low = 1, .default_trigger = "default-on" },
242         { .name = "soc:blue:wlan", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
243         { .name = "soc:blue:wlan1", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
244         { .name = "soc:green:eth1", .gpio = 111, .active_low = 1, .default_trigger = "default-on" },
245         { .name = "soc:green:eth2", .gpio = 112, .active_low = 1, .default_trigger = "default-on" },
246         { .name = "soc:green:eth3", .gpio = 113, .active_low = 1, .default_trigger = "default-on" },
247         { .name = "soc:green:eth4", .gpio = 114, .active_low = 1, .default_trigger = "default-on", },
248 };
249
250 static struct gpio_button
251 arv752dpw22_gpio_buttons[] __initdata = {
252         { .desc = "btn0", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 12, .active_low = 1, },
253         { .desc = "btn1", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 13, .active_low = 1, },
254         { .desc = "btn2", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 28, .active_low = 1, },
255 };
256
257 static struct gpio_led
258 arv7518pw_gpio_leds[] __initdata = {
259         { .name = "soc:green:power", .gpio = 2, .active_low = 1, },
260         { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
261         { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
262         { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
263         { .name = "soc:red:internet", .gpio = 8, .active_low = 1, },
264         { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
265 };
266
267 static struct gpio_button
268 arv7518pw_gpio_buttons[] __initdata = {
269         { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 23, .active_low = 1, },
270         { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 25, .active_low = 1, },
271 };
272
273 static void
274 arv45xx_register_ethernet(void)
275 {
276 #define ARV45XX_BRN_MAC                 0x3f0016
277         memcpy_fromio(&ltq_eth_data.mac.sa_data,
278                 (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_MAC), 6);
279         ltq_register_etop(&ltq_eth_data);
280 }
281
282 static void
283 arv75xx_register_ethernet(void)
284 {
285 #define ARV75XX_BRN_MAC                 0x7f0016
286         memcpy_fromio(&ltq_eth_data.mac.sa_data,
287                 (void *)KSEG1ADDR(LTQ_FLASH_START + ARV75XX_BRN_MAC), 6);
288         ltq_register_etop(&ltq_eth_data);
289 }
290
291 static void
292 bewan_register_ethernet(void)
293 {
294 #define BEWAN_BRN_MAC                   0x3f0014
295         memcpy_fromio(&ltq_eth_data.mac.sa_data,
296                 (void *)KSEG1ADDR(LTQ_FLASH_START + BEWAN_BRN_MAC), 6);
297         ltq_register_etop(&ltq_eth_data);
298 }
299
300 static u16 arv45xx_ath5k_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
301 static struct ath5k_platform_data arv45xx_ath5k_platform_data;
302
303 /*static int arv45xx_pci_plat_dev_init(struct pci_dev *dev)
304 {
305         dev->dev.platform_data = &arv45xx_ath5k_platform_data;
306         return 0;
307 }
308 */
309 void __init
310 arv45xx_register_ath5k(void)
311 {
312 #define ARV45XX_BRN_ATH         0x3f0478
313         int i;
314         unsigned char eeprom_mac[6];
315         static u16 eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
316         u32 *p = (u32*)arv45xx_ath5k_eeprom_data;
317
318         memcpy_fromio(eeprom_mac,
319                 (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_MAC), 6);
320         eeprom_mac[5]++;
321         memcpy_fromio(arv45xx_ath5k_eeprom_data,
322                 (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_ATH), ATH5K_PLAT_EEP_MAX_WORDS);
323         // swap eeprom bytes
324         for (i = 0; i < ATH5K_PLAT_EEP_MAX_WORDS>>1; i++){
325                 //arv4518_ath5k_eeprom_data[i] = ((eeprom_data[i]&0xff)<<8)|((eeprom_data[i]&0xff00)>>8);
326                 p[i] = ((eeprom_data[(i<<1)+1]&0xff)<<24)|((eeprom_data[(i<<1)+1]&0xff00)<<8)|((eeprom_data[i<<1]&0xff)<<8)|((eeprom_data[i<<1]&0xff00)>>8);
327                 if (i == 0xbf>>1){
328                         // printk ("regdomain: 0x%x --> 0x%x\n", p[i], (p[i] & 0xffff0000)|0x67);
329                         /* regdomain is invalid?? how did original fw convert 
330                         * value to 0x82d4 ??
331                         * for now, force to 0x67 */
332                         p[i] &= 0xffff0000;
333                         p[i] |= 0x67;
334                 }
335         }
336         arv45xx_ath5k_platform_data.eeprom_data = arv45xx_ath5k_eeprom_data;
337         arv45xx_ath5k_platform_data.macaddr = eeprom_mac;
338         //lqpci_plat_dev_init = arv45xx_pci_plat_dev_init;
339 }
340
341 static void __init
342 arv3527p_init(void)
343 {
344         ltq_register_gpio_stp();
345         //ltq_add_device_gpio_leds(arv3527p_gpio_leds, ARRAY_SIZE(arv3527p_gpio_leds));
346         ltq_register_nor(&arv45xx_flash_data);
347         arv45xx_register_ethernet();
348 }
349
350 MIPS_MACHINE(LANTIQ_MACH_ARV3527P,
351                         "ARV3527P",
352                         "ARV3527P - Arcor Easybox 401",
353                         arv3527p_init);
354
355 static void __init
356 arv4510pw_init(void)
357 {
358         ltq_register_gpio_stp();
359         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4510pw_gpio_leds), arv4510pw_gpio_leds);
360         ltq_register_nor(&arv4510_flash_data);
361         ltq_pci_data.irq[12] = (INT_NUM_IM2_IRL0 + 31);
362         ltq_pci_data.irq[15] = (INT_NUM_IM0_IRL0 + 26);
363         ltq_pci_data.gpio |= PCI_EXIN2 | PCI_REQ2;
364         ltq_register_pci(&ltq_pci_data);
365         bewan_register_ethernet();
366 }
367
368 MIPS_MACHINE(LANTIQ_MACH_ARV4510PW,
369                         "ARV4510PW",
370                         "ARV4510PW - Wippies Homebox",
371                         arv4510pw_init);
372
373 static void __init
374 arv4518pw_init(void)
375 {
376 #define ARV4518PW_EBU                   0
377 #define ARV4518PW_USB                   14
378 #define ARV4518PW_SWITCH_RESET          13
379 #define ARV4518PW_MADWIFI_ADDR          0xb07f0400
380
381         ltq_register_gpio_ebu(ARV4518PW_EBU);
382         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4518pw_gpio_leds), arv4518pw_gpio_leds);
383         ltq_register_gpio_buttons(arv4518pw_gpio_buttons, ARRAY_SIZE(arv4518pw_gpio_buttons));
384         ltq_register_nor(&arv45xx_flash_data);
385         ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
386         ltq_register_pci(&ltq_pci_data);
387         ltq_register_madwifi_eep(ARV4518PW_MADWIFI_ADDR);
388         xway_register_dwc(ARV4518PW_USB);
389         arv45xx_register_ethernet();
390         arv45xx_register_ath5k();
391
392         gpio_request(ARV4518PW_SWITCH_RESET, "switch");
393         gpio_direction_output(ARV4518PW_SWITCH_RESET, 1);
394         gpio_export(ARV4518PW_SWITCH_RESET, 0);
395 }
396
397 MIPS_MACHINE(LANTIQ_MACH_ARV4518PW,
398                         "ARV4518PW",
399                         "ARV4518PW - SMC7908A-ISP, Airties WAV-221",
400                         arv4518pw_init);
401
402 static void __init
403 arv4520pw_init(void)
404 {
405 #define ARV4520PW_EBU                   0x400
406 #define ARV4520PW_USB                   28
407 #define ARV4520PW_SWITCH_RESET          110
408
409         ltq_register_gpio_ebu(ARV4520PW_EBU);
410         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4520pw_gpio_leds), arv4520pw_gpio_leds);
411         ltq_register_nor(&arv45xx_flash_data);
412         ltq_register_pci(&ltq_pci_data);
413         ltq_register_tapi();
414         arv45xx_register_ethernet();
415         xway_register_dwc(ARV4520PW_USB);
416
417         gpio_request(ARV4520PW_SWITCH_RESET, "switch");
418         gpio_set_value(ARV4520PW_SWITCH_RESET, 1);
419 }
420
421 MIPS_MACHINE(LANTIQ_MACH_ARV4520PW,
422                         "ARV4520PW",
423                         "ARV4520PW - Airties WAV-281, Arcor A800",
424                         arv4520pw_init);
425
426 static void __init
427 arv452Cpw_init(void)
428 {
429 #define ARV452CPW_EBU                   0x77f
430 #define ARV452CPW_USB                   28
431 #define ARV452CPW_RELAY1                31
432 #define ARV452CPW_RELAY2                107
433 #define ARV452CPW_SWITCH_RESET          110
434 #define ARV452CPW_MADWIFI_ADDR          0xb07f0400
435
436         ltq_register_gpio_ebu(ARV452CPW_EBU);
437         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv452cpw_gpio_leds), arv452cpw_gpio_leds);
438         ltq_register_nor(&arv45xx_flash_data);
439         ltq_register_pci(&ltq_pci_data);
440         ltq_register_madwifi_eep(ARV452CPW_MADWIFI_ADDR);
441         xway_register_dwc(ARV452CPW_USB);
442         arv45xx_register_ethernet();
443         arv45xx_register_ath5k();
444
445         gpio_request(ARV452CPW_SWITCH_RESET, "switch");
446         gpio_set_value(ARV452CPW_SWITCH_RESET, 1);
447         gpio_export(ARV452CPW_SWITCH_RESET, 0);
448
449         gpio_request(ARV452CPW_RELAY1, "relay1");
450         gpio_direction_output(ARV452CPW_RELAY1, 1);
451         gpio_export(ARV452CPW_RELAY1, 0);
452
453         gpio_request(ARV452CPW_RELAY2, "relay2");
454         gpio_set_value(ARV452CPW_RELAY2, 1);
455         gpio_export(ARV452CPW_RELAY2, 0);
456 }
457
458 MIPS_MACHINE(LANTIQ_MACH_ARV452CPW,
459                         "ARV452CPW",
460                         "ARV452CPW - Arcor A801",
461                         arv452Cpw_init);
462
463 #define ARV4525PW_MADWIFI_ADDR          0xb07f0400
464
465 static void __init
466 arv4525pw_init(void)
467 {
468         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
469         ltq_register_nor(&arv45xx_flash_data);
470         ltq_pci_data.clock = PCI_CLOCK_INT;
471         ltq_register_pci(&ltq_pci_data);
472         ltq_register_madwifi_eep(ARV4525PW_MADWIFI_ADDR);
473         ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
474         arv45xx_register_ethernet();
475 }
476
477 MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
478                         "ARV4525PW",
479                         "ARV4525PW - Speedport W502V",
480                         arv4525pw_init);
481
482 static void __init
483 arv7525pw_init(void)
484 {
485         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
486         ltq_register_nor(&arv7525_flash_data);
487         ltq_pci_data.clock = PCI_CLOCK_INT;
488         ltq_pci_data.gpio |= PCI_EXIN1;
489         ltq_pci_data.irq[14] = (INT_NUM_IM3_IRL0 + 31);
490         ltq_register_pci(&ltq_pci_data);
491         ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
492         arv45xx_register_ethernet();
493         ltq_register_rt2x00("RT2860.eeprom");
494         ltq_register_tapi();
495 }
496
497 MIPS_MACHINE(LANTIQ_MACH_ARV7525PW,
498                         "ARV7525PW",
499                         "ARV7525PW - Speedport W303V",
500                         arv7525pw_init);
501
502 static void __init
503 arv7518pw_init(void)
504 {
505 #define ARV7518PW_EBU                   0x2
506 #define ARV7518PW_USB                   14
507
508         ltq_register_gpio_ebu(ARV7518PW_EBU);
509         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv7518pw_gpio_leds), arv7518pw_gpio_leds);
510         ltq_register_gpio_buttons(arv7518pw_gpio_buttons, ARRAY_SIZE(arv7518pw_gpio_buttons));
511         ltq_register_nor(&arv75xx_flash_data);
512         ltq_register_pci(&ltq_pci_data);
513         ltq_register_tapi();
514         xway_register_dwc(ARV7518PW_USB);
515         arv75xx_register_ethernet();
516         //arv7518_register_ath9k(mac);
517 }
518
519 MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
520                         "ARV7518PW",
521                         "ARV7518PW - ASTORIA",
522                         arv7518pw_init);
523
524 static void __init
525 arv752dpw22_init(void)
526 {
527 #define ARV752DPW22_EBU                 0x2
528 #define ARV752DPW22_USB                 100
529 #define ARV752DPW22_RELAY               101
530
531         ltq_register_gpio_ebu(ARV752DPW22_EBU);
532         ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv752dpw22_gpio_leds), arv752dpw22_gpio_leds);
533         ltq_register_gpio_buttons(arv752dpw22_gpio_buttons, ARRAY_SIZE(arv752dpw22_gpio_buttons));
534         ltq_register_nor(&arv75xx_flash_data);
535         ltq_pci_data.irq[15] = (INT_NUM_IM3_IRL0 + 31);
536         ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
537         ltq_register_pci(&ltq_pci_data);
538         xway_register_dwc(ARV752DPW22_USB);
539         arv75xx_register_ethernet();
540
541         gpio_request(ARV752DPW22_RELAY, "relay");
542         gpio_set_value(ARV752DPW22_RELAY, 1);
543         gpio_export(ARV752DPW22_RELAY, 0);
544 }
545
546 MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
547                         "ARV752DPW22",
548                         "ARV752DPW22 - Arcor A803",
549                         arv752dpw22_init);