74d787fdd2bb47e6c8a8f983c3fe258a0aedfcd2
[openwrt.git] / target / linux / brcm63xx / patches-3.18 / 534-board_hw556.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -12,6 +12,7 @@
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 @@ -2660,6 +2661,402 @@ static struct board_info __initdata boar
12         },
13  };
14  
15 +static struct board_info __initdata board_HW556_C = {
16 +       .name                                   = "HW556_C",
17 +       .expected_cpu_id                        = 0x6358,
18 +
19 +       .has_uart0                              = 1,
20 +       .has_pci                                = 1,
21 +       .has_ohci0                              = 1,
22 +       .has_ehci0                              = 1,
23 +       .num_usbh_ports                         = 2,
24 +
25 +       .has_caldata                            = 1,
26 +       .caldata = {
27 +               {
28 +                       .vendor                 = PCI_VENDOR_ID_RALINK,
29 +                       .caldata_offset         = 0xeffe00,
30 +                       .slot                   = 1,
31 +                       .eeprom                 = "rt2x00.eeprom",
32 +               },
33 +       },
34 +
35 +       .has_enet1                              = 1,
36 +       .enet1 = {
37 +               .has_phy                        = 1,
38 +               .phy_id                         = 0,
39 +               .force_speed_100                = 1,
40 +               .force_duplex_full              = 1,
41 +       },
42 +
43 +       .leds = {
44 +               {
45 +                       .name                   = "HW556:green:lan1",
46 +                       .gpio                   = 0,
47 +                       .active_low             = 1,
48 +               },
49 +               {
50 +                       .name                   = "HW556:green:lan2",
51 +                       .gpio                   = 1,
52 +                       .active_low             = 1,
53 +               },
54 +               {
55 +                       .name                   = "HW556:red:dsl",
56 +                       .gpio                   = 2,
57 +                       .active_low             = 1,
58 +               },
59 +               {
60 +                       .name                   = "HW556:red:power",
61 +                       .gpio                   = 3,
62 +                       .active_low             = 1,
63 +                       .default_trigger        = "default-on",
64 +               },
65 +               {
66 +                       .name                   = "HW556:red:message",
67 +                       .gpio                   = 12,
68 +                       .active_low             = 1,
69 +               },
70 +               {
71 +                       .name                   = "HW556:red:lan1",
72 +                       .gpio                   = 13,
73 +                       .active_low             = 1,
74 +               },
75 +               {
76 +                       .name                   = "HW556:red:hspa",
77 +                       .gpio                   = 15,
78 +                       .active_low             = 1,
79 +               },
80 +               {
81 +                       .name                   = "HW556:red:lan2",
82 +                       .gpio                   = 22,
83 +                       .active_low             = 1,
84 +               },
85 +               {
86 +                       .name                   = "HW556:green:lan3",
87 +                       .gpio                   = 23,
88 +                       .active_low             = 1,
89 +               },
90 +               {
91 +                       .name                   = "HW556:red:lan3",
92 +                       .gpio                   = 26,
93 +                       .active_low             = 1,
94 +               },
95 +               {
96 +                       .name                   = "HW556:green:lan4",
97 +                       .gpio                   = 27,
98 +                       .active_low             = 1,
99 +               },
100 +               {
101 +                       .name                   = "HW556:red:lan4",
102 +                       .gpio                   = 28,
103 +                       .active_low             = 1,
104 +               },
105 +       },
106 +
107 +       .buttons = {
108 +               {
109 +                       .desc                   = "help",
110 +                       .gpio                   = 8,
111 +                       .active_low             = 1,
112 +                       .type                   = EV_KEY,
113 +                       .code                   = KEY_HELP,
114 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
115 +               },
116 +               {
117 +                       .desc                   = "wlan",
118 +                       .gpio                   = 9,
119 +                       .active_low             = 1,
120 +                       .type                   = EV_KEY,
121 +                       .code                   = KEY_WLAN,
122 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
123 +               },
124 +               {
125 +                       .desc                   = "restart",
126 +                       .gpio                   = 10,
127 +                       .active_low             = 1,
128 +                       .type                   = EV_KEY,
129 +                       .code                   = KEY_RESTART,
130 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
131 +               },
132 +               {
133 +                       .desc                   = "reset",
134 +                       .gpio                   = 11,
135 +                       .active_low             = 1,
136 +                       .type                   = EV_KEY,
137 +                       .code                   = KEY_CONFIG,
138 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
139 +               },
140 +       },
141 +};
142 +static struct board_info __initdata board_HW556_A = {
143 +       .name                                   = "HW556_A",
144 +       .expected_cpu_id                        = 0x6358,
145 +
146 +       .has_uart0                              = 1,
147 +       .has_pci                                = 1,
148 +       .has_ohci0                              = 1,
149 +       .has_ehci0                              = 1,
150 +       .num_usbh_ports                         = 2,
151 +
152 +       .has_caldata                            = 1,
153 +       .caldata = {
154 +               {
155 +                       .vendor                 = PCI_VENDOR_ID_ATHEROS,
156 +                       .caldata_offset         = 0xf7e000,
157 +                       .slot                   = 1,
158 +                       .endian_check           = 1,
159 +                       .led_pin                = 2,
160 +               },
161 +       },
162 +
163 +       .has_enet1                              = 1,
164 +       .enet1 = {
165 +               .has_phy                        = 1,
166 +               .phy_id                         = 0,
167 +               .force_speed_100                = 1,
168 +               .force_duplex_full              = 1,
169 +       },
170 +
171 +       .leds = {
172 +               {
173 +                       .name                   = "HW556:red:message",
174 +                       .gpio                   = 0,
175 +                       .active_low             = 1,
176 +               },
177 +               {
178 +                       .name                   = "HW556:red:hspa",
179 +                       .gpio                   = 1,
180 +                       .active_low             = 1,
181 +               },
182 +               {
183 +                       .name                   = "HW556:red:dsl",
184 +                       .gpio                   = 2,
185 +                       .active_low             = 1,
186 +               },
187 +               {
188 +                       .name                   = "HW556:red:power",
189 +                       .gpio                   = 3,
190 +                       .active_low             = 1,
191 +                       .default_trigger        = "default-on",
192 +               },
193 +               {
194 +                       .name                   = "HW556:red:all",
195 +                       .gpio                   = 6,
196 +                       .active_low             = 1,
197 +                       .default_trigger        = "default-on",
198 +               },
199 +               {
200 +                       .name                   = "HW556:green:lan1",
201 +                       .gpio                   = 12,
202 +                       .active_low             = 1,
203 +               },
204 +               {
205 +                       .name                   = "HW556:red:lan1",
206 +                       .gpio                   = 13,
207 +                       .active_low             = 1,
208 +               },
209 +               {
210 +                       .name                   = "HW556:green:lan2",
211 +                       .gpio                   = 15,
212 +                       .active_low             = 1,
213 +               },
214 +               {
215 +                       .name                   = "HW556:red:lan2",
216 +                       .gpio                   = 22,
217 +                       .active_low             = 1,
218 +               },
219 +               {
220 +                       .name                   = "HW556:green:lan3",
221 +                       .gpio                   = 23,
222 +                       .active_low             = 1,
223 +               },
224 +               {
225 +                       .name                   = "HW556:red:lan3",
226 +                       .gpio                   = 26,
227 +                       .active_low             = 1,
228 +               },
229 +               {
230 +                       .name                   = "HW556:green:lan4",
231 +                       .gpio                   = 27,
232 +                       .active_low             = 1,
233 +               },
234 +               {
235 +                       .name                   = "HW556:red:lan4",
236 +                       .gpio                   = 28,
237 +                       .active_low             = 1,
238 +               },
239 +       },
240 +
241 +       .buttons = {
242 +               {
243 +                       .desc                   = "help",
244 +                       .gpio                   = 8,
245 +                       .active_low             = 1,
246 +                       .type                   = EV_KEY,
247 +                       .code                   = KEY_HELP,
248 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
249 +               },
250 +               {
251 +                       .desc                   = "wlan",
252 +                       .gpio                   = 9,
253 +                       .active_low             = 1,
254 +                       .type                   = EV_KEY,
255 +                       .code                   = KEY_WLAN,
256 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
257 +               },
258 +               {
259 +                       .desc                   = "restart",
260 +                       .gpio                   = 10,
261 +                       .active_low             = 1,
262 +                       .type                   = EV_KEY,
263 +                       .code                   = KEY_RESTART,
264 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
265 +               },
266 +               {
267 +                       .desc                   = "reset",
268 +                       .gpio                   = 11,
269 +                       .active_low             = 1,
270 +                       .type                   = EV_KEY,
271 +                       .code                   = KEY_CONFIG,
272 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
273 +               },
274 +       },
275 +};
276 +static struct board_info __initdata board_HW556_B = {
277 +       .name                                   = "HW556_B",
278 +       .expected_cpu_id                        = 0x6358,
279 +
280 +       .has_uart0                              = 1,
281 +       .has_pci                                = 1,
282 +       .has_ohci0                              = 1,
283 +       .has_ehci0                              = 1,
284 +       .num_usbh_ports                         = 2,
285 +
286 +       .has_caldata                            = 1,
287 +       .caldata = {
288 +               {
289 +                       .vendor                 = PCI_VENDOR_ID_ATHEROS,
290 +                       .caldata_offset         = 0xefe000,
291 +                       .slot                   = 1,
292 +                       .endian_check           = 1,
293 +                       .led_pin                = 2,
294 +               },
295 +       },
296 +
297 +       .has_enet1                              = 1,
298 +       .enet1 = {
299 +               .has_phy                        = 1,
300 +               .phy_id                         = 0,
301 +               .force_speed_100                = 1,
302 +               .force_duplex_full              = 1,
303 +       },
304 +
305 +       .leds = {
306 +               {
307 +                       .name                   = "HW556:red:message",
308 +                       .gpio                   = 0,
309 +                       .active_low             = 1,
310 +               },
311 +               {
312 +                       .name                   = "HW556:red:hspa",
313 +                       .gpio                   = 1,
314 +                       .active_low             = 1,
315 +               },
316 +               {
317 +                       .name                   = "HW556:red:dsl",
318 +                       .gpio                   = 2,
319 +                       .active_low             = 1,
320 +               },
321 +               {
322 +                       .name                   = "HW556:red:power",
323 +                       .gpio                   = 3,
324 +                       .active_low             = 1,
325 +                       .default_trigger        = "default-on",
326 +               },
327 +               {
328 +                       .name                   = "HW556:red:all",
329 +                       .gpio                   = 6,
330 +                       .active_low             = 1,
331 +                       .default_trigger        = "default-on",
332 +               },
333 +               {
334 +                       .name                   = "HW556:green:lan1",
335 +                       .gpio                   = 12,
336 +                       .active_low             = 1,
337 +               },
338 +               {
339 +                       .name                   = "HW556:red:lan1",
340 +                       .gpio                   = 13,
341 +                       .active_low             = 1,
342 +               },
343 +               {
344 +                       .name                   = "HW556:green:lan2",
345 +                       .gpio                   = 15,
346 +                       .active_low             = 1,
347 +               },
348 +               {
349 +                       .name                   = "HW556:red:lan2",
350 +                       .gpio                   = 22,
351 +                       .active_low             = 1,
352 +               },
353 +               {
354 +                       .name                   = "HW556:green:lan3",
355 +                       .gpio                   = 23,
356 +                       .active_low             = 1,
357 +               },
358 +               {
359 +                       .name                   = "HW556:red:lan3",
360 +                       .gpio                   = 26,
361 +                       .active_low             = 1,
362 +               },
363 +               {
364 +                       .name                   = "HW556:green:lan4",
365 +                       .gpio                   = 27,
366 +                       .active_low             = 1,
367 +               },
368 +               {
369 +                       .name                   = "HW556:red:lan4",
370 +                       .gpio                   = 28,
371 +                       .active_low             = 1,
372 +               },
373 +       },
374 +
375 +       .buttons = {
376 +               {
377 +                       .desc                   = "help",
378 +                       .gpio                   = 8,
379 +                       .active_low             = 1,
380 +                       .type                   = EV_KEY,
381 +                       .code                   = KEY_HELP,
382 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
383 +               },
384 +               {
385 +                       .desc                   = "wlan",
386 +                       .gpio                   = 9,
387 +                       .active_low             = 1,
388 +                       .type                   = EV_KEY,
389 +                       .code                   = KEY_WLAN,
390 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
391 +               },
392 +               {
393 +                       .desc                   = "restart",
394 +                       .gpio                   = 10,
395 +                       .active_low             = 1,
396 +                       .type                   = EV_KEY,
397 +                       .code                   = KEY_RESTART,
398 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
399 +               },
400 +               {
401 +                       .desc                   = "reset",
402 +                       .gpio                   = 11,
403 +                       .active_low             = 1,
404 +                       .type                   = EV_KEY,
405 +                       .code                   = KEY_CONFIG,
406 +                       .debounce_interval      = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
407 +               },
408 +       },
409 +};
410 +
411   /* T-Home Speedport W 303V Typ B */
412  static struct board_info __initdata board_spw303v = {
413         .name                   = "96358-502V",
414 @@ -3096,6 +3493,9 @@ static const struct board_info __initcon
415         &board_nb4_fxc_r1,
416         &board_ct6373_1,
417         &board_HW553,
418 +       &board_HW556_A,
419 +       &board_HW556_B,
420 +       &board_HW556_C,
421         &board_spw303v,
422         &board_DVAG3810BN,
423  #endif
424 @@ -3160,6 +3560,9 @@ static struct of_device_id const bcm963x
425         { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, },
426         { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, },
427         { .compatible = "huawei,hg553", .data = &board_HW553, },
428 +       { .compatible = "huawei,hg556a-a", .data = &board_HW556_A, },
429 +       { .compatible = "huawei,hg556a-b", .data = &board_HW556_B, },
430 +       { .compatible = "huawei,hg556a-c", .data = &board_HW556_C, },
431         { .compatible = "pirelli,a226g", .data = &board_DWVS0, },
432         { .compatible = "pirelli,a226m", .data = &board_DWVS0, },
433         { .compatible = "pirelli,a226m-fwb", .data = &board_DWVS0, },