1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
4 #include <linux/string.h>
5 #include <linux/gpio_keys.h>
6 #include <linux/input.h>
7 +#include <linux/pci_ids.h>
8 #include <linux/platform_device.h>
9 #include <linux/spi/spi.h>
10 #include <linux/spi/spi_gpio.h>
11 @@ -1821,6 +1822,492 @@ static struct board_info __initdata boar
15 +static struct board_info __initdata board_HW556 = {
17 + .expected_cpu_id = 0x6358,
23 + .num_usbh_ports = 2,
28 + .caldata_offset = 0xe00000,
36 + .force_speed_100 = 1,
37 + .force_duplex_full = 1,
42 + .name = "HW556:red:message",
47 + .name = "HW556:red:hspa",
52 + .name = "HW556:red:dsl",
57 + .name = "HW556:red:power",
60 + .default_trigger = "default-on",
63 + .name = "HW556:red:all",
66 + .default_trigger = "default-on",
77 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
85 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
92 + .code = KEY_RESTART,
93 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
100 + .code = KEY_CONFIG,
101 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
105 +static struct board_info __initdata board_HW556_A = {
107 + .expected_cpu_id = 0x6358,
113 + .num_usbh_ports = 2,
118 + .vendor = PCI_VENDOR_ID_RALINK,
119 + .caldata_offset = 0xeffe00,
121 + .eeprom = "rt2x00.eeprom",
129 + .force_speed_100 = 1,
130 + .force_duplex_full = 1,
135 + .name = "HW556:green:lan1",
140 + .name = "HW556:green:lan2",
145 + .name = "HW556:red:dsl",
150 + .name = "HW556:red:power",
153 + .default_trigger = "default-on",
156 + .name = "HW556:red:message",
161 + .name = "HW556:red:lan1",
166 + .name = "HW556:red:hspa",
171 + .name = "HW556:red:lan2",
176 + .name = "HW556:green:lan3",
181 + .name = "HW556:red:lan3",
186 + .name = "HW556:green:lan4",
191 + .name = "HW556:red:lan4",
204 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
212 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
219 + .code = KEY_RESTART,
220 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
227 + .code = KEY_CONFIG,
228 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
232 +static struct board_info __initdata board_HW556_B = {
234 + .expected_cpu_id = 0x6358,
240 + .num_usbh_ports = 2,
245 + .vendor = PCI_VENDOR_ID_ATHEROS,
246 + .caldata_offset = 0xf7e000,
257 + .force_speed_100 = 1,
258 + .force_duplex_full = 1,
263 + .name = "HW556:red:message",
268 + .name = "HW556:red:hspa",
273 + .name = "HW556:red:dsl",
278 + .name = "HW556:red:power",
281 + .default_trigger = "default-on",
284 + .name = "HW556:red:all",
287 + .default_trigger = "default-on",
290 + .name = "HW556:green:lan1",
295 + .name = "HW556:red:lan1",
300 + .name = "HW556:green:lan2",
305 + .name = "HW556:red:lan2",
310 + .name = "HW556:green:lan3",
315 + .name = "HW556:red:lan3",
320 + .name = "HW556:green:lan4",
325 + .name = "HW556:red:lan4",
338 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
346 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
353 + .code = KEY_RESTART,
354 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
361 + .code = KEY_CONFIG,
362 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
366 +static struct board_info __initdata board_HW556_C = {
368 + .expected_cpu_id = 0x6358,
374 + .num_usbh_ports = 2,
379 + .vendor = PCI_VENDOR_ID_ATHEROS,
380 + .caldata_offset = 0xefe000,
391 + .force_speed_100 = 1,
392 + .force_duplex_full = 1,
397 + .name = "HW556:red:message",
402 + .name = "HW556:red:hspa",
407 + .name = "HW556:red:dsl",
412 + .name = "HW556:red:power",
415 + .default_trigger = "default-on",
418 + .name = "HW556:red:all",
421 + .default_trigger = "default-on",
424 + .name = "HW556:green:lan1",
429 + .name = "HW556:red:lan1",
434 + .name = "HW556:green:lan2",
439 + .name = "HW556:red:lan2",
444 + .name = "HW556:green:lan3",
449 + .name = "HW556:red:lan3",
454 + .name = "HW556:green:lan4",
459 + .name = "HW556:red:lan4",
472 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
480 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
487 + .code = KEY_RESTART,
488 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
495 + .code = KEY_CONFIG,
496 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
501 /* T-Home Speedport W 303V Typ B */
502 static struct board_info __initdata board_spw303v = {
503 .name = "96358-502V",
504 @@ -3350,6 +3837,10 @@ static const struct board_info __initcon
515 @@ -3369,13 +3860,37 @@ static void __init boardid_fixup(u8 *boo
516 struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K);
517 char *board_name = (char *)bcm63xx_nvram_get_name();
519 - if (BCMCPU_IS_6358() && (!strcmp(board_name, "96358VW"))) {
520 - u8 *p = boot_addr + NB4_PID_OFFSET;
522 - /* Extract nb4 PID */
523 - if (!memcmp(p, "NB4-", 4)) {
524 - memcpy(board_name, p, sizeof("NB4-XXX-rX"));
526 + if (BCMCPU_IS_6358()) {
527 + if (!strcmp(board_name, "96358VW")) {
528 + u8 *p = boot_addr + NB4_PID_OFFSET;
530 + /* Extract nb4 PID */
531 + if (!memcmp(p, "NB4-", 4)) {
532 + memcpy(board_name, p, sizeof("NB4-XXX-rX"));
535 + } else if (!strcmp(board_name, "HW556")) {
537 + * HW556 has different wlan caldatas depending on
538 + * hardware version.
539 + * Detect hardware version and change board id
541 + u8 cal_data_ath9k[4] = { 0xa5, 0x5a, 0, 0 };
542 + u8 cal_data_rt3062[4] = { 0x62, 0x30, 1, 0 };
544 + if (!memcmp(boot_addr + 0xeffe00,
545 + &cal_data_rt3062, 4)) {
546 + /* Ralink 0xeffe00 */
547 + memcpy(board_name, "HW556_A", 7);
548 + } else if (!memcmp(boot_addr + 0xf7e000,
549 + &cal_data_ath9k, 4)) {
550 + /* Atheros 0xf7e000 */
551 + memcpy(board_name, "HW556_B", 7);
552 + } else if (!memcmp(boot_addr + 0xefe000,
553 + &cal_data_ath9k, 4)) {
554 + /* Atheros 0xefe000 */
555 + memcpy(board_name, "HW556_C", 7);
560 --- a/drivers/mtd/bcm63xxpart.c
561 +++ b/drivers/mtd/bcm63xxpart.c
562 @@ -70,6 +70,11 @@ static int bcm63xx_parse_cfe_partitions(
563 BCM63XX_CFE_BLOCK_SIZE);
565 cfelen = cfe_erasesize;
567 + /* Fix HW556 MX29LV128DB */
568 + if (!strncmp(bcm63xx_nvram_get_name(), "HW556", 5))
571 nvramlen = bcm63xx_nvram_get_psi_size() * SZ_1K;
572 nvramlen = roundup(nvramlen, cfe_erasesize);
573 nvramaddr = master->size - nvramlen;