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 void arv_load_nor(unsigned int max)
138 #define UBOOT_MAGIC 0x27051956
145 ltq_register_nor(&arv75xx_brnboot_flash_data);
147 ltq_register_nor(&arv45xx_brnboot_flash_data);
151 for (i = 1; i < 4 && sector < 0; i++) {
152 unsigned int uboot_magic;
153 memcpy_fromio(&uboot_magic, (void *)KSEG1ADDR(LTQ_FLASH_START) + (i * 0x10000), 4);
154 if (uboot_magic == UBOOT_MAGIC)
161 arv_partitions[0].size = arv_partitions[1].offset = (sector - 1) * 0x10000;
162 arv_partitions[2].offset = arv_partitions[0].size + 0x10000;
163 arv_partitions[2].size = max - arv_partitions[2].offset - 0x10000;
164 arv_partitions[3].offset = max - 0x10000;
165 ltq_register_nor(&arv_flash_data);
168 static struct ltq_pci_data ltq_pci_data = {
169 .clock = PCI_CLOCK_EXT,
170 .gpio = PCI_GNT1 | PCI_REQ1,
172 [14] = INT_NUM_IM0_IRL0 + 22,
176 static struct ltq_eth_data ltq_eth_data = {
177 .mii_mode = PHY_INTERFACE_MODE_RMII,
180 static struct gpio_led
181 arv4510pw_gpio_leds[] __initdata = {
182 { .name = "soc:green:foo", .gpio = 4, .active_low = 1, },
185 static struct gpio_led
186 arv4518pw_gpio_leds[] __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:wifi", .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 = 100, .active_low = 1, .default_trigger = "default-on" },
195 { .name = "soc:green:fxs1", .gpio = 101, .active_low = 1, .default_trigger = "default-on" },
196 { .name = "soc:green:fxs2", .gpio = 102, .active_low = 1, .default_trigger = "default-on" },
197 { .name = "soc:green:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
200 static struct gpio_keys_button
201 arv4518pw_gpio_keys[] __initdata = {
206 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
214 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
222 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
228 static struct gpio_led
229 arv4519pw_gpio_leds[] __initdata = {
230 { .name = "soc:red:power", .gpio = 7, .active_low = 1, },
231 { .name = "soc:green:power", .gpio = 2, .active_low = 1, .default_trigger = "default-on" },
232 { .name = "soc:green:wifi", .gpio = 6, .active_low = 1, },
233 { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
234 { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
235 { .name = "soc:red:internet", .gpio = 8, .active_low = 1, },
236 { .name = "soc:green:voip", .gpio = 100, .active_low = 1, },
237 { .name = "soc:green:phone1", .gpio = 101, .active_low = 1, },
238 { .name = "soc:green:phone2", .gpio = 102, .active_low = 1, },
239 { .name = "soc:green:fxo", .gpio = 103, .active_low = 1, },
240 { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
241 { .name = "soc:orange:wps", .gpio = 104, .active_low = 1, },
242 { .name = "soc:green:wps", .gpio = 105, .active_low = 1, },
243 { .name = "soc:red:wps", .gpio = 106, .active_low = 1, },
247 static struct gpio_keys_button
248 arv4519pw_gpio_keys[] __initdata = {
253 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
261 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
267 static struct gpio_led
268 arv4520pw_gpio_leds[] __initdata = {
269 { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
270 { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
271 { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
272 { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
273 { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, },
274 { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
275 { .name = "soc:blue:voip", .gpio = 100, .active_low = 1, },
276 { .name = "soc:blue:fxs1", .gpio = 101, .active_low = 1, },
277 { .name = "soc:blue:fxs2", .gpio = 102, .active_low = 1, },
278 { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, },
279 { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, },
280 { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, },
281 { .name = "soc:blue:wifi", .gpio = 106, .active_low = 1, },
284 static struct gpio_led
285 arv452cpw_gpio_leds[] __initdata = {
286 { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
287 { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
288 { .name = "soc:blue:isdn", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
289 { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
290 { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
291 { .name = "soc:red:wps", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
292 { .name = "soc:blue:fxs1", .gpio = 100, .active_low = 1, .default_trigger = "default-on" },
293 { .name = "soc:blue:fxs2", .gpio = 101, .active_low = 1, .default_trigger = "default-on" },
294 { .name = "soc:blue:wps", .gpio = 102, .active_low = 1, .default_trigger = "default-on" },
295 { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
296 { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" },
297 { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" },
298 { .name = "soc:blue:wifi", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
299 { .name = "soc:blue:internet", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
300 { .name = "soc:red:internet", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
303 static struct gpio_led
304 arv4525pw_gpio_leds[] __initdata = {
305 { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
306 { .name = "soc:green:wifi", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
307 { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
308 { .name = "soc:green:fxs-internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
309 { .name = "soc:green:fxs-festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
312 #define ARV4525PW_PHYRESET 13
313 #define ARV4525PW_RELAY 31
315 static struct gpio arv4525pw_gpios[] __initdata = {
316 { ARV4525PW_PHYRESET, GPIOF_OUT_INIT_HIGH, "phyreset" },
317 { ARV4525PW_RELAY, GPIOF_OUT_INIT_HIGH, "relay" },
321 static struct gpio_led
322 arv752dpw22_gpio_leds[] __initdata = {
323 { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
324 { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
325 { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
326 { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
327 { .name = "soc:red:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
328 { .name = "soc:red:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" },
329 { .name = "soc:green:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" },
330 { .name = "soc:green:wifi", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
331 { .name = "soc:green:wifi1", .gpio = 107, .active_low = 1, .default_trigger = "default-on" },
332 { .name = "soc:blue:wifi", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
333 { .name = "soc:blue:wifi1", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
334 { .name = "soc:green:eth1", .gpio = 111, .active_low = 1, .default_trigger = "default-on" },
335 { .name = "soc:green:eth2", .gpio = 112, .active_low = 1, .default_trigger = "default-on" },
336 { .name = "soc:green:eth3", .gpio = 113, .active_low = 1, .default_trigger = "default-on" },
337 { .name = "soc:green:eth4", .gpio = 114, .active_low = 1, .default_trigger = "default-on", },
340 static struct gpio_keys_button
341 arv752dpw22_gpio_keys[] __initdata = {
346 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
354 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
362 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
368 static struct gpio_led
369 arv7518pw_gpio_leds[] __initdata = {
370 { .name = "soc:red:power", .gpio = 7, .active_low = 1, },
371 { .name = "soc:green:power", .gpio = 2, .active_low = 1, .default_trigger = "default-on" },
372 { .name = "soc:green:wifi", .gpio = 6, .active_low = 1, },
373 { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
374 { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
375 { .name = "soc:red:internet", .gpio = 8, .active_low = 1, },
376 { .name = "soc:green:voip", .gpio = 100, .active_low = 1, },
377 { .name = "soc:green:phone1", .gpio = 101, .active_low = 1, },
378 { .name = "soc:green:phone2", .gpio = 102, .active_low = 1, },
379 { .name = "soc:orange:fail", .gpio = 103, .active_low = 1, },
380 { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
381 { .name = "soc:orange:wps", .gpio = 104, .active_low = 1, },
382 { .name = "soc:green:wps", .gpio = 105, .active_low = 1, },
383 { .name = "soc:red:wps", .gpio = 106, .active_low = 1, },
387 static struct gpio_keys_button
388 arv7518pw_gpio_keys[] __initdata = {
393 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
401 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
407 static struct gpio_keys_button
408 arv7525pw_gpio_keys[] __initdata = {
413 .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
420 arv_register_ethernet(unsigned int mac_addr)
422 memcpy_fromio(<q_eth_data.mac.sa_data,
423 (void *)KSEG1ADDR(LTQ_FLASH_START + mac_addr), 6);
424 ltq_register_etop(<q_eth_data);
427 static u16 arv_ath5k_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
428 static u16 arv_ath9k_eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
429 static u8 arv_athxk_eeprom_mac[6];
432 arv_register_ath5k(unsigned int ath_addr, unsigned int mac_addr)
436 memcpy_fromio(arv_athxk_eeprom_mac,
437 (void *)KSEG1ADDR(LTQ_FLASH_START + mac_addr), 6);
438 arv_athxk_eeprom_mac[5]++;
439 memcpy_fromio(arv_ath5k_eeprom_data,
440 (void *)KSEG1ADDR(LTQ_FLASH_START + ath_addr), ATH5K_PLAT_EEP_MAX_WORDS);
442 for (i = 0; i < ATH5K_PLAT_EEP_MAX_WORDS>>1; i++) {
443 arv_ath5k_eeprom_data[i] = swab16(arv_ath5k_eeprom_data[i]);
446 * regdomain is invalid. it's unknown how did original
447 * fw convered value to 0x82d4 so for now force to 0x67
449 arv_ath5k_eeprom_data[i] &= 0x0000;
450 arv_ath5k_eeprom_data[i] |= 0x67;
456 arv_register_ath9k(unsigned int ath_addr, unsigned int mac_addr)
459 u16 *eepdata, sum, el;
461 memcpy_fromio(arv_athxk_eeprom_mac,
462 (void *)KSEG1ADDR(LTQ_FLASH_START + mac_addr), 6);
463 arv_athxk_eeprom_mac[5]++;
464 memcpy_fromio(arv_ath9k_eeprom_data,
465 (void *)KSEG1ADDR(LTQ_FLASH_START + ath_addr), ATH9K_PLAT_EEP_MAX_WORDS);
467 // force regdomain to 0x67
468 arv_ath9k_eeprom_data[0x208>>1] = 0x67;
470 // calculate new checksum
471 sum = arv_ath9k_eeprom_data[0x200>>1];
472 el = sum / sizeof(u16) - 2; /* skip length and (old) checksum */
473 eepdata = (u16 *) (&arv_ath9k_eeprom_data[0x204>>1]); /* after checksum */
474 for (i = 0; i < el; i++)
477 arv_ath9k_eeprom_data[0x202>>1] = sum;
483 #define ARV3527P_MAC_ADDR 0x3f0016
485 ltq_register_gpio_stp();
486 //ltq_add_device_gpio_leds(arv3527p_gpio_leds, ARRAY_SIZE(arv3527p_gpio_leds));
487 arv_load_nor(0x400000);
488 arv_register_ethernet(ARV3527P_MAC_ADDR);
491 MIPS_MACHINE(LANTIQ_MACH_ARV3527P,
493 "ARV3527P - Arcor Easybox 401",
499 #define ARV4510PW_MAC_ADDR 0x3f0014
501 ltq_register_gpio_stp();
502 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4510pw_gpio_leds), arv4510pw_gpio_leds);
503 arv_load_nor(0x400000);
504 ltq_pci_data.irq[12] = (INT_NUM_IM2_IRL0 + 31);
505 ltq_pci_data.irq[15] = (INT_NUM_IM0_IRL0 + 26);
506 ltq_pci_data.gpio |= PCI_EXIN2 | PCI_REQ2;
507 ltq_register_pci(<q_pci_data);
508 arv_register_ethernet(ARV4510PW_MAC_ADDR);
511 MIPS_MACHINE(LANTIQ_MACH_ARV4510PW,
513 "ARV4510PW - Wippies Homebox",
519 #define ARV4518PW_EBU 0
520 #define ARV4518PW_USB 14
521 #define ARV4518PW_SWITCH_RESET 13
522 #define ARV4518PW_ATH_ADDR 0x3f0400
523 #define ARV4518PW_MADWIFI_ADDR 0xb03f0400
524 #define ARV4518PW_MAC_ADDR 0x3f0016
526 ltq_register_gpio_ebu(ARV4518PW_EBU);
527 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4518pw_gpio_leds), arv4518pw_gpio_leds);
528 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
529 ARRAY_SIZE(arv4518pw_gpio_keys), arv4518pw_gpio_keys);
530 arv_load_nor(0x400000);
531 ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
532 ltq_register_pci(<q_pci_data);
533 xway_register_dwc(ARV4518PW_USB);
534 arv_register_ethernet(ARV4518PW_MAC_ADDR);
535 arv_register_ath5k(ARV4518PW_ATH_ADDR, ARV4518PW_MAC_ADDR);
536 ltq_register_ath5k(arv_ath5k_eeprom_data, arv_athxk_eeprom_mac);
538 gpio_request(ARV4518PW_SWITCH_RESET, "switch");
539 gpio_direction_output(ARV4518PW_SWITCH_RESET, 1);
540 gpio_export(ARV4518PW_SWITCH_RESET, 0);
543 MIPS_MACHINE(LANTIQ_MACH_ARV4518PW,
545 "ARV4518PW - SMC7908A-ISP, Airties WAV-221",
551 #define ARV4519PW_EBU 0
552 #define ARV4519PW_USB 14
553 #define ARV4519PW_RELAY 31
554 #define ARV4519PW_SWITCH_RESET 13
555 #define ARV4519PW_ATH_ADDR 0x3f0400
556 #define ARV4519PW_MAC_ADDR 0x3f0016
558 arv_load_nor(0x400000);
559 ltq_register_gpio_ebu(ARV4519PW_EBU);
560 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4519pw_gpio_leds), arv4519pw_gpio_leds);
561 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
562 ARRAY_SIZE(arv4519pw_gpio_keys), arv4519pw_gpio_keys);
563 ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ1;
564 ltq_register_pci(<q_pci_data);
565 xway_register_dwc(ARV4519PW_USB);
566 arv_register_ethernet(ARV4519PW_MAC_ADDR);
567 arv_register_ath5k(ARV4519PW_ATH_ADDR, ARV4519PW_MAC_ADDR);
568 ltq_register_ath5k(arv_ath5k_eeprom_data, arv_athxk_eeprom_mac);
570 gpio_request(ARV4519PW_RELAY, "relay");
571 gpio_direction_output(ARV4519PW_RELAY, 1);
572 gpio_export(ARV4519PW_RELAY, 0);
574 gpio_request(ARV4519PW_SWITCH_RESET, "switch");
575 gpio_set_value(ARV4519PW_SWITCH_RESET, 1);
576 gpio_export(ARV4519PW_SWITCH_RESET, 0);
579 MIPS_MACHINE(LANTIQ_MACH_ARV4519PW,
581 "ARV4519PW - Vodafone, Pirelli",
587 #define ARV4520PW_EBU 0x400
588 #define ARV4520PW_USB 28
589 #define ARV4520PW_SWITCH_RESET 110
590 #define ARV4520PW_MAC_ADDR 0x3f0016
592 ltq_register_gpio_ebu(ARV4520PW_EBU);
593 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4520pw_gpio_leds), arv4520pw_gpio_leds);
594 arv_load_nor(0x400000);
595 ltq_register_pci(<q_pci_data);
597 arv_register_ethernet(ARV4520PW_MAC_ADDR);
598 xway_register_dwc(ARV4520PW_USB);
600 gpio_request(ARV4520PW_SWITCH_RESET, "switch");
601 gpio_set_value(ARV4520PW_SWITCH_RESET, 1);
604 MIPS_MACHINE(LANTIQ_MACH_ARV4520PW,
606 "ARV4520PW - Airties WAV-281, Arcor A800",
612 #define ARV452CPW_EBU 0x77f
613 #define ARV452CPW_USB 28
614 #define ARV452CPW_RELAY1 31
615 #define ARV452CPW_RELAY2 107
616 #define ARV452CPW_SWITCH_RESET 110
617 #define ARV452CPW_ATH_ADDR 0x3f0400
618 #define ARV452CPW_MADWIFI_ADDR 0xb03f0400
619 #define ARV452CPW_MAC_ADDR 0x3f0016
621 ltq_register_gpio_ebu(ARV452CPW_EBU);
622 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv452cpw_gpio_leds), arv452cpw_gpio_leds);
623 arv_load_nor(0x400000);
624 ltq_register_pci(<q_pci_data);
625 xway_register_dwc(ARV452CPW_USB);
626 arv_register_ethernet(ARV452CPW_MAC_ADDR);
627 arv_register_ath5k(ARV452CPW_ATH_ADDR, ARV452CPW_MAC_ADDR);
628 ltq_register_ath5k(arv_ath5k_eeprom_data, arv_athxk_eeprom_mac);
630 gpio_request(ARV452CPW_SWITCH_RESET, "switch");
631 gpio_set_value(ARV452CPW_SWITCH_RESET, 1);
632 gpio_export(ARV452CPW_SWITCH_RESET, 0);
634 gpio_request(ARV452CPW_RELAY1, "relay1");
635 gpio_direction_output(ARV452CPW_RELAY1, 1);
636 gpio_export(ARV452CPW_RELAY1, 0);
638 gpio_request(ARV452CPW_RELAY2, "relay2");
639 gpio_set_value(ARV452CPW_RELAY2, 1);
640 gpio_export(ARV452CPW_RELAY2, 0);
643 MIPS_MACHINE(LANTIQ_MACH_ARV452CPW,
645 "ARV452CPW - Arcor A801",
651 #define ARV4525PW_ATH_ADDR 0x3f0400
652 #define ARV4525PW_MADWIFI_ADDR 0xb03f0400
653 #define ARV4525PW_MAC_ADDR 0x3f0016
655 arv_load_nor(0x400000);
656 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
657 gpio_request_array(arv4525pw_gpios, ARRAY_SIZE(arv4525pw_gpios));
658 gpio_export(ARV4525PW_RELAY, false);
659 gpio_export(ARV4525PW_PHYRESET, false);
660 ltq_pci_data.clock = PCI_CLOCK_INT;
661 ltq_register_pci(<q_pci_data);
662 arv_register_ath5k(ARV4525PW_ATH_ADDR, ARV4525PW_MADWIFI_ADDR);
663 ltq_register_ath5k(arv_ath5k_eeprom_data, arv_athxk_eeprom_mac);
664 ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
665 arv_register_ethernet(ARV4525PW_MAC_ADDR);
668 MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
670 "ARV4525PW - Speedport W502V",
676 #define ARV7525P_MAC_ADDR 0x3f0016
678 arv_load_nor(0x400000);
679 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
680 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
681 ARRAY_SIZE(arv7525pw_gpio_keys), arv7525pw_gpio_keys);
682 ltq_pci_data.clock = PCI_CLOCK_INT;
683 ltq_pci_data.gpio = PCI_GNT1 | PCI_EXIN1;
684 ltq_pci_data.irq[14] = (INT_NUM_IM3_IRL0 + 31);
685 ltq_register_pci(<q_pci_data);
686 ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
687 ltq_register_rt2x00("RT2860.eeprom");
689 arv_register_ethernet(ARV7525P_MAC_ADDR);
692 MIPS_MACHINE(LANTIQ_MACH_ARV7525PW,
694 "ARV7525PW - Speedport W303V",
700 #define ARV7518PW_EBU 0x2
701 #define ARV7518PW_USB 14
702 #define ARV7518PW_SWITCH_RESET 13
703 #define ARV7518PW_ATH_ADDR 0x7f0400
704 #define ARV7518PW_MAC_ADDR 0x7f0016
706 arv_load_nor(0x800000);
707 ltq_register_gpio_ebu(ARV7518PW_EBU);
708 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv7518pw_gpio_leds), arv7518pw_gpio_leds);
709 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
710 ARRAY_SIZE(arv7518pw_gpio_keys), arv7518pw_gpio_keys);
711 ltq_register_pci(<q_pci_data);
713 xway_register_dwc(ARV7518PW_USB);
714 arv_register_ethernet(ARV7518PW_MAC_ADDR);
715 arv_register_ath9k(ARV7518PW_ATH_ADDR, ARV7518PW_MAC_ADDR);
716 ltq_register_ath9k(arv_ath9k_eeprom_data, arv_athxk_eeprom_mac);
717 ltq_pci_ath_fixup(14, arv_ath9k_eeprom_data);
719 gpio_request(ARV7518PW_SWITCH_RESET, "switch");
720 gpio_direction_output(ARV7518PW_SWITCH_RESET, 1);
721 gpio_export(ARV7518PW_SWITCH_RESET, 0);
724 MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
726 "ARV7518PW - ASTORIA",
730 arv752dpw22_init(void)
732 #define ARV752DPW22_EBU 0x2
733 #define ARV752DPW22_USB 100
734 #define ARV752DPW22_RELAY 101
735 #define ARV752DPW22_MAC_ADDR 0x7f0016
737 arv_load_nor(0x800000);
738 ltq_register_gpio_ebu(ARV752DPW22_EBU);
739 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv752dpw22_gpio_leds), arv752dpw22_gpio_leds);
740 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
741 ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys);
742 ltq_pci_data.irq[15] = (INT_NUM_IM3_IRL0 + 31);
743 ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
744 ltq_register_pci(<q_pci_data);
745 xway_register_dwc(ARV752DPW22_USB);
746 arv_register_ethernet(ARV752DPW22_MAC_ADDR);
748 gpio_request(ARV752DPW22_RELAY, "relay");
749 gpio_set_value(ARV752DPW22_RELAY, 1);
750 gpio_export(ARV752DPW22_RELAY, 0);
753 MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
755 "ARV752DPW22 - Arcor A803",