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 @@ -713,6 +720,441 @@ 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",
130 + .devs = neufbox4_devices,
131 + .num_devs = ARRAY_SIZE(neufbox4_devices),
134 +static struct board_info __initdata board_nb4_ser_r1 = {
135 + .name = "NB4-SER-r1",
136 + .expected_cpu_id = 0x6358,
144 + .use_internal_phy = 1,
148 + .force_speed_100 = 1,
149 + .force_duplex_full = 1,
162 + .gpio = NXP_74HC64_GPIO(4),
172 + .gpio = NXP_74HC64_GPIO(3),
177 + .gpio = NXP_74HC64_GPIO(2),
187 + .gpio = NXP_74HC64_GPIO(0),
191 + .name = "service:red",
196 + .name = "service:green",
201 + .name = "service:blue",
216 + .devs = neufbox4_devices,
217 + .num_devs = ARRAY_SIZE(neufbox4_devices),
220 +static struct board_info __initdata board_nb4_ser_r2 = {
221 + .name = "NB4-SER-r2",
222 + .expected_cpu_id = 0x6358,
230 + .use_internal_phy = 1,
234 + .force_speed_100 = 1,
235 + .force_duplex_full = 1,
246 + .gpio = NXP_74HC64_GPIO(4),
256 + .gpio = NXP_74HC64_GPIO(3),
261 + .gpio = NXP_74HC64_GPIO(2),
271 + .gpio = NXP_74HC64_GPIO(0),
275 + .name = "service:red",
280 + .name = "service:green",
285 + .name = "service:blue",
300 + .devs = neufbox4_devices,
301 + .num_devs = ARRAY_SIZE(neufbox4_devices),
304 +static struct board_info __initdata board_nb4_fxc_r1 = {
305 + .name = "NB4-FXC-r1",
306 + .expected_cpu_id = 0x6358,
314 + .use_internal_phy = 1,
318 + .force_speed_100 = 1,
319 + .force_duplex_full = 1,
332 + .gpio = NXP_74HC64_GPIO(4),
341 + .gpio = NXP_74HC64_GPIO(3),
346 + .gpio = NXP_74HC64_GPIO(2),
355 + .gpio = NXP_74HC64_GPIO(0),
359 + .name = "service:red",
363 + .name = "service:green",
367 + .name = "service:blue",
381 + .devs = neufbox4_devices,
382 + .num_devs = ARRAY_SIZE(neufbox4_devices),
385 +static struct board_info __initdata board_nb4_fxc_r2 = {
386 + .name = "NB4-FXC-r2",
387 + .expected_cpu_id = 0x6358,
395 + .use_internal_phy = 1,
399 + .force_speed_100 = 1,
400 + .force_duplex_full = 1,
411 + .gpio = NXP_74HC64_GPIO(4),
420 + .gpio = NXP_74HC64_GPIO(3),
425 + .gpio = NXP_74HC64_GPIO(2),
434 + .gpio = NXP_74HC64_GPIO(0),
438 + .name = "service:red",
442 + .name = "service:green",
446 + .name = "service:blue",
460 + .devs = neufbox4_devices,
461 + .num_devs = ARRAY_SIZE(neufbox4_devices),
466 @@ -743,9 +1185,30 @@ static const struct board_info __initdat
478 +static void __init neufbox4_nvram_fixup(void)
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"));
495 * early init callback, read nvram data from flash and checksum it
497 @@ -793,6 +1256,9 @@ void __init board_prom_init(void)
501 + /* Fixup broken neufbox4 board name */
502 + neufbox4_nvram_fixup();
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;
513 - struct gpio_led leds[8];
514 + struct gpio_led leds[9];
517 struct gpio_button reset_buttons[1];