1 --- a/arch/mips/include/asm/mach-lantiq/machine.h
2 +++ b/arch/mips/include/asm/mach-lantiq/machine.h
4 LANTIQ_MACH_EASY4010, /* Twinpass evalkit */
5 LANTIQ_MACH_EASY50712, /* Danube evalkit */
6 LANTIQ_MACH_EASY50812, /* AR9 eval board */
9 + LANTIQ_MACH_ARV4510PW, /* Wippies Homebox */
10 + LANTIQ_MACH_ARV4518PW, /* Airties WAV-221, SMC-7908A-ISP */
11 + LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */
12 + LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */
13 + LANTIQ_MACH_ARV4525PW, /* Speedport W502V */
14 + LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */
15 + LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */
16 + LANTIQ_MACH_ARV7518PW, /* ASTORIA */
18 --- a/arch/mips/lantiq/xway/Kconfig
19 +++ b/arch/mips/lantiq/xway/Kconfig
24 +config LANTIQ_MACH_ARV45XX
31 --- a/arch/mips/lantiq/xway/Makefile
32 +++ b/arch/mips/lantiq/xway/Makefile
34 obj-$(CONFIG_LANTIQ_MACH_EASY50812) += mach-easy50812.o
35 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
36 obj-$(CONFIG_LANTIQ_MACH_EASY4010) += mach-easy4010.o
37 +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
39 +++ b/arch/mips/lantiq/xway/mach-arv45xx.c
42 + * This program is free software; you can redistribute it and/or modify it
43 + * under the terms of the GNU General Public License version 2 as published
44 + * by the Free Software Foundation.
46 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
49 +#include <linux/init.h>
50 +#include <linux/platform_device.h>
51 +#include <linux/leds.h>
52 +#include <linux/gpio.h>
53 +#include <linux/gpio_buttons.h>
54 +#include <linux/mtd/mtd.h>
55 +#include <linux/mtd/partitions.h>
56 +#include <linux/mtd/physmap.h>
57 +#include <linux/input.h>
58 +#include <linux/etherdevice.h>
63 +#include <lantiq_platform.h>
66 +#include "dev-dwc_otg.h"
68 +#ifdef CONFIG_MTD_PARTITIONS
69 +static struct mtd_partition arv45xx_partitions[] =
77 + .name = "uboot_env",
87 + .name = "board_config",
93 +static struct mtd_partition arv4518_partitions[] =
101 + .name = "uboot_env",
111 + .name = "board_config",
112 + .offset = 0x3f0000,
117 +static struct mtd_partition arv75xx_partitions[] =
125 + .name = "uboot_env",
135 + .name = "board_config",
136 + .offset = 0x7f0000,
143 +static struct physmap_flash_data arv45xx_flash_data = {
144 +#ifdef CONFIG_MTD_PARTITIONS
145 + .nr_parts = ARRAY_SIZE(arv45xx_partitions),
146 + .parts = arv45xx_partitions,
150 +static struct physmap_flash_data arv4518_flash_data = {
151 +#ifdef CONFIG_MTD_PARTITIONS
152 + .nr_parts = ARRAY_SIZE(arv4518_partitions),
153 + .parts = arv4518_partitions,
157 +static struct physmap_flash_data arv75xx_flash_data = {
158 +#ifdef CONFIG_MTD_PARTITIONS
159 + .nr_parts = ARRAY_SIZE(arv75xx_partitions),
160 + .parts = arv75xx_partitions,
164 +static struct lq_pci_data lq_pci_data = {
165 + .clock = PCI_CLOCK_EXT,
166 + .gpio = PCI_GNT1 | PCI_REQ1,
168 + [14] = INT_NUM_IM0_IRL0 + 22,
172 +static struct lq_eth_data lq_eth_data = {
173 + .mii_mode = REV_MII_MODE,
174 + .mac = "\xff\xff\xff\xff\xff\xff",
177 +static struct gpio_led
178 +arv4510pw_leds_gpio[] __initdata = {
179 + { .name = "soc:green:foo", .gpio = 4, .active_low = 1, },
182 +static struct gpio_led
183 +arv4518pw_leds_gpio[] __initdata = {
184 + { .name = "soc:green:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
185 + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
186 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
187 + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
188 + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
189 + { .name = "soc:red:fail", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
190 + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, .default_trigger = "default-on" },
191 + { .name = "soc:green:voip", .gpio = 32, .active_low = 1, .default_trigger = "default-on" },
192 + { .name = "soc:green:fxs1", .gpio = 33, .active_low = 1, .default_trigger = "default-on" },
193 + { .name = "soc:green:fxs2", .gpio = 34, .active_low = 1, .default_trigger = "default-on" },
194 + { .name = "soc:green:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
197 +static struct gpio_button
198 +arv4518pw_gpio_buttons[] __initdata = {
199 + { .desc = "wlan", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, },
200 + { .desc = "wps", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 29, .active_low = 1, },
201 + { .desc = "reset", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 30, .active_low = 1, },
204 +static struct gpio_led
205 +arv4520pw_leds_gpio[] __initdata = {
206 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
207 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
208 + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
209 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
210 + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, },
211 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
212 + { .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
213 + { .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
214 + { .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
215 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
216 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
217 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
218 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
221 +static struct gpio_led
222 +arv452cpw_leds_gpio[] __initdata = {
223 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
224 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
225 + { .name = "soc:blue:isdn", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
226 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
227 + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
228 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
229 + { .name = "soc:blue:fxs1", .gpio = 32, .active_low = 1, .default_trigger = "default-on" },
230 + { .name = "soc:blue:fxs2", .gpio = 33, .active_low = 1, .default_trigger = "default-on" },
231 + { .name = "soc:blue:wps", .gpio = 34, .active_low = 1, .default_trigger = "default-on" },
232 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
233 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
234 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
235 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
236 + { .name = "soc:blue:internet", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
237 + { .name = "soc:red:internet", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
240 +static struct gpio_led
241 +arv4525pw_leds_gpio[] __initdata = {
242 + { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
243 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
244 + { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
245 + { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
246 + { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
249 +static struct gpio_led
250 +arv752dpw22_leds_gpio[] __initdata = {
251 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
252 + { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
253 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
254 + { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
255 + { .name = "soc:red:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
256 + { .name = "soc:red:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
257 + { .name = "soc:green:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
258 + { .name = "soc:green:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
259 + { .name = "soc:green:wlan1", .gpio = 39, .active_low = 1, .default_trigger = "default-on" },
260 + { .name = "soc:blue:wlan", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
261 + { .name = "soc:blue:wlan1", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
262 + { .name = "soc:green:eth1", .gpio = 43, .active_low = 1, .default_trigger = "default-on" },
263 + { .name = "soc:green:eth2", .gpio = 44, .active_low = 1, .default_trigger = "default-on" },
264 + { .name = "soc:green:eth3", .gpio = 45, .active_low = 1, .default_trigger = "default-on" },
265 + { .name = "soc:green:eth4", .gpio = 46, .active_low = 1, .default_trigger = "default-on", },
268 +static struct gpio_button
269 +arv752dpw22_gpio_buttons[] __initdata = {
270 + { .desc = "btn0", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 12, .active_low = 1, },
271 + { .desc = "btn1", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 13, .active_low = 1, },
272 + { .desc = "btn2", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 28, .active_low = 1, },
275 +static struct gpio_led
276 +arv7518pw_leds_gpio[] __initdata = {
277 + { .name = "soc:green:power", .gpio = 2, .active_low = 1, },
278 + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
279 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
280 + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
281 + { .name = "soc:red:internet", .gpio = 8, .active_low = 1, },
282 + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
285 +static struct gpio_button
286 +arv7518pw_gpio_buttons[] __initdata = {
287 + { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 23, .active_low = 1, },
288 + { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 25, .active_low = 1, },
292 +arv45xx_register_ethernet(void)
294 +#define ARV45XX_BRN_MAC 0x3f0016
295 + memcpy_fromio(lq_eth_data.mac,
296 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV45XX_BRN_MAC), 6);
297 + lq_register_ethernet(&lq_eth_data);
301 +arv75xx_register_ethernet(void)
303 +#define ARV75XX_BRN_MAC 0x7f0016
304 + memcpy_fromio(lq_eth_data.mac,
305 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV75XX_BRN_MAC), 6);
306 + lq_register_ethernet(&lq_eth_data);
310 +bewan_register_ethernet(void)
312 +#define BEWAN_BRN_MAC 0x3f0014
313 + memcpy_fromio(lq_eth_data.mac,
314 + (void *)KSEG1ADDR(LQ_FLASH_START + BEWAN_BRN_MAC), 6);
315 + lq_register_ethernet(&lq_eth_data);
319 +arv4510pw_init(void)
321 + lq_register_gpio();
322 + lq_register_gpio_stp();
323 + lq_register_gpio_leds(arv4510pw_leds_gpio, ARRAY_SIZE(arv4510pw_leds_gpio));
324 + lq_register_asc(0);
325 + lq_register_asc(1);
326 + lq_register_nor(&arv45xx_flash_data);
327 + lq_register_pci(&lq_pci_data);
328 + lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
329 + lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
330 + lq_register_pci(&lq_pci_data);
332 + bewan_register_ethernet();
335 +MIPS_MACHINE(LANTIQ_MACH_ARV4510PW,
337 + "ARV4510PW - Wippies Homebox",
341 +arv4518pw_init(void)
343 +#define ARV4518PW_EBU 0
344 +#define ARV4518PW_USB 14
345 +#define ARV4518PW_SWITCH_RESET 13
347 + lq_register_gpio();
348 + lq_register_gpio_ebu(ARV4518PW_EBU);
349 + lq_register_gpio_leds(arv4518pw_leds_gpio, ARRAY_SIZE(arv4518pw_leds_gpio));
350 + lq_register_gpio_buttons(arv4518pw_gpio_buttons, ARRAY_SIZE(arv4518pw_gpio_buttons));
351 + lq_register_asc(0);
352 + lq_register_asc(1);
353 + lq_register_nor(&arv4518_flash_data);
354 + lq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
355 + lq_register_pci(&lq_pci_data);
357 + arv45xx_register_ethernet();
358 + xway_register_dwc(ARV4518PW_USB);
360 + gpio_request(ARV4518PW_SWITCH_RESET, "switch");
361 + gpio_direction_output(ARV4518PW_SWITCH_RESET, 1);
362 + gpio_export(ARV4518PW_SWITCH_RESET, 0);
365 +MIPS_MACHINE(LANTIQ_MACH_ARV4518PW,
367 + "ARV4518PW - SMC7908A-ISP, Airties WAV-221",
371 +arv4520pw_init(void)
373 +#define ARV4520PW_EBU 0x400
374 +#define ARV4520PW_USB 28
376 + lq_register_gpio();
377 + lq_register_gpio_ebu(ARV4520PW_EBU);
378 + lq_register_gpio_leds(arv4520pw_leds_gpio, ARRAY_SIZE(arv4520pw_leds_gpio));
379 + lq_register_asc(0);
380 + lq_register_asc(1);
381 + lq_register_nor(&arv45xx_flash_data);
382 + lq_register_pci(&lq_pci_data);
384 + arv45xx_register_ethernet();
385 + xway_register_dwc(ARV4520PW_USB);
388 +MIPS_MACHINE(LANTIQ_MACH_ARV4520PW,
390 + "ARV4520PW - Airties WAV-281, Arcor A800",
394 +arv452Cpw_init(void)
396 +#define ARV452CPW_EBU 0x77f
397 +#define ARV452CPW_USB 28
398 +#define ARV452CPW_RELAY1 31
399 +#define ARV452CPW_RELAY2 39
400 +#define ARV452CPW_SWITCH_RESET 42
402 + lq_register_gpio();
403 + lq_register_gpio_ebu(ARV452CPW_EBU);
404 + lq_register_gpio_leds(arv452cpw_leds_gpio, ARRAY_SIZE(arv452cpw_leds_gpio));
405 + lq_register_asc(0);
406 + lq_register_asc(1);
407 + lq_register_nor(&arv4518_flash_data);
408 + lq_register_pci(&lq_pci_data);
410 + arv45xx_register_ethernet();
411 + xway_register_dwc(ARV452CPW_USB);
413 + gpio_request(ARV452CPW_SWITCH_RESET, "switch");
414 + gpio_set_value(ARV452CPW_SWITCH_RESET, 1);
415 + gpio_export(ARV452CPW_SWITCH_RESET, 0);
417 + gpio_request(ARV452CPW_RELAY1, "relay1");
418 + gpio_direction_output(ARV452CPW_RELAY1, 1);
419 + gpio_export(ARV452CPW_RELAY1, 0);
421 + gpio_request(ARV452CPW_RELAY2, "relay2");
422 + gpio_set_value(ARV452CPW_RELAY2, 1);
423 + gpio_export(ARV452CPW_RELAY2, 0);
426 +MIPS_MACHINE(LANTIQ_MACH_ARV452CPW,
428 + "ARV452CPW - Arcor A801",
432 +arv4525pw_init(void)
434 + lq_register_gpio();
435 + lq_register_gpio_leds(arv4525pw_leds_gpio, ARRAY_SIZE(arv4525pw_leds_gpio));
436 + lq_register_asc(0);
437 + lq_register_asc(1);
438 + lq_register_nor(&arv45xx_flash_data);
439 + lq_pci_data.clock = PCI_CLOCK_INT;
440 + lq_register_pci(&lq_pci_data);
442 + lq_eth_data.mii_mode = MII_MODE;
443 + arv45xx_register_ethernet();
446 +MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
448 + "ARV4525PW - Speedport W502V",
452 +arv7518pw_init(void)
454 +#define ARV7518PW_EBU 0x2
455 +#define ARV7518PW_USB -1
457 + lq_register_gpio();
458 + lq_register_gpio_ebu(ARV7518PW_EBU);
459 + lq_register_asc(0);
460 + lq_register_asc(1);
461 + lq_register_gpio_leds(arv7518pw_leds_gpio, ARRAY_SIZE(arv7518pw_leds_gpio));
462 + lq_register_gpio_buttons(arv7518pw_gpio_buttons, ARRAY_SIZE(arv7518pw_gpio_buttons));
463 + lq_register_nor(&arv75xx_flash_data);
464 + lq_register_pci(&lq_pci_data);
466 + xway_register_dwc(ARV7518PW_USB);
467 + arv75xx_register_ethernet();
468 + //arv7518_register_ath9k(mac);
471 +MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
473 + "ARV7518PW - ASTORIA",
477 +arv752dpw22_init(void)
479 +#define ARV752DPW22_EBU 0x2
480 +#define ARV752DPW22_USB 32
481 +#define ARV752DPW22_RELAY 33
483 + lq_register_gpio();
484 + lq_register_gpio_ebu(ARV752DPW22_EBU);
485 + lq_register_asc(0);
486 + lq_register_asc(1);
487 + lq_register_gpio_leds(arv752dpw22_leds_gpio, ARRAY_SIZE(arv752dpw22_leds_gpio));
488 + lq_register_gpio_buttons(arv752dpw22_gpio_buttons, ARRAY_SIZE(arv752dpw22_gpio_buttons));
489 + lq_register_nor(&arv75xx_flash_data);
490 + lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
491 + lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
492 + lq_register_pci(&lq_pci_data);
494 + xway_register_dwc(ARV752DPW22_USB);
495 + arv75xx_register_ethernet();
497 + gpio_request(ARV752DPW22_RELAY, "relay");
498 + gpio_set_value(ARV752DPW22_RELAY, 1);
499 + gpio_export(ARV752DPW22_RELAY, 0);
502 +MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
504 + "ARV752DPW22 - Arcor A803",