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 */
7 + LANTIQ_MACH_ARV4518, /* Airties WAV-221, SMC-7908A-ISP */
8 + LANTIQ_MACH_ARV452, /* Airties WAV-281, Arcor EasyboxA800 */
9 + LANTIQ_MACH_ARV4525, /* Speedport W502V */
10 + LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */
11 + LANTIQ_MACH_ARV7518PW, /* ASTORIA */
13 --- a/arch/mips/lantiq/xway/Kconfig
14 +++ b/arch/mips/lantiq/xway/Kconfig
19 +config LANTIQ_MACH_ARV45XX
26 --- a/arch/mips/lantiq/xway/Makefile
27 +++ b/arch/mips/lantiq/xway/Makefile
29 obj-$(CONFIG_LANTIQ_MACH_EASY50812) += mach-easy50812.o
30 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
31 obj-$(CONFIG_LANTIQ_MACH_EASY4010) += mach-easy4010.o
32 +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
34 +++ b/arch/mips/lantiq/xway/mach-arv45xx.c
37 + * This program is free software; you can redistribute it and/or modify it
38 + * under the terms of the GNU General Public License version 2 as published
39 + * by the Free Software Foundation.
41 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
44 +#include <linux/init.h>
45 +#include <linux/platform_device.h>
46 +#include <linux/leds.h>
47 +#include <linux/gpio.h>
48 +#include <linux/gpio_buttons.h>
49 +#include <linux/mtd/mtd.h>
50 +#include <linux/mtd/partitions.h>
51 +#include <linux/mtd/physmap.h>
52 +#include <linux/input.h>
53 +#include <linux/etherdevice.h>
58 +#include <lantiq_platform.h>
62 +#define ARV452_LATCH_SWITCH (1 << 10)
63 +#define ARV752DPW22_LATCH_DEFAULT (2)
65 +#ifdef CONFIG_MTD_PARTITIONS
66 +static struct mtd_partition arv45xx_partitions[] =
74 + .name = "uboot_env",
84 + .name = "board_config",
91 +static struct physmap_flash_data arv45xx_flash_data = {
92 +#ifdef CONFIG_MTD_PARTITIONS
93 + .nr_parts = ARRAY_SIZE(arv45xx_partitions),
94 + .parts = arv45xx_partitions,
98 +static struct mtd_partition arv75xx_partitions[] =
106 + .name = "uboot_env",
116 + .name = "board_config",
117 + .offset = 0x7f0000,
122 +static struct physmap_flash_data arv75xx_flash_data = {
123 +#ifdef CONFIG_MTD_PARTITIONS
124 + .nr_parts = ARRAY_SIZE(arv75xx_partitions),
125 + .parts = arv75xx_partitions,
129 +static struct lq_pci_data lq_pci_data = {
130 + .clock = PCI_CLOCK_EXT,
131 + .gpio = PCI_GNT1 | PCI_REQ1,
133 + [14] = INT_NUM_IM0_IRL0 + 22,
137 +static struct lq_eth_data lq_eth_data = {
138 + .mii_mode = REV_MII_MODE,
139 + .mac = "\xff\xff\xff\xff\xff\xff",
142 +static struct gpio_led
143 +arv4518_leds_gpio[] __initdata = {
144 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
145 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
146 + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
147 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
148 + { .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
149 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
150 + { .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
151 + { .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
152 + { .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
153 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
154 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
155 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
156 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
159 +static struct gpio_led
160 +arv452_leds_gpio[] __initdata = {
161 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
162 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
163 + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
164 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
165 + { .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
166 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
167 + { .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
168 + { .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
169 + { .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
170 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
171 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
172 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
173 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
176 +static struct gpio_led arv4525_leds_gpio[] __initdata = {
177 + { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, },
178 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
179 + { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, },
180 + { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, },
181 + { .name = "soc:green:online", .gpio = 9, .active_low = 1, },
184 +static struct gpio_led
185 +arv752dpw22_leds_gpio[] __initdata = {
186 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
187 + { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
188 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
189 + { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
190 + { .name = "soc:red:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
191 + { .name = "soc:red:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
192 + { .name = "soc:green:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
193 + { .name = "soc:green:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
194 + { .name = "soc:green:wlan1", .gpio = 39, .active_low = 1, .default_trigger = "default-on" },
195 + { .name = "soc:blue:wlan", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
196 + { .name = "soc:blue:wlan1", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
197 + { .name = "soc:green:eth1", .gpio = 43, .active_low = 1, .default_trigger = "default-on" },
198 + { .name = "soc:green:eth2", .gpio = 44, .active_low = 1, .default_trigger = "default-on" },
199 + { .name = "soc:green:eth3", .gpio = 45, .active_low = 1, .default_trigger = "default-on" },
200 + { .name = "soc:green:eth4", .gpio = 46, .active_low = 1, .default_trigger = "default-on", },
203 +static struct gpio_led
204 +arv7518pw_leds_gpio[] __initdata = {
205 + { .name = "soc:green:power", .gpio = 2, .active_low = 1, },
206 + { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
207 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
208 + { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
209 + { .name = "sco:red:internet", .gpio = 8, .active_low = 1, },
210 + { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
214 +arv45xx_register_ethernet(void)
216 +#define ARV45XX_BRN_MAC 0x3f0016
217 + memcpy_fromio(lq_eth_data.mac,
218 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV45XX_BRN_MAC), 6);
219 + lq_register_ethernet(&lq_eth_data);
223 +arv75xx_register_ethernet(void)
225 +#define ARV75XX_BRN_MAC 0x7f0016
226 + memcpy_fromio(lq_eth_data.mac,
227 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV75XX_BRN_MAC), 6);
228 + lq_register_ethernet(&lq_eth_data);
234 + lq_register_gpio();
235 + lq_register_gpio_ebu(0);
236 + lq_register_gpio_leds(arv4518_leds_gpio, ARRAY_SIZE(arv4518_leds_gpio));
237 + lq_register_asc(0);
238 + lq_register_asc(1);
239 + lq_register_nor(&arv45xx_flash_data);
240 + lq_register_pci(&lq_pci_data);
242 + arv45xx_register_ethernet();
245 +MIPS_MACHINE(LANTIQ_MACH_ARV4518,
247 + "ARV4518 - SMC7908A-ISP",
253 + lq_register_gpio();
254 + lq_register_gpio_ebu(ARV452_LATCH_SWITCH);
255 + lq_register_gpio_leds(arv452_leds_gpio, ARRAY_SIZE(arv452_leds_gpio));
256 + lq_register_asc(0);
257 + lq_register_asc(1);
258 + lq_register_nor(&arv45xx_flash_data);
259 + lq_register_pci(&lq_pci_data);
261 + arv45xx_register_ethernet();
264 +MIPS_MACHINE(LANTIQ_MACH_ARV452,
266 + "ARV452 - Airties WAV-281, Arcor A800",
272 + lq_register_gpio();
273 + lq_register_gpio_leds(arv4525_leds_gpio, ARRAY_SIZE(arv4525_leds_gpio));
274 + lq_register_asc(0);
275 + lq_register_asc(1);
276 + lq_register_nor(&arv45xx_flash_data);
277 + lq_register_pci(&lq_pci_data);
279 + lq_eth_data.mii_mode = MII_MODE;
280 + arv45xx_register_ethernet();
283 +MIPS_MACHINE(LANTIQ_MACH_ARV4525,
285 + "ARV4525 - Speedport W502V",
290 +arv7518pw_init(void)
292 + lq_register_gpio();
293 + lq_register_gpio_ebu(ARV452_LATCH_SWITCH);
294 + lq_register_asc(0);
295 + lq_register_asc(1);
296 + lq_register_gpio_leds(arv7518pw_leds_gpio, ARRAY_SIZE(arv7518pw_leds_gpio));
297 + lq_register_nor(&arv75xx_flash_data);
298 + lq_register_pci(&lq_pci_data);
300 + arv75xx_register_ethernet();
301 + //arv7518_register_ath9k(mac);
304 +MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
306 + "ARV7518PW - ASTORIA",
310 +arv752dpw22_init(void)
312 + lq_register_gpio();
313 + lq_register_gpio_ebu(ARV752DPW22_LATCH_DEFAULT);
314 + lq_register_asc(0);
315 + lq_register_asc(1);
316 + lq_register_gpio_leds(arv752dpw22_leds_gpio, ARRAY_SIZE(arv752dpw22_leds_gpio));
317 + lq_register_nor(&arv75xx_flash_data);
318 + lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
319 + lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
320 + lq_register_pci(&lq_pci_data);
322 + arv75xx_register_ethernet();
323 + gpio_request(32, "usb-power");
324 + gpio_direction_output(32, 0);
326 + __gpio_set_value(32, 1);
327 + gpio_request(33, "relay");
328 + gpio_direction_output(33, 1);
331 +MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
333 + "ARV752DPW22 - Arcor A803",