brcm63xx: 3.10: backport multi-board support
[openwrt.git] / target / linux / brcm63xx / patches-3.10 / 561-board_WAP-5813n.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -13,6 +13,7 @@
4  #include <linux/gpio_keys.h>
5  #include <linux/input.h>
6  #include <linux/pci_ids.h>
7 +#include <linux/platform_data/b53.h>
8  #include <linux/platform_device.h>
9  #include <linux/spi/spi.h>
10  #include <linux/spi/spi_gpio.h>
11 @@ -4466,6 +4467,99 @@ static struct board_info __initdata boar
12         .has_ohci0 = 1,
13         .has_ehci0 = 1,
14  };
15 +
16 +static struct b53_platform_data WAP5813n_b53_pdata = {
17 +       .alias = "eth0",
18 +};
19 +
20 +static struct spi_board_info WAP5813n_spi_devices[] = {
21 +       {
22 +               .modalias = "b53-switch",
23 +               .max_speed_hz = 781000,
24 +               .bus_num = 0,
25 +               .chip_select = 0,
26 +               .platform_data = &WAP5813n_b53_pdata,
27 +       }
28 +};
29 +
30 +static struct board_info __initdata board_WAP5813n = {
31 +       .name                           = "96369R-1231N",
32 +       .expected_cpu_id                = 0x6368,
33 +
34 +       .has_uart0                      = 1,
35 +       .has_pci                        = 1,
36 +       .has_ohci0                      = 1,
37 +       .has_ehci0                      = 1,
38 +
39 +       .has_enetsw                     = 1,
40 +       .enetsw = {
41 +               .used_ports = {
42 +                       [4] = {
43 +                               .used = 1,
44 +                               .phy_id = 0xff,
45 +                               .bypass_link = 1,
46 +                               .force_speed = 1000,
47 +                               .force_duplex_full = 1,
48 +                               .name = "RGMII",
49 +                       },
50 +               },
51 +       },
52 +
53 +       .leds = {
54 +               {
55 +                       .name           = "WAP-5813n:green:power",
56 +                       .gpio           = 22,
57 +                       .default_trigger = "default-on",
58 +               },
59 +               {
60 +                       .name           = "WAP-5813n:red:power",
61 +                       .gpio           = 24,
62 +               },
63 +               {
64 +                       .name           = "WAP-5813n:green:inet",
65 +                       .gpio           = 5,
66 +               },
67 +               {
68 +                       .name           = "WAP-5813n:red:inet",
69 +                       .gpio           = 31,
70 +               },
71 +               {
72 +                       .name           = "WAP-5813n:green:wps",
73 +                       .gpio           = 23,
74 +                       .active_low     = 1,
75 +               },
76 +       },
77 +
78 +       .buttons = {
79 +               {
80 +                       .desc           = "wlan",
81 +                       .gpio           = 32,
82 +                       .active_low     = 1,
83 +                       .type           = EV_KEY,
84 +                       .code           = KEY_WLAN,
85 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
86 +               },
87 +               {
88 +                       .desc           = "reset",
89 +                       .gpio           = 34,
90 +                       .active_low     = 1,
91 +                       .type           = EV_KEY,
92 +                       .code           = KEY_RESTART,
93 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
94 +               },
95 +               {
96 +                       .desc           = "wps",
97 +                       .gpio           = 35,
98 +                       .active_low     = 1,
99 +                       .type           = EV_KEY,
100 +                       .code           = KEY_WPS_BUTTON,
101 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
102 +               },
103 +       },
104 +
105 +       .spis = WAP5813n_spi_devices,
106 +       .num_spis = ARRAY_SIZE(WAP5813n_spi_devices),
107 +};
108  #endif
109  
110  /*
111 @@ -4849,6 +4943,7 @@ static const struct board_info __initcon
112  #ifdef CONFIG_BCM63XX_CPU_6368
113         &board_96368mvwg,
114         &board_96368mvngr,
115 +       &board_WAP5813n,
116  #endif
117  #ifdef CONFIG_BCM63XX_CPU_63268
118         &board_963268bu_p300,