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