a3b19b77429c7ac706be357b8b6de05b592226fa
[openwrt.git] / target / linux / brcm63xx / patches-2.6.32 / 221-board-NB4.patch
1 Index: linux-2.6.32.13/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 ===================================================================
3 --- linux-2.6.32.13.orig/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-05-27 21:45:09.000000000 -0400
4 +++ linux-2.6.32.13/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-05-27 21:46:39.000000000 -0400
5 @@ -17,6 +17,7 @@
6 #include <linux/ssb/ssb.h>
7 #include <linux/gpio_buttons.h>
8 #include <linux/input.h>
9 +#include <linux/nxp_74hc164.h>
10 #include <asm/addrspace.h>
11 #include <bcm63xx_board.h>
12 #include <bcm63xx_cpu.h>
13 @@ -33,6 +34,12 @@
14
15 #define PFX "board_bcm963xx: "
16
17 +#define NEUFBOX4_PID_OFFSET 0xff80
18 +#define NEUFBOX4_EXP_GPIO_BASE 64
19 +#define NEUFBOX4_GPIO_74HC164_DATA 7
20 +#define NEUFBOX4_GPIO_74HC164_CLK 6
21 +#define NXP_74HC64_GPIO(X) (NEUFBOX4_EXP_GPIO_BASE + (X))
22 +
23 static struct bcm963xx_nvram nvram;
24 static unsigned int mac_addr_used;
25 static struct board_info board;
26 @@ -697,6 +704,471 @@
27
28 .has_ohci0 = 1,
29 };
30 +
31 +static struct nxp_74hc164_platform_data neufbox4_74hc164_data = {
32 + .gpio_base = NEUFBOX4_EXP_GPIO_BASE,
33 + .gpio_pin_data = NEUFBOX4_GPIO_74HC164_DATA,
34 + .gpio_pin_clk = NEUFBOX4_GPIO_74HC164_CLK,
35 +
36 +};
37 +
38 +static struct platform_device neufbox4_74hc164 = {
39 + .name = NXP_74HC164_DRIVER_NAME,
40 + .id = -1,
41 + .dev = {
42 + .platform_data = &neufbox4_74hc164_data,
43 + }
44 +};
45 +
46 +static struct platform_device * __initdata neufbox4_devices[] = {
47 + &neufbox4_74hc164,
48 +};
49 +
50 +static struct board_info __initdata board_nb4_ser_r0 = {
51 + .name = "NB4-SER-r0",
52 + .expected_cpu_id = 0x6358,
53 +
54 + .has_enet0 = 1,
55 + .has_enet1 = 1,
56 + .has_pci = 1,
57 +
58 + .enet0 = {
59 + .has_phy = 1,
60 + .use_internal_phy = 1,
61 + },
62 +
63 + .enet1 = {
64 + .force_speed_100 = 1,
65 + .force_duplex_full = 1,
66 + },
67 +
68 +
69 + .has_ohci0 = 1,
70 + .has_pccard = 1,
71 + .has_ehci0 = 1,
72 +
73 + .has_udc0 = 1,
74 +
75 + .leds = {
76 + {
77 + .name = "adsl",
78 + .gpio = NXP_74HC64_GPIO(4),
79 + .active_low = 1,
80 + },
81 + {
82 + .name = "traffic",
83 + .gpio = 2,
84 + .active_low = 1,
85 + },
86 + {
87 + .name = "tel",
88 + .gpio = NXP_74HC64_GPIO(3),
89 + .active_low = 1,
90 + },
91 + {
92 + .name = "tv",
93 + .gpio = NXP_74HC64_GPIO(2),
94 + .active_low = 1,
95 + },
96 + {
97 + .name = "wifi",
98 + .gpio = 15,
99 + .active_low = 1,
100 + },
101 + {
102 + .name = "alarm",
103 + .gpio = NXP_74HC64_GPIO(0),
104 + .active_low = 1,
105 + },
106 + {
107 + .name = "service:red",
108 + .gpio = 29,
109 + .active_low = 1,
110 + },
111 + {
112 + .name = "service:green",
113 + .gpio = 30,
114 + .active_low = 1,
115 + },
116 + {
117 + .name = "service:blue",
118 + .gpio = 4,
119 + .active_low = 1,
120 + },
121 + },
122 + .buttons = {
123 + {
124 + .desc = "reset",
125 + .gpio = 34,
126 + .type = EV_KEY,
127 + .code = KEY_RESTART,
128 + .threshold = 3,
129 + },
130 + {
131 + .desc = "wps",
132 + .gpio = 37,
133 + .type = EV_KEY,
134 + .code = KEY_WPS_BUTTON,
135 + .threshold = 3,
136 + },
137 + },
138 + .devs = neufbox4_devices,
139 + .num_devs = ARRAY_SIZE(neufbox4_devices),
140 +};
141 +
142 +static struct board_info __initdata board_nb4_ser_r1 = {
143 + .name = "NB4-SER-r1",
144 + .expected_cpu_id = 0x6358,
145 +
146 + .has_enet0 = 1,
147 + .has_enet1 = 1,
148 + .has_pci = 1,
149 +
150 + .enet0 = {
151 + .has_phy = 1,
152 + .use_internal_phy = 1,
153 + },
154 +
155 + .enet1 = {
156 + .force_speed_100 = 1,
157 + .force_duplex_full = 1,
158 + },
159 +
160 +
161 + .has_ohci0 = 1,
162 + .has_pccard = 1,
163 + .has_ehci0 = 1,
164 +
165 + .has_udc0 = 1,
166 +
167 + .leds = {
168 + {
169 + .name = "adsl",
170 + .gpio = NXP_74HC64_GPIO(4),
171 + .active_low = 1,
172 + },
173 + {
174 + .name = "traffic",
175 + .gpio = 2,
176 + .active_low = 1,
177 + },
178 + {
179 + .name = "tel",
180 + .gpio = NXP_74HC64_GPIO(3),
181 + .active_low = 1,
182 + },
183 + {
184 + .name = "tv",
185 + .gpio = NXP_74HC64_GPIO(2),
186 + .active_low = 1,
187 + },
188 + {
189 + .name = "wifi",
190 + .gpio = 15,
191 + .active_low = 1,
192 + },
193 + {
194 + .name = "alarm",
195 + .gpio = NXP_74HC64_GPIO(0),
196 + .active_low = 1,
197 + },
198 + {
199 + .name = "service:red",
200 + .gpio = 29,
201 + .active_low = 1,
202 + },
203 + {
204 + .name = "service:green",
205 + .gpio = 30,
206 + .active_low = 1,
207 + },
208 + {
209 + .name = "service:blue",
210 + .gpio = 4,
211 + .active_low = 1,
212 + },
213 + },
214 + .buttons = {
215 + {
216 + .desc = "reset",
217 + .gpio = 34,
218 + .type = EV_KEY,
219 + .code = KEY_RESTART,
220 + .threshold = 3,
221 + },
222 + {
223 + .desc = "wps",
224 + .gpio = 37,
225 + .type = EV_KEY,
226 + .code = KEY_WPS_BUTTON,
227 + .threshold = 3,
228 + },
229 + },
230 + .devs = neufbox4_devices,
231 + .num_devs = ARRAY_SIZE(neufbox4_devices),
232 +};
233 +
234 +static struct board_info __initdata board_nb4_ser_r2 = {
235 + .name = "NB4-SER-r2",
236 + .expected_cpu_id = 0x6358,
237 +
238 + .has_enet0 = 1,
239 + .has_enet1 = 1,
240 + .has_pci = 1,
241 +
242 + .enet0 = {
243 + .has_phy = 1,
244 + .use_internal_phy = 1,
245 + },
246 +
247 + .enet1 = {
248 + .force_speed_100 = 1,
249 + .force_duplex_full = 1,
250 + },
251 +
252 +
253 + .has_ohci0 = 1,
254 + .has_pccard = 1,
255 + .has_ehci0 = 1,
256 +
257 + .leds = {
258 + {
259 + .name = "adsl",
260 + .gpio = NXP_74HC64_GPIO(4),
261 + .active_low = 1,
262 + },
263 + {
264 + .name = "traffic",
265 + .gpio = 2,
266 + .active_low = 1,
267 + },
268 + {
269 + .name = "tel",
270 + .gpio = NXP_74HC64_GPIO(3),
271 + .active_low = 1,
272 + },
273 + {
274 + .name = "tv",
275 + .gpio = NXP_74HC64_GPIO(2),
276 + .active_low = 1,
277 + },
278 + {
279 + .name = "wifi",
280 + .gpio = 15,
281 + .active_low = 1,
282 + },
283 + {
284 + .name = "alarm",
285 + .gpio = NXP_74HC64_GPIO(0),
286 + .active_low = 1,
287 + },
288 + {
289 + .name = "service:red",
290 + .gpio = 29,
291 + .active_low = 1,
292 + },
293 + {
294 + .name = "service:green",
295 + .gpio = 30,
296 + .active_low = 1,
297 + },
298 + {
299 + .name = "service:blue",
300 + .gpio = 4,
301 + .active_low = 1,
302 + },
303 + },
304 + .buttons = {
305 + {
306 + .desc = "reset",
307 + .gpio = 34,
308 + .type = EV_KEY,
309 + .code = KEY_RESTART,
310 + .threshold = 3,
311 + },
312 + {
313 + .desc = "wps",
314 + .gpio = 37,
315 + .type = EV_KEY,
316 + .code = KEY_WPS_BUTTON,
317 + .threshold = 3,
318 + },
319 + },
320 + .devs = neufbox4_devices,
321 + .num_devs = ARRAY_SIZE(neufbox4_devices),
322 +};
323 +
324 +static struct board_info __initdata board_nb4_fxc_r1 = {
325 + .name = "NB4-FXC-r1",
326 + .expected_cpu_id = 0x6358,
327 +
328 + .has_enet0 = 1,
329 + .has_enet1 = 1,
330 + .has_pci = 1,
331 +
332 + .enet0 = {
333 + .has_phy = 1,
334 + .use_internal_phy = 1,
335 + },
336 +
337 + .enet1 = {
338 + .force_speed_100 = 1,
339 + .force_duplex_full = 1,
340 + },
341 +
342 +
343 + .has_ohci0 = 1,
344 + .has_pccard = 1,
345 + .has_ehci0 = 1,
346 +
347 + .has_udc0 = 1,
348 +
349 + .leds = {
350 + {
351 + .name = "adsl",
352 + .gpio = NXP_74HC64_GPIO(4),
353 + .active_low = 1,
354 + },
355 + {
356 + .name = "traffic",
357 + .gpio = 2,
358 + },
359 + {
360 + .name = "tel",
361 + .gpio = NXP_74HC64_GPIO(3),
362 + .active_low = 1,
363 + },
364 + {
365 + .name = "tv",
366 + .gpio = NXP_74HC64_GPIO(2),
367 + .active_low = 1,
368 + },
369 + {
370 + .name = "wifi",
371 + .gpio = 15,
372 + },
373 + {
374 + .name = "alarm",
375 + .gpio = NXP_74HC64_GPIO(0),
376 + .active_low = 1,
377 + },
378 + {
379 + .name = "service:red",
380 + .gpio = 29,
381 + },
382 + {
383 + .name = "service:green",
384 + .gpio = 30,
385 + },
386 + {
387 + .name = "service:blue",
388 + .gpio = 4,
389 + },
390 + },
391 + .buttons = {
392 + {
393 + .desc = "reset",
394 + .gpio = 34,
395 + .type = EV_KEY,
396 + .code = KEY_RESTART,
397 + .threshold = 3,
398 + },
399 + {
400 + .desc = "wps",
401 + .gpio = 37,
402 + .type = EV_KEY,
403 + .code = KEY_WPS_BUTTON,
404 + .threshold = 3,
405 + },
406 + },
407 + .devs = neufbox4_devices,
408 + .num_devs = ARRAY_SIZE(neufbox4_devices),
409 +};
410 +
411 +static struct board_info __initdata board_nb4_fxc_r2 = {
412 + .name = "NB4-FXC-r2",
413 + .expected_cpu_id = 0x6358,
414 +
415 + .has_enet0 = 1,
416 + .has_enet1 = 1,
417 + .has_pci = 1,
418 +
419 + .enet0 = {
420 + .has_phy = 1,
421 + .use_internal_phy = 1,
422 + },
423 +
424 + .enet1 = {
425 + .force_speed_100 = 1,
426 + .force_duplex_full = 1,
427 + },
428 +
429 +
430 + .has_ohci0 = 1,
431 + .has_pccard = 1,
432 + .has_ehci0 = 1,
433 +
434 + .leds = {
435 + {
436 + .name = "adsl",
437 + .gpio = NXP_74HC64_GPIO(4),
438 + .active_low = 1,
439 + },
440 + {
441 + .name = "traffic",
442 + .gpio = 2,
443 + },
444 + {
445 + .name = "tel",
446 + .gpio = NXP_74HC64_GPIO(3),
447 + .active_low = 1,
448 + },
449 + {
450 + .name = "tv",
451 + .gpio = NXP_74HC64_GPIO(2),
452 + .active_low = 1,
453 + },
454 + {
455 + .name = "wifi",
456 + .gpio = 15,
457 + },
458 + {
459 + .name = "alarm",
460 + .gpio = NXP_74HC64_GPIO(0),
461 + .active_low = 1,
462 + },
463 + {
464 + .name = "service:red",
465 + .gpio = 29,
466 + },
467 + {
468 + .name = "service:green",
469 + .gpio = 30,
470 + },
471 + {
472 + .name = "service:blue",
473 + .gpio = 4,
474 + },
475 + },
476 + .buttons = {
477 + {
478 + .desc = "reset",
479 + .gpio = 34,
480 + .type = EV_KEY,
481 + .code = KEY_RESTART,
482 + .threshold = 3,
483 + },
484 + {
485 + .desc = "wps",
486 + .gpio = 37,
487 + .type = EV_KEY,
488 + .code = KEY_WPS_BUTTON,
489 + .threshold = 3,
490 + },
491 + },
492 + .devs = neufbox4_devices,
493 + .num_devs = ARRAY_SIZE(neufbox4_devices),
494 +};
495 #endif
496
497 /*
498 @@ -727,9 +1199,30 @@
499 &board_96358vw2,
500 &board_AGPFS0,
501 &board_DWVS0,
502 + &board_nb4_ser_r0,
503 + &board_nb4_ser_r1,
504 + &board_nb4_ser_r2,
505 + &board_nb4_fxc_r1,
506 + &board_nb4_fxc_r2,
507 #endif
508 };
509
510 +static void __init neufbox4_nvram_fixup(void)
511 +{
512 + u8 *boot_addr, *p;
513 + u32 val;
514 +
515 + if (BCMCPU_IS_6358() && (!strcmp(nvram.name, "96358VW"))) {
516 + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
517 + val &= MPI_CSBASE_BASE_MASK;
518 + boot_addr = (u8 *)KSEG1ADDR(val);
519 + /* Extract neufbox4 PID */
520 + p = boot_addr + NEUFBOX4_PID_OFFSET;
521 + if (!memcmp(p, "NB4-", 4))
522 + memcpy(nvram.name, p, sizeof("NB4-XXX-rX"));
523 + }
524 +}
525 +
526 /*
527 * early init callback, read nvram data from flash and checksum it
528 */
529 @@ -777,6 +1270,9 @@
530 return;
531 }
532
533 + /* Fixup broken neufbox4 board name */
534 + neufbox4_nvram_fixup();
535 +
536 /* find board by name */
537 for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
538 if (strncmp(nvram.name, bcm963xx_boards[i]->name,
539 Index: linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
540 ===================================================================
541 --- linux-2.6.32.13.orig/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 2010-05-27 21:44:35.000000000 -0400
542 +++ linux-2.6.32.13/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 2010-05-27 21:47:03.000000000 -0400
543 @@ -55,7 +55,7 @@
544 struct bcm63xx_dsp_platform_data dsp;
545
546 /* GPIO LEDs */
547 - struct gpio_led leds[5];
548 + struct gpio_led leds[9];
549
550 /* Buttons */
551 struct gpio_button buttons[2];
This page took 0.072878 seconds and 3 git commands to generate.