lantiq: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / lantiq / files / arch / mips / boot / dts / lantiq / vr9_arcadyan_vgv7519.dtsi
1 #include "vr9.dtsi"
2
3 #include <dt-bindings/input/input.h>
4 #include <dt-bindings/leds/common.h>
5 #include <dt-bindings/mips/lantiq_rcu_gphy.h>
6
7 / {
8 compatible = "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9";
9
10 chosen {
11 bootargs = "console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp";
12 };
13
14 aliases {
15 led-boot = &power_green;
16 led-failsafe = &power_red;
17 led-running = &power_green;
18 led-upgrade = &power_green;
19
20 led-dsl = &broadband_green;
21 led-internet = &internet_green;
22 led-wifi = &wireless_green;
23 };
24
25 memory@0 {
26 device_type = "memory";
27 reg = <0x0 0x4000000>;
28 };
29
30 keys {
31 compatible = "gpio-keys-polled";
32 poll-interval = <100>;
33 reset {
34 label = "reset";
35 gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_RESTART>;
37 };
38 eco {
39 label = "eco";
40 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
41 linux,code = <BTN_0>;
42 };
43 rfkill {
44 label = "rfkill";
45 gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RFKILL>;
47 };
48 wps {
49 label = "wps";
50 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_WPS_BUTTON>;
52 };
53 };
54
55 leds {
56 compatible = "gpio-leds";
57
58 eco {
59 label = "blue:eco";
60 gpios = <&stp 2 GPIO_ACTIVE_LOW>;
61 };
62 wps_red {
63 function = LED_FUNCTION_WPS;
64 color = <LED_COLOR_ID_RED>;
65 gpios = <&stp 3 GPIO_ACTIVE_LOW>;
66 };
67 wps_green {
68 function = LED_FUNCTION_WPS;
69 color = <LED_COLOR_ID_GREEN>;
70 gpios = <&stp 4 GPIO_ACTIVE_LOW>;
71 };
72 upgrade {
73 label = "blue:upgrade";
74 gpios = <&stp 5 GPIO_ACTIVE_LOW>;
75 };
76 tv {
77 label = "green:tv";
78 gpios = <&stp 6 GPIO_ACTIVE_LOW>;
79 };
80 internet_green: internet_green {
81 label = "green:internet";
82 gpios = <&stp 7 GPIO_ACTIVE_LOW>;
83 };
84 internet_red {
85 label = "red:internet";
86 gpios = <&stp 8 GPIO_ACTIVE_LOW>;
87 };
88 broadband_red {
89 label = "red:broadband";
90 gpios = <&stp 9 GPIO_ACTIVE_LOW>;
91 };
92 broadband_green: broadband_green {
93 label = "green:broadband";
94 gpios = <&stp 10 GPIO_ACTIVE_LOW>;
95 };
96 voice {
97 label = "green:voice";
98 gpios = <&stp 11 GPIO_ACTIVE_LOW>;
99 };
100 wireless_red {
101 label = "red:wireless";
102 gpios = <&stp 12 GPIO_ACTIVE_LOW>;
103 };
104 wireless_green: wireless_green {
105 label = "green:wireless";
106 gpios = <&stp 13 GPIO_ACTIVE_LOW>;
107 };
108 power_green: power2 {
109 function = LED_FUNCTION_POWER;
110 color = <LED_COLOR_ID_GREEN>;
111 gpios = <&stp 14 GPIO_ACTIVE_LOW>;
112 default-state = "keep";
113 };
114 power_red: power {
115 function = LED_FUNCTION_POWER;
116 color = <LED_COLOR_ID_RED>;
117 gpios = <&stp 15 GPIO_ACTIVE_LOW>;
118 };
119 };
120
121 usb_vbus: regulator-usb-vbus {
122 compatible = "regulator-fixed";
123
124 regulator-name = "USB_VBUS";
125
126 regulator-min-microvolt = <5000000>;
127 regulator-max-microvolt = <5000000>;
128
129 gpio = <&gpio 32 GPIO_ACTIVE_HIGH>;
130 enable-active-high;
131 };
132 };
133
134 &eth0 {
135 nvmem-cells = <&macaddr_boardconfig_16 1>;
136 nvmem-cell-names = "mac-address";
137 };
138
139 &gphy0 {
140 lantiq,gphy-mode = <GPHY_MODE_GE>;
141 };
142
143 &gphy1 {
144 lantiq,gphy-mode = <GPHY_MODE_GE>;
145 };
146
147 &gpio {
148 pinctrl-names = "default";
149 pinctrl-0 = <&state_default>;
150
151 state_default: pinmux {
152 pci-rst {
153 lantiq,pins = "io21";
154 lantiq,open-drain = <0>;
155 lantiq,pull = <0>;
156 lantiq,output = <1>;
157 };
158 };
159 };
160
161 &gswip {
162 pinctrl-0 = <&mdio_pins>, <&gphy0_led1_pins>, <&gphy1_led0_pins>;
163 pinctrl-names = "default";
164 };
165
166 &gswip_mdio {
167 phy0: ethernet-phy@0 {
168 reg = <0x0>;
169 };
170 phy1: ethernet-phy@1 {
171 reg = <0x1>;
172 };
173 phy5: ethernet-phy@5 {
174 reg = <0x5>;
175 };
176 phy11: ethernet-phy@11 {
177 reg = <0x11>;
178 };
179 phy13: ethernet-phy@13 {
180 reg = <0x13>;
181 };
182 };
183
184 &gswip_ports {
185 port@0 {
186 reg = <0>;
187 label = "lan4";
188 phy-mode = "rgmii";
189 phy-handle = <&phy0>;
190 };
191 port@1 {
192 reg = <1>;
193 label = "lan3";
194 phy-mode = "rgmii";
195 phy-handle = <&phy1>;
196 };
197 port@2 {
198 reg = <2>;
199 label = "lan2";
200 phy-mode = "internal";
201 phy-handle = <&phy11>;
202 };
203 port@4 {
204 reg = <4>;
205 label = "lan1";
206 phy-mode = "internal";
207 phy-handle = <&phy13>;
208 };
209 port@5 {
210 reg = <5>;
211 label = "wan";
212 phy-mode = "rgmii";
213 phy-handle = <&phy5>;
214 };
215 };
216
217 &localbus {
218 flash@0 {
219 compatible = "lantiq,nor";
220 bank-width = <2>;
221 reg = <0 0x0 0x800000>, <1 0x800000 0x800000>;
222
223 partitions {
224 compatible = "fixed-partitions";
225 #address-cells = <1>;
226 #size-cells = <1>;
227
228 boardconfig: partition@40000 {
229 label = "board_config";
230 reg = <0x40000 0x10000>;
231 read-only;
232
233 nvmem-layout {
234 compatible = "fixed-layout";
235 #address-cells = <1>;
236 #size-cells = <1>;
237
238 macaddr_boardconfig_16: macaddr@16 {
239 compatible = "mac-base";
240 reg = <0x16 0x6>;
241 #nvmem-cell-cells = <1>;
242 };
243 };
244 };
245 };
246 };
247 };
248
249 &pci0 {
250 status = "okay";
251 gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
252
253 wifi@1814,3091 {
254 compatible = "pci1814,3091";
255 reg = <0x7000 0 0 0 0>;
256 ralink,mtd-eeprom = <&boardconfig 0x410>;
257 ralink,eeprom-swap;
258 nvmem-cells = <&macaddr_boardconfig_16 1>;
259 nvmem-cell-names = "mac-address";
260 };
261 };
262
263 &pcie0 {
264 status = "disabled";
265 };
266
267 &stp {
268 status = "okay";
269 lantiq,shadow = <0xffff>;
270 lantiq,groups = <0x3>;
271 /* lantiq,rising; */
272 };
273
274 &usb_phy0 {
275 status = "okay";
276 };
277
278 &usb_phy1 {
279 status = "okay";
280 };
281
282 &usb0 {
283 status = "okay";
284 vbus-supply = <&usb_vbus>;
285 };
286
287 &usb1 {
288 status = "okay";
289 vbus-supply = <&usb_vbus>;
290 };
291
292 &vmmc {
293 status = "okay";
294 gpios = <&gpio 30 GPIO_ACTIVE_HIGH //fxs relay
295 &gpio 31 GPIO_ACTIVE_HIGH //still unknown
296 &gpio 3 GPIO_ACTIVE_HIGH>; //reset_slic?
297 };