1 --- a/arch/mips/lantiq/machtypes.h
2 +++ b/arch/mips/lantiq/machtypes.h
3 @@ -20,6 +20,36 @@ 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 */
40 --- a/arch/mips/lantiq/xway/Kconfig
41 +++ b/arch/mips/lantiq/xway/Kconfig
42 @@ -6,6 +6,30 @@ config LANTIQ_MACH_EASY50712
43 bool "Easy50712 - Danube"
46 +config LANTIQ_MACH_ARV
50 +config LANTIQ_MACH_NETGEAR
54 +config LANTIQ_MACH_GIGASX76X
58 +config LANTIQ_MACH_WBMR
59 + bool "WBMR-HP-G300H"
62 +config LANTIQ_MACH_FRITZ_VR9
66 +config LANTIQ_MACH_FRITZ_AR9
73 --- a/arch/mips/lantiq/xway/Makefile
74 +++ b/arch/mips/lantiq/xway/Makefile
75 @@ -2,3 +2,9 @@ obj-y := sysctrl.o reset.o gpio.o gpio_s
77 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
78 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
79 +obj-$(CONFIG_LANTIQ_MACH_ARV) += mach-arv.o
80 +obj-$(CONFIG_LANTIQ_MACH_FRITZ_AR9) += mach-fritz_ar9.o
81 +obj-$(CONFIG_LANTIQ_MACH_FRITZ_VR9) += mach-fritz_vr9.o
82 +obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o
83 +obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o
84 +obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o
85 --- a/arch/mips/lantiq/falcon/Kconfig
86 +++ b/arch/mips/lantiq/falcon/Kconfig
87 @@ -6,6 +6,14 @@ config LANTIQ_MACH_EASY98000
91 +config LANTIQ_MACH_EASY98020
95 +config LANTIQ_MACH_95C3AM1
102 --- a/arch/mips/lantiq/falcon/Makefile
103 +++ b/arch/mips/lantiq/falcon/Makefile
105 obj-y := prom.o reset.o sysctrl.o devices.o gpio.o
106 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o
107 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
108 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
109 +obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
110 +obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o
111 --- a/arch/mips/lantiq/falcon/mach-easy98000.c
112 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
115 - * This program is free software; you can redistribute it and/or modify it
116 - * under the terms of the GNU General Public License version 2 as published
117 - * by the Free Software Foundation.
119 - * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
120 - * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
123 +#include <linux/init.h>
124 #include <linux/platform_device.h>
125 +#include <linux/leds.h>
126 +#include <linux/gpio.h>
127 +#include <linux/gpio_buttons.h>
128 +#include <linux/etherdevice.h>
129 +#include <linux/mtd/mtd.h>
130 #include <linux/mtd/partitions.h>
131 +#include <linux/mtd/physmap.h>
132 +#include <linux/input.h>
133 +#include <linux/interrupt.h>
134 +#include <linux/dm9000.h>
135 +#include <linux/i2c.h>
136 +#include <linux/i2c-gpio.h>
137 #include <linux/spi/spi.h>
138 #include <linux/spi/spi_gpio.h>
139 #include <linux/spi/eeprom.h>
140 +#include <falcon/lantiq_soc.h>
142 #include "../machtypes.h"
145 +#include "dev-leds-gpio.h"
147 +#define EASY98000_GPIO_LED_0 9
148 +#define EASY98000_GPIO_LED_1 10
149 +#define EASY98000_GPIO_LED_2 11
150 +#define EASY98000_GPIO_LED_3 12
151 +#define EASY98000_GPIO_LED_4 13
152 +#define EASY98000_GPIO_LED_5 14
154 -static struct mtd_partition easy98000_nor_partitions[] = {
155 +extern unsigned char ltq_ethaddr[6];
157 +static struct mtd_partition easy98000_nor_partitions[] =
162 @@ -35,7 +50,7 @@ static struct mtd_partition easy98000_no
166 -struct physmap_flash_data easy98000_nor_flash_data = {
167 +static struct physmap_flash_data easy98000_nor_flash_data = {
168 .nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
169 .parts = easy98000_nor_partitions,
171 @@ -55,12 +70,105 @@ static struct spi_board_info easy98000_s
172 .platform_data = &easy98000_spi_flash_platform_data
175 +static struct gpio_led easy98000_leds_gpio[] __initdata = {
177 + .name = "easy98000:green:0",
178 + .gpio = EASY98000_GPIO_LED_0,
181 + .name = "easy98000:green:1",
182 + .gpio = EASY98000_GPIO_LED_1,
185 + .name = "easy98000:green:2",
186 + .gpio = EASY98000_GPIO_LED_2,
189 + .name = "easy98000:green:3",
190 + .gpio = EASY98000_GPIO_LED_3,
193 + .name = "easy98000:green:4",
194 + .gpio = EASY98000_GPIO_LED_4,
197 + .name = "easy98000:green:5",
198 + .gpio = EASY98000_GPIO_LED_5,
203 +#define CONFIG_DM9000_BASE 0x14000000
204 +#define DM9000_IO (CONFIG_DM9000_BASE + 3)
205 +#define DM9000_DATA (CONFIG_DM9000_BASE + 1)
207 +static struct dm9000_plat_data dm9000_plat_data = {
208 + .flags = DM9000_PLATF_8BITONLY,
209 + //.dev_addr = { }, /* possibility to provide an ethernet address for the chip */
212 +static struct resource dm9000_resources[] = {
213 + MEM_RES("dm9000_io", DM9000_IO, DM9000_IO),
214 + MEM_RES("dm9000_data", DM9000_DATA, DM9000_DATA),
216 + /* with irq (210 -> gpio 110) the driver is very unreliable */
217 + .start = -1, /* use polling */
219 + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
223 +static struct platform_device dm9000_platform = {
226 + .num_resources = ARRAY_SIZE(dm9000_resources),
227 + .resource = dm9000_resources,
229 + .platform_data = (void *) &dm9000_plat_data,
233 +extern int easy98000_addon_has_dm9000(void);
234 +static void __init register_davicom(void)
236 + if (!easy98000_addon_has_dm9000())
239 + if (!is_valid_ether_addr(ltq_ethaddr))
240 + random_ether_addr(dm9000_plat_data.dev_addr);
242 + memcpy(dm9000_plat_data.dev_addr, ltq_ethaddr, 6);
243 + /* change to "Locally Administered Address" */
244 + dm9000_plat_data.dev_addr[0] |= 0x2;
246 + platform_device_register(&dm9000_platform);
249 +static struct i2c_gpio_platform_data easy98000_i2c_gpio_data = {
254 +static struct platform_device easy98000_i2c_gpio_device = {
255 + .name = "i2c-gpio",
258 + .platform_data = &easy98000_i2c_gpio_data,
262 +void __init register_easy98000_cpld(void)
264 + platform_device_register_simple("easy98000_cpld_led", 0, NULL, 0);
265 + platform_device_register_simple("easy98000_addon", 0, NULL, 0);
268 /* setup gpio based spi bus/device for access to the eeprom on the board */
269 -#define SPI_GPIO_MRST 102
270 -#define SPI_GPIO_MTSR 103
271 -#define SPI_GPIO_CLK 104
272 -#define SPI_GPIO_CS0 105
273 -#define SPI_GPIO_CS1 106
274 +#define SPI_GPIO_MRST 102
275 +#define SPI_GPIO_MTSR 103
276 +#define SPI_GPIO_CLK 104
277 +#define SPI_GPIO_CS0 105
278 +#define SPI_GPIO_CS1 106
279 #define SPI_GPIO_BUS_NUM 1
281 static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
282 @@ -94,11 +202,22 @@ static struct spi_board_info easy98000_s
286 -easy98000_init_common(void)
287 +easy98000_spi_gpio_init(void)
289 spi_register_board_info(&easy98000_spi_gpio_devices, 1);
290 platform_device_register(&easy98000_spi_gpio_device);
294 +easy98000_init_common(void)
296 falcon_register_i2c();
297 + platform_device_register(&easy98000_i2c_gpio_device);
298 + register_davicom();
299 + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98000_leds_gpio),
300 + easy98000_leds_gpio);
301 + register_easy98000_cpld();
302 + easy98000_spi_gpio_init();