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 a803 */
15 + LANTIQ_MACH_ARV7518PW, /* ASTORIA */
17 --- a/arch/mips/lantiq/xway/Kconfig
18 +++ b/arch/mips/lantiq/xway/Kconfig
23 +config LANTIQ_MACH_ARV45XX
30 --- a/arch/mips/lantiq/xway/Makefile
31 +++ b/arch/mips/lantiq/xway/Makefile
33 obj-$(CONFIG_LANTIQ_MACH_EASY50812) += mach-easy50812.o
34 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
35 obj-$(CONFIG_LANTIQ_MACH_EASY4010) += mach-easy4010.o
36 +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
38 +++ b/arch/mips/lantiq/xway/mach-arv45xx.c
41 + * This program is free software; you can redistribute it and/or modify it
42 + * under the terms of the GNU General Public License version 2 as published
43 + * by the Free Software Foundation.
45 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
48 +#include <linux/init.h>
49 +#include <linux/platform_device.h>
50 +#include <linux/leds.h>
51 +#include <linux/gpio.h>
52 +#include <linux/gpio_buttons.h>
53 +#include <linux/mtd/mtd.h>
54 +#include <linux/mtd/partitions.h>
55 +#include <linux/mtd/physmap.h>
56 +#include <linux/input.h>
57 +#include <linux/etherdevice.h>
62 +#include <lantiq_platform.h>
65 +#include "dev-dwc_otg.h"
67 +#define ARV4520PW_LATCH_SWITCH (1 << 10)
68 +#define ARV752DPW_LATCH_DEFAULT (2)
70 +#ifdef CONFIG_MTD_PARTITIONS
71 +static struct mtd_partition arv45xx_partitions[] =
79 + .name = "uboot_env",
89 + .name = "board_config",
95 +static struct mtd_partition arv4518_partitions[] =
103 + .name = "uboot_env",
113 + .name = "board_config",
114 + .offset = 0x3f0000,
119 +static struct mtd_partition arv75xx_partitions[] =
127 + .name = "uboot_env",
137 + .name = "board_config",
138 + .offset = 0x7f0000,
145 +static struct physmap_flash_data arv45xx_flash_data = {
146 +#ifdef CONFIG_MTD_PARTITIONS
147 + .nr_parts = ARRAY_SIZE(arv45xx_partitions),
148 + .parts = arv45xx_partitions,
152 +static struct physmap_flash_data arv4518_flash_data = {
153 +#ifdef CONFIG_MTD_PARTITIONS
154 + .nr_parts = ARRAY_SIZE(arv4518_partitions),
155 + .parts = arv4518_partitions,
159 +static struct physmap_flash_data arv75xx_flash_data = {
160 +#ifdef CONFIG_MTD_PARTITIONS
161 + .nr_parts = ARRAY_SIZE(arv75xx_partitions),
162 + .parts = arv75xx_partitions,
166 +static struct lq_pci_data lq_pci_data = {
167 + .clock = PCI_CLOCK_EXT,
168 + .gpio = PCI_GNT1 | PCI_REQ1,
170 + [14] = INT_NUM_IM0_IRL0 + 22,
174 +static struct lq_eth_data lq_eth_data = {
175 + .mii_mode = REV_MII_MODE,
176 + .mac = "\xff\xff\xff\xff\xff\xff",
179 +static struct gpio_led
180 +arv4510pw_leds_gpio[] __initdata = {
181 + { .name = "soc:green:foo", .gpio = 4, .active_low = 1, },
184 +static struct gpio_led
185 +arv4518pw_leds_gpio[] __initdata = {
186 + { .name = "soc:green:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
187 + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
188 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
189 + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
190 + { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
191 + { .name = "soc:red:fail", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
192 + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, .default_trigger = "default-on" },
193 + { .name = "soc:green:voip", .gpio = 32, .active_low = 1, .default_trigger = "default-on" },
194 + { .name = "soc:green:fxs1", .gpio = 33, .active_low = 1, .default_trigger = "default-on" },
195 + { .name = "soc:green:fxs2", .gpio = 34, .active_low = 1, .default_trigger = "default-on" },
196 + { .name = "soc:green:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
199 +static struct gpio_button
200 +arv4518pw_gpio_buttons[] __initdata = {
201 + { .desc = "wlan", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, },
202 + { .desc = "wps", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 29, .active_low = 1, },
203 + { .desc = "reset", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 30, .active_low = 1, },
206 +static struct gpio_led
207 +arv4520pw_leds_gpio[] __initdata = {
208 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
209 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
210 + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
211 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
212 + { .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
213 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
214 + { .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
215 + { .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
216 + { .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
217 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
218 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
219 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
220 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
223 +static struct gpio_led
224 +arv4525pw_leds_gpio[] __initdata = {
225 + { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
226 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
227 + { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
228 + { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
229 + { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
232 +static struct gpio_led
233 +arv752dpw_leds_gpio[] __initdata = {
234 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
235 + { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
236 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
237 + { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
238 + { .name = "soc:red:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
239 + { .name = "soc:red:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
240 + { .name = "soc:green:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
241 + { .name = "soc:green:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
242 + { .name = "soc:green:wlan1", .gpio = 39, .active_low = 1, .default_trigger = "default-on" },
243 + { .name = "soc:blue:wlan", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
244 + { .name = "soc:blue:wlan1", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
245 + { .name = "soc:green:eth1", .gpio = 43, .active_low = 1, .default_trigger = "default-on" },
246 + { .name = "soc:green:eth2", .gpio = 44, .active_low = 1, .default_trigger = "default-on" },
247 + { .name = "soc:green:eth3", .gpio = 45, .active_low = 1, .default_trigger = "default-on" },
248 + { .name = "soc:green:eth4", .gpio = 46, .active_low = 1, .default_trigger = "default-on", },
251 +static struct gpio_button
252 +arv752dpw_gpio_buttons[] __initdata = {
253 + { .desc = "btn0", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 12, .active_low = 1, },
254 + { .desc = "btn1", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 13, .active_low = 1, },
255 + { .desc = "btn2", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 28, .active_low = 1, },
258 +static struct gpio_led
259 +arv7518pw_leds_gpio[] __initdata = {
260 + { .name = "soc:green:power", .gpio = 2, .active_low = 1, },
261 + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
262 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
263 + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
264 + { .name = "sco:red:internet", .gpio = 8, .active_low = 1, },
265 + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
269 +arv45xx_register_ethernet(void)
271 +#define ARV45XX_BRN_MAC 0x3f0016
272 + memcpy_fromio(lq_eth_data.mac,
273 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV45XX_BRN_MAC), 6);
274 + lq_register_ethernet(&lq_eth_data);
278 +arv75xx_register_ethernet(void)
280 +#define ARV75XX_BRN_MAC 0x7f0016
281 + memcpy_fromio(lq_eth_data.mac,
282 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV75XX_BRN_MAC), 6);
283 + lq_register_ethernet(&lq_eth_data);
287 +bewan_register_ethernet(void)
289 +#define BEWAN_BRN_MAC 0x3f0014
290 + memcpy_fromio(lq_eth_data.mac,
291 + (void *)KSEG1ADDR(LQ_FLASH_START + BEWAN_BRN_MAC), 6);
292 + lq_register_ethernet(&lq_eth_data);
296 +arv4510pw_init(void)
298 + lq_register_gpio();
299 + lq_register_gpio_stp();
300 + lq_register_gpio_leds(arv4510pw_leds_gpio, ARRAY_SIZE(arv4510pw_leds_gpio));
301 + lq_register_asc(0);
302 + lq_register_asc(1);
303 + lq_register_nor(&arv45xx_flash_data);
304 + lq_register_pci(&lq_pci_data);
305 + lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
306 + lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
307 + lq_register_pci(&lq_pci_data);
309 + bewan_register_ethernet();
312 +MIPS_MACHINE(LANTIQ_MACH_ARV4510PW,
314 + "ARV4510PW - Wippies Homebox",
318 +arv4518pw_init(void)
320 + lq_register_gpio();
321 + lq_register_gpio_ebu(0);
322 + lq_register_gpio_leds(arv4518pw_leds_gpio, ARRAY_SIZE(arv4518pw_leds_gpio));
323 + lq_register_gpio_buttons(arv4518pw_gpio_buttons, ARRAY_SIZE(arv4518pw_gpio_buttons));
324 + lq_register_asc(0);
325 + lq_register_asc(1);
326 + lq_register_nor(&arv4518_flash_data);
327 + lq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
328 + lq_register_pci(&lq_pci_data);
330 + arv45xx_register_ethernet();
331 + xway_register_dwc(14);
332 + gpio_request(13, "switch-reset");
333 + gpio_direction_output(13, 1);
334 + gpio_export(13, 0);
337 +MIPS_MACHINE(LANTIQ_MACH_ARV4518PW,
339 + "ARV4518PW - SMC7908A-ISP, Airties WAV-221",
343 +arv4520pw_init(void)
345 + lq_register_gpio();
346 + lq_register_gpio_ebu(ARV4520PW_LATCH_SWITCH);
347 + lq_register_gpio_leds(arv4520pw_leds_gpio, ARRAY_SIZE(arv4520pw_leds_gpio));
348 + lq_register_asc(0);
349 + lq_register_asc(1);
350 + lq_register_nor(&arv45xx_flash_data);
351 + lq_register_pci(&lq_pci_data);
353 + arv45xx_register_ethernet();
354 + xway_register_dwc(28);
357 +MIPS_MACHINE(LANTIQ_MACH_ARV4520PW,
359 + "ARV4520PW - Airties WAV-281, Arcor A800",
363 +arv4525pw_init(void)
365 + lq_register_gpio();
366 + lq_register_gpio_leds(arv4525pw_leds_gpio, ARRAY_SIZE(arv4525pw_leds_gpio));
367 + lq_register_asc(0);
368 + lq_register_asc(1);
369 + lq_register_nor(&arv45xx_flash_data);
370 + lq_pci_data.clock = PCI_CLOCK_INT;
371 + lq_register_pci(&lq_pci_data);
373 + lq_eth_data.mii_mode = MII_MODE;
374 + arv45xx_register_ethernet();
377 +MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
379 + "ARV4525PW - Speedport W502V",
383 +arv7518pw_init(void)
385 + lq_register_gpio();
386 + lq_register_gpio_ebu(ARV4520PW_LATCH_SWITCH);
387 + lq_register_asc(0);
388 + lq_register_asc(1);
389 + lq_register_gpio_leds(arv7518pw_leds_gpio, ARRAY_SIZE(arv7518pw_leds_gpio));
390 + lq_register_nor(&arv75xx_flash_data);
391 + lq_register_pci(&lq_pci_data);
393 + arv75xx_register_ethernet();
394 + //arv7518_register_ath9k(mac);
397 +MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
399 + "ARV7518PW - ASTORIA",
403 +arv752dpw_init(void)
405 + lq_register_gpio();
406 + lq_register_gpio_ebu(ARV752DPW_LATCH_DEFAULT);
407 + lq_register_asc(0);
408 + lq_register_asc(1);
409 + lq_register_gpio_leds(arv752dpw_leds_gpio, ARRAY_SIZE(arv752dpw_leds_gpio));
410 + lq_register_gpio_buttons(arv752dpw_gpio_buttons, ARRAY_SIZE(arv752dpw_gpio_buttons));
411 + lq_register_nor(&arv75xx_flash_data);
412 + lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
413 + lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
414 + lq_register_pci(&lq_pci_data);
416 + arv75xx_register_ethernet();
417 + gpio_request(32, "usb-power");
418 + gpio_direction_output(32, 0);
420 + __gpio_set_value(32, 1);
421 + gpio_request(33, "relay");
422 + gpio_direction_output(33, 1);
425 +MIPS_MACHINE(LANTIQ_MACH_ARV752DPW,
427 + "ARV752DPW - Arcor A803",