1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
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>
13 #define PFX "board_bcm963xx: "
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))
21 static struct bcm963xx_nvram nvram;
22 static unsigned int mac_addr_used;
23 static struct board_info board;
24 @@ -758,6 +765,471 @@ static struct board_info __initdata boar
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,
36 +static struct platform_device neufbox4_74hc164 = {
37 + .name = NXP_74HC164_DRIVER_NAME,
40 + .platform_data = &neufbox4_74hc164_data,
44 +static struct platform_device * __initdata neufbox4_devices[] = {
48 +static struct board_info __initdata board_nb4_ser_r0 = {
49 + .name = "NB4-SER-r0",
50 + .expected_cpu_id = 0x6358,
58 + .use_internal_phy = 1,
62 + .force_speed_100 = 1,
63 + .force_duplex_full = 1,
76 + .gpio = NXP_74HC64_GPIO(4),
86 + .gpio = NXP_74HC64_GPIO(3),
91 + .gpio = NXP_74HC64_GPIO(2),
101 + .gpio = NXP_74HC64_GPIO(0),
105 + .name = "service:red",
110 + .name = "service:green",
115 + .name = "service:blue",
125 + .code = KEY_RESTART,
132 + .code = KEY_WPS_BUTTON,
136 + .devs = neufbox4_devices,
137 + .num_devs = ARRAY_SIZE(neufbox4_devices),
140 +static struct board_info __initdata board_nb4_ser_r1 = {
141 + .name = "NB4-SER-r1",
142 + .expected_cpu_id = 0x6358,
150 + .use_internal_phy = 1,
154 + .force_speed_100 = 1,
155 + .force_duplex_full = 1,
168 + .gpio = NXP_74HC64_GPIO(4),
178 + .gpio = NXP_74HC64_GPIO(3),
183 + .gpio = NXP_74HC64_GPIO(2),
193 + .gpio = NXP_74HC64_GPIO(0),
197 + .name = "service:red",
202 + .name = "service:green",
207 + .name = "service:blue",
217 + .code = KEY_RESTART,
224 + .code = KEY_WPS_BUTTON,
228 + .devs = neufbox4_devices,
229 + .num_devs = ARRAY_SIZE(neufbox4_devices),
232 +static struct board_info __initdata board_nb4_ser_r2 = {
233 + .name = "NB4-SER-r2",
234 + .expected_cpu_id = 0x6358,
242 + .use_internal_phy = 1,
246 + .force_speed_100 = 1,
247 + .force_duplex_full = 1,
258 + .gpio = NXP_74HC64_GPIO(4),
268 + .gpio = NXP_74HC64_GPIO(3),
273 + .gpio = NXP_74HC64_GPIO(2),
283 + .gpio = NXP_74HC64_GPIO(0),
287 + .name = "service:red",
292 + .name = "service:green",
297 + .name = "service:blue",
307 + .code = KEY_RESTART,
314 + .code = KEY_WPS_BUTTON,
318 + .devs = neufbox4_devices,
319 + .num_devs = ARRAY_SIZE(neufbox4_devices),
322 +static struct board_info __initdata board_nb4_fxc_r1 = {
323 + .name = "NB4-FXC-r1",
324 + .expected_cpu_id = 0x6358,
332 + .use_internal_phy = 1,
336 + .force_speed_100 = 1,
337 + .force_duplex_full = 1,
350 + .gpio = NXP_74HC64_GPIO(4),
359 + .gpio = NXP_74HC64_GPIO(3),
364 + .gpio = NXP_74HC64_GPIO(2),
373 + .gpio = NXP_74HC64_GPIO(0),
377 + .name = "service:red",
381 + .name = "service:green",
385 + .name = "service:blue",
394 + .code = KEY_RESTART,
401 + .code = KEY_WPS_BUTTON,
405 + .devs = neufbox4_devices,
406 + .num_devs = ARRAY_SIZE(neufbox4_devices),
409 +static struct board_info __initdata board_nb4_fxc_r2 = {
410 + .name = "NB4-FXC-r2",
411 + .expected_cpu_id = 0x6358,
419 + .use_internal_phy = 1,
423 + .force_speed_100 = 1,
424 + .force_duplex_full = 1,
435 + .gpio = NXP_74HC64_GPIO(4),
444 + .gpio = NXP_74HC64_GPIO(3),
449 + .gpio = NXP_74HC64_GPIO(2),
458 + .gpio = NXP_74HC64_GPIO(0),
462 + .name = "service:red",
466 + .name = "service:green",
470 + .name = "service:blue",
479 + .code = KEY_RESTART,
486 + .code = KEY_WPS_BUTTON,
490 + .devs = neufbox4_devices,
491 + .num_devs = ARRAY_SIZE(neufbox4_devices),
496 @@ -788,9 +1260,30 @@ static const struct board_info __initdat
508 +static void __init neufbox4_nvram_fixup(void)
513 + if (BCMCPU_IS_6358() && (!strcmp(nvram.name, "96358VW"))) {
514 + val = bcm_mpi_readl(MPI_CSBASE_REG(0));
515 + val &= MPI_CSBASE_BASE_MASK;
516 + boot_addr = (u8 *)KSEG1ADDR(val);
517 + /* Extract neufbox4 PID */
518 + p = boot_addr + NEUFBOX4_PID_OFFSET;
519 + if (!memcmp(p, "NB4-", 4))
520 + memcpy(nvram.name, p, sizeof("NB4-XXX-rX"));
525 * Register a sane SPROMv2 to make the on-board
527 @@ -908,6 +1401,9 @@ void __init board_prom_init(void)
531 + /* Fixup broken neufbox4 board name */
532 + neufbox4_nvram_fixup();
534 /* find board by name */
535 for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
536 if (strncmp(nvram.name, bcm963xx_boards[i]->name,