Root/target/linux/lantiq/patches-2.6.39/200-mach-arv45xx.patch

1--- a/arch/mips/lantiq/xway/Kconfig
2+++ b/arch/mips/lantiq/xway/Kconfig
3@@ -6,6 +6,10 @@
4     bool "Easy50712 - Danube"
5     default y
6 
7+config LANTIQ_MACH_ARV45XX
8+ bool "ARV45XX"
9+ default y
10+
11 endmenu
12 
13 endif
14--- a/arch/mips/lantiq/xway/Makefile
15+++ b/arch/mips/lantiq/xway/Makefile
16@@ -5,3 +5,4 @@
17 
18 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
19 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
20+obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
21--- /dev/null
22+++ b/arch/mips/lantiq/xway/mach-arv45xx.c
23@@ -0,0 +1,634 @@
24+/*
25+ * This program is free software; you can redistribute it and/or modify it
26+ * under the terms of the GNU General Public License version 2 as published
27+ * by the Free Software Foundation.
28+ *
29+ * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
30+ */
31+
32+#include <linux/init.h>
33+#include <linux/platform_device.h>
34+#include <linux/leds.h>
35+#include <linux/gpio.h>
36+#include <linux/mtd/mtd.h>
37+#include <linux/mtd/partitions.h>
38+#include <linux/mtd/physmap.h>
39+#include <linux/input.h>
40+#include <linux/etherdevice.h>
41+#include <linux/ath5k_platform.h>
42+#include <linux/pci.h>
43+
44+#include <lantiq_soc.h>
45+#include <lantiq_platform.h>
46+
47+#include "../machtypes.h"
48+#include "devices.h"
49+#include "dev-leds-gpio.h"
50+#include "dev-dwc_otg.h"
51+#include "../dev-gpio-buttons.h"
52+
53+#ifdef CONFIG_MTD_PARTITIONS
54+static struct mtd_partition arv4510_partitions[] =
55+{
56+ {
57+ .name = "uboot",
58+ .offset = 0x0,
59+ .size = 0x20000,
60+ },
61+ {
62+ .name = "uboot_env",
63+ .offset = 0x20000,
64+ .size = 0x120000,
65+ },
66+ {
67+ .name = "linux",
68+ .offset = 0x40000,
69+ .size = 0xfa0000,
70+ },
71+ {
72+ .name = "board_config",
73+ .offset = 0xfe0000,
74+ .size = 0x20000,
75+ },
76+};
77+
78+static struct mtd_partition arv45xx_partitions[] =
79+{
80+ {
81+ .name = "uboot",
82+ .offset = 0x0,
83+ .size = 0x20000,
84+ },
85+ {
86+ .name = "uboot_env",
87+ .offset = 0x20000,
88+ .size = 0x10000,
89+ },
90+ {
91+ .name = "linux",
92+ .offset = 0x30000,
93+ .size = 0x3c0000,
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 mtd_partition arv7525_partitions[] =
127+{
128+ {
129+ .name = "uboot",
130+ .offset = 0x0,
131+ .size = 0x10000,
132+ },
133+ {
134+ .name = "uboot_env",
135+ .offset = 0x10000,
136+ .size = 0x10000,
137+ },
138+ {
139+ .name = "linux",
140+ .offset = 0x20000,
141+ .size = 0x3d0000,
142+ },
143+ {
144+ .name = "board_config",
145+ .offset = 0x3f0000,
146+ .size = 0x10000,
147+ },
148+};
149+#endif
150+
151+static struct physmap_flash_data arv4510_flash_data = {
152+#ifdef CONFIG_MTD_PARTITIONS
153+ .nr_parts = ARRAY_SIZE(arv4510_partitions),
154+ .parts = arv4510_partitions,
155+#endif
156+};
157+
158+static struct physmap_flash_data arv45xx_flash_data = {
159+#ifdef CONFIG_MTD_PARTITIONS
160+ .nr_parts = ARRAY_SIZE(arv45xx_partitions),
161+ .parts = arv45xx_partitions,
162+#endif
163+};
164+
165+static struct physmap_flash_data arv75xx_flash_data = {
166+#ifdef CONFIG_MTD_PARTITIONS
167+ .nr_parts = ARRAY_SIZE(arv75xx_partitions),
168+ .parts = arv75xx_partitions,
169+#endif
170+};
171+
172+static struct physmap_flash_data arv7525_flash_data = {
173+#ifdef CONFIG_MTD_PARTITIONS
174+ .nr_parts = ARRAY_SIZE(arv7525_partitions),
175+ .parts = arv7525_partitions,
176+#endif
177+};
178+
179+static struct ltq_pci_data ltq_pci_data = {
180+ .clock = PCI_CLOCK_EXT,
181+ .gpio = PCI_GNT1 | PCI_REQ1,
182+ .irq = {
183+ [14] = INT_NUM_IM0_IRL0 + 22,
184+ },
185+};
186+
187+static struct ltq_eth_data ltq_eth_data = {
188+ .mii_mode = PHY_INTERFACE_MODE_RMII,
189+};
190+
191+static struct gpio_led
192+arv4510pw_leds_gpio[] __initdata = {
193+ { .name = "soc:green:foo", .gpio = 4, .active_low = 1, },
194+};
195+
196+static struct gpio_led
197+arv4518pw_leds_gpio[] __initdata = {
198+ { .name = "soc:green:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
199+ { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
200+ { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
201+ { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
202+ { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
203+ { .name = "soc:red:fail", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
204+ { .name = "soc:green:usb", .gpio = 19, .active_low = 1, .default_trigger = "default-on" },
205+ { .name = "soc:green:voip", .gpio = 72, .active_low = 1, .default_trigger = "default-on" },
206+ { .name = "soc:green:fxs1", .gpio = 73, .active_low = 1, .default_trigger = "default-on" },
207+ { .name = "soc:green:fxs2", .gpio = 74, .active_low = 1, .default_trigger = "default-on" },
208+ { .name = "soc:green:fxo", .gpio = 75, .active_low = 1, .default_trigger = "default-on" },
209+};
210+
211+static struct gpio_keys_button
212+arv4518pw_gpio_keys[] __initdata = {
213+ {
214+ .desc = "wlan",
215+ .type = EV_KEY,
216+ .code = BTN_0,
217+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
218+ .gpio = 28,
219+ .active_low = 1,
220+ },
221+ {
222+ .desc = "wps",
223+ .type = EV_KEY,
224+ .code = BTN_1,
225+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
226+ .gpio = 29,
227+ .active_low = 1,
228+ },
229+ {
230+ .desc = "reset",
231+ .type = EV_KEY,
232+ .code = BTN_2,
233+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
234+ .gpio = 30,
235+ .active_low = 1,
236+ },
237+};
238+
239+static struct gpio_led
240+arv4520pw_leds_gpio[] __initdata = {
241+ { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
242+ { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
243+ { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
244+ { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
245+ { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, },
246+ { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
247+ { .name = "soc:blue:voip", .gpio = 72, .active_low = 1, },
248+ { .name = "soc:blue:fxs1", .gpio = 73, .active_low = 1, },
249+ { .name = "soc:blue:fxs2", .gpio = 74, .active_low = 1, },
250+ { .name = "soc:blue:fxo", .gpio = 75, .active_low = 1, },
251+ { .name = "soc:blue:voice", .gpio = 76, .active_low = 1, },
252+ { .name = "soc:blue:usb", .gpio = 77, .active_low = 1, },
253+ { .name = "soc:blue:wlan", .gpio = 78, .active_low = 1, },
254+};
255+
256+static struct gpio_led
257+arv452cpw_leds_gpio[] __initdata = {
258+ { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
259+ { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
260+ { .name = "soc:blue:isdn", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
261+ { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
262+ { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
263+ { .name = "soc:red:wps", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
264+ { .name = "soc:blue:fxs1", .gpio = 72, .active_low = 1, .default_trigger = "default-on" },
265+ { .name = "soc:blue:fxs2", .gpio = 73, .active_low = 1, .default_trigger = "default-on" },
266+ { .name = "soc:blue:wps", .gpio = 74, .active_low = 1, .default_trigger = "default-on" },
267+ { .name = "soc:blue:fxo", .gpio = 75, .active_low = 1, .default_trigger = "default-on" },
268+ { .name = "soc:blue:voice", .gpio = 76, .active_low = 1, .default_trigger = "default-on" },
269+ { .name = "soc:blue:usb", .gpio = 77, .active_low = 1, .default_trigger = "default-on" },
270+ { .name = "soc:blue:wlan", .gpio = 78, .active_low = 1, .default_trigger = "default-on" },
271+ { .name = "soc:blue:internet", .gpio = 80, .active_low = 1, .default_trigger = "default-on" },
272+ { .name = "soc:red:internet", .gpio = 81, .active_low = 1, .default_trigger = "default-on" },
273+};
274+
275+static struct gpio_led
276+arv4525pw_leds_gpio[] __initdata = {
277+ { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
278+ { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
279+ { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
280+ { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
281+ { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
282+};
283+
284+static struct gpio_led
285+arv752dpw22_leds_gpio[] __initdata = {
286+ { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
287+ { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
288+ { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
289+ { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
290+ { .name = "soc:red:fxo", .gpio = 75, .active_low = 1, .default_trigger = "default-on" },
291+ { .name = "soc:red:voice", .gpio = 76, .active_low = 1, .default_trigger = "default-on" },
292+ { .name = "soc:green:usb", .gpio = 77, .active_low = 1, .default_trigger = "default-on" },
293+ { .name = "soc:green:wlan", .gpio = 78, .active_low = 1, .default_trigger = "default-on" },
294+ { .name = "soc:green:wlan1", .gpio = 79, .active_low = 1, .default_trigger = "default-on" },
295+ { .name = "soc:blue:wlan", .gpio = 80, .active_low = 1, .default_trigger = "default-on" },
296+ { .name = "soc:blue:wlan1", .gpio = 81, .active_low = 1, .default_trigger = "default-on" },
297+ { .name = "soc:green:eth1", .gpio = 83, .active_low = 1, .default_trigger = "default-on" },
298+ { .name = "soc:green:eth2", .gpio = 84, .active_low = 1, .default_trigger = "default-on" },
299+ { .name = "soc:green:eth3", .gpio = 85, .active_low = 1, .default_trigger = "default-on" },
300+ { .name = "soc:green:eth4", .gpio = 86, .active_low = 1, .default_trigger = "default-on", },
301+};
302+
303+static struct gpio_keys_button
304+arv752dpw22_gpio_keys[] __initdata = {
305+ {
306+ .desc = "btn0",
307+ .type = EV_KEY,
308+ .code = BTN_0,
309+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
310+ .gpio = 12,
311+ .active_low = 1,
312+ },
313+ {
314+ .desc = "btn1",
315+ .type = EV_KEY,
316+ .code = BTN_1,
317+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
318+ .gpio = 13,
319+ .active_low = 1,
320+ },
321+ {
322+ .desc = "btn2",
323+ .type = EV_KEY,
324+ .code = BTN_2,
325+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
326+ .gpio = 28,
327+ .active_low = 1,
328+ },
329+};
330+
331+static struct gpio_led
332+arv7518pw_leds_gpio[] __initdata = {
333+ { .name = "soc:green:power", .gpio = 2, .active_low = 1, },
334+ { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
335+ { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
336+ { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
337+ { .name = "soc:red:internet", .gpio = 8, .active_low = 1, },
338+ { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
339+};
340+
341+static struct gpio_keys_button
342+arv7518pw_gpio_keys[] __initdata = {
343+ {
344+ .desc = "reset",
345+ .type = EV_KEY,
346+ .code = BTN_0,
347+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
348+ .gpio = 23,
349+ .active_low = 1,
350+ },
351+ {
352+ .desc = "wlan",
353+ .type = EV_KEY,
354+ .code = BTN_1,
355+ .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
356+ .gpio = 25,
357+ .active_low = 1,
358+ },
359+};
360+
361+static void
362+arv45xx_register_ethernet(void)
363+{
364+#define ARV45XX_BRN_MAC 0x3f0016
365+ memcpy_fromio(&ltq_eth_data.mac.sa_data,
366+ (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_MAC), 6);
367+ ltq_register_etop(&ltq_eth_data);
368+}
369+
370+static void
371+arv75xx_register_ethernet(void)
372+{
373+#define ARV75XX_BRN_MAC 0x7f0016
374+ memcpy_fromio(&ltq_eth_data.mac.sa_data,
375+ (void *)KSEG1ADDR(LTQ_FLASH_START + ARV75XX_BRN_MAC), 6);
376+ ltq_register_etop(&ltq_eth_data);
377+}
378+
379+static void
380+bewan_register_ethernet(void)
381+{
382+#define BEWAN_BRN_MAC 0x3f0014
383+ memcpy_fromio(&ltq_eth_data.mac.sa_data,
384+ (void *)KSEG1ADDR(LTQ_FLASH_START + BEWAN_BRN_MAC), 6);
385+ ltq_register_etop(&ltq_eth_data);
386+}
387+
388+static u16 arv45xx_ath5k_eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
389+static struct ath5k_platform_data arv45xx_ath5k_platform_data;
390+
391+/*static int arv45xx_pci_plat_dev_init(struct pci_dev *dev)
392+{
393+ dev->dev.platform_data = &arv45xx_ath5k_platform_data;
394+ return 0;
395+}
396+*/
397+void __init
398+arv45xx_register_ath5k(void)
399+{
400+#define ARV45XX_BRN_ATH 0x3f0478
401+ int i;
402+ unsigned char eeprom_mac[6];
403+ static u16 eeprom_data[ATH5K_PLAT_EEP_MAX_WORDS];
404+ u32 *p = (u32*)arv45xx_ath5k_eeprom_data;
405+
406+ memcpy_fromio(eeprom_mac,
407+ (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_MAC), 6);
408+ eeprom_mac[5]++;
409+ memcpy_fromio(arv45xx_ath5k_eeprom_data,
410+ (void *)KSEG1ADDR(LTQ_FLASH_START + ARV45XX_BRN_ATH), ATH5K_PLAT_EEP_MAX_WORDS);
411+ // swap eeprom bytes
412+ for (i = 0; i < ATH5K_PLAT_EEP_MAX_WORDS>>1; i++){
413+ //arv4518_ath5k_eeprom_data[i] = ((eeprom_data[i]&0xff)<<8)|((eeprom_data[i]&0xff00)>>8);
414+ 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);
415+ if (i == 0xbf>>1){
416+ // printk ("regdomain: 0x%x --> 0x%x\n", p[i], (p[i] & 0xffff0000)|0x67);
417+ /* regdomain is invalid?? how did original fw convert
418+ * value to 0x82d4 ??
419+ * for now, force to 0x67 */
420+ p[i] &= 0xffff0000;
421+ p[i] |= 0x67;
422+ }
423+ }
424+ arv45xx_ath5k_platform_data.eeprom_data = arv45xx_ath5k_eeprom_data;
425+ arv45xx_ath5k_platform_data.macaddr = eeprom_mac;
426+ //lqpci_plat_dev_init = arv45xx_pci_plat_dev_init;
427+}
428+
429+static void __init
430+arv3527p_init(void)
431+{
432+ ltq_register_gpio_stp();
433+ //ltq_add_device_leds_gpio(arv3527p_leds_gpio, ARRAY_SIZE(arv3527p_leds_gpio));
434+ ltq_register_nor(&arv45xx_flash_data);
435+ arv45xx_register_ethernet();
436+}
437+
438+MIPS_MACHINE(LANTIQ_MACH_ARV3527P,
439+ "ARV3527P",
440+ "ARV3527P - Arcor Easybox 401",
441+ arv3527p_init);
442+
443+static void __init
444+arv4510pw_init(void)
445+{
446+ ltq_register_gpio_stp();
447+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4510pw_leds_gpio), arv4510pw_leds_gpio);
448+ ltq_register_nor(&arv4510_flash_data);
449+ ltq_pci_data.irq[12] = (INT_NUM_IM2_IRL0 + 31);
450+ ltq_pci_data.irq[15] = (INT_NUM_IM0_IRL0 + 26);
451+ ltq_pci_data.gpio |= PCI_EXIN2 | PCI_REQ2;
452+ ltq_register_pci(&ltq_pci_data);
453+ bewan_register_ethernet();
454+}
455+
456+MIPS_MACHINE(LANTIQ_MACH_ARV4510PW,
457+ "ARV4510PW",
458+ "ARV4510PW - Wippies Homebox",
459+ arv4510pw_init);
460+
461+static void __init
462+arv4518pw_init(void)
463+{
464+#define ARV4518PW_EBU 0
465+#define ARV4518PW_USB 14
466+#define ARV4518PW_SWITCH_RESET 13
467+#define ARV4518PW_MADWIFI_ADDR 0xb07f0400
468+
469+ ltq_register_gpio_ebu(ARV4518PW_EBU);
470+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4518pw_leds_gpio), arv4518pw_leds_gpio);
471+ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv4518pw_gpio_keys), arv4518pw_gpio_keys);
472+ ltq_register_nor(&arv45xx_flash_data);
473+ ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
474+ ltq_register_pci(&ltq_pci_data);
475+ ltq_register_madwifi_eep(ARV4518PW_MADWIFI_ADDR);
476+ xway_register_dwc(ARV4518PW_USB);
477+ arv45xx_register_ethernet();
478+ arv45xx_register_ath5k();
479+
480+ gpio_request(ARV4518PW_SWITCH_RESET, "switch");
481+ gpio_direction_output(ARV4518PW_SWITCH_RESET, 1);
482+ gpio_export(ARV4518PW_SWITCH_RESET, 0);
483+}
484+
485+MIPS_MACHINE(LANTIQ_MACH_ARV4518PW,
486+ "ARV4518PW",
487+ "ARV4518PW - SMC7908A-ISP, Airties WAV-221",
488+ arv4518pw_init);
489+
490+static void __init
491+arv4520pw_init(void)
492+{
493+#define ARV4520PW_EBU 0x400
494+#define ARV4520PW_USB 28
495+#define ARV4520PW_SWITCH_RESET 82
496+
497+ ltq_register_gpio_ebu(ARV4520PW_EBU);
498+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4520pw_leds_gpio), arv4520pw_leds_gpio);
499+ ltq_register_nor(&arv45xx_flash_data);
500+ ltq_register_pci(&ltq_pci_data);
501+ ltq_register_tapi();
502+ arv45xx_register_ethernet();
503+ xway_register_dwc(ARV4520PW_USB);
504+
505+ gpio_request(ARV4520PW_SWITCH_RESET, "switch");
506+ gpio_set_value(ARV4520PW_SWITCH_RESET, 1);
507+}
508+
509+MIPS_MACHINE(LANTIQ_MACH_ARV4520PW,
510+ "ARV4520PW",
511+ "ARV4520PW - Airties WAV-281, Arcor A800",
512+ arv4520pw_init);
513+
514+static void __init
515+arv452Cpw_init(void)
516+{
517+#define ARV452CPW_EBU 0x77f
518+#define ARV452CPW_USB 28
519+#define ARV452CPW_RELAY1 31
520+#define ARV452CPW_RELAY2 79
521+#define ARV452CPW_SWITCH_RESET 82
522+#define ARV452CPW_MADWIFI_ADDR 0xb07f0400
523+
524+ ltq_register_gpio_ebu(ARV452CPW_EBU);
525+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv452cpw_leds_gpio), arv452cpw_leds_gpio);
526+ ltq_register_nor(&arv45xx_flash_data);
527+ ltq_register_pci(&ltq_pci_data);
528+ ltq_register_madwifi_eep(ARV452CPW_MADWIFI_ADDR);
529+ xway_register_dwc(ARV452CPW_USB);
530+ arv45xx_register_ethernet();
531+ arv45xx_register_ath5k();
532+
533+ gpio_request(ARV452CPW_SWITCH_RESET, "switch");
534+ gpio_set_value(ARV452CPW_SWITCH_RESET, 1);
535+ gpio_export(ARV452CPW_SWITCH_RESET, 0);
536+
537+ gpio_request(ARV452CPW_RELAY1, "relay1");
538+ gpio_direction_output(ARV452CPW_RELAY1, 1);
539+ gpio_export(ARV452CPW_RELAY1, 0);
540+
541+ gpio_request(ARV452CPW_RELAY2, "relay2");
542+ gpio_set_value(ARV452CPW_RELAY2, 1);
543+ gpio_export(ARV452CPW_RELAY2, 0);
544+}
545+
546+MIPS_MACHINE(LANTIQ_MACH_ARV452CPW,
547+ "ARV452CPW",
548+ "ARV452CPW - Arcor A801",
549+ arv452Cpw_init);
550+
551+static void __init
552+arv4525pw_init(void)
553+{
554+#define ARV4525PW_MADWIFI_ADDR 0xb07f0400
555+
556+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4525pw_leds_gpio), arv4525pw_leds_gpio);
557+ ltq_register_nor(&arv45xx_flash_data);
558+ ltq_pci_data.clock = PCI_CLOCK_INT;
559+ ltq_register_pci(&ltq_pci_data);
560+ ltq_register_madwifi_eep(ARV4525PW_MADWIFI_ADDR);
561+ ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
562+ arv45xx_register_ethernet();
563+}
564+
565+MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
566+ "ARV4525PW",
567+ "ARV4525PW - Speedport W502V",
568+ arv4525pw_init);
569+
570+static void __init
571+arv7525pw_init(void)
572+{
573+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv4525pw_leds_gpio), arv4525pw_leds_gpio);
574+ ltq_register_nor(&arv7525_flash_data);
575+ ltq_register_pci(&ltq_pci_data);
576+ ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
577+ ltq_register_tapi();
578+ arv45xx_register_ethernet();
579+}
580+
581+MIPS_MACHINE(LANTIQ_MACH_ARV7525PW,
582+ "ARV7525PW",
583+ "ARV7525PW - Speedport W303V",
584+ arv7525pw_init);
585+
586+static void __init
587+arv7518pw_init(void)
588+{
589+#define ARV7518PW_EBU 0x2
590+#define ARV7518PW_USB 14
591+
592+ ltq_register_gpio_ebu(ARV7518PW_EBU);
593+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv7518pw_leds_gpio), arv7518pw_leds_gpio);
594+ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv7518pw_gpio_keys), arv7518pw_gpio_keys);
595+ ltq_register_nor(&arv75xx_flash_data);
596+ ltq_register_pci(&ltq_pci_data);
597+ ltq_register_tapi();
598+ xway_register_dwc(ARV7518PW_USB);
599+ arv75xx_register_ethernet();
600+ //arv7518_register_ath9k(mac);
601+}
602+
603+MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
604+ "ARV7518PW",
605+ "ARV7518PW - ASTORIA",
606+ arv7518pw_init);
607+
608+
609+static void __init
610+arv752dpw_init(void)
611+{
612+#define ARV752DPW22_EBU 0x2
613+#define ARV752DPW22_USB 72
614+#define ARV752DPW22_RELAY 73
615+ ltq_register_gpio_ebu(ARV752DPW22_EBU);
616+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv752dpw22_leds_gpio), arv752dpw22_leds_gpio);
617+ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys);
618+ ltq_register_nor(&arv75xx_flash_data);
619+ ltq_register_pci(&ltq_pci_data);
620+ xway_register_dwc(ARV752DPW22_USB);
621+ arv75xx_register_ethernet();
622+ gpio_request(ARV752DPW22_RELAY, "relay");
623+ gpio_set_value(ARV752DPW22_RELAY, 1);
624+ gpio_export(ARV752DPW22_RELAY, 0);
625+}
626+
627+MIPS_MACHINE(LANTIQ_MACH_ARV752DPW,
628+ "ARV752DPW",
629+ "ARV752DPW - Arcor A802",
630+ arv752dpw_init);
631+
632+static void __init
633+arv752dpw22_init(void)
634+{
635+#define ARV752DPW22_EBU 0x2
636+#define ARV752DPW22_USB 72
637+#define ARV752DPW22_RELAY 73
638+
639+ ltq_register_gpio_ebu(ARV752DPW22_EBU);
640+ ltq_add_device_leds_gpio(-1, ARRAY_SIZE(arv752dpw22_leds_gpio), arv752dpw22_leds_gpio);
641+ ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL, ARRAY_SIZE(arv752dpw22_gpio_keys), arv752dpw22_gpio_keys);
642+ ltq_register_nor(&arv75xx_flash_data);
643+ ltq_pci_data.irq[15] = (INT_NUM_IM3_IRL0 + 31);
644+ ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
645+ ltq_register_pci(&ltq_pci_data);
646+ xway_register_dwc(ARV752DPW22_USB);
647+ arv75xx_register_ethernet();
648+
649+ gpio_request(ARV752DPW22_RELAY, "relay");
650+ gpio_set_value(ARV752DPW22_RELAY, 1);
651+ gpio_export(ARV752DPW22_RELAY, 0);
652+}
653+
654+MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
655+ "ARV752DPW22",
656+ "ARV752DPW22 - Arcor A803",
657+ arv752dpw22_init);
658--- a/arch/mips/lantiq/machtypes.h
659+++ b/arch/mips/lantiq/machtypes.h
660@@ -22,6 +22,18 @@
661     LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */
662     LANTIQ_MACH_EASY98020, /* Falcon Reference Board */
663     LANTIQ_MACH_95C3AM1, /* Board 95C3AM1 */
664+
665+ /* Arcadyan */
666+ LANTIQ_MACH_ARV3527P, /* Arcor easybox a401 */
667+ LANTIQ_MACH_ARV4510PW, /* Wippies Homebox */
668+ LANTIQ_MACH_ARV4518PW, /* Airties WAV-221, SMC-7908A-ISP */
669+ LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */
670+ LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */
671+ LANTIQ_MACH_ARV4525PW, /* Speedport W502V */
672+ LANTIQ_MACH_ARV7525PW, /* Speedport W303V Typ A */
673+ LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */
674+ LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */
675+ LANTIQ_MACH_ARV7518PW, /* ASTORIA */
676 };
677 
678 #endif
679

Archive Download this file



interactive