brcm63xx: Add DT support for HG553
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.14 / 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 @@ -4169,6 +4170,118 @@ 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 sprom_fixup __initdata wap5813n_fixups[] = {
31 + { .offset = 97, .value = 0xfeed },
32 + { .offset = 98, .value = 0x15d1 },
33 + { .offset = 99, .value = 0xfb0d },
34 + { .offset = 113, .value = 0xfef7 },
35 + { .offset = 114, .value = 0x15f7 },
36 + { .offset = 115, .value = 0xfb1a },
37 +};
38 +
39 +static struct board_info __initdata board_WAP5813n = {
40 + .name = "96369R-1231N",
41 + .of_board_id = "comtrend,wap-5813n",
42 + .expected_cpu_id = 0x6368,
43 +
44 + .has_uart0 = 1,
45 + .has_pci = 1,
46 + .use_fallback_sprom = 1,
47 + .has_ohci0 = 1,
48 + .has_ehci0 = 1,
49 +
50 + .has_enetsw = 1,
51 + .enetsw = {
52 + .used_ports = {
53 + [4] = {
54 + .used = 1,
55 + .phy_id = 0xff,
56 + .bypass_link = 1,
57 + .force_speed = 1000,
58 + .force_duplex_full = 1,
59 + .name = "RGMII",
60 + },
61 + },
62 + },
63 +
64 + .leds = {
65 + {
66 + .name = "WAP-5813n:green:power",
67 + .gpio = 22,
68 + .default_trigger = "default-on",
69 + },
70 + {
71 + .name = "WAP-5813n:red:power",
72 + .gpio = 24,
73 + },
74 + {
75 + .name = "WAP-5813n:green:inet",
76 + .gpio = 5,
77 + },
78 + {
79 + .name = "WAP-5813n:red:inet",
80 + .gpio = 31,
81 + },
82 + {
83 + .name = "WAP-5813n:green:wps",
84 + .gpio = 23,
85 + .active_low = 1,
86 + },
87 + },
88 +
89 + .buttons = {
90 + {
91 + .desc = "wlan",
92 + .gpio = 32,
93 + .active_low = 1,
94 + .type = EV_KEY,
95 + .code = KEY_WLAN,
96 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
97 + },
98 + {
99 + .desc = "reset",
100 + .gpio = 34,
101 + .active_low = 1,
102 + .type = EV_KEY,
103 + .code = KEY_RESTART,
104 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
105 + },
106 + {
107 + .desc = "wps",
108 + .gpio = 35,
109 + .active_low = 1,
110 + .type = EV_KEY,
111 + .code = KEY_WPS_BUTTON,
112 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
113 + },
114 + },
115 +
116 + .fallback_sprom = {
117 + .type = SPROM_BCM43222,
118 + .pci_bus = 0,
119 + .pci_dev = 1,
120 + .board_fixups = wap5813n_fixups,
121 + .num_board_fixups = ARRAY_SIZE(wap5813n_fixups),
122 + },
123 +
124 + .spis = WAP5813n_spi_devices,
125 + .num_spis = ARRAY_SIZE(WAP5813n_spi_devices),
126 +};
127 #endif /* CONFIG_BCM63XX_CPU_6368 */
128
129 /*
130 @@ -4548,6 +4661,7 @@ static const struct board_info __initcon
131 #ifdef CONFIG_BCM63XX_CPU_6368
132 &board_96368mvwg,
133 &board_96368mvngr,
134 + &board_WAP5813n,
135 #endif
136 #ifdef CONFIG_BCM63XX_CPU_63268
137 &board_963268bu_p300,