summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-3.0/210-machtypes.patch
blob: bf998e4c7546471a49202cb71dd8fa4def049d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
Index: linux-3.0.3/arch/mips/lantiq/machtypes.h
===================================================================
--- linux-3.0.3.orig/arch/mips/lantiq/machtypes.h	2011-10-05 14:32:23.173150836 +0200
+++ linux-3.0.3/arch/mips/lantiq/machtypes.h	2011-10-05 14:32:23.385150846 +0200
@@ -20,9 +20,33 @@
 	LANTIQ_MACH_EASY98000,		/* Falcon Eval Board, NOR Flash */
 	LANTIQ_MACH_EASY98000SF,	/* Falcon Eval Board, Serial Flash */
 	LANTIQ_MACH_EASY98000NAND,	/* Falcon Eval Board, NAND Flash */
+	LANTIQ_MACH_EASY98020,		/* EASY98020 Eval Board */
+	LANTIQ_MACH_EASY98020_1LAN,	/* EASY98020 Eval Board (1 LAN port) */
+	LANTIQ_MACH_EASY98020_2LAN,	/* EASY98020 Eval Board (2 LAN port) */
+	LANTIQ_MACH_95C3AM1,		/* 95C3AM1 Eval Board */
 
 	/* FRITZ!BOX */
 	LANTIQ_MACH_FRITZ3370,		/* FRITZ!BOX 3370 vdsl cpe */
+
+	/* Arcadyan */
+	LANTIQ_MACH_ARV3527P,		/* Arcor easybox a401 */
+	LANTIQ_MACH_ARV4510PW,		/* Wippies Homebox */
+	LANTIQ_MACH_ARV4518PW,		/* Airties WAV-221, SMC-7908A-ISP */
+	LANTIQ_MACH_ARV4520PW,		/* Airties WAV-281, Arcor EasyboxA800 */
+	LANTIQ_MACH_ARV452CPW,		/* Arcor EasyboxA801 */
+	LANTIQ_MACH_ARV4525PW,		/* Speedport W502V */
+	LANTIQ_MACH_ARV752DPW,		/* Arcor easybox a802 */
+	LANTIQ_MACH_ARV752DPW22,	/* Arcor easybox a803 */
+	LANTIQ_MACH_ARV7518PW,		/* ASTORIA */
+
+	/* Netgear */
+	LANTIQ_MACH_DGN3500B,		/* Netgear DGN3500 */
+
+	/* Gigaset */
+	LANTIQ_MACH_GIGASX76X,		/* Gigaset SX76x */
+
+	/* Buffalo */
+	LANTIQ_MACH_WBMR,		/* WBMR-HP-G300H */
 };
 
 #endif
Index: linux-3.0.3/arch/mips/lantiq/xway/Kconfig
===================================================================
--- linux-3.0.3.orig/arch/mips/lantiq/xway/Kconfig	2011-10-05 14:32:23.173150836 +0200
+++ linux-3.0.3/arch/mips/lantiq/xway/Kconfig	2011-10-05 14:32:23.385150846 +0200
@@ -6,6 +6,22 @@
 	bool "Easy50712 - Danube"
 	default y
 
+config LANTIQ_MACH_ARV45XX
+	bool "ARV45XX"
+	default y
+
+config LANTIQ_MACH_NETGEAR
+	bool "Netgear"
+	default y
+
+config LANTIQ_MACH_GIGASX76X
+	bool "GIGASX76X"
+	default y
+
+config LANTIQ_MACH_WBMR
+	bool "WBMR-HP-G300H"
+	default y
+
 endmenu
 
 endif
Index: linux-3.0.3/arch/mips/lantiq/xway/Makefile
===================================================================
--- linux-3.0.3.orig/arch/mips/lantiq/xway/Makefile	2011-10-05 14:32:23.173150836 +0200
+++ linux-3.0.3/arch/mips/lantiq/xway/Makefile	2011-10-05 15:46:10.061340080 +0200
@@ -7,3 +7,7 @@
 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
 obj-$(CONFIG_LANTIQ_MACH_FRITZ3370) += mach-fritz.o
+obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
+obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o
+obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o
+obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o
Index: linux-3.0.3/arch/mips/lantiq/falcon/Kconfig
===================================================================
--- linux-3.0.3.orig/arch/mips/lantiq/falcon/Kconfig	2011-10-05 14:32:22.745150818 +0200
+++ linux-3.0.3/arch/mips/lantiq/falcon/Kconfig	2011-10-05 14:32:23.385150846 +0200
@@ -6,6 +6,14 @@
 	bool "Easy98000"
 	default y
 
+config LANTIQ_MACH_EASY98020
+	bool "Easy98020"
+	default y
+
+config LANTIQ_MACH_95C3AM1
+	bool "95C3AM1"
+	default y
+
 endmenu
 
 endif
Index: linux-3.0.3/arch/mips/lantiq/falcon/Makefile
===================================================================
--- linux-3.0.3.orig/arch/mips/lantiq/falcon/Makefile	2011-10-05 14:32:23.089150832 +0200
+++ linux-3.0.3/arch/mips/lantiq/falcon/Makefile	2011-10-05 14:32:23.389150846 +0200
@@ -1,2 +1,6 @@
 obj-y := clk.o prom.o reset.o sysctrl.o devices.o gpio.o softdog_vpe.o
+obj-$(CONFIG_LANTIQ_MACH_EASY98000) += addon-easy98000.o
+obj-$(CONFIG_LANTIQ_MACH_EASY98000) += dev-leds-easy98000-cpld.o
 obj-$(CONFIG_LANTIQ_MACH_EASY98000) += mach-easy98000.o
+obj-$(CONFIG_LANTIQ_MACH_EASY98020) += mach-easy98020.o
+obj-$(CONFIG_LANTIQ_MACH_95C3AM1)   += mach-95C3AM1.o
Index: linux-3.0.3/arch/mips/lantiq/falcon/mach-easy98000.c
===================================================================
--- linux-3.0.3.orig/arch/mips/lantiq/falcon/mach-easy98000.c	2011-10-05 15:17:45.445267210 +0200
+++ linux-3.0.3/arch/mips/lantiq/falcon/mach-easy98000.c	2011-10-05 15:45:54.153339399 +0200
@@ -1,23 +1,38 @@
-/*
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License version 2 as published
- *  by the Free Software Foundation.
- *
- *  Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
- *  Copyright (C) 2011 John Crispin <blogic@openwrt.org>
- */
-
+#include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <linux/gpio.h>
+#include <linux/gpio_buttons.h>
+#include <linux/etherdevice.h>
+#include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/dm9000.h>
+#include <linux/i2c.h>
+#include <linux/i2c-gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_gpio.h>
 #include <linux/spi/eeprom.h>
+#include <falcon/lantiq_soc.h>
 
 #include "../machtypes.h"
 
 #include "devices.h"
+#include "dev-leds-gpio.h"
+
+#define EASY98000_GPIO_LED_0 9
+#define EASY98000_GPIO_LED_1 10
+#define EASY98000_GPIO_LED_2 11
+#define EASY98000_GPIO_LED_3 12
+#define EASY98000_GPIO_LED_4 13
+#define EASY98000_GPIO_LED_5 14
+
+extern unsigned char ltq_ethaddr[6];
 
-static struct mtd_partition easy98000_nor_partitions[] = {
+static struct mtd_partition easy98000_nor_partitions[] =
+{
 	{
 		.name	= "uboot",
 		.offset	= 0x0,
@@ -35,7 +50,7 @@
 	},
 };
 
-struct physmap_flash_data easy98000_nor_flash_data = {
+static struct physmap_flash_data easy98000_nor_flash_data = {
 	.nr_parts	= ARRAY_SIZE(easy98000_nor_partitions),
 	.parts		= easy98000_nor_partitions,
 };
@@ -55,12 +70,105 @@
 	.platform_data		= &easy98000_spi_flash_platform_data
 };
 
+static struct gpio_led easy98000_leds_gpio[] __initdata = {
+	{
+		.name		= "easy98000:green:0",
+		.gpio		= EASY98000_GPIO_LED_0,
+		.active_low	= 0,
+	}, {
+		.name		= "easy98000:green:1",
+		.gpio		= EASY98000_GPIO_LED_1,
+		.active_low	= 0,
+	}, {
+		.name		= "easy98000:green:2",
+		.gpio		= EASY98000_GPIO_LED_2,
+		.active_low	= 0,
+	}, {
+		.name		= "easy98000:green:3",
+		.gpio		= EASY98000_GPIO_LED_3,
+		.active_low	= 0,
+	}, {
+		.name		= "easy98000:green:4",
+		.gpio		= EASY98000_GPIO_LED_4,
+		.active_low	= 0,
+	}, {
+		.name		= "easy98000:green:5",
+		.gpio		= EASY98000_GPIO_LED_5,
+		.active_low	= 0,
+	}
+};
+
+#define CONFIG_DM9000_BASE		0x14000000
+#define DM9000_IO			(CONFIG_DM9000_BASE + 3)
+#define DM9000_DATA			(CONFIG_DM9000_BASE + 1)
+
+static struct dm9000_plat_data dm9000_plat_data = {
+	.flags = DM9000_PLATF_8BITONLY,
+	//.dev_addr = { }, /* possibility to provide an ethernet address for the chip */
+};
+
+static struct resource dm9000_resources[] = {
+	MEM_RES("dm9000_io", DM9000_IO, DM9000_IO),
+	MEM_RES("dm9000_data", DM9000_DATA, DM9000_DATA),
+	[2] = {
+		/* with irq (210 -> gpio 110) the driver is very unreliable */
+		.start	= -1,		/* use polling */
+		.end	= -1,
+		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
+	},
+};
+
+static struct platform_device dm9000_platform = {
+	.name = "dm9000",
+	.id = 0,
+	.num_resources	= ARRAY_SIZE(dm9000_resources),
+	.resource	= dm9000_resources,
+	.dev = {
+		.platform_data = (void *) &dm9000_plat_data,
+	}
+};
+
+extern int easy98000_addon_has_dm9000(void);
+static void __init register_davicom(void)
+{
+	if (!easy98000_addon_has_dm9000())
+		return;
+
+	if (!is_valid_ether_addr(ltq_ethaddr))
+		random_ether_addr(dm9000_plat_data.dev_addr);
+	else {
+		memcpy(dm9000_plat_data.dev_addr, ltq_ethaddr, 6);
+		/* change to "Locally Administered Address" */
+		dm9000_plat_data.dev_addr[0] |= 0x2;
+	}
+	platform_device_register(&dm9000_platform);
+}
+
+static struct i2c_gpio_platform_data easy98000_i2c_gpio_data = {
+	.sda_pin	= 107,
+	.scl_pin	= 108,
+};
+
+static struct platform_device easy98000_i2c_gpio_device = {
+	.name		= "i2c-gpio",
+	.id		= 0,
+	.dev = {
+		.platform_data	= &easy98000_i2c_gpio_data,
+	}
+};
+
+void __init register_easy98000_cpld(void)
+{
+	platform_device_register_simple("easy98000_cpld_led", 0, NULL, 0);
+	platform_device_register_simple("easy98000_addon", 0, NULL, 0);
+}
+
 /* setup gpio based spi bus/device for access to the eeprom on the board */
-#define SPI_GPIO_MRST		102
-#define SPI_GPIO_MTSR		103
-#define SPI_GPIO_CLK		104
-#define SPI_GPIO_CS0		105
-#define SPI_GPIO_CS1		106
+#define SPI_GPIO_MRST	102
+#define SPI_GPIO_MTSR	103
+#define SPI_GPIO_CLK	104
+#define SPI_GPIO_CS0	105
+#define SPI_GPIO_CS1	106
 #define SPI_GPIO_BUS_NUM	1
 
 static struct spi_gpio_platform_data easy98000_spi_gpio_data = {
@@ -93,29 +201,36 @@
 	.platform_data		= &at25160n,
 };
 
-static void __init
-easy98000_init_common(void)
+static void __init easy98000_spi_gpio_init(void)
 {
 	spi_register_board_info(&easy98000_spi_gpio_devices, 1);
 	platform_device_register(&easy98000_spi_gpio_device);
 }
 
-static void __init
-easy98000_init(void)
+static void __init easy98000_init_common(void)
+{
+	falcon_register_i2c();
+	platform_device_register(&easy98000_i2c_gpio_device);
+	register_davicom();
+	ltq_add_device_leds_gpio(-1, ARRAY_SIZE(easy98000_leds_gpio),
+					easy98000_leds_gpio);
+	register_easy98000_cpld();
+	easy98000_spi_gpio_init();
+}
+
+static void __init easy98000_init(void)
 {
 	easy98000_init_common();
 	ltq_register_nor(&easy98000_nor_flash_data);
 }
 
-static void __init
-easy98000sf_init(void)
+static void __init easy98000sf_init(void)
 {
 	easy98000_init_common();
 	falcon_register_spi_flash(&easy98000_spi_flash_data);
 }
 
-static void __init
-easy98000nand_init(void)
+static void __init easy98000nand_init(void)
 {
 	easy98000_init_common();
 	falcon_register_nand();