ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_sercomm_na502s.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #include "mt7621.dtsi"
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7
8 / {
9 compatible = "sercomm,na502s", "mediatek,mt7621-soc";
10 model = "SERCOMM NA502S";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 function = LED_FUNCTION_POWER;
24 color = <LED_COLOR_ID_GREEN>;
25 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
26 };
27
28 wifi {
29 label = "green:wifi";
30 gpios = <&gpio_expander1 0 GPIO_ACTIVE_LOW>;
31 linux,default-trigger = "phy0tpt";
32 };
33
34 zwave {
35 label = "green:zwave";
36 gpios = <&gpio_expander1 1 GPIO_ACTIVE_LOW>;
37 };
38
39 zigbee {
40 label = "green:zigbee";
41 gpios = <&gpio_expander1 2 GPIO_ACTIVE_LOW>;
42 };
43
44 bluetooth {
45 function = LED_FUNCTION_BLUETOOTH;
46 color = <LED_COLOR_ID_GREEN>;
47 gpios = <&gpio_expander1 3 GPIO_ACTIVE_LOW>;
48 };
49
50 rf433 {
51 label = "green:rf433";
52 gpios = <&gpio_expander1 4 GPIO_ACTIVE_LOW>;
53 };
54
55 service {
56 label = "green:service";
57 gpios = <&gpio_expander1 5 GPIO_ACTIVE_LOW>;
58 };
59
60 3g {
61 label = "green:3g";
62 gpios = <&gpio_expander1 6 GPIO_ACTIVE_LOW>;
63 };
64
65 voice {
66 label = "green:voice";
67 gpios = <&gpio_expander1 7 GPIO_ACTIVE_LOW>;
68 };
69 };
70
71 keys {
72 compatible = "gpio-keys";
73
74 battery_tamper {
75 label = "battery_tamper";
76 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
77 linux,code = <BTN_1>;
78 };
79
80 reset {
81 label = "reset";
82 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
83 linux,code = <KEY_RESTART>;
84 };
85
86 voice {
87 label = "voice";
88 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
89 linux,code = <BTN_0>;
90 };
91
92 select {
93 label = "select";
94 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
95 linux,code = <BTN_1>;
96 };
97
98 sync {
99 label = "sync";
100 gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
101 linux,code = <KEY_RFKILL>;
102 };
103 };
104
105 gpio-export {
106 compatible = "gpio-export";
107
108 zwave_reset {
109 gpio-export,name = "zwave_reset";
110 gpio-export,output = <1>;
111 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
112 };
113
114 lprf_reset {
115 gpio-export,name = "lprf_reset";
116 gpio-export,output = <1>;
117 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
118 };
119
120 charger_detect {
121 gpio-export,name = "charger_detect";
122 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
123 };
124
125 buzzer {
126 gpio-export,name = "buzzer";
127 gpio-export,output = <0>;
128 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
129 };
130
131 3g_hw_shunt_en {
132 gpio-export,name = "3g_hw_shunt_en";
133 gpio-export,output = <0>;
134 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
135 };
136
137 3g_sw_on_off {
138 gpio-export,name = "3g_sw_on_off";
139 gpio-export,output = <1>;
140 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
141 };
142
143 3g_wake_up {
144 gpio-export,name = "3g_wake_up";
145 gpio-export,output = <0>;
146 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
147 };
148
149 3g_hw_reset {
150 gpio-export,name = "3g_hw_reset";
151 gpio-export,output = <1>;
152 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
153 };
154
155 zigbee_reset {
156 gpio-export,name = "zigbee_reset";
157 gpio-export,output = <1>;
158 gpios = <&gpio_expander0 0 GPIO_ACTIVE_LOW>;
159 };
160
161 zigbee_boot {
162 gpio-export,name = "zigbee_boot";
163 gpio-export,output = <1>;
164 gpios = <&gpio_expander0 1 GPIO_ACTIVE_LOW>;
165 };
166
167 2g_sw0 {
168 gpio-export,name = "2g_sw0";
169 gpio-export,output = <1>;
170 gpios = <&gpio_expander0 2 GPIO_ACTIVE_LOW>;
171 };
172
173 2g_sw1 {
174 gpio-export,name = "2g_sw1";
175 gpio-export,output = <1>;
176 gpios = <&gpio_expander0 3 GPIO_ACTIVE_LOW>;
177 };
178
179 fm2018_pwd {
180 gpio-export,name = "fm2018_pwd";
181 gpio-export,output = <1>;
182 gpios = <&gpio_expander0 4 GPIO_ACTIVE_LOW>;
183 };
184
185 fm2018_reset {
186 gpio-export,name = "fm2018_reset";
187 gpio-export,output = <1>;
188 gpios = <&gpio_expander0 5 GPIO_ACTIVE_LOW>;
189 };
190
191 batt_teset {
192 gpio-export,name = "batt_test";
193 gpio-export,output = <1>;
194 gpios = <&gpio_expander0 6 GPIO_ACTIVE_LOW>;
195 };
196
197 mfi_reset {
198 gpio-export,name = "mfi_reset";
199 gpio-export,output = <1>;
200 gpios = <&gpio_expander0 7 GPIO_ACTIVE_LOW>;
201 };
202 };
203 };
204
205 &ethernet {
206 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
207 };
208
209 &gmac0 {
210 nvmem-cells = <&macaddr_factory_e000 0>;
211 nvmem-cell-names = "mac-address";
212 };
213
214 &nand {
215 status = "okay";
216
217 partitions {
218 compatible = "fixed-partitions";
219 #address-cells = <1>;
220 #size-cells = <1>;
221
222 partition@0 {
223 label = "u-boot";
224 reg = <0x0 0x80000>;
225 read-only;
226 };
227
228 partition@80000 {
229 label = "config";
230 reg = <0x80000 0x80000>;
231 read-only;
232 };
233
234 factory: partition@100000 {
235 label = "factory";
236 reg = <0x100000 0x40000>;
237
238 nvmem-layout {
239 compatible = "fixed-layout";
240 #address-cells = <1>;
241 #size-cells = <1>;
242
243 eeprom_factory_0: eeprom@0 {
244 reg = <0x0 0x400>;
245 };
246
247 eeprom_factory_8000: eeprom@8000 {
248 reg = <0x8000 0x200>;
249 };
250
251 macaddr_factory_e000: macaddr@e000 {
252 compatible = "mac-base";
253 reg = <0xe000 0x6>;
254 #nvmem-cell-cells = <1>;
255 };
256 };
257 };
258
259 partition@140000 {
260 label = "kernel1";
261 reg = <0x140000 0x1400000>;
262 };
263
264 partition@1540000 {
265 label = "kernel";
266 reg = <0x1540000 0x400000>;
267 };
268
269 partition@1940000 {
270 label = "ubi";
271 reg = <0x1940000 0x1000000>;
272 };
273
274 partition@2940000 {
275 label = "user_storage";
276 reg = <0x2940000 0x100000>;
277 };
278
279 partition@2a40000 {
280 label = "data";
281 reg = <0x2a40000 0x1000000>;
282 };
283
284 partition@3a40000 {
285 label = "storage";
286 reg = <0x3a40000 0x3200000>;
287 };
288
289 partition@6c40000 {
290 label = "backup";
291 reg = <0x6c40000 0x1340000>;
292 };
293 };
294 };
295
296 &pcie {
297 status = "okay";
298 };
299
300 &pcie0 {
301 wifi@0,0 {
302 compatible = "mediatek,mt76";
303 reg = <0x0000 0 0 0 0>;
304 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 1>;
305 nvmem-cell-names = "eeprom", "mac-address";
306 ieee80211-freq-limit = <5000000 6000000>;
307 };
308 };
309
310 &pcie1 {
311 wifi@0,0 {
312 compatible = "mediatek,mt76";
313 reg = <0x0 0 0 0 0>;
314 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 2>;
315 nvmem-cell-names = "eeprom", "mac-address";
316 ieee80211-freq-limit = <2400000 2500000>;
317 };
318 };
319
320 &state_default {
321 gpio {
322 groups = "jtag", "rgmii2";
323 function = "gpio";
324 };
325 };
326
327 &i2c {
328 status = "okay";
329
330 /* This GPIO expander is fake. The kernel fails to initialize the
331 first expander, but succeeds on the second (real) one */
332 gpio_expander2: gpio-expander2@22 {
333 #gpio-cells = <2>;
334 #interrupt-cells = <2>;
335 compatible = "semtech,sx1502q";
336 reg = <0x22>;
337
338 gpio-controller;
339 interrupt-controller;
340 };
341
342 gpio_expander0: gpio-expander0@20 {
343 #gpio-cells = <2>;
344 #interrupt-cells = <2>;
345 compatible = "semtech,sx1502q";
346 reg = <0x20>;
347
348 gpio-controller;
349 interrupt-controller;
350 };
351
352 gpio_expander1: gpio-expander1@21 {
353 #gpio-cells = <2>;
354 #interrupt-cells = <2>;
355 compatible = "semtech,sx1502q";
356 reg = <0x21>;
357
358 gpio-controller;
359 interrupt-controller;
360 };
361 };
362
363 &switch0 {
364 ports {
365 port@4 {
366 status = "okay";
367 label = "lan";
368 };
369 };
370 };
371
372 &uartlite2 {
373 status = "okay";
374 };