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