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