fdbcbc18bce8c9d4746152f75d484894a6d1cb4e
[openwrt/staging/noltari.git] / target / linux / mediatek / dts / mt7622-elecom-wrc-x3200gst3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/leds/common.h>
7
8 #include "mt7622.dtsi"
9 #include "mt6380.dtsi"
10
11 / {
12 model = "ELECOM WRC-X3200GST3";
13 compatible = "elecom,wrc-x3200gst3", "mediatek,mt7622";
14
15 aliases {
16 serial0 = &uart0;
17 led-boot = &led_power_green;
18 led-failsafe = &led_power_red;
19 led-running = &led_power_green;
20 led-upgrade = &led_power_green;
21 label-mac-device = &wan;
22 };
23
24 chosen {
25 bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
26 };
27
28 memory {
29 reg = <0 0x40000000 0 0x1f000000>;
30 };
31
32 leds {
33 compatible = "gpio-leds";
34
35 led-0 {
36 label = "red:wps";
37 gpios = <&pio 47 GPIO_ACTIVE_HIGH>;
38 color = <LED_COLOR_ID_RED>;
39 function = LED_FUNCTION_WPS;
40 };
41
42 led_power_red: led-1 {
43 label = "red:power";
44 gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
45 color = <LED_COLOR_ID_RED>;
46 function = LED_FUNCTION_POWER;
47 function-enumerator = <1>;
48 };
49
50 led_power_green: led-2 {
51 label = "green:power";
52 gpios = <&pio 49 GPIO_ACTIVE_HIGH>;
53 color = <LED_COLOR_ID_GREEN>;
54 function = LED_FUNCTION_POWER;
55 function-enumerator = <2>;
56 };
57
58 led-3 {
59 label = "blue:power";
60 gpios = <&pio 50 GPIO_ACTIVE_HIGH>;
61 color = <LED_COLOR_ID_BLUE>;
62 function = LED_FUNCTION_POWER;
63 function-enumerator = <3>;
64 };
65
66 led-4 {
67 label = "white:wlan2g";
68 gpios = <&pio 85 GPIO_ACTIVE_HIGH>;
69 color = <LED_COLOR_ID_WHITE>;
70 function = LED_FUNCTION_WLAN;
71 function-enumerator = <1>;
72 linux,default-trigger = "phy0tpt";
73 };
74
75 led-5 {
76 label = "white:wlan5g";
77 gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
78 color = <LED_COLOR_ID_WHITE>;
79 function = LED_FUNCTION_WLAN;
80 function-enumerator = <2>;
81 linux,default-trigger = "phy1radio";
82 };
83 };
84
85 keys {
86 compatible = "gpio-keys";
87
88 reset {
89 label = "reset";
90 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
91 linux,code = <KEY_RESTART>;
92 };
93
94 ap {
95 label = "ap";
96 gpios = <&pio 42 GPIO_ACTIVE_LOW>;
97 linux,code = <BTN_0>;
98 linux,input-type = <EV_SW>;
99 };
100
101 router {
102 label = "router";
103 gpios = <&pio 43 GPIO_ACTIVE_LOW>;
104 linux,code = <BTN_1>;
105 linux,input-type = <EV_SW>;
106 };
107
108 wps {
109 label = "wps";
110 gpios = <&pio 102 GPIO_ACTIVE_LOW>;
111 linux,code = <KEY_WPS_BUTTON>;
112 };
113 };
114 };
115
116 &cpu0 {
117 proc-supply = <&mt6380_vcpu_reg>;
118 sram-supply = <&mt6380_vm_reg>;
119 };
120
121 &cpu1 {
122 proc-supply = <&mt6380_vcpu_reg>;
123 sram-supply = <&mt6380_vm_reg>;
124 };
125
126 &pio {
127 eth_pins: eth-pins {
128 mux {
129 function = "eth";
130 groups = "mdc_mdio", "rgmii_via_gmac2";
131 };
132 };
133
134 pcie0_pins: pcie0-pins {
135 mux {
136 function = "pcie";
137 groups = "pcie0_pad_perst",
138 "pcie0_1_waken",
139 "pcie0_1_clkreq";
140 };
141 };
142
143 pmic_bus_pins: pmic-bus-pins {
144 mux {
145 function = "pmic";
146 groups = "pmic_bus";
147 };
148 };
149
150 pwm7_pins: pwm1-2-pins {
151 mux {
152 function = "pwm";
153 groups = "pwm_ch7_2";
154 };
155 };
156
157 /* Serial NAND is shared pin with SPI-NOR */
158 serial_nand_pins: serial-nand-pins {
159 mux {
160 function = "flash";
161 groups = "snfi";
162 };
163
164 conf-cmd-data {
165 pins = "SPI_WP", "SPI_HOLD", "SPI_MOSI",
166 "SPI_MISO", "SPI_CS";
167 drive-strength = <16>;
168 bias-pull-up;
169 };
170
171 conf-clk {
172 pins = "SPI_CLK";
173 drive-strength = <16>;
174 bias-pull-down;
175 };
176 };
177
178 uart0_pins: uart0-pins {
179 mux {
180 function = "uart";
181 groups = "uart0_0_tx_rx" ;
182 };
183 };
184
185 watchdog_pins: watchdog-pins {
186 mux {
187 function = "watchdog";
188 groups = "watchdog";
189 };
190 };
191 };
192
193 &eth {
194 pinctrl-names = "default";
195 pinctrl-0 = <&eth_pins>;
196 status = "okay";
197
198 gmac0: mac@0 {
199 compatible = "mediatek,eth-mac";
200 reg = <0>;
201
202 phy-connection-type = "2500base-x";
203
204 nvmem-cells = <&macaddr_factory_7fff4>;
205 nvmem-cell-names = "mac-address";
206
207 fixed-link {
208 speed = <2500>;
209 full-duplex;
210 pause;
211 };
212 };
213
214 mdio-bus {
215 #address-cells = <1>;
216 #size-cells = <0>;
217
218 switch@0 {
219 compatible = "mediatek,mt7531";
220 reg = <0>;
221 interrupt-controller;
222 #interrupt-cells = <1>;
223 interrupt-parent = <&pio>;
224 interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
225 reset-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
226
227 ports {
228 #address-cells = <1>;
229 #size-cells = <0>;
230
231 wan: port@0 {
232 reg = <0>;
233 label = "wan";
234
235 nvmem-cells = <&macaddr_factory_7fffa>;
236 nvmem-cell-names = "mac-address";
237 };
238
239 port@1 {
240 reg = <1>;
241 label = "lan4";
242 };
243
244 port@2 {
245 reg = <2>;
246 label = "lan3";
247 };
248
249 port@3 {
250 reg = <3>;
251 label = "lan2";
252 };
253
254 port@4 {
255 reg = <4>;
256 label = "lan1";
257 };
258
259 port@6 {
260 reg = <6>;
261 label = "cpu";
262 ethernet = <&gmac0>;
263 phy-mode = "2500base-x";
264
265 fixed-link {
266 speed = <2500>;
267 full-duplex;
268 pause;
269 };
270 };
271 };
272 };
273 };
274 };
275
276 &bch {
277 status = "okay";
278 };
279
280 &snfi {
281 pinctrl-names = "default";
282 pinctrl-0 = <&serial_nand_pins>;
283 status = "okay";
284
285 flash@0 {
286 compatible = "spi-nand";
287 reg = <0>;
288 spi-tx-bus-width = <4>;
289 spi-rx-bus-width = <4>;
290 nand-ecc-engine = <&snfi>;
291 mediatek,bmt-v2;
292 mediatek,bmt-table-size = <0x1000>;
293 mediatek,bmt-remap-range = <0x0 0x8c0000>,
294 <0x1bc0000 0x30c0000>;
295
296 partitions {
297 compatible = "fixed-partitions";
298 #address-cells = <1>;
299 #size-cells = <1>;
300
301 partition@0 {
302 label = "Preloader";
303 reg = <0x0 0x80000>;
304 read-only;
305 };
306
307 partition@80000 {
308 label = "ATF";
309 reg = <0x80000 0x40000>;
310 read-only;
311 };
312
313 partition@c0000 {
314 label = "u-boot";
315 reg = <0xc0000 0x80000>;
316 read-only;
317 };
318
319 partition@140000 {
320 label = "u-boot-env";
321 reg = <0x140000 0x80000>;
322 read-only;
323 };
324
325 factory: partition@1c0000 {
326 label = "factory";
327 reg = <0x1c0000 0x100000>;
328 read-only;
329
330 compatible = "nvmem-cells";
331 #address-cells = <1>;
332 #size-cells = <1>;
333
334 macaddr_factory_4: macaddr@4 {
335 reg = <0x4 0x6>;
336 };
337
338 macaddr_factory_7fff4: macaddr@7fff4 {
339 reg = <0x7fff4 0x6>;
340 };
341
342 macaddr_factory_7fffa: macaddr@7fffa {
343 reg = <0x7fffa 0x6>;
344 };
345 };
346
347 partition@2c0000 {
348 label = "kernel";
349 reg = <0x2c0000 0x600000>;
350 };
351
352 partition@8c0000 {
353 label = "ubi";
354 reg = <0x8c0000 0x1300000>;
355 };
356
357 partition@1bc0000 {
358 label = "tm_pattern";
359 reg = <0x1bc0000 0x500000>;
360 read-only;
361 };
362
363 partition@20c0000 {
364 label = "tm_key";
365 reg = <0x20c0000 0x100000>;
366 read-only;
367 };
368
369 partition@21c0000 {
370 label = "user_data";
371 reg = <0x21c0000 0xf00000>;
372 read-only;
373 };
374
375 partition@30c0000 {
376 label = "reserved";
377 reg = <0x30c0000 0x4f40000>;
378 read-only;
379 };
380 };
381 };
382 };
383
384 &pcie0 {
385 pinctrl-names = "default";
386 pinctrl-0 = <&pcie0_pins>;
387 status = "okay";
388 };
389
390 &slot0 {
391 status = "okay";
392
393 wifi@0,0 {
394 compatible = "mediatek,mt76";
395 reg = <0x0000 0 0 0 0>;
396 mediatek,mtd-eeprom = <&factory 0x5000>;
397 ieee80211-freq-limit = <5000000 6000000>;
398 nvmem-cells = <&macaddr_factory_4>;
399 nvmem-cell-names = "mac-address";
400 mac-address-increment = <1>;
401 };
402 };
403
404 &pwm {
405 pinctrl-names = "default";
406 pinctrl-0 = <&pwm7_pins>;
407 status = "okay";
408 };
409
410 &pwrap {
411 pinctrl-names = "default";
412 pinctrl-0 = <&pmic_bus_pins>;
413 status = "okay";
414 };
415
416 &rtc {
417 status = "disabled";
418 };
419
420 &uart0 {
421 pinctrl-names = "default";
422 pinctrl-0 = <&uart0_pins>;
423 status = "okay";
424 };
425
426 &watchdog {
427 pinctrl-names = "default";
428 pinctrl-0 = <&watchdog_pins>;
429 status = "okay";
430 };
431
432 &wmac {
433 status = "okay";
434
435 mediatek,mtd-eeprom = <&factory 0x0>;
436 };