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_MAC_ADDR 0x3f0016
527 ltq_register_gpio_ebu(ARV4518PW_EBU);
528 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4518pw_gpio_leds), arv4518pw_gpio_leds);
529 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
530 ARRAY_SIZE(arv4518pw_gpio_keys), arv4518pw_gpio_keys);
531 arv_load_nor(0x400000);
532 ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
533 ltq_register_pci(<q_pci_data);
534 xway_register_dwc(ARV4518PW_USB);
535 arv_register_ethernet(ARV4518PW_MAC_ADDR);
536 arv_register_ath5k(ARV4518PW_ATH_ADDR, ARV4518PW_MAC_ADDR);
537 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);
573 gpio_request(ARV4519PW_RELAY, "relay");
574 gpio_direction_output(ARV4519PW_RELAY, 1);
575 gpio_export(ARV4519PW_RELAY, 0);
577 gpio_request(ARV4519PW_SWITCH_RESET, "switch");
578 gpio_set_value(ARV4519PW_SWITCH_RESET, 1);
579 gpio_export(ARV4519PW_SWITCH_RESET, 0);
582 MIPS_MACHINE(LANTIQ_MACH_ARV4519PW,
584 "ARV4519PW - Vodafone, Pirelli",
590 #define ARV4520PW_EBU 0x400
591 #define ARV4520PW_USB 28
592 #define ARV4520PW_SWITCH_RESET 110
593 #define ARV4520PW_MAC_ADDR 0x3f0016
595 ltq_register_gpio_ebu(ARV4520PW_EBU);
596 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4520pw_gpio_leds), arv4520pw_gpio_leds);
597 arv_load_nor(0x400000);
598 ltq_register_pci(<q_pci_data);
600 arv_register_ethernet(ARV4520PW_MAC_ADDR);
601 ltq_register_rt2x00(NULL, (const u8 *) ltq_eth_data.mac.sa_data);
602 xway_register_dwc(ARV4520PW_USB);
605 gpio_request(ARV4520PW_SWITCH_RESET, "switch");
606 gpio_set_value(ARV4520PW_SWITCH_RESET, 1);
609 MIPS_MACHINE(LANTIQ_MACH_ARV4520PW,
611 "ARV4520PW - Airties WAV-281, Arcor A800",
617 #define ARV452CPW_EBU 0x77f
618 #define ARV452CPW_USB 28
619 #define ARV452CPW_RELAY1 31
620 #define ARV452CPW_RELAY2 107
621 #define ARV452CPW_SWITCH_RESET 110
622 #define ARV452CPW_ATH_ADDR 0x3f0400
623 #define ARV452CPW_MAC_ADDR 0x3f0016
625 ltq_register_gpio_ebu(ARV452CPW_EBU);
626 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv452cpw_gpio_leds), arv452cpw_gpio_leds);
627 arv_load_nor(0x400000);
628 ltq_register_pci(<q_pci_data);
629 xway_register_dwc(ARV452CPW_USB);
630 arv_register_ethernet(ARV452CPW_MAC_ADDR);
631 arv_register_ath5k(ARV452CPW_ATH_ADDR, ARV452CPW_MAC_ADDR);
632 ltq_register_ath5k(arv_ath5k_eeprom_data, arv_athxk_eeprom_mac);
635 gpio_request(ARV452CPW_SWITCH_RESET, "switch");
636 gpio_set_value(ARV452CPW_SWITCH_RESET, 1);
637 gpio_export(ARV452CPW_SWITCH_RESET, 0);
639 gpio_request(ARV452CPW_RELAY1, "relay1");
640 gpio_direction_output(ARV452CPW_RELAY1, 1);
641 gpio_export(ARV452CPW_RELAY1, 0);
643 gpio_request(ARV452CPW_RELAY2, "relay2");
644 gpio_set_value(ARV452CPW_RELAY2, 1);
645 gpio_export(ARV452CPW_RELAY2, 0);
648 MIPS_MACHINE(LANTIQ_MACH_ARV452CPW,
650 "ARV452CPW - Arcor A801",
656 #define ARV4525PW_ATH_ADDR 0x3f0400
657 #define ARV4525PW_MAC_ADDR 0x3f0016
659 arv_load_nor(0x400000);
660 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
661 gpio_request_array(arv4525pw_gpios, ARRAY_SIZE(arv4525pw_gpios));
662 gpio_export(ARV4525PW_RELAY, false);
663 gpio_export(ARV4525PW_PHYRESET, false);
664 ltq_pci_data.clock = PCI_CLOCK_INT;
665 ltq_register_pci(<q_pci_data);
666 arv_register_ath5k(ARV4525PW_ATH_ADDR, ARV4525PW_MAC_ADDR);
667 ltq_register_ath5k(arv_ath5k_eeprom_data, arv_athxk_eeprom_mac);
668 ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
669 arv_register_ethernet(ARV4525PW_MAC_ADDR);
673 MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
675 "ARV4525PW - Speedport W502V",
681 #define ARV7525P_MAC_ADDR 0x3f0016
683 arv_load_nor(0x400000);
684 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
685 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
686 ARRAY_SIZE(arv7525pw_gpio_keys), arv7525pw_gpio_keys);
687 ltq_pci_data.clock = PCI_CLOCK_INT;
688 ltq_pci_data.gpio = PCI_GNT1 | PCI_EXIN1;
689 ltq_pci_data.irq[14] = (INT_NUM_IM3_IRL0 + 31);
690 ltq_register_pci(<q_pci_data);
691 ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
692 ltq_register_rt2x00("RT2860.eeprom", NULL);
694 arv_register_ethernet(ARV7525P_MAC_ADDR);
697 MIPS_MACHINE(LANTIQ_MACH_ARV7525PW,
699 "ARV7525PW - Speedport W303V",
705 #define ARV7518PW_EBU 0x2
706 #define ARV7518PW_USB 14
707 #define ARV7518PW_SWITCH_RESET 13
708 #define ARV7518PW_ATH_ADDR 0x7f0400
709 #define ARV7518PW_MAC_ADDR 0x7f0016
711 arv_load_nor(0x800000);
712 ltq_register_gpio_ebu(ARV7518PW_EBU);
713 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv7518pw_gpio_leds), arv7518pw_gpio_leds);
714 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
715 ARRAY_SIZE(arv7518pw_gpio_keys), arv7518pw_gpio_keys);
716 ltq_register_pci(<q_pci_data);
718 xway_register_dwc(ARV7518PW_USB);
719 arv_register_ethernet(ARV7518PW_MAC_ADDR);
720 arv_register_ath9k(ARV7518PW_ATH_ADDR, ARV7518PW_MAC_ADDR);
721 ltq_register_ath9k(arv_ath9k_eeprom_data, arv_athxk_eeprom_mac);
722 ltq_pci_ath_fixup(14, arv_ath9k_eeprom_data);
725 gpio_request(ARV7518PW_SWITCH_RESET, "switch");
726 gpio_direction_output(ARV7518PW_SWITCH_RESET, 1);
727 gpio_export(ARV7518PW_SWITCH_RESET, 0);
730 MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
732 "ARV7518PW - ASTORIA",
736 arv752dpw22_init(void)
738 #define ARV752DPW22_EBU 0x2
739 #define ARV752DPW22_USB 100
740 #define ARV752DPW22_RELAY 101
741 #define ARV752DPW22_MAC_ADDR 0x7f0016
743 arv_load_nor(0x800000);
744 ltq_register_gpio_ebu(ARV752DPW22_EBU);
745 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv752dpw22_gpio_leds), arv752dpw22_gpio_leds);
746 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
747 ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys);
748 ltq_pci_data.irq[15] = (INT_NUM_IM3_IRL0 + 31);
749 ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
750 ltq_register_pci(<q_pci_data);
751 xway_register_dwc(ARV752DPW22_USB);
752 arv_register_ethernet(ARV752DPW22_MAC_ADDR);
755 gpio_request(ARV752DPW22_RELAY, "relay");
756 gpio_set_value(ARV752DPW22_RELAY, 1);
757 gpio_export(ARV752DPW22_RELAY, 0);
760 MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
762 "ARV752DPW22 - Arcor A803",
768 #define ARV752DPW22_EBU 0x2
769 #define ARV752DPW22_USB 100
770 #define ARV752DPW22_RELAY 101
771 #define ARV752DPW22_MAC_ADDR 0x7f0016
773 arv_load_nor(0x800000);
774 ltq_register_gpio_ebu(ARV752DPW22_EBU);
775 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv752dpw22_gpio_leds), arv752dpw22_gpio_leds);
776 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys);
777 ltq_pci_data.irq[14] = (INT_NUM_IM3_IRL0 + 31);
778 ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
779 ltq_register_pci(<q_pci_data);
781 xway_register_dwc(ARV752DPW22_USB);
782 ltq_register_rt2x00("RT2860.eeprom", NULL);
783 arv_register_ethernet(ARV752DPW22_MAC_ADDR);
784 gpio_request(ARV752DPW22_RELAY, "relay");
785 gpio_set_value(ARV752DPW22_RELAY, 1);
786 gpio_export(ARV752DPW22_RELAY, 0);
790 MIPS_MACHINE(LANTIQ_MACH_ARV752DPW,
792 "ARV752DPW - Arcor A802",