081e932b5c7eb8c3eff5273356534cb093d2bfb1
[openwrt/staging/stintel.git] / target / linux / qualcommax / files / arch / arm64 / boot / dts / qcom / ipq8072-301w.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /* Copyright (c) 2021, Dirk Buchwalder <buchwalder@posteo.de> */
3
4 /dts-v1/;
5
6 #include "ipq8074.dtsi"
7 #include "ipq8074-hk-cpu.dtsi"
8 #include "ipq8074-ess.dtsi"
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/leds/common.h>
12
13 / {
14 model = "QNAP 301w";
15 compatible = "qnap,301w", "qcom,ipq8074";
16
17 aliases {
18 serial0 = &blsp1_uart5;
19 /*
20 * Aliases as required by u-boot
21 * to patch MAC addresses
22 */
23 led-boot = &led_system_red;
24 led-failsafe = &led_system_red;
25 led-running = &led_pwr_green;
26 led-upgrade = &led_system_red;
27 ethernet0 = &dp1;
28 ethernet1 = &dp2;
29 ethernet2 = &dp3;
30 ethernet3 = &dp4;
31 ethernet4 = &dp5;
32 ethernet5 = &dp6_syn;
33 label-mac-device = &dp1;
34 };
35
36 chosen {
37 stdout-path = "serial0:115200n8";
38 };
39
40 keys {
41 compatible = "gpio-keys";
42 pinctrl-0 = <&button_pins>;
43 pinctrl-names = "default";
44
45 wps-button {
46 label = "wps";
47 gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_WPS_BUTTON>;
49 };
50
51 reset-button {
52 label = "reset";
53 gpios = <&tlmm 67 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_RESTART>;
55 };
56 };
57
58 leds {
59 compatible = "gpio-leds";
60 pinctrl-0 = <&leds_pins>;
61 pinctrl-names = "default";
62
63 led_system_green: led-system-green {
64 gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
65 color = <LED_COLOR_ID_GREEN>;
66 };
67
68 led_system_red: led-system-red {
69 gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
70 color = <LED_COLOR_ID_RED>;
71 };
72
73 led_pwr_green: led-pwr-green {
74 gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>;
75 color = <LED_COLOR_ID_GREEN>;
76 };
77
78 led-wifi-green {
79 gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
80 color = <LED_COLOR_ID_GREEN>;
81 };
82
83 led-lan4-green {
84 gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
85 color = <LED_COLOR_ID_GREEN>;
86 };
87
88 led-lan4-amber {
89 gpios = <&tlmm 7 GPIO_ACTIVE_HIGH>;
90 color = <LED_COLOR_ID_AMBER>;
91 };
92
93 led-lan3-green {
94 gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
95 color = <LED_COLOR_ID_GREEN>;
96 };
97
98 led-lan3-amber {
99 gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
100 color = <LED_COLOR_ID_AMBER>;
101 };
102
103 led-lan2-green {
104 gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
105 color = <LED_COLOR_ID_GREEN>;
106 };
107
108 led-lan2-amber {
109 gpios = <&tlmm 13 GPIO_ACTIVE_HIGH>;
110 color = <LED_COLOR_ID_AMBER>;
111 };
112
113 led-lan1-green {
114 gpios = <&tlmm 14 GPIO_ACTIVE_HIGH>;
115 color = <LED_COLOR_ID_GREEN>;
116 };
117
118 led-lan1-amber {
119 gpios = <&tlmm 15 GPIO_ACTIVE_HIGH>;
120 color = <LED_COLOR_ID_AMBER>;
121 };
122
123 led-10g-1-green {
124 gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;
125 color = <LED_COLOR_ID_GREEN>;
126 };
127
128 led-10g-1-amber {
129 gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>;
130 color = <LED_COLOR_ID_AMBER>;
131 };
132
133 led-10g-2-green {
134 gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
135 color = <LED_COLOR_ID_GREEN>;
136 };
137
138 led-10g-2-amber {
139 gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
140 color = <LED_COLOR_ID_AMBER>;
141 };
142 };
143 };
144
145 &tlmm {
146
147 mdio_pins: mdio-state {
148 mdc-pins {
149 pins = "gpio68";
150 function = "mdc";
151 drive-strength = <8>;
152 bias-pull-up;
153 };
154
155 mdio-pins {
156 pins = "gpio69";
157 function = "mdio";
158 drive-strength = <8>;
159 bias-pull-up;
160 };
161 };
162
163 button_pins: button-state {
164 wps-pins {
165 pins = "gpio57";
166 function = "gpio";
167 drive-strength = <8>;
168 bias-pull-up;
169 };
170
171 rst-pins {
172 pins = "gpio67";
173 function = "gpio";
174 drive-strength = <8>;
175 bias-pull-up;
176 };
177 };
178
179 leds_pins: leds-state {
180 pins = "gpio1", "gpio3", "gpio4", "gpio6", "gpio7", "gpio8",
181 "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio42",
182 "gpio51", "gpio52", "gpio54", "gpio56";
183 function = "gpio";
184 drive-strength = <8>;
185 bias-pull-down;
186 };
187 };
188
189 &blsp1_uart5 {
190 status = "okay";
191 };
192
193 &prng {
194 status = "okay";
195 };
196
197 &ssphy_0 {
198 status = "okay";
199 };
200
201 &qusb_phy_0 {
202 status = "okay";
203 };
204
205 &ssphy_1 {
206 status = "okay";
207 };
208
209 &qusb_phy_1 {
210 status = "okay";
211 };
212
213 &usb_0 {
214 status = "okay";
215 };
216
217 &usb_1 {
218 status = "okay";
219 };
220
221 &cryptobam {
222 status = "okay";
223 };
224
225 &crypto {
226 status = "okay";
227 };
228
229 &qpic_bam {
230 status = "okay";
231 };
232
233 &blsp1_spi1 { /* BLSP1 QUP1 */
234 pinctrl-0 = <&spi_0_pins>;
235 pinctrl-names = "default";
236 cs-gpios = <0>;
237 status = "okay";
238
239 flash@0 {
240 #address-cells = <1>;
241 #size-cells = <1>;
242 reg = <0>;
243 compatible = "jedec,spi-nor";
244 spi-max-frequency = <50000000>;
245
246 partitions {
247 compatible = "fixed-partitions";
248 #address-cells = <1>;
249 #size-cells = <1>;
250
251 partition@0 {
252 label = "0:sbl1";
253 reg = <0x0 0x50000>;
254 read-only;
255 };
256
257 partition@50000 {
258 label = "0:mibib";
259 reg = <0x50000 0x10000>;
260 read-only;
261 };
262
263 partition@60000 {
264 label = "0:qsee";
265 reg = <0x60000 0x180000>;
266 read-only;
267 };
268
269 partition@1e0000 {
270 label = "0:devcfg";
271 reg = <0x1e0000 0x10000>;
272 read-only;
273 };
274
275 partition@1f0000 {
276 label = "0:apdp";
277 reg = <0x1f0000 0x10000>;
278 read-only;
279 };
280
281 partition@200000 {
282 label = "0:rpm";
283 reg = <0x200000 0x40000>;
284 read-only;
285 };
286
287 partition@240000 {
288 label = "0:cdt";
289 reg = <0x240000 0x10000>;
290 read-only;
291 };
292
293 partition@250000 {
294 label = "0:appsblenv";
295 reg = <0x250000 0x20000>;
296 };
297
298 partition@270000 {
299 label = "0:appsbl";
300 reg = <0x250000 0x100000>;
301 read-only;
302 };
303
304 partition@370000 {
305 label = "0:art";
306 reg = <0x370000 0x40000>;
307 read-only;
308 };
309
310 partition@3b0000 {
311 label = "0:ethphyfw1";
312 reg = <0x3b0000 0x80000>;
313
314 compatible = "nvmem-cells";
315 #address-cells = <1>;
316 #size-cells = <1>;
317
318 aqr0_fw: firmware@0 {
319 reg = <0x0 0x5fc02>;
320 };
321 };
322
323 partition@430000 {
324 label = "0:ethphyfw2";
325 reg = <0x430000 0x80000>;
326
327 compatible = "nvmem-cells";
328 #address-cells = <1>;
329 #size-cells = <1>;
330
331 aqr1_fw: firmware@0 {
332 reg = <0x0 0x5fc02>;
333 };
334 };
335
336 partition@4b0000 {
337 label = "reserved";
338 reg = <0x4b0000 0x350000>;
339 };
340 };
341 };
342 };
343
344 &mdio {
345 status = "okay";
346
347 pinctrl-0 = <&mdio_pins>;
348 pinctrl-names = "default";
349 reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
350
351 aqr113c_0: ethernet-phy@0 {
352 compatible ="ethernet-phy-ieee802.3-c45";
353 reg = <0>;
354 reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
355 firmware-name = "marvell/AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x0_ID44778_VER1630.cld";
356 nvmem-cell-names = "firmware";
357 nvmem-cells = <&aqr0_fw>;
358 };
359
360 aqr113c_8: ethernet-phy@8 {
361 compatible ="ethernet-phy-ieee802.3-c45";
362 reg = <8>;
363 reset-gpios = <&tlmm 59 GPIO_ACTIVE_LOW>;
364 firmware-name = "marvell/AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x8_ID44776_VER1630.cld";
365 nvmem-cell-names = "firmware";
366 nvmem-cells = <&aqr1_fw>;
367 };
368
369 ethernet-phy-package@16 {
370 #address-cells = <1>;
371 #size-cells = <0>;
372 compatible = "qcom,qca8075-package";
373 reg = <16>;
374
375 qcom,package-mode = "qsgmii";
376
377 qca8075_16: ethernet-phy@16 {
378 compatible = "ethernet-phy-ieee802.3-c22";
379 reg = <16>;
380 };
381
382 qca8075_17: ethernet-phy@17 {
383 compatible = "ethernet-phy-ieee802.3-c22";
384 reg = <17>;
385 };
386
387 qca8075_18: ethernet-phy@18 {
388 compatible = "ethernet-phy-ieee802.3-c22";
389 reg = <18>;
390 };
391
392 qca8075_19: ethernet-phy@19 {
393 compatible = "ethernet-phy-ieee802.3-c22";
394 reg = <19>;
395 };
396 };
397 };
398
399 &sdhc_1 {
400 status = "okay";
401
402 /* According to the stock dts from the QNAP gpl drop
403 * the emmc has a problem with the hs400 > hs200 speed switch.
404 * Therefore remove the mmc-hs400-1_8v property
405 */
406 /delete-property/ mmc-hs400-1_8v;
407 mmc-hs200-1_8v;
408 mmc-ddr-1_8v;
409 vqmmc-supply = <&l11>;
410 };
411
412 &switch {
413 status = "okay";
414
415 switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>; /* lan port bitmap */
416 switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
417 switch_mac_mode = <MAC_MODE_QSGMII>; /* mac mode for uniphy instance0*/
418 switch_mac_mode1 = <MAC_MODE_USXGMII>; /* mac mode for uniphy instance1*/
419 switch_mac_mode2 = <MAC_MODE_USXGMII>; /* mac mode for uniphy instance2*/
420
421 qcom,port_phyinfo {
422 port@0 {
423 port_id = <1>;
424 phy_address = <16>;
425 };
426 port@1 {
427 port_id = <2>;
428 phy_address = <17>;
429 };
430 port@2 {
431 port_id = <3>;
432 phy_address = <18>;
433 };
434 port@3 {
435 port_id = <4>;
436 phy_address = <19>;
437 };
438 port@4 {
439 port_id = <5>;
440 phy_address = <8>;
441 compatible = "ethernet-phy-ieee802.3-c45";
442 ethernet-phy-ieee802.3-c45;
443 };
444 port@5 {
445 port_id = <6>;
446 phy_address = <0>;
447 compatible = "ethernet-phy-ieee802.3-c45";
448 ethernet-phy-ieee802.3-c45;
449 };
450 };
451 };
452
453 &edma {
454 status = "okay";
455 };
456
457 &dp1 {
458 status = "okay";
459 phy-mode = "qsgmii";
460 phy-handle = <&qca8075_16>;
461 label = "lan4";
462 };
463
464 &dp2 {
465 status = "okay";
466 phy-mode = "qsgmii";
467 phy-handle = <&qca8075_17>;
468 label = "lan3";
469 };
470
471 &dp3 {
472 status = "okay";
473 phy-mode = "qsgmii";
474 phy-handle = <&qca8075_18>;
475 label = "lan2";
476 };
477
478 &dp4 {
479 status = "okay";
480 phy-mode = "qsgmii";
481 phy-handle = <&qca8075_19>;
482 label = "lan1";
483 };
484
485 &dp5 {
486 status = "okay";
487 qcom,mactype = <1>;
488 phy-mode = "usxgmii";
489 phy-handle = <&aqr113c_8>;
490 label = "10g-1";
491 };
492
493 &dp6_syn {
494 status = "okay";
495 phy-mode = "usxgmii";
496 phy-handle = <&aqr113c_0>;
497 label = "10g-2";
498 };
499
500 &wifi {
501 status = "okay";
502
503 qcom,ath11k-calibration-variant = "QNAP-301w";
504 };