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.
6 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
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/ath9k_platform.h>
21 #include <linux/pci.h>
23 #include <lantiq_soc.h>
24 #include <lantiq_platform.h>
25 #include <dev-gpio-leds.h>
26 #include <dev-gpio-buttons.h>
28 #include "../machtypes.h"
29 #include "dev-wifi-rt2x00.h"
30 #include "dev-wifi-athxk.h"
32 #include "dev-dwc_otg.h"
33 #include "pci-ath-fixup.h"
35 static struct mtd_partition arv45xx_brnboot_partitions
[] =
53 .name
= "reserved", /* 12-byte signature at 0x3efff4 :/ */
64 static struct mtd_partition arv75xx_brnboot_partitions
[] =
82 .name
= "reserved", /* 12-byte signature at 0x7efff4 :/ */
87 .name
= "board_config",
94 * this is generic configuration for all arv based boards, note that it can be
95 * rewriten in arv_load_nor()
97 static struct mtd_partition arv_partitions
[] =
115 .name
= "board_config",
121 static struct physmap_flash_data arv45xx_brnboot_flash_data
= {
122 .nr_parts
= ARRAY_SIZE(arv45xx_brnboot_partitions
),
123 .parts
= arv45xx_brnboot_partitions
,
126 static struct physmap_flash_data arv75xx_brnboot_flash_data
= {
127 .nr_parts
= ARRAY_SIZE(arv75xx_brnboot_partitions
),
128 .parts
= arv75xx_brnboot_partitions
,
131 static struct physmap_flash_data arv_flash_data
= {
132 .nr_parts
= ARRAY_SIZE(arv_partitions
),
133 .parts
= arv_partitions
,
136 static struct ltq_pci_data ltq_pci_data
= {
137 .clock
= PCI_CLOCK_EXT
,
138 .gpio
= PCI_GNT1
| PCI_REQ1
,
140 [14] = INT_NUM_IM0_IRL0
+ 22,
144 static struct ltq_eth_data ltq_eth_data
= {
145 .mii_mode
= PHY_INTERFACE_MODE_RMII
,
148 static struct gpio_led
149 arv4510pw_gpio_leds
[] __initdata
= {
150 { .name
= "soc:green:foo", .gpio
= 4, .active_low
= 1, },
153 static struct gpio_led
154 arv4518pw_gpio_leds
[] __initdata
= {
155 { .name
= "soc:green:power", .gpio
= 3, .active_low
= 1, .default_trigger
= "default-on" },
156 { .name
= "soc:green:adsl", .gpio
= 4, .active_low
= 1, .default_trigger
= "default-on" },
157 { .name
= "soc:green:internet", .gpio
= 5, .active_low
= 1, .default_trigger
= "default-on" },
158 { .name
= "soc:green:wifi", .gpio
= 6, .active_low
= 1, .default_trigger
= "default-on" },
159 { .name
= "soc:yellow:wps", .gpio
= 7, .active_low
= 1, .default_trigger
= "default-on" },
160 { .name
= "soc:red:fail", .gpio
= 8, .active_low
= 1, .default_trigger
= "default-on" },
161 { .name
= "soc:green:usb", .gpio
= 19, .active_low
= 1, .default_trigger
= "default-on" },
162 { .name
= "soc:green:voip", .gpio
= 100, .active_low
= 1, .default_trigger
= "default-on" },
163 { .name
= "soc:green:fxs1", .gpio
= 101, .active_low
= 1, .default_trigger
= "default-on" },
164 { .name
= "soc:green:fxs2", .gpio
= 102, .active_low
= 1, .default_trigger
= "default-on" },
165 { .name
= "soc:green:fxo", .gpio
= 103, .active_low
= 1, .default_trigger
= "default-on" },
168 static struct gpio_keys_button
169 arv4518pw_gpio_keys
[] __initdata
= {
174 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
182 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
190 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
196 static struct gpio_led
197 arv4519pw_gpio_leds
[] __initdata
= {
198 { .name
= "soc:red:power", .gpio
= 7, .active_low
= 1, },
199 { .name
= "soc:green:power", .gpio
= 2, .active_low
= 1, .default_trigger
= "default-on" },
200 { .name
= "soc:green:wifi", .gpio
= 6, .active_low
= 1, },
201 { .name
= "soc:green:adsl", .gpio
= 4, .active_low
= 1, },
202 { .name
= "soc:green:internet", .gpio
= 5, .active_low
= 1, },
203 { .name
= "soc:red:internet", .gpio
= 8, .active_low
= 1, },
204 { .name
= "soc:green:voip", .gpio
= 100, .active_low
= 1, },
205 { .name
= "soc:green:phone1", .gpio
= 101, .active_low
= 1, },
206 { .name
= "soc:green:phone2", .gpio
= 102, .active_low
= 1, },
207 { .name
= "soc:green:fxo", .gpio
= 103, .active_low
= 1, },
208 { .name
= "soc:green:usb", .gpio
= 19, .active_low
= 1, },
209 { .name
= "soc:orange:wps", .gpio
= 104, .active_low
= 1, },
210 { .name
= "soc:green:wps", .gpio
= 105, .active_low
= 1, },
211 { .name
= "soc:red:wps", .gpio
= 106, .active_low
= 1, },
215 static struct gpio_keys_button
216 arv4519pw_gpio_keys
[] __initdata
= {
221 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
229 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
235 static struct gpio_led
236 arv4520pw_gpio_leds
[] __initdata
= {
237 { .name
= "soc:blue:power", .gpio
= 3, .active_low
= 1, },
238 { .name
= "soc:blue:adsl", .gpio
= 4, .active_low
= 1, },
239 { .name
= "soc:blue:internet", .gpio
= 5, .active_low
= 1, },
240 { .name
= "soc:red:power", .gpio
= 6, .active_low
= 1, },
241 { .name
= "soc:yellow:wps", .gpio
= 7, .active_low
= 1, },
242 { .name
= "soc:red:wps", .gpio
= 9, .active_low
= 1, },
243 { .name
= "soc:blue:voip", .gpio
= 100, .active_low
= 1, },
244 { .name
= "soc:blue:fxs1", .gpio
= 101, .active_low
= 1, },
245 { .name
= "soc:blue:fxs2", .gpio
= 102, .active_low
= 1, },
246 { .name
= "soc:blue:fxo", .gpio
= 103, .active_low
= 1, },
247 { .name
= "soc:blue:voice", .gpio
= 104, .active_low
= 1, },
248 { .name
= "soc:blue:usb", .gpio
= 105, .active_low
= 1, },
249 { .name
= "soc:blue:wifi", .gpio
= 106, .active_low
= 1, },
252 static struct gpio_led
253 arv452cpw_gpio_leds
[] __initdata
= {
254 { .name
= "soc:blue:power", .gpio
= 3, .active_low
= 1, .default_trigger
= "default-on" },
255 { .name
= "soc:blue:adsl", .gpio
= 4, .active_low
= 1, .default_trigger
= "default-on" },
256 { .name
= "soc:blue:isdn", .gpio
= 5, .active_low
= 1, .default_trigger
= "default-on" },
257 { .name
= "soc:red:power", .gpio
= 6, .active_low
= 1, .default_trigger
= "default-on" },
258 { .name
= "soc:yellow:wps", .gpio
= 7, .active_low
= 1, .default_trigger
= "default-on" },
259 { .name
= "soc:red:wps", .gpio
= 9, .active_low
= 1, .default_trigger
= "default-on" },
260 { .name
= "soc:blue:fxs1", .gpio
= 100, .active_low
= 1, .default_trigger
= "default-on" },
261 { .name
= "soc:blue:fxs2", .gpio
= 101, .active_low
= 1, .default_trigger
= "default-on" },
262 { .name
= "soc:blue:wps", .gpio
= 102, .active_low
= 1, .default_trigger
= "default-on" },
263 { .name
= "soc:blue:fxo", .gpio
= 103, .active_low
= 1, .default_trigger
= "default-on" },
264 { .name
= "soc:blue:voice", .gpio
= 104, .active_low
= 1, .default_trigger
= "default-on" },
265 { .name
= "soc:blue:usb", .gpio
= 105, .active_low
= 1, .default_trigger
= "default-on" },
266 { .name
= "soc:blue:wifi", .gpio
= 106, .active_low
= 1, .default_trigger
= "default-on" },
267 { .name
= "soc:blue:internet", .gpio
= 108, .active_low
= 1, .default_trigger
= "default-on" },
268 { .name
= "soc:red:internet", .gpio
= 109, .active_low
= 1, .default_trigger
= "default-on" },
271 static struct gpio_led
272 arv4525pw_gpio_leds
[] __initdata
= {
273 { .name
= "soc:green:dsl", .gpio
= 6, .active_low
= 1, .default_trigger
= "default-on" },
274 { .name
= "soc:green:wifi", .gpio
= 8, .active_low
= 1, .default_trigger
= "default-on" },
275 { .name
= "soc:green:online", .gpio
= 9, .active_low
= 1, .default_trigger
= "default-on" },
276 { .name
= "soc:green:fxs-internet", .gpio
= 5, .active_low
= 1, .default_trigger
= "default-on" },
277 { .name
= "soc:green:fxs-festnetz", .gpio
= 4, .active_low
= 1, .default_trigger
= "default-on" },
280 #define ARV4525PW_PHYRESET 13
281 #define ARV4525PW_RELAY 31
284 arv4525pw_gpios
[] __initdata
= {
285 { ARV4525PW_PHYRESET
, GPIOF_OUT_INIT_HIGH
, "phyreset" },
286 { ARV4525PW_RELAY
, GPIOF_OUT_INIT_HIGH
, "relay" },
290 static struct gpio_led
291 arv752dpw22_gpio_leds
[] __initdata
= {
292 { .name
= "soc:blue:power", .gpio
= 3, .active_low
= 1, .default_trigger
= "default-on" },
293 { .name
= "soc:red:internet", .gpio
= 5, .active_low
= 1, .default_trigger
= "default-on" },
294 { .name
= "soc:red:power", .gpio
= 6, .active_low
= 1, .default_trigger
= "default-on" },
295 { .name
= "soc:red:wps", .gpio
= 8, .active_low
= 1, .default_trigger
= "default-on" },
296 { .name
= "soc:red:fxo", .gpio
= 103, .active_low
= 1, .default_trigger
= "default-on" },
297 { .name
= "soc:red:voice", .gpio
= 104, .active_low
= 1, .default_trigger
= "default-on" },
298 { .name
= "soc:green:usb", .gpio
= 105, .active_low
= 1, .default_trigger
= "default-on" },
299 { .name
= "soc:green:wifi", .gpio
= 106, .active_low
= 1, .default_trigger
= "default-on" },
300 { .name
= "soc:green:wifi1", .gpio
= 107, .active_low
= 1, .default_trigger
= "default-on" },
301 { .name
= "soc:blue:wifi", .gpio
= 108, .active_low
= 1, .default_trigger
= "default-on" },
302 { .name
= "soc:blue:wifi1", .gpio
= 109, .active_low
= 1, .default_trigger
= "default-on" },
303 { .name
= "soc:green:eth1", .gpio
= 111, .active_low
= 1, .default_trigger
= "default-on" },
304 { .name
= "soc:green:eth2", .gpio
= 112, .active_low
= 1, .default_trigger
= "default-on" },
305 { .name
= "soc:green:eth3", .gpio
= 113, .active_low
= 1, .default_trigger
= "default-on" },
306 { .name
= "soc:green:eth4", .gpio
= 114, .active_low
= 1, .default_trigger
= "default-on", },
309 static struct gpio_keys_button
310 arv752dpw22_gpio_keys
[] __initdata
= {
315 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
323 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
331 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
337 static struct gpio_led
338 arv7518pw_gpio_leds
[] __initdata
= {
339 { .name
= "soc:red:power", .gpio
= 7, .active_low
= 1, },
340 { .name
= "soc:green:power", .gpio
= 2, .active_low
= 1, .default_trigger
= "default-on" },
341 { .name
= "soc:green:wifi", .gpio
= 6, .active_low
= 1, },
342 { .name
= "soc:green:adsl", .gpio
= 4, .active_low
= 1, },
343 { .name
= "soc:green:internet", .gpio
= 5, .active_low
= 1, },
344 { .name
= "soc:red:internet", .gpio
= 8, .active_low
= 1, },
345 { .name
= "soc:green:voip", .gpio
= 100, .active_low
= 1, },
346 { .name
= "soc:green:phone1", .gpio
= 101, .active_low
= 1, },
347 { .name
= "soc:green:phone2", .gpio
= 102, .active_low
= 1, },
348 { .name
= "soc:orange:fail", .gpio
= 103, .active_low
= 1, },
349 { .name
= "soc:green:usb", .gpio
= 19, .active_low
= 1, },
350 { .name
= "soc:orange:wps", .gpio
= 104, .active_low
= 1, },
351 { .name
= "soc:green:wps", .gpio
= 105, .active_low
= 1, },
352 { .name
= "soc:red:wps", .gpio
= 106, .active_low
= 1, },
356 static struct gpio_keys_button
357 arv7518pw_gpio_keys
[] __initdata
= {
362 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
370 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
376 static struct gpio_keys_button
377 arv7525pw_gpio_keys
[] __initdata
= {
382 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
389 arv_load_nor(unsigned int max
)
391 #define UBOOT_MAGIC 0x27051956
398 ltq_register_nor(&arv75xx_brnboot_flash_data
);
400 ltq_register_nor(&arv45xx_brnboot_flash_data
);
404 for (i
= 1; i
< 4 && sector
< 0; i
++) {
405 unsigned int uboot_magic
;
406 memcpy_fromio(&uboot_magic
, (void *)KSEG1ADDR(LTQ_FLASH_START
) + (i
* 0x10000), 4);
407 if (uboot_magic
== UBOOT_MAGIC
)
414 arv_partitions
[0].size
= arv_partitions
[1].offset
= (sector
- 1) * 0x10000;
415 arv_partitions
[2].offset
= arv_partitions
[0].size
+ 0x10000;
416 arv_partitions
[2].size
= max
- arv_partitions
[2].offset
- 0x10000;
417 arv_partitions
[3].offset
= max
- 0x10000;
418 ltq_register_nor(&arv_flash_data
);
422 arv_register_ethernet(unsigned int mac_addr
)
424 memcpy_fromio(<q_eth_data
.mac
.sa_data
,
425 (void *)KSEG1ADDR(LTQ_FLASH_START
+ mac_addr
), 6);
426 ltq_register_etop(<q_eth_data
);
429 static u16 arv_ath5k_eeprom_data
[ATH5K_PLAT_EEP_MAX_WORDS
];
430 static u16 arv_ath9k_eeprom_data
[ATH9K_PLAT_EEP_MAX_WORDS
];
431 static u8 arv_athxk_eeprom_mac
[6];
434 arv_register_ath5k(unsigned int ath_addr
, unsigned int mac_addr
)
438 memcpy_fromio(arv_athxk_eeprom_mac
,
439 (void *)KSEG1ADDR(LTQ_FLASH_START
+ mac_addr
), 6);
440 arv_athxk_eeprom_mac
[5]++;
441 memcpy_fromio(arv_ath5k_eeprom_data
,
442 (void *)KSEG1ADDR(LTQ_FLASH_START
+ ath_addr
), ATH5K_PLAT_EEP_MAX_WORDS
);
444 for (i
= 0; i
< ATH5K_PLAT_EEP_MAX_WORDS
>>1; i
++) {
445 arv_ath5k_eeprom_data
[i
] = swab16(arv_ath5k_eeprom_data
[i
]);
448 * regdomain is invalid. it's unknown how did original
449 * fw convered value to 0x82d4 so for now force to 0x67
451 arv_ath5k_eeprom_data
[i
] &= 0x0000;
452 arv_ath5k_eeprom_data
[i
] |= 0x67;
458 arv_register_ath9k(unsigned int ath_addr
, unsigned int mac_addr
)
461 u16
*eepdata
, sum
, el
;
463 memcpy_fromio(arv_athxk_eeprom_mac
,
464 (void *)KSEG1ADDR(LTQ_FLASH_START
+ mac_addr
), 6);
465 arv_athxk_eeprom_mac
[5]++;
466 memcpy_fromio(arv_ath9k_eeprom_data
,
467 (void *)KSEG1ADDR(LTQ_FLASH_START
+ ath_addr
), ATH9K_PLAT_EEP_MAX_WORDS
);
469 // force regdomain to 0x67
470 arv_ath9k_eeprom_data
[0x208>>1] = 0x67;
472 // calculate new checksum
473 sum
= arv_ath9k_eeprom_data
[0x200>>1];
474 el
= sum
/ sizeof(u16
) - 2; /* skip length and (old) checksum */
475 eepdata
= (u16
*) (&arv_ath9k_eeprom_data
[0x204>>1]); /* after checksum */
476 for (i
= 0; i
< el
; i
++)
479 arv_ath9k_eeprom_data
[0x202>>1] = sum
;
485 #define ARV3527P_MAC_ADDR 0x3f0016
487 ltq_register_gpio_stp();
488 // ltq_add_device_gpio_leds(arv3527p_gpio_leds, ARRAY_SIZE(arv3527p_gpio_leds));
489 arv_load_nor(0x400000);
490 arv_register_ethernet(ARV3527P_MAC_ADDR
);
493 MIPS_MACHINE(LANTIQ_MACH_ARV3527P
,
495 "ARV3527P - Arcor Easybox 401",
501 #define ARV4510PW_MAC_ADDR 0x3f0014
503 ltq_register_gpio_stp();
504 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4510pw_gpio_leds
), arv4510pw_gpio_leds
);
505 arv_load_nor(0x400000);
506 ltq_pci_data
.irq
[12] = (INT_NUM_IM2_IRL0
+ 31);
507 ltq_pci_data
.irq
[15] = (INT_NUM_IM0_IRL0
+ 26);
508 ltq_pci_data
.gpio
|= PCI_EXIN2
| PCI_REQ2
;
509 ltq_register_pci(<q_pci_data
);
510 arv_register_ethernet(ARV4510PW_MAC_ADDR
);
513 MIPS_MACHINE(LANTIQ_MACH_ARV4510PW
,
515 "ARV4510PW - Wippies Homebox",
521 #define ARV4518PW_EBU 0
522 #define ARV4518PW_USB 14
523 #define ARV4518PW_SWITCH_RESET 13
524 #define ARV4518PW_ATH_ADDR 0x3f0400
525 #define ARV4518PW_MADWIFI_ADDR 0xb03f0400
526 #define ARV4518PW_MAC_ADDR 0x3f0016
528 ltq_register_gpio_ebu(ARV4518PW_EBU
);
529 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4518pw_gpio_leds
), arv4518pw_gpio_leds
);
530 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
,
531 ARRAY_SIZE(arv4518pw_gpio_keys
), arv4518pw_gpio_keys
);
532 arv_load_nor(0x400000);
533 ltq_pci_data
.gpio
= PCI_GNT2
| PCI_REQ2
;
534 ltq_register_pci(<q_pci_data
);
535 xway_register_dwc(ARV4518PW_USB
);
536 arv_register_ethernet(ARV4518PW_MAC_ADDR
);
537 arv_register_ath5k(ARV4518PW_ATH_ADDR
, ARV4518PW_MAC_ADDR
);
538 ltq_register_ath5k(arv_ath5k_eeprom_data
, arv_athxk_eeprom_mac
);
540 gpio_request(ARV4518PW_SWITCH_RESET
, "switch");
541 gpio_direction_output(ARV4518PW_SWITCH_RESET
, 1);
542 gpio_export(ARV4518PW_SWITCH_RESET
, 0);
545 MIPS_MACHINE(LANTIQ_MACH_ARV4518PW
,
547 "ARV4518PW - SMC7908A-ISP, Airties WAV-221",
553 #define ARV4519PW_EBU 0
554 #define ARV4519PW_USB 14
555 #define ARV4519PW_RELAY 31
556 #define ARV4519PW_SWITCH_RESET 13
557 #define ARV4519PW_ATH_ADDR 0x3f0400
558 #define ARV4519PW_MAC_ADDR 0x3f0016
560 arv_load_nor(0x400000);
561 ltq_register_gpio_ebu(ARV4519PW_EBU
);
562 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4519pw_gpio_leds
), arv4519pw_gpio_leds
);
563 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
,
564 ARRAY_SIZE(arv4519pw_gpio_keys
), arv4519pw_gpio_keys
);
565 ltq_pci_data
.gpio
= PCI_GNT2
| PCI_REQ1
;
566 ltq_register_pci(<q_pci_data
);
567 xway_register_dwc(ARV4519PW_USB
);
568 arv_register_ethernet(ARV4519PW_MAC_ADDR
);
569 arv_register_ath5k(ARV4519PW_ATH_ADDR
, ARV4519PW_MAC_ADDR
);
570 ltq_register_ath5k(arv_ath5k_eeprom_data
, arv_athxk_eeprom_mac
);
572 gpio_request(ARV4519PW_RELAY
, "relay");
573 gpio_direction_output(ARV4519PW_RELAY
, 1);
574 gpio_export(ARV4519PW_RELAY
, 0);
576 gpio_request(ARV4519PW_SWITCH_RESET
, "switch");
577 gpio_set_value(ARV4519PW_SWITCH_RESET
, 1);
578 gpio_export(ARV4519PW_SWITCH_RESET
, 0);
581 MIPS_MACHINE(LANTIQ_MACH_ARV4519PW
,
583 "ARV4519PW - Vodafone, Pirelli",
589 #define ARV4520PW_EBU 0x400
590 #define ARV4520PW_USB 28
591 #define ARV4520PW_SWITCH_RESET 110
592 #define ARV4520PW_MAC_ADDR 0x3f0016
594 ltq_register_gpio_ebu(ARV4520PW_EBU
);
595 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4520pw_gpio_leds
), arv4520pw_gpio_leds
);
596 arv_load_nor(0x400000);
597 ltq_register_pci(<q_pci_data
);
599 arv_register_ethernet(ARV4520PW_MAC_ADDR
);
600 ltq_register_rt2x00(NULL
, (const u8
*) ltq_eth_data
.mac
.sa_data
);
601 xway_register_dwc(ARV4520PW_USB
);
603 gpio_request(ARV4520PW_SWITCH_RESET
, "switch");
604 gpio_set_value(ARV4520PW_SWITCH_RESET
, 1);
607 MIPS_MACHINE(LANTIQ_MACH_ARV4520PW
,
609 "ARV4520PW - Airties WAV-281, Arcor A800",
615 #define ARV452CPW_EBU 0x77f
616 #define ARV452CPW_USB 28
617 #define ARV452CPW_RELAY1 31
618 #define ARV452CPW_RELAY2 107
619 #define ARV452CPW_SWITCH_RESET 110
620 #define ARV452CPW_ATH_ADDR 0x3f0400
621 #define ARV452CPW_MADWIFI_ADDR 0xb03f0400
622 #define ARV452CPW_MAC_ADDR 0x3f0016
624 ltq_register_gpio_ebu(ARV452CPW_EBU
);
625 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv452cpw_gpio_leds
), arv452cpw_gpio_leds
);
626 arv_load_nor(0x400000);
627 ltq_register_pci(<q_pci_data
);
628 xway_register_dwc(ARV452CPW_USB
);
629 arv_register_ethernet(ARV452CPW_MAC_ADDR
);
630 arv_register_ath5k(ARV452CPW_ATH_ADDR
, ARV452CPW_MAC_ADDR
);
631 ltq_register_ath5k(arv_ath5k_eeprom_data
, arv_athxk_eeprom_mac
);
633 gpio_request(ARV452CPW_SWITCH_RESET
, "switch");
634 gpio_set_value(ARV452CPW_SWITCH_RESET
, 1);
635 gpio_export(ARV452CPW_SWITCH_RESET
, 0);
637 gpio_request(ARV452CPW_RELAY1
, "relay1");
638 gpio_direction_output(ARV452CPW_RELAY1
, 1);
639 gpio_export(ARV452CPW_RELAY1
, 0);
641 gpio_request(ARV452CPW_RELAY2
, "relay2");
642 gpio_set_value(ARV452CPW_RELAY2
, 1);
643 gpio_export(ARV452CPW_RELAY2
, 0);
646 MIPS_MACHINE(LANTIQ_MACH_ARV452CPW
,
648 "ARV452CPW - Arcor A801",
654 #define ARV4525PW_ATH_ADDR 0x3f0400
655 #define ARV4525PW_MADWIFI_ADDR 0xb03f0400
656 #define ARV4525PW_MAC_ADDR 0x3f0016
658 arv_load_nor(0x400000);
659 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds
), arv4525pw_gpio_leds
);
660 gpio_request_array(arv4525pw_gpios
, ARRAY_SIZE(arv4525pw_gpios
));
661 gpio_export(ARV4525PW_RELAY
, false);
662 gpio_export(ARV4525PW_PHYRESET
, false);
663 ltq_pci_data
.clock
= PCI_CLOCK_INT
;
664 ltq_register_pci(<q_pci_data
);
665 arv_register_ath5k(ARV4525PW_ATH_ADDR
, ARV4525PW_MADWIFI_ADDR
);
666 ltq_register_ath5k(arv_ath5k_eeprom_data
, arv_athxk_eeprom_mac
);
667 ltq_eth_data
.mii_mode
= PHY_INTERFACE_MODE_MII
;
668 arv_register_ethernet(ARV4525PW_MAC_ADDR
);
671 MIPS_MACHINE(LANTIQ_MACH_ARV4525PW
,
673 "ARV4525PW - Speedport W502V",
679 #define ARV7525P_MAC_ADDR 0x3f0016
681 arv_load_nor(0x400000);
682 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds
), arv4525pw_gpio_leds
);
683 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
,
684 ARRAY_SIZE(arv7525pw_gpio_keys
), arv7525pw_gpio_keys
);
685 ltq_pci_data
.clock
= PCI_CLOCK_INT
;
686 ltq_pci_data
.gpio
= PCI_GNT1
| PCI_EXIN1
;
687 ltq_pci_data
.irq
[14] = (INT_NUM_IM3_IRL0
+ 31);
688 ltq_register_pci(<q_pci_data
);
689 ltq_eth_data
.mii_mode
= PHY_INTERFACE_MODE_MII
;
690 ltq_register_rt2x00("RT2860.eeprom", NULL
);
692 arv_register_ethernet(ARV7525P_MAC_ADDR
);
695 MIPS_MACHINE(LANTIQ_MACH_ARV7525PW
,
697 "ARV7525PW - Speedport W303V",
703 #define ARV7518PW_EBU 0x2
704 #define ARV7518PW_USB 14
705 #define ARV7518PW_SWITCH_RESET 13
706 #define ARV7518PW_ATH_ADDR 0x7f0400
707 #define ARV7518PW_MAC_ADDR 0x7f0016
709 arv_load_nor(0x800000);
710 ltq_register_gpio_ebu(ARV7518PW_EBU
);
711 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv7518pw_gpio_leds
), arv7518pw_gpio_leds
);
712 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
,
713 ARRAY_SIZE(arv7518pw_gpio_keys
), arv7518pw_gpio_keys
);
714 ltq_register_pci(<q_pci_data
);
716 xway_register_dwc(ARV7518PW_USB
);
717 arv_register_ethernet(ARV7518PW_MAC_ADDR
);
718 arv_register_ath9k(ARV7518PW_ATH_ADDR
, ARV7518PW_MAC_ADDR
);
719 ltq_register_ath9k(arv_ath9k_eeprom_data
, arv_athxk_eeprom_mac
);
720 ltq_pci_ath_fixup(14, arv_ath9k_eeprom_data
);
722 gpio_request(ARV7518PW_SWITCH_RESET
, "switch");
723 gpio_direction_output(ARV7518PW_SWITCH_RESET
, 1);
724 gpio_export(ARV7518PW_SWITCH_RESET
, 0);
727 MIPS_MACHINE(LANTIQ_MACH_ARV7518PW
,
729 "ARV7518PW - ASTORIA",
733 arv752dpw22_init(void)
735 #define ARV752DPW22_EBU 0x2
736 #define ARV752DPW22_USB 100
737 #define ARV752DPW22_RELAY 101
738 #define ARV752DPW22_MAC_ADDR 0x7f0016
740 arv_load_nor(0x800000);
741 ltq_register_gpio_ebu(ARV752DPW22_EBU
);
742 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv752dpw22_gpio_leds
), arv752dpw22_gpio_leds
);
743 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
,
744 ARRAY_SIZE(arv752dpw22_gpio_keys
), arv752dpw22_gpio_keys
);
745 ltq_pci_data
.irq
[15] = (INT_NUM_IM3_IRL0
+ 31);
746 ltq_pci_data
.gpio
|= PCI_EXIN1
| PCI_REQ2
;
747 ltq_register_pci(<q_pci_data
);
748 xway_register_dwc(ARV752DPW22_USB
);
749 arv_register_ethernet(ARV752DPW22_MAC_ADDR
);
751 gpio_request(ARV752DPW22_RELAY
, "relay");
752 gpio_set_value(ARV752DPW22_RELAY
, 1);
753 gpio_export(ARV752DPW22_RELAY
, 0);
756 MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22
,
758 "ARV752DPW22 - Arcor A803",
764 #define ARV752DPW22_EBU 0x2
765 #define ARV752DPW22_USB 100
766 #define ARV752DPW22_RELAY 101
767 #define ARV752DPW22_MAC_ADDR 0x7f0016
769 arv_load_nor(0x800000);
770 ltq_register_gpio_ebu(ARV752DPW22_EBU
);
771 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv752dpw22_gpio_leds
), arv752dpw22_gpio_leds
);
772 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
, ARRAY_SIZE(arv752dpw22_gpio_keys
), arv752dpw22_gpio_keys
);
773 ltq_pci_data
.irq
[14] = (INT_NUM_IM3_IRL0
+ 31);
774 ltq_pci_data
.gpio
|= PCI_EXIN1
| PCI_REQ2
;
775 ltq_register_pci(<q_pci_data
);
776 xway_register_dwc(ARV752DPW22_USB
);
777 ltq_register_rt2x00("RT2860.eeprom", NULL
);
778 arv_register_ethernet(ARV752DPW22_MAC_ADDR
);
779 gpio_request(ARV752DPW22_RELAY
, "relay");
780 gpio_set_value(ARV752DPW22_RELAY
, 1);
781 gpio_export(ARV752DPW22_RELAY
, 0);
785 MIPS_MACHINE(LANTIQ_MACH_ARV752DPW
,
787 "ARV752DPW - Arcor A802",