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