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