summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches/400-mach-arv45xx.patch
blob: 6a7770c01eb571db0b537e489bdb9ab24af9ac47 (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
326
327
328
329
330
331
332
333
334
--- a/arch/mips/include/asm/mach-lantiq/machine.h
+++ b/arch/mips/include/asm/mach-lantiq/machine.h
@@ -11,4 +11,9 @@
 	LANTIQ_MACH_EASY4010,		/* Twinpass evalkit */
 	LANTIQ_MACH_EASY50712,		/* Danube evalkit */
 	LANTIQ_MACH_EASY50812,		/* AR9 eval board */
+	LANTIQ_MACH_ARV4518,		/* Airties WAV-221, SMC-7908A-ISP */
+	LANTIQ_MACH_ARV452,			/* Airties WAV-281, Arcor EasyboxA800 */
+	LANTIQ_MACH_ARV4525,		/* Speedport W502V */
+	LANTIQ_MACH_ARV752DPW22,	/* Arcor easybox a803 */
+	LANTIQ_MACH_ARV7518PW,		/* ASTORIA */
 };
--- a/arch/mips/lantiq/xway/Kconfig
+++ b/arch/mips/lantiq/xway/Kconfig
@@ -14,6 +14,10 @@
 	bool "Easy4010"
 	default y
 
+config LANTIQ_MACH_ARV45XX
+	bool "ARV45XX"
+	default y
+
 endmenu
 
 endif
--- a/arch/mips/lantiq/xway/Makefile
+++ b/arch/mips/lantiq/xway/Makefile
@@ -3,3 +3,4 @@
 obj-$(CONFIG_LANTIQ_MACH_EASY50812) += mach-easy50812.o
 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
 obj-$(CONFIG_LANTIQ_MACH_EASY4010) += mach-easy4010.o
+obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
--- /dev/null
+++ b/arch/mips/lantiq/xway/mach-arv45xx.c
@@ -0,0 +1,299 @@
+/*
+ *  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) 2010 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/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/input.h>
+#include <linux/etherdevice.h>
+
+#include <machine.h>
+
+#include <xway.h>
+#include <lantiq_platform.h>
+
+#include "devices.h"
+
+#define ARV452_LATCH_SWITCH		(1 << 10)
+#define ARV752DPW22_LATCH_DEFAULT	(2)
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition arv45xx_partitions[] =
+{
+	{
+		.name	= "uboot",
+		.offset	= 0x0,
+		.size	= 0x20000,
+	},
+	{
+		.name	= "uboot_env",
+		.offset	= 0x20000,
+		.size	= 0x10000,
+	},
+	{
+		.name	= "linux",
+		.offset	= 0x30000,
+		.size	= 0x3c0000,
+	},
+	{
+		.name	= "board_config",
+		.offset	= 0x3f0000,
+		.size	= 0x10000,
+	},
+};
+#endif
+
+static struct physmap_flash_data arv45xx_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+	.nr_parts	= ARRAY_SIZE(arv45xx_partitions),
+	.parts		= arv45xx_partitions,
+#endif
+};
+
+static struct mtd_partition arv75xx_partitions[] =
+{
+	{
+		.name	= "uboot",
+		.offset	= 0x0,
+		.size	= 0x40000,
+	},
+	{
+		.name	= "uboot_env",
+		.offset	= 0x40000,
+		.size	= 0x10000,
+	},
+	{
+		.name	= "linux",
+		.offset	= 0x50000,
+		.size	= 0x7a0000,
+	},
+	{
+		.name	= "board_config",
+		.offset	= 0x7f0000,
+		.size	= 0x10000,
+	},
+};
+
+static struct physmap_flash_data arv75xx_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+	.nr_parts	= ARRAY_SIZE(arv75xx_partitions),
+	.parts		= arv75xx_partitions,
+#endif
+};
+
+static struct lq_pci_data lq_pci_data = {
+	.clock      = PCI_CLOCK_EXT,
+	.gpio   = PCI_GNT1 | PCI_REQ1,
+	.irq    = {
+		[14] = INT_NUM_IM0_IRL0 + 22,
+	},
+};
+
+static struct lq_eth_data lq_eth_data = {
+	.mii_mode	= REV_MII_MODE,
+	.mac		= "\xff\xff\xff\xff\xff\xff",
+};
+
+static struct gpio_led
+arv4518_leds_gpio[] __initdata = {
+	{ .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
+	{ .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
+	{ .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
+	{ .name = "soc:red:power", .gpio = 6, .active_low = 1, },
+	{ .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
+	{ .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
+	{ .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
+	{ .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
+	{ .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
+	{ .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
+	{ .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
+	{ .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
+	{ .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
+};
+
+static struct gpio_led
+arv452_leds_gpio[] __initdata = {
+	{ .name = "soc:blue:power", .gpio = 3, .active_low = 1, },
+	{ .name = "soc:blue:adsl", .gpio = 4, .active_low = 1, },
+	{ .name = "soc:blue:internet", .gpio = 5, .active_low = 1, },
+	{ .name = "soc:red:power", .gpio = 6, .active_low = 1, },
+	{ .name = "soc:yello:wps", .gpio = 7, .active_low = 1, },
+	{ .name = "soc:red:wps", .gpio = 9, .active_low = 1, },
+	{ .name = "soc:blue:voip", .gpio = 32, .active_low = 1, },
+	{ .name = "soc:blue:fxs1", .gpio = 33, .active_low = 1, },
+	{ .name = "soc:blue:fxs2", .gpio = 34, .active_low = 1, },
+	{ .name = "soc:blue:fxo", .gpio = 35, .active_low = 1, },
+	{ .name = "soc:blue:voice", .gpio = 36, .active_low = 1, },
+	{ .name = "soc:blue:usb", .gpio = 37, .active_low = 1, },
+	{ .name = "soc:blue:wlan", .gpio = 38, .active_low = 1, },
+};
+
+static struct gpio_led arv4525_leds_gpio[] __initdata = {
+	{ .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, },
+	{ .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
+	{ .name = "soc:green:dsl", .gpio = 6, .active_low = 1, },
+	{ .name = "soc:green:wlan", .gpio = 8, .active_low = 1, },
+	{ .name = "soc:green:online", .gpio = 9, .active_low = 1, },
+};
+
+static struct gpio_led
+arv752dpw22_leds_gpio[] __initdata = {
+	{ .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:red:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:red:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:wlan1", .gpio = 39, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:blue:wlan", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:blue:wlan1", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:eth1", .gpio = 43, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:eth2", .gpio = 44, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:eth3", .gpio = 45, .active_low = 1, .default_trigger = "default-on" },
+	{ .name = "soc:green:eth4", .gpio = 46, .active_low = 1, .default_trigger = "default-on", },
+};
+
+static struct gpio_led
+arv7518pw_leds_gpio[] __initdata = {
+	{ .name = "soc:green:power", .gpio = 2, .active_low = 1, },
+	{ .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
+	{ .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
+	{ .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
+	{ .name = "sco:red:internet", .gpio = 8, .active_low = 1, },
+	{ .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
+};
+
+static void
+arv45xx_register_ethernet(void)
+{
+#define ARV45XX_BRN_MAC			0x3f0016
+	memcpy_fromio(lq_eth_data.mac,
+		(void *)KSEG1ADDR(LQ_FLASH_START + ARV45XX_BRN_MAC), 6);
+	lq_register_ethernet(&lq_eth_data);
+}
+
+static void
+arv75xx_register_ethernet(void)
+{
+#define ARV75XX_BRN_MAC			0x7f0016
+	memcpy_fromio(lq_eth_data.mac,
+		(void *)KSEG1ADDR(LQ_FLASH_START + ARV75XX_BRN_MAC), 6);
+	lq_register_ethernet(&lq_eth_data);
+}
+
+static void __init
+arv4518_init(void)
+{
+	lq_register_gpio();
+	lq_register_gpio_ebu(0);
+	lq_register_gpio_leds(arv4518_leds_gpio, ARRAY_SIZE(arv4518_leds_gpio));
+	lq_register_asc(0);
+	lq_register_asc(1);
+	lq_register_nor(&arv45xx_flash_data);
+	lq_register_pci(&lq_pci_data);
+	lq_register_wdt();
+	arv45xx_register_ethernet();
+}
+
+MIPS_MACHINE(LANTIQ_MACH_ARV4518,
+			"ARV4518",
+			"ARV4518 - SMC7908A-ISP",
+			arv4518_init);
+
+static void __init
+arv452_init(void)
+{
+	lq_register_gpio();
+	lq_register_gpio_ebu(ARV452_LATCH_SWITCH);
+	lq_register_gpio_leds(arv452_leds_gpio, ARRAY_SIZE(arv452_leds_gpio));
+	lq_register_asc(0);
+	lq_register_asc(1);
+	lq_register_nor(&arv45xx_flash_data);
+	lq_register_pci(&lq_pci_data);
+	lq_register_wdt();
+	arv45xx_register_ethernet();
+}
+
+MIPS_MACHINE(LANTIQ_MACH_ARV452,
+			"ARV452",
+			"ARV452 - Airties WAV-281, Arcor A800",
+			arv452_init);
+
+static void __init
+arv4525_init(void)
+{
+	lq_register_gpio();
+	lq_register_gpio_leds(arv4525_leds_gpio, ARRAY_SIZE(arv4525_leds_gpio));
+	lq_register_asc(0);
+	lq_register_asc(1);
+	lq_register_nor(&arv45xx_flash_data);
+	lq_register_pci(&lq_pci_data);
+	lq_register_wdt();
+	lq_eth_data.mii_mode = MII_MODE;
+	arv45xx_register_ethernet();
+}
+
+MIPS_MACHINE(LANTIQ_MACH_ARV4525,
+			"ARV4525",
+			"ARV4525 - Speedport W502V",
+			arv4525_init);
+
+
+static void __init
+arv7518pw_init(void)
+{
+	lq_register_gpio();
+	lq_register_gpio_ebu(ARV452_LATCH_SWITCH);
+	lq_register_asc(0);
+	lq_register_asc(1);
+	lq_register_gpio_leds(arv7518pw_leds_gpio, ARRAY_SIZE(arv7518pw_leds_gpio));
+	lq_register_nor(&arv75xx_flash_data);
+	lq_register_pci(&lq_pci_data);
+	lq_register_wdt();
+	arv75xx_register_ethernet();
+	//arv7518_register_ath9k(mac);
+}
+
+MIPS_MACHINE(LANTIQ_MACH_ARV7518PW,
+			"ARV7518PW",
+			"ARV7518PW - ASTORIA",
+			arv7518pw_init);
+
+static void __init
+arv752dpw22_init(void)
+{
+	lq_register_gpio();
+	lq_register_gpio_ebu(ARV752DPW22_LATCH_DEFAULT);
+	lq_register_asc(0);
+	lq_register_asc(1);
+	lq_register_gpio_leds(arv752dpw22_leds_gpio, ARRAY_SIZE(arv752dpw22_leds_gpio));
+	lq_register_nor(&arv75xx_flash_data);
+	lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
+	lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
+	lq_register_pci(&lq_pci_data);
+	lq_register_wdt();
+	arv75xx_register_ethernet();
+	gpio_request(32, "usb-power");
+	gpio_direction_output(32, 0);
+	mdelay(1);
+	__gpio_set_value(32, 1);
+	gpio_request(33, "relay");
+	gpio_direction_output(33, 1);
+}
+
+MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
+			"ARV752DPW22",
+			"ARV752DPW22 - Arcor A803",
+			arv752dpw22_init);