dc71dbd050297acbeb293607bd033b576baa3509
[openwrt/staging/nbd.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>;
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
236 partition@140000 {
237 label = "kernel1";
238 reg = <0x140000 0x1400000>;
239 };
240
241 partition@1540000 {
242 label = "kernel";
243 reg = <0x1540000 0x400000>;
244 };
245
246 partition@1940000 {
247 label = "ubi";
248 reg = <0x1940000 0x1000000>;
249 };
250
251 partition@2940000 {
252 label = "user_storage";
253 reg = <0x2940000 0x100000>;
254 };
255
256 partition@2a40000 {
257 label = "data";
258 reg = <0x2a40000 0x1000000>;
259 };
260
261 partition@3a40000 {
262 label = "storage";
263 reg = <0x3a40000 0x3200000>;
264 };
265
266 partition@6c40000 {
267 label = "backup";
268 reg = <0x6c40000 0x1340000>;
269 };
270 };
271 };
272
273 &pcie {
274 status = "okay";
275 };
276
277 &pcie0 {
278 wifi@0,0 {
279 compatible = "mediatek,mt76";
280 reg = <0x0000 0 0 0 0>;
281 mediatek,mtd-eeprom = <&factory 0x8000>;
282 nvmem-cells = <&macaddr_factory_e000>;
283 nvmem-cell-names = "mac-address";
284 mac-address-increment = <1>;
285 ieee80211-freq-limit = <5000000 6000000>;
286 };
287 };
288
289 &pcie1 {
290 wifi@0,0 {
291 compatible = "mediatek,mt76";
292 reg = <0x0 0 0 0 0>;
293 mediatek,mtd-eeprom = <&factory 0x0000>;
294 nvmem-cells = <&macaddr_factory_e000>;
295 nvmem-cell-names = "mac-address";
296 mac-address-increment = <2>;
297 ieee80211-freq-limit = <2400000 2500000>;
298 };
299 };
300
301 &state_default {
302 gpio {
303 groups = "jtag", "rgmii2";
304 function = "gpio";
305 };
306 };
307
308 &i2c {
309 status = "okay";
310
311 /* This GPIO expander is fake. The kernel fails to initialize the
312 first expander, but succeeds on the second (real) one */
313 gpio_expander2: gpio-expander2@22 {
314 #gpio-cells = <2>;
315 #interrupt-cells = <2>;
316 compatible = "semtech,sx1502q";
317 reg = <0x22>;
318
319 gpio-controller;
320 };
321
322 gpio_expander0: gpio-expander0@20 {
323 #gpio-cells = <2>;
324 #interrupt-cells = <2>;
325 compatible = "semtech,sx1502q";
326 reg = <0x20>;
327
328 gpio-controller;
329 };
330
331 gpio_expander1: gpio-expander1@21 {
332 #gpio-cells = <2>;
333 #interrupt-cells = <2>;
334 compatible = "semtech,sx1502q";
335 reg = <0x21>;
336
337 gpio-controller;
338 };
339 };
340
341 &switch0 {
342 ports {
343 port@4 {
344 status = "okay";
345 label = "lan";
346 };
347 };
348 };
349
350 &uartlite2 {
351 status = "okay";
352 };
353
354 &factory {
355 compatible = "nvmem-cells";
356 #address-cells = <1>;
357 #size-cells = <1>;
358
359 macaddr_factory_e000: macaddr@e000 {
360 reg = <0xe000 0x6>;
361 };
362 };