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 */
12 --- a/arch/mips/lantiq/xway/Kconfig
13 +++ b/arch/mips/lantiq/xway/Kconfig
18 +config LANTIQ_MACH_ARV45XX
25 --- a/arch/mips/lantiq/xway/Makefile
26 +++ b/arch/mips/lantiq/xway/Makefile
28 obj-$(CONFIG_LANTIQ_MACH_EASY50812) += mach-easy50812.o
29 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
30 obj-$(CONFIG_LANTIQ_MACH_EASY4010) += mach-easy4010.o
31 +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
33 +++ b/arch/mips/lantiq/xway/mach-arv45xx.c
36 + * This program is free software; you can redistribute it and/or modify it
37 + * under the terms of the GNU General Public License version 2 as published
38 + * by the Free Software Foundation.
40 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
43 +#include <linux/init.h>
44 +#include <linux/platform_device.h>
45 +#include <linux/leds.h>
46 +#include <linux/gpio.h>
47 +#include <linux/gpio_buttons.h>
48 +#include <linux/mtd/mtd.h>
49 +#include <linux/mtd/partitions.h>
50 +#include <linux/mtd/physmap.h>
51 +#include <linux/input.h>
52 +#include <linux/etherdevice.h>
57 +#include <lantiq_platform.h>
61 +#define ARV452_LATCH_SWITCH (1 << 10)
62 +#define ARV752DPW22_LATCH_DEFAULT (2)
64 +#ifdef CONFIG_MTD_PARTITIONS
65 +static struct mtd_partition arv45xx_partitions[] =
73 + .name = "uboot_env",
83 + .name = "board_config",
90 +static struct physmap_flash_data arv45xx_flash_data = {
91 +#ifdef CONFIG_MTD_PARTITIONS
92 + .nr_parts = ARRAY_SIZE(arv45xx_partitions),
93 + .parts = arv45xx_partitions,
97 +static struct mtd_partition arv75xx_partitions[] =
105 + .name = "uboot_env",
115 + .name = "board_config",
116 + .offset = 0x7f0000,
121 +static struct physmap_flash_data arv75xx_flash_data = {
122 +#ifdef CONFIG_MTD_PARTITIONS
123 + .nr_parts = ARRAY_SIZE(arv75xx_partitions),
124 + .parts = arv75xx_partitions,
128 +static struct lq_pci_data lq_pci_data = {
129 + .clock = PCI_CLOCK_EXT,
130 + .gpio = PCI_GNT1 | PCI_REQ1,
132 + [14] = INT_NUM_IM0_IRL0 + 22,
136 +static struct lq_eth_data lq_eth_data = {
137 + .mii_mode = REV_MII_MODE,
138 + .mac = "\xff\xff\xff\xff\xff\xff",
141 +static struct gpio_led
142 +arv4518_leds_gpio[] __initdata = {
143 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
144 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
145 + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
146 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
147 + { .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
148 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
149 + { .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
150 + { .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
151 + { .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
152 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
153 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
154 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
155 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
158 +static struct gpio_led
159 +arv452_leds_gpio[] __initdata = {
160 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
161 + { .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
162 + { .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
163 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, },
164 + { .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
165 + { .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
166 + { .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
167 + { .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
168 + { .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
169 + { .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
170 + { .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
171 + { .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
172 + { .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
175 +static struct gpio_led arv4525_leds_gpio[] __initdata = {
176 + { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, },
177 + { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
178 + { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, },
179 + { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, },
180 + { .name = "soc:green:online", .gpio = 9, .active_low = 1, },
183 +static struct gpio_led
184 +arv752dpw22_leds_gpio[] __initdata = {
185 + { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
186 + { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
187 + { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
188 + { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
189 + { .name = "soc:red:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
190 + { .name = "soc:red:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
191 + { .name = "soc:green:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
192 + { .name = "soc:green:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
193 + { .name = "soc:green:wlan1", .gpio = 39, .active_low = 1, .default_trigger = "default-on" },
194 + { .name = "soc:blue:wlan", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
195 + { .name = "soc:blue:wlan1", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
196 + { .name = "soc:green:eth1", .gpio = 43, .active_low = 1, .default_trigger = "default-on" },
197 + { .name = "soc:green:eth2", .gpio = 44, .active_low = 1, .default_trigger = "default-on" },
198 + { .name = "soc:green:eth3", .gpio = 45, .active_low = 1, .default_trigger = "default-on" },
199 + { .name = "soc:green:eth4", .gpio = 46, .active_low = 1, .default_trigger = "default-on", },
203 +arv45xx_register_ethernet(void)
205 +#define ARV45XX_BRN_MAC 0x3f0016
206 + memcpy_fromio(lq_eth_data.mac,
207 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV45XX_BRN_MAC), 6);
208 + lq_register_ethernet(&lq_eth_data);
212 +arv75xx_register_ethernet(void)
214 +#define ARV75XX_BRN_MAC 0x7f0016
215 + memcpy_fromio(lq_eth_data.mac,
216 + (void *)KSEG1ADDR(LQ_FLASH_START + ARV75XX_BRN_MAC), 6);
217 + lq_register_ethernet(&lq_eth_data);
223 + lq_register_gpio();
224 + lq_register_gpio_ebu(0);
225 + lq_register_gpio_leds(arv4518_leds_gpio, ARRAY_SIZE(arv4518_leds_gpio));
226 + lq_register_asc(0);
227 + lq_register_asc(1);
228 + lq_register_nor(&arv45xx_flash_data);
229 + lq_register_pci(&lq_pci_data);
231 + arv45xx_register_ethernet();
234 +MIPS_MACHINE(LANTIQ_MACH_ARV4518,
236 + "ARV4518 - SMC7908A-ISP",
242 + lq_register_gpio();
243 + lq_register_gpio_ebu(ARV452_LATCH_SWITCH);
244 + lq_register_gpio_leds(arv452_leds_gpio, ARRAY_SIZE(arv452_leds_gpio));
245 + lq_register_asc(0);
246 + lq_register_asc(1);
247 + lq_register_nor(&arv45xx_flash_data);
248 + lq_register_pci(&lq_pci_data);
250 + arv45xx_register_ethernet();
253 +MIPS_MACHINE(LANTIQ_MACH_ARV452,
255 + "ARV452 - Airties WAV-281, Arcor A800",
261 + lq_register_gpio();
262 + lq_register_gpio_leds(arv4525_leds_gpio, ARRAY_SIZE(arv4525_leds_gpio));
263 + lq_register_asc(0);
264 + lq_register_asc(1);
265 + lq_register_nor(&arv45xx_flash_data);
266 + lq_register_pci(&lq_pci_data);
268 + lq_eth_data.mii_mode = MII_MODE;
269 + arv45xx_register_ethernet();
272 +MIPS_MACHINE(LANTIQ_MACH_ARV4525,
274 + "ARV4525 - Speedport W502V",
278 +arv752dpw22_init(void)
280 + lq_register_gpio();
281 + lq_register_gpio_ebu(ARV752DPW22_LATCH_DEFAULT);
282 + lq_register_asc(0);
283 + lq_register_asc(1);
284 + lq_register_gpio_leds(arv752dpw22_leds_gpio, ARRAY_SIZE(arv752dpw22_leds_gpio));
285 + lq_register_nor(&arv75xx_flash_data);
286 + lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
287 + lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
288 + lq_register_pci(&lq_pci_data);
290 + arv75xx_register_ethernet();
291 + gpio_request(32, "usb-power");
292 + gpio_direction_output(32, 0);
294 + __gpio_set_value(32, 1);
295 + gpio_request(33, "relay");
296 + gpio_direction_output(33, 1);
299 +MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
301 + "ARV752DPW22 - Arcor A803",