1 --- a/arch/mips/lantiq/machtypes.h
2 +++ b/arch/mips/lantiq/machtypes.h
3 @@ -20,6 +20,42 @@ enum lantiq_mach_type {
4 LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */
5 LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */
6 LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */
7 + LANTIQ_MACH_EASY98020, /* EASY98020 Eval Board */
8 + LANTIQ_MACH_EASY98020_1LAN, /* EASY98020 Eval Board (1 LAN port) */
9 + LANTIQ_MACH_EASY98020_2LAN, /* EASY98020 Eval Board (2 LAN port) */
10 + LANTIQ_MACH_95C3AM1, /* 95C3AM1 Eval Board */
13 + LANTIQ_MACH_ARV3527P, /* Arcor easybox a401 */
14 + LANTIQ_MACH_ARV4510PW, /* Wippies Homebox */
15 + LANTIQ_MACH_ARV4518PW, /* Airties WAV-221, SMC-7908A-ISP */
16 + LANTIQ_MACH_ARV4519PW, /* Vodafone, Pirelli */
17 + LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */
18 + LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */
19 + LANTIQ_MACH_ARV4525PW, /* Speedport W502V */
20 + LANTIQ_MACH_ARV7525PW, /* Speedport W303V */
21 + LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */
22 + LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */
23 + LANTIQ_MACH_ARV7518PW, /* ASTORIA */
26 + LANTIQ_MACH_DGN3500B, /* Netgear DGN3500 */
29 + LANTIQ_MACH_FRITZ3370, /* FRITZ!BOX 3370 vdsl cpe */
30 + LANTIQ_MACH_FRITZ7320, /* FRITZ!BOX 7320 1&1 homeserver */
33 + LANTIQ_MACH_GIGASX76X, /* Gigaset SX76x */
36 + LANTIQ_MACH_WBMR, /* WBMR-HP-G300H */
39 + LANTIQ_MACH_P2601HNFX, /* ZyXEL P-2601HN-Fx */
42 + LANTIQ_MACH_H201L, /* ZTE ZXV10 H201L */
46 --- a/arch/mips/lantiq/xway/Kconfig
47 +++ b/arch/mips/lantiq/xway/Kconfig
48 @@ -6,6 +6,38 @@ config LANTIQ_MACH_EASY50712
49 bool "Easy50712 - Danube"
52 +config LANTIQ_MACH_ARV
56 +config LANTIQ_MACH_NETGEAR
60 +config LANTIQ_MACH_GIGASX76X
64 +config LANTIQ_MACH_WBMR
65 + bool "WBMR-HP-G300H"
68 +config LANTIQ_MACH_P2601HNFX
72 +config LANTIQ_MACH_H201L
76 +config LANTIQ_MACH_FRITZ_VR9
80 +config LANTIQ_MACH_FRITZ_AR9
87 --- a/arch/mips/lantiq/xway/Makefile
88 +++ b/arch/mips/lantiq/xway/Makefile
89 @@ -2,3 +2,11 @@ obj-y := sysctrl.o reset.o gpio.o gpio_s
91 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
92 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
93 +obj-$(CONFIG_LANTIQ_MACH_ARV) += mach-arv.o
94 +obj-$(CONFIG_LANTIQ_MACH_FRITZ_AR9) += mach-fritz_ar9.o
95 +obj-$(CONFIG_LANTIQ_MACH_FRITZ_VR9) += mach-fritz_vr9.o
96 +obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o
97 +obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o
98 +obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o
99 +obj-$(CONFIG_LANTIQ_MACH_P2601HNFX) += mach-p2601hnfx.o
100 +obj-$(CONFIG_LANTIQ_MACH_H201L) += mach-h201l.o
101 --- a/arch/mips/lantiq/falcon/Kconfig
102 +++ b/arch/mips/lantiq/falcon/Kconfig
103 @@ -6,6 +6,14 @@ config LANTIQ_MACH_EASY98000
107 +config LANTIQ_MACH_EASY98020
111 +config LANTIQ_MACH_95C3AM1
118 --- a/arch/mips/lantiq/falcon/Makefile
119 +++ b/arch/mips/lantiq/falcon/Makefile
121 obj-y := prom.o reset.o sysctrl.o devices.o gpio.o
122 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o
123 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
124 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
125 +obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
126 +obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o
127 --- a/arch/mips/lantiq/falcon/mach-easy98000.c
128 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
131 - * This program is free software; you can redistribute it and/or modify it
132 - * under the terms of the GNU General Public License version 2 as published
133 - * by the Free Software Foundation.
135 - * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
136 - * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
139 +#include <linux/init.h>
140 #include <linux/platform_device.h>
141 +#include <linux/leds.h>
142 +#include <linux/gpio.h>
143 +#include <linux/gpio_buttons.h>
144 +#include <linux/etherdevice.h>
145 +#include <linux/mtd/mtd.h>
146 #include <linux/mtd/partitions.h>
147 +#include <linux/mtd/physmap.h>
148 +#include <linux/input.h>
149 +#include <linux/interrupt.h>
150 +#include <linux/dm9000.h>
151 +#include <linux/i2c.h>
152 +#include <linux/i2c-gpio.h>
153 #include <linux/spi/spi.h>
154 #include <linux/spi/spi_gpio.h>
155 #include <linux/spi/eeprom.h>
156 +#include <falcon/lantiq_soc.h>
158 #include "../machtypes.h"
161 +#include "dev-leds-gpio.h"
163 +#define EASY98000_GPIO_LED_0 9
164 +#define EASY98000_GPIO_LED_1 10
165 +#define EASY98000_GPIO_LED_2 11
166 +#define EASY98000_GPIO_LED_3 12
167 +#define EASY98000_GPIO_LED_4 13
168 +#define EASY98000_GPIO_LED_5 14
170 -static struct mtd_partition easy98000_nor_partitions[] = {
171 +extern unsigned char ltq_ethaddr[6];
173 +static struct mtd_partition easy98000_nor_partitions[] =
178 @@ -35,7 +50,7 @@ static struct mtd_partition easy98000_no
182 -struct physmap_flash_data easy98000_nor_flash_data = {
183 +static struct physmap_flash_data easy98000_nor_flash_data = {
184 .nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
185 .parts = easy98000_nor_partitions,
187 @@ -55,12 +70,105 @@ static struct spi_board_info easy98000_s
188 .platform_data = &easy98000_spi_flash_platform_data
191 +static struct gpio_led easy98000_leds_gpio[] __initdata = {
193 + .name = "easy98000:green:0",
194 + .gpio = EASY98000_GPIO_LED_0,
197 + .name = "easy98000:green:1",
198 + .gpio = EASY98000_GPIO_LED_1,
201 + .name = "easy98000:green:2",
202 + .gpio = EASY98000_GPIO_LED_2,
205 + .name = "easy98000:green:3",
206 + .gpio = EASY98000_GPIO_LED_3,
209 + .name = "easy98000:green:4",
210 + .gpio = EASY98000_GPIO_LED_4,
213 + .name = "easy98000:green:5",
214 + .gpio = EASY98000_GPIO_LED_5,
219 +#define CONFIG_DM9000_BASE 0x14000000
220 +#define DM9000_IO (CONFIG_DM9000_BASE + 3)
221 +#define DM9000_DATA (CONFIG_DM9000_BASE + 1)
223 +static struct dm9000_plat_data dm9000_plat_data = {
224 + .flags = DM9000_PLATF_8BITONLY,
225 + //.dev_addr = { }, /* possibility to provide an ethernet address for the chip */
228 +static struct resource dm9000_resources[] = {
229 + MEM_RES("dm9000_io", DM9000_IO, DM9000_IO),
230 + MEM_RES("dm9000_data", DM9000_DATA, DM9000_DATA),
232 + /* with irq (210 -> gpio 110) the driver is very unreliable */
233 + .start = -1, /* use polling */
235 + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
239 +static struct platform_device dm9000_platform = {
242 + .num_resources = ARRAY_SIZE(dm9000_resources),
243 + .resource = dm9000_resources,
245 + .platform_data = (void *) &dm9000_plat_data,
249 +extern int easy98000_addon_has_dm9000(void);
250 +static void __init register_davicom(void)
252 + if (!easy98000_addon_has_dm9000())
255 + if (!is_valid_ether_addr(ltq_ethaddr))
256 + random_ether_addr(dm9000_plat_data.dev_addr);
258 + memcpy(dm9000_plat_data.dev_addr, ltq_ethaddr, 6);
259 + /* change to "Locally Administered Address" */
260 + dm9000_plat_data.dev_addr[0] |= 0x2;
262 + platform_device_register(&dm9000_platform);
265 +static struct i2c_gpio_platform_data easy98000_i2c_gpio_data = {
270 +static struct platform_device easy98000_i2c_gpio_device = {
271 + .name = "i2c-gpio",
274 + .platform_data = &easy98000_i2c_gpio_data,
278 +void __init register_easy98000_cpld(void)
280 + platform_device_register_simple("easy98000_cpld_led", 0, NULL, 0);
281 + platform_device_register_simple("easy98000_addon", 0, NULL, 0);
284 /* setup gpio based spi bus/device for access to the eeprom on the board */
285 -#define SPI_GPIO_MRST 102
286 -#define SPI_GPIO_MTSR 103
287 -#define SPI_GPIO_CLK 104
288 -#define SPI_GPIO_CS0 105
289 -#define SPI_GPIO_CS1 106
290 +#define SPI_GPIO_MRST 102
291 +#define SPI_GPIO_MTSR 103
292 +#define SPI_GPIO_CLK 104
293 +#define SPI_GPIO_CS0 105
294 +#define SPI_GPIO_CS1 106
295 #define SPI_GPIO_BUS_NUM 1
297 static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
298 @@ -94,11 +202,22 @@ static struct spi_board_info easy98000_s
302 -easy98000_init_common(void)
303 +easy98000_spi_gpio_init(void)
305 spi_register_board_info(&easy98000_spi_gpio_devices, 1);
306 platform_device_register(&easy98000_spi_gpio_device);
310 +easy98000_init_common(void)
312 falcon_register_i2c();
313 + platform_device_register(&easy98000_i2c_gpio_device);
314 + register_davicom();
315 + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98000_leds_gpio),
316 + easy98000_leds_gpio);
317 + register_easy98000_cpld();
318 + easy98000_spi_gpio_init();