brcm63xx: update development kernel to linux 3.14
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.14 / 534-board_hw556.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -2911,6 +2911,492 @@ static struct board_info __initdata boar
4 },
5 };
6
7 +static struct board_info __initdata board_HW556 = {
8 + .name = "HW556",
9 + .expected_cpu_id = 0x6358,
10 +
11 + .has_uart0 = 1,
12 + .has_pci = 1,
13 + .has_ohci0 = 1,
14 + .has_ehci0 = 1,
15 + .num_usbh_ports = 2,
16 +
17 + .has_caldata = 1,
18 + .caldata = {
19 + {
20 + .caldata_offset = 0xe00000,
21 + },
22 + },
23 +
24 + .has_enet1 = 1,
25 + .enet1 = {
26 + .has_phy = 1,
27 + .phy_id = 0,
28 + .force_speed_100 = 1,
29 + .force_duplex_full = 1,
30 + },
31 +
32 + .leds = {
33 + {
34 + .name = "HW556:red:message",
35 + .gpio = 0,
36 + .active_low = 1,
37 + },
38 + {
39 + .name = "HW556:red:hspa",
40 + .gpio = 1,
41 + .active_low = 1,
42 + },
43 + {
44 + .name = "HW556:red:dsl",
45 + .gpio = 2,
46 + .active_low = 1,
47 + },
48 + {
49 + .name = "HW556:red:power",
50 + .gpio = 3,
51 + .active_low = 1,
52 + .default_trigger = "default-on",
53 + },
54 + {
55 + .name = "HW556:red:all",
56 + .gpio = 6,
57 + .active_low = 1,
58 + .default_trigger = "default-on",
59 + },
60 + },
61 +
62 + .buttons = {
63 + {
64 + .desc = "help",
65 + .gpio = 8,
66 + .active_low = 1,
67 + .type = EV_KEY,
68 + .code = KEY_HELP,
69 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
70 + },
71 + {
72 + .desc = "wlan",
73 + .gpio = 9,
74 + .active_low = 1,
75 + .type = EV_KEY,
76 + .code = KEY_WLAN,
77 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
78 + },
79 + {
80 + .desc = "restart",
81 + .gpio = 10,
82 + .active_low = 1,
83 + .type = EV_KEY,
84 + .code = KEY_RESTART,
85 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
86 + },
87 + {
88 + .desc = "reset",
89 + .gpio = 11,
90 + .active_low = 1,
91 + .type = EV_KEY,
92 + .code = KEY_CONFIG,
93 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
94 + },
95 + },
96 +};
97 +static struct board_info __initdata board_HW556_A = {
98 + .name = "HW556_A",
99 + .expected_cpu_id = 0x6358,
100 +
101 + .has_uart0 = 1,
102 + .has_pci = 1,
103 + .has_ohci0 = 1,
104 + .has_ehci0 = 1,
105 + .num_usbh_ports = 2,
106 +
107 + .has_caldata = 1,
108 + .caldata = {
109 + {
110 + .vendor = PCI_VENDOR_ID_RALINK,
111 + .caldata_offset = 0xeffe00,
112 + .slot = 1,
113 + .eeprom = "rt2x00.eeprom",
114 + },
115 + },
116 +
117 + .has_enet1 = 1,
118 + .enet1 = {
119 + .has_phy = 1,
120 + .phy_id = 0,
121 + .force_speed_100 = 1,
122 + .force_duplex_full = 1,
123 + },
124 +
125 + .leds = {
126 + {
127 + .name = "HW556:green:lan1",
128 + .gpio = 0,
129 + .active_low = 1,
130 + },
131 + {
132 + .name = "HW556:green:lan2",
133 + .gpio = 1,
134 + .active_low = 1,
135 + },
136 + {
137 + .name = "HW556:red:dsl",
138 + .gpio = 2,
139 + .active_low = 1,
140 + },
141 + {
142 + .name = "HW556:red:power",
143 + .gpio = 3,
144 + .active_low = 1,
145 + .default_trigger = "default-on",
146 + },
147 + {
148 + .name = "HW556:red:message",
149 + .gpio = 12,
150 + .active_low = 1,
151 + },
152 + {
153 + .name = "HW556:red:lan1",
154 + .gpio = 13,
155 + .active_low = 1,
156 + },
157 + {
158 + .name = "HW556:red:hspa",
159 + .gpio = 15,
160 + .active_low = 1,
161 + },
162 + {
163 + .name = "HW556:red:lan2",
164 + .gpio = 22,
165 + .active_low = 1,
166 + },
167 + {
168 + .name = "HW556:green:lan3",
169 + .gpio = 23,
170 + .active_low = 1,
171 + },
172 + {
173 + .name = "HW556:red:lan3",
174 + .gpio = 26,
175 + .active_low = 1,
176 + },
177 + {
178 + .name = "HW556:green:lan4",
179 + .gpio = 27,
180 + .active_low = 1,
181 + },
182 + {
183 + .name = "HW556:red:lan4",
184 + .gpio = 28,
185 + .active_low = 1,
186 + },
187 + },
188 +
189 + .buttons = {
190 + {
191 + .desc = "help",
192 + .gpio = 8,
193 + .active_low = 1,
194 + .type = EV_KEY,
195 + .code = KEY_HELP,
196 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
197 + },
198 + {
199 + .desc = "wlan",
200 + .gpio = 9,
201 + .active_low = 1,
202 + .type = EV_KEY,
203 + .code = KEY_WLAN,
204 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
205 + },
206 + {
207 + .desc = "restart",
208 + .gpio = 10,
209 + .active_low = 1,
210 + .type = EV_KEY,
211 + .code = KEY_RESTART,
212 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
213 + },
214 + {
215 + .desc = "reset",
216 + .gpio = 11,
217 + .active_low = 1,
218 + .type = EV_KEY,
219 + .code = KEY_CONFIG,
220 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
221 + },
222 + },
223 +};
224 +static struct board_info __initdata board_HW556_B = {
225 + .name = "HW556_B",
226 + .expected_cpu_id = 0x6358,
227 +
228 + .has_uart0 = 1,
229 + .has_pci = 1,
230 + .has_ohci0 = 1,
231 + .has_ehci0 = 1,
232 + .num_usbh_ports = 2,
233 +
234 + .has_caldata = 1,
235 + .caldata = {
236 + {
237 + .vendor = PCI_VENDOR_ID_ATHEROS,
238 + .caldata_offset = 0xf7e000,
239 + .slot = 1,
240 + .endian_check = 1,
241 + .led_pin = 2,
242 + },
243 + },
244 +
245 + .has_enet1 = 1,
246 + .enet1 = {
247 + .has_phy = 1,
248 + .phy_id = 0,
249 + .force_speed_100 = 1,
250 + .force_duplex_full = 1,
251 + },
252 +
253 + .leds = {
254 + {
255 + .name = "HW556:red:message",
256 + .gpio = 0,
257 + .active_low = 1,
258 + },
259 + {
260 + .name = "HW556:red:hspa",
261 + .gpio = 1,
262 + .active_low = 1,
263 + },
264 + {
265 + .name = "HW556:red:dsl",
266 + .gpio = 2,
267 + .active_low = 1,
268 + },
269 + {
270 + .name = "HW556:red:power",
271 + .gpio = 3,
272 + .active_low = 1,
273 + .default_trigger = "default-on",
274 + },
275 + {
276 + .name = "HW556:red:all",
277 + .gpio = 6,
278 + .active_low = 1,
279 + .default_trigger = "default-on",
280 + },
281 + {
282 + .name = "HW556:green:lan1",
283 + .gpio = 12,
284 + .active_low = 1,
285 + },
286 + {
287 + .name = "HW556:red:lan1",
288 + .gpio = 13,
289 + .active_low = 1,
290 + },
291 + {
292 + .name = "HW556:green:lan2",
293 + .gpio = 15,
294 + .active_low = 1,
295 + },
296 + {
297 + .name = "HW556:red:lan2",
298 + .gpio = 22,
299 + .active_low = 1,
300 + },
301 + {
302 + .name = "HW556:green:lan3",
303 + .gpio = 23,
304 + .active_low = 1,
305 + },
306 + {
307 + .name = "HW556:red:lan3",
308 + .gpio = 26,
309 + .active_low = 1,
310 + },
311 + {
312 + .name = "HW556:green:lan4",
313 + .gpio = 27,
314 + .active_low = 1,
315 + },
316 + {
317 + .name = "HW556:red:lan4",
318 + .gpio = 28,
319 + .active_low = 1,
320 + },
321 + },
322 +
323 + .buttons = {
324 + {
325 + .desc = "help",
326 + .gpio = 8,
327 + .active_low = 1,
328 + .type = EV_KEY,
329 + .code = KEY_HELP,
330 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
331 + },
332 + {
333 + .desc = "wlan",
334 + .gpio = 9,
335 + .active_low = 1,
336 + .type = EV_KEY,
337 + .code = KEY_WLAN,
338 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
339 + },
340 + {
341 + .desc = "restart",
342 + .gpio = 10,
343 + .active_low = 1,
344 + .type = EV_KEY,
345 + .code = KEY_RESTART,
346 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
347 + },
348 + {
349 + .desc = "reset",
350 + .gpio = 11,
351 + .active_low = 1,
352 + .type = EV_KEY,
353 + .code = KEY_CONFIG,
354 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
355 + },
356 + },
357 +};
358 +static struct board_info __initdata board_HW556_C = {
359 + .name = "HW556_C",
360 + .expected_cpu_id = 0x6358,
361 +
362 + .has_uart0 = 1,
363 + .has_pci = 1,
364 + .has_ohci0 = 1,
365 + .has_ehci0 = 1,
366 + .num_usbh_ports = 2,
367 +
368 + .has_caldata = 1,
369 + .caldata = {
370 + {
371 + .vendor = PCI_VENDOR_ID_ATHEROS,
372 + .caldata_offset = 0xefe000,
373 + .slot = 1,
374 + .endian_check = 1,
375 + .led_pin = 2,
376 + },
377 + },
378 +
379 + .has_enet1 = 1,
380 + .enet1 = {
381 + .has_phy = 1,
382 + .phy_id = 0,
383 + .force_speed_100 = 1,
384 + .force_duplex_full = 1,
385 + },
386 +
387 + .leds = {
388 + {
389 + .name = "HW556:red:message",
390 + .gpio = 0,
391 + .active_low = 1,
392 + },
393 + {
394 + .name = "HW556:red:hspa",
395 + .gpio = 1,
396 + .active_low = 1,
397 + },
398 + {
399 + .name = "HW556:red:dsl",
400 + .gpio = 2,
401 + .active_low = 1,
402 + },
403 + {
404 + .name = "HW556:red:power",
405 + .gpio = 3,
406 + .active_low = 1,
407 + .default_trigger = "default-on",
408 + },
409 + {
410 + .name = "HW556:red:all",
411 + .gpio = 6,
412 + .active_low = 1,
413 + .default_trigger = "default-on",
414 + },
415 + {
416 + .name = "HW556:green:lan1",
417 + .gpio = 12,
418 + .active_low = 1,
419 + },
420 + {
421 + .name = "HW556:red:lan1",
422 + .gpio = 13,
423 + .active_low = 1,
424 + },
425 + {
426 + .name = "HW556:green:lan2",
427 + .gpio = 15,
428 + .active_low = 1,
429 + },
430 + {
431 + .name = "HW556:red:lan2",
432 + .gpio = 22,
433 + .active_low = 1,
434 + },
435 + {
436 + .name = "HW556:green:lan3",
437 + .gpio = 23,
438 + .active_low = 1,
439 + },
440 + {
441 + .name = "HW556:red:lan3",
442 + .gpio = 26,
443 + .active_low = 1,
444 + },
445 + {
446 + .name = "HW556:green:lan4",
447 + .gpio = 27,
448 + .active_low = 1,
449 + },
450 + {
451 + .name = "HW556:red:lan4",
452 + .gpio = 28,
453 + .active_low = 1,
454 + },
455 + },
456 +
457 + .buttons = {
458 + {
459 + .desc = "help",
460 + .gpio = 8,
461 + .active_low = 1,
462 + .type = EV_KEY,
463 + .code = KEY_HELP,
464 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
465 + },
466 + {
467 + .desc = "wlan",
468 + .gpio = 9,
469 + .active_low = 1,
470 + .type = EV_KEY,
471 + .code = KEY_WLAN,
472 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
473 + },
474 + {
475 + .desc = "restart",
476 + .gpio = 10,
477 + .active_low = 1,
478 + .type = EV_KEY,
479 + .code = KEY_RESTART,
480 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
481 + },
482 + {
483 + .desc = "reset",
484 + .gpio = 11,
485 + .active_low = 1,
486 + .type = EV_KEY,
487 + .code = KEY_CONFIG,
488 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
489 + },
490 + },
491 +};
492 +
493 /* T-Home Speedport W 303V Typ B */
494 static struct board_info __initdata board_spw303v = {
495 .name = "96358-502V",
496 @@ -3350,6 +3836,10 @@ static const struct board_info __initcon
497 &board_nb4_fxc_r2,
498 &board_ct6373_1,
499 &board_HW553,
500 + &board_HW556,
501 + &board_HW556_A,
502 + &board_HW556_B,
503 + &board_HW556_C,
504 &board_spw303v,
505 &board_DVAG3810BN,
506 #endif
507 @@ -3415,13 +3905,37 @@ static void __init boardid_fixup(u8 *boo
508 struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K);
509 char *board_name = (char *)bcm63xx_nvram_get_name();
510
511 - if (BCMCPU_IS_6358() && (!strcmp(board_name, "96358VW"))) {
512 - u8 *p = boot_addr + NB4_PID_OFFSET;
513 -
514 - /* Extract nb4 PID */
515 - if (!memcmp(p, "NB4-", 4)) {
516 - memcpy(board_name, p, sizeof("NB4-XXX-rX"));
517 - return;
518 + if (BCMCPU_IS_6358()) {
519 + if (!strcmp(board_name, "96358VW")) {
520 + u8 *p = boot_addr + NB4_PID_OFFSET;
521 +
522 + /* Extract nb4 PID */
523 + if (!memcmp(p, "NB4-", 4)) {
524 + memcpy(board_name, p, sizeof("NB4-XXX-rX"));
525 + return;
526 + }
527 + } else if (!strcmp(board_name, "HW556")) {
528 + /*
529 + * HW556 has different wlan caldatas depending on
530 + * hardware version.
531 + * Detect hardware version and change board id
532 + */
533 + u8 cal_data_ath9k[4] = { 0xa5, 0x5a, 0, 0 };
534 + u8 cal_data_rt3062[4] = { 0x62, 0x30, 1, 0 };
535 +
536 + if (!memcmp(boot_addr + 0xeffe00,
537 + &cal_data_rt3062, 4)) {
538 + /* Ralink 0xeffe00 */
539 + memcpy(board_name, "HW556_A", 7);
540 + } else if (!memcmp(boot_addr + 0xf7e000,
541 + &cal_data_ath9k, 4)) {
542 + /* Atheros 0xf7e000 */
543 + memcpy(board_name, "HW556_B", 7);
544 + } else if (!memcmp(boot_addr + 0xefe000,
545 + &cal_data_ath9k, 4)) {
546 + /* Atheros 0xefe000 */
547 + memcpy(board_name, "HW556_C", 7);
548 + }
549 }
550 }
551
552 --- a/drivers/mtd/bcm63xxpart.c
553 +++ b/drivers/mtd/bcm63xxpart.c
554 @@ -70,6 +70,11 @@ static int bcm63xx_parse_cfe_partitions(
555 BCM63XX_CFE_BLOCK_SIZE);
556
557 cfelen = cfe_erasesize;
558 +
559 + /* Fix HW556 MX29LV128DB */
560 + if (!strncmp(bcm63xx_nvram_get_name(), "HW556", 5))
561 + cfelen = 0x20000;
562 +
563 nvramlen = bcm63xx_nvram_get_psi_size() * SZ_1K;
564 nvramlen = roundup(nvramlen, cfe_erasesize);
565 nvramaddr = master->size - nvramlen;