1 --- a/arch/mips/lantiq/machtypes.h
2 +++ b/arch/mips/lantiq/machtypes.h
3 @@ -20,9 +20,34 @@ 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_FRITZ3370, /* FRITZ!BOX 3370 vdsl cpe */
16 + LANTIQ_MACH_ARV3527P, /* Arcor easybox a401 */
17 + LANTIQ_MACH_ARV4510PW, /* Wippies Homebox */
18 + LANTIQ_MACH_ARV4518PW, /* Airties WAV-221, SMC-7908A-ISP */
19 + LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */
20 + LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */
21 + LANTIQ_MACH_ARV4525PW, /* Speedport W502V */
22 + LANTIQ_MACH_ARV7525PW, /* Speedport W303V */
23 + LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */
24 + LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */
25 + LANTIQ_MACH_ARV7518PW, /* ASTORIA */
28 + LANTIQ_MACH_DGN3500B, /* Netgear DGN3500 */
31 + LANTIQ_MACH_GIGASX76X, /* Gigaset SX76x */
34 + LANTIQ_MACH_WBMR, /* WBMR-HP-G300H */
38 --- a/arch/mips/lantiq/xway/Kconfig
39 +++ b/arch/mips/lantiq/xway/Kconfig
40 @@ -6,6 +6,22 @@ config LANTIQ_MACH_EASY50712
41 bool "Easy50712 - Danube"
44 +config LANTIQ_MACH_ARV45XX
48 +config LANTIQ_MACH_NETGEAR
52 +config LANTIQ_MACH_GIGASX76X
56 +config LANTIQ_MACH_WBMR
57 + bool "WBMR-HP-G300H"
63 --- a/arch/mips/lantiq/xway/Makefile
64 +++ b/arch/mips/lantiq/xway/Makefile
65 @@ -7,3 +7,7 @@ obj-$(CONFIG_SOC_VR9) += clk-vr9.o prom-
66 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
67 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
68 obj-$(CONFIG_LANTIQ_MACH_FRITZ3370) += mach-fritz.o
69 +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
70 +obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o
71 +obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o
72 +obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o
73 --- a/arch/mips/lantiq/falcon/Kconfig
74 +++ b/arch/mips/lantiq/falcon/Kconfig
75 @@ -6,6 +6,14 @@ config LANTIQ_MACH_EASY98000
79 +config LANTIQ_MACH_EASY98020
83 +config LANTIQ_MACH_95C3AM1
90 --- a/arch/mips/lantiq/falcon/Makefile
91 +++ b/arch/mips/lantiq/falcon/Makefile
93 obj-y := clk.o prom.o reset.o sysctrl.o devices.o gpio.o softdog_vpe.o
94 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o
95 +obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
96 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
97 +obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
98 +obj-$(CONFIG_LANTIQ_MACH_95C3AM1) += mach-95C3AM1.o
99 --- a/arch/mips/lantiq/falcon/mach-easy98000.c
100 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
103 - * This program is free software; you can redistribute it and/or modify it
104 - * under the terms of the GNU General Public License version 2 as published
105 - * by the Free Software Foundation.
107 - * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
108 - * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
111 +#include <linux/init.h>
112 #include <linux/platform_device.h>
113 +#include <linux/leds.h>
114 +#include <linux/gpio.h>
115 +#include <linux/gpio_buttons.h>
116 +#include <linux/etherdevice.h>
117 +#include <linux/mtd/mtd.h>
118 #include <linux/mtd/partitions.h>
119 +#include <linux/mtd/physmap.h>
120 +#include <linux/input.h>
121 +#include <linux/interrupt.h>
122 +#include <linux/dm9000.h>
123 +#include <linux/i2c.h>
124 +#include <linux/i2c-gpio.h>
125 #include <linux/spi/spi.h>
126 #include <linux/spi/spi_gpio.h>
127 #include <linux/spi/eeprom.h>
128 +#include <falcon/lantiq_soc.h>
130 #include "../machtypes.h"
133 +#include "dev-leds-gpio.h"
135 +#define EASY98000_GPIO_LED_0 9
136 +#define EASY98000_GPIO_LED_1 10
137 +#define EASY98000_GPIO_LED_2 11
138 +#define EASY98000_GPIO_LED_3 12
139 +#define EASY98000_GPIO_LED_4 13
140 +#define EASY98000_GPIO_LED_5 14
142 +extern unsigned char ltq_ethaddr[6];
144 -static struct mtd_partition easy98000_nor_partitions[] = {
145 +static struct mtd_partition easy98000_nor_partitions[] =
150 @@ -35,7 +50,7 @@ static struct mtd_partition easy98000_no
154 -struct physmap_flash_data easy98000_nor_flash_data = {
155 +static struct physmap_flash_data easy98000_nor_flash_data = {
156 .nr_parts = ARRAY_SIZE(easy98000_nor_partitions),
157 .parts = easy98000_nor_partitions,
159 @@ -55,12 +70,105 @@ static struct spi_board_info easy98000_s
160 .platform_data = &easy98000_spi_flash_platform_data
163 +static struct gpio_led easy98000_leds_gpio[] __initdata = {
165 + .name = "easy98000:green:0",
166 + .gpio = EASY98000_GPIO_LED_0,
169 + .name = "easy98000:green:1",
170 + .gpio = EASY98000_GPIO_LED_1,
173 + .name = "easy98000:green:2",
174 + .gpio = EASY98000_GPIO_LED_2,
177 + .name = "easy98000:green:3",
178 + .gpio = EASY98000_GPIO_LED_3,
181 + .name = "easy98000:green:4",
182 + .gpio = EASY98000_GPIO_LED_4,
185 + .name = "easy98000:green:5",
186 + .gpio = EASY98000_GPIO_LED_5,
191 +#define CONFIG_DM9000_BASE 0x14000000
192 +#define DM9000_IO (CONFIG_DM9000_BASE + 3)
193 +#define DM9000_DATA (CONFIG_DM9000_BASE + 1)
195 +static struct dm9000_plat_data dm9000_plat_data = {
196 + .flags = DM9000_PLATF_8BITONLY,
197 + //.dev_addr = { }, /* possibility to provide an ethernet address for the chip */
200 +static struct resource dm9000_resources[] = {
201 + MEM_RES("dm9000_io", DM9000_IO, DM9000_IO),
202 + MEM_RES("dm9000_data", DM9000_DATA, DM9000_DATA),
204 + /* with irq (210 -> gpio 110) the driver is very unreliable */
205 + .start = -1, /* use polling */
207 + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
211 +static struct platform_device dm9000_platform = {
214 + .num_resources = ARRAY_SIZE(dm9000_resources),
215 + .resource = dm9000_resources,
217 + .platform_data = (void *) &dm9000_plat_data,
221 +extern int easy98000_addon_has_dm9000(void);
222 +static void __init register_davicom(void)
224 + if (!easy98000_addon_has_dm9000())
227 + if (!is_valid_ether_addr(ltq_ethaddr))
228 + random_ether_addr(dm9000_plat_data.dev_addr);
230 + memcpy(dm9000_plat_data.dev_addr, ltq_ethaddr, 6);
231 + /* change to "Locally Administered Address" */
232 + dm9000_plat_data.dev_addr[0] |= 0x2;
234 + platform_device_register(&dm9000_platform);
237 +static struct i2c_gpio_platform_data easy98000_i2c_gpio_data = {
242 +static struct platform_device easy98000_i2c_gpio_device = {
243 + .name = "i2c-gpio",
246 + .platform_data = &easy98000_i2c_gpio_data,
250 +void __init register_easy98000_cpld(void)
252 + platform_device_register_simple("easy98000_cpld_led", 0, NULL, 0);
253 + platform_device_register_simple("easy98000_addon", 0, NULL, 0);
256 /* setup gpio based spi bus/device for access to the eeprom on the board */
257 -#define SPI_GPIO_MRST 102
258 -#define SPI_GPIO_MTSR 103
259 -#define SPI_GPIO_CLK 104
260 -#define SPI_GPIO_CS0 105
261 -#define SPI_GPIO_CS1 106
262 +#define SPI_GPIO_MRST 102
263 +#define SPI_GPIO_MTSR 103
264 +#define SPI_GPIO_CLK 104
265 +#define SPI_GPIO_CS0 105
266 +#define SPI_GPIO_CS1 106
267 #define SPI_GPIO_BUS_NUM 1
269 static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
270 @@ -93,29 +201,36 @@ static struct spi_board_info easy98000_s
271 .platform_data = &at25160n,
275 -easy98000_init_common(void)
276 +static void __init easy98000_spi_gpio_init(void)
278 spi_register_board_info(&easy98000_spi_gpio_devices, 1);
279 platform_device_register(&easy98000_spi_gpio_device);
283 -easy98000_init(void)
284 +static void __init easy98000_init_common(void)
286 + falcon_register_i2c();
287 + platform_device_register(&easy98000_i2c_gpio_device);
288 + register_davicom();
289 + ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98000_leds_gpio),
290 + easy98000_leds_gpio);
291 + register_easy98000_cpld();
292 + easy98000_spi_gpio_init();
295 +static void __init easy98000_init(void)
297 easy98000_init_common();
298 ltq_register_nor(&easy98000_nor_flash_data);
302 -easy98000sf_init(void)
303 +static void __init easy98000sf_init(void)
305 easy98000_init_common();
306 falcon_register_spi_flash(&easy98000_spi_flash_data);
310 -easy98000nand_init(void)
311 +static void __init easy98000nand_init(void)
313 easy98000_init_common();
314 falcon_register_nand();