qualcommax: convert qca807x PHY to PHY package implementation
[openwrt/staging/jow.git] / target / linux / qualcommax / files / arch / arm64 / boot / dts / qcom / ipq8072-ax9000.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /* Copyright (c) 2021, Robert Marko <robimarko@gmail.com> */
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 = "Xiaomi AX9000";
15 compatible = "xiaomi,ax9000", "qcom,ipq8074";
16
17 aliases {
18 serial0 = &blsp1_uart5;
19 led-boot = &led_system_yellow;
20 led-failsafe = &led_system_yellow;
21 led-running = &led_system_blue;
22 led-upgrade = &led_system_yellow;
23 label-mac-device = &dp5;
24 };
25
26 chosen {
27 stdout-path = "serial0:115200n8";
28 bootargs-append = " root=/dev/ubiblock0_0";
29 };
30
31 keys {
32 compatible = "gpio-keys";
33
34 reset {
35 label = "reset";
36 gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39
40 wps {
41 label = "wps"; /* Labeled Mesh on the device */
42 gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
43 linux,code = <KEY_WPS_BUTTON>;
44 };
45 };
46
47 leds {
48 compatible = "gpio-leds";
49
50 led_system_blue: system-blue {
51 gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
52 color = <LED_COLOR_ID_BLUE>;
53 };
54
55 led_system_yellow: system-yellow {
56 gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
57 color = <LED_COLOR_ID_YELLOW>;
58 };
59
60 network-yellow {
61 gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
62 color = <LED_COLOR_ID_YELLOW>;
63 };
64
65 network-blue {
66 gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
67 color = <LED_COLOR_ID_BLUE>;
68 };
69
70 top-red {
71 gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>;
72 color = <LED_COLOR_ID_RED>;
73 default-state = "keep";
74 };
75
76 top-green {
77 gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
78 color = <LED_COLOR_ID_GREEN>;
79 default-state = "keep";
80 };
81
82 top-blue {
83 gpios = <&tlmm 66 GPIO_ACTIVE_HIGH>;
84 color = <LED_COLOR_ID_BLUE>;
85 default-state = "keep";
86 };
87 };
88 };
89
90 &tlmm {
91 mdio_pins: mdio-pins {
92 mdc {
93 pins = "gpio68";
94 function = "mdc";
95 drive-strength = <8>;
96 bias-pull-up;
97 };
98
99 mdio {
100 pins = "gpio69";
101 function = "mdio";
102 drive-strength = <8>;
103 bias-pull-up;
104 };
105 };
106
107 i2c_pins: i2c-pins {
108 pins = "gpio0", "gpio2";
109 function = "blsp5_i2c";
110 drive-strength = <8>;
111 bias-disable;
112 };
113 };
114
115 &blsp1_uart5 {
116 status = "okay";
117 };
118
119 &blsp1_i2c6 {
120 status = "okay";
121
122 pinctrl-0 = <&i2c_pins>;
123 pinctrl-names = "default";
124 };
125
126 &prng {
127 status = "okay";
128 };
129
130 &cryptobam {
131 status = "okay";
132 };
133
134 &crypto {
135 status = "okay";
136 };
137
138 &qpic_bam {
139 status = "okay";
140 };
141
142 &qpic_nand {
143 status = "okay";
144
145 /*
146 * Bootloader will find the NAND DT node by the compatible and
147 * then "fixup" it by adding the partitions from the SMEM table
148 * using the legacy bindings thus making it impossible for us
149 * to change the partition table or utilize NVMEM for calibration.
150 * So add a dummy partitions node that bootloader will populate
151 * and set it as disabled so the kernel ignores it instead of
152 * printing warnings due to the broken way bootloader adds the
153 * partitions.
154 */
155 partitions {
156 status = "disabled";
157 };
158
159 nand@0 {
160 reg = <0>;
161 nand-ecc-strength = <4>;
162 nand-ecc-step-size = <512>;
163 nand-bus-width = <8>;
164
165 partitions {
166 compatible = "fixed-partitions";
167 #address-cells = <1>;
168 #size-cells = <1>;
169
170 partition@0 {
171 label = "0:sbl1";
172 reg = <0x0 0x100000>;
173 read-only;
174 };
175
176 partition@100000 {
177 label = "0:mibib";
178 reg = <0x100000 0x100000>;
179 read-only;
180 };
181
182 partition@200000 {
183 label = "0:bootconfig";
184 reg = <0x200000 0x80000>;
185 read-only;
186 };
187
188 partition@280000 {
189 label = "0:bootconfig1";
190 reg = <0x280000 0x80000>;
191 read-only;
192 };
193
194 partition@300000 {
195 label = "0:qsee";
196 reg = <0x300000 0x300000>;
197 read-only;
198 };
199
200 partition@600000 {
201 label = "0:qsee_1";
202 reg = <0x600000 0x300000>;
203 read-only;
204 };
205
206 partition@900000 {
207 label = "0:devcfg";
208 reg = <0x900000 0x80000>;
209 read-only;
210 };
211
212 partition@980000 {
213 label = "0:devcfg_1";
214 reg = <0x980000 0x80000>;
215 read-only;
216 };
217
218 partition@a00000 {
219 label = "0:apdp";
220 reg = <0xa00000 0x80000>;
221 read-only;
222 };
223
224 partition@a80000 {
225 label = "0:apdp_1";
226 reg = <0xa80000 0x80000>;
227 read-only;
228 };
229
230 partition@b00000 {
231 label = "0:rpm";
232 reg = <0xb00000 0x80000>;
233 read-only;
234 };
235
236 partition@b80000 {
237 label = "0:rpm_1";
238 reg = <0xb80000 0x80000>;
239 read-only;
240 };
241
242 partition@c00000 {
243 label = "0:cdt";
244 reg = <0xc00000 0x80000>;
245 read-only;
246 };
247
248 partition@c80000 {
249 label = "0:cdt_1";
250 reg = <0xc80000 0x80000>;
251 read-only;
252 };
253
254 partition@d00000 {
255 label = "0:appsblenv";
256 reg = <0xd00000 0x80000>;
257 };
258
259 partition@d80000 {
260 label = "0:appsbl";
261 reg = <0xd80000 0x100000>;
262 read-only;
263 };
264
265 partition@e80000 {
266 label = "0:appsbl_1";
267 reg = <0xe80000 0x100000>;
268 read-only;
269 };
270
271 partition@f80000 {
272 label = "0:art";
273 reg = <0xf80000 0x80000>;
274 read-only;
275
276 nvmem-layout {
277 compatible = "fixed-layout";
278 #address-cells = <1>;
279 #size-cells = <1>;
280
281 macaddr_dp1: macaddr@0 {
282 reg = <0x0 0x6>;
283 };
284
285 macaddr_dp2: macaddr@6 {
286 reg = <0x6 0x6>;
287 };
288
289 macaddr_dp3: macaddr@c {
290 reg = <0xc 0x6>;
291 };
292
293 macaddr_dp4: macaddr@12 {
294 reg = <0x12 0x6>;
295 };
296
297 macaddr_dp5: macaddr@18 {
298 reg = <0x18 0x6>;
299 };
300
301 caldata_qca9889: caldata@4d000 {
302 reg = <0x4d000 0x844>;
303 };
304 };
305 };
306
307 partition@1000000 {
308 label = "bdata";
309 reg = <0x1000000 0x80000>;
310 };
311
312 partition@1080000 {
313 /* This is crash + crash_syslog parts combined */
314 label = "pstore";
315 reg = <0x1080000 0x100000>;
316 };
317
318 partition@1180000 {
319 label = "ubi_kernel";
320 reg = <0x1180000 0x3800000>;
321 };
322
323 partition@4980000 {
324 label = "rootfs";
325 reg = <0x4980000 0xb680000>;
326 };
327 };
328 };
329 };
330
331 &qusb_phy_0 {
332 status = "okay";
333 };
334
335 &ssphy_0 {
336 status = "okay";
337 };
338
339 &usb_0 {
340 status = "okay";
341 };
342
343 &mdio {
344 status = "okay";
345
346 pinctrl-0 = <&mdio_pins>;
347 pinctrl-names = "default";
348 reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
349
350 ethernet-phy-package@0 {
351 #address-cells = <1>;
352 #size-cells = <0>;
353 compatible = "qcom,qca8075-package";
354 reg = <0>;
355
356 qcom,package-mode = "qsgmii";
357
358 qca8075_0: ethernet-phy@0 {
359 compatible = "ethernet-phy-ieee802.3-c22";
360 reg = <0>;
361 };
362
363 qca8075_1: ethernet-phy@1 {
364 compatible = "ethernet-phy-ieee802.3-c22";
365 reg = <1>;
366 };
367
368 qca8075_2: ethernet-phy@2 {
369 compatible = "ethernet-phy-ieee802.3-c22";
370 reg = <2>;
371 };
372
373 qca8075_3: ethernet-phy@3 {
374 compatible = "ethernet-phy-ieee802.3-c22";
375 reg = <3>;
376 };
377 };
378
379 qca8081: ethernet-phy@24 {
380 compatible = "ethernet-phy-id004d.d101";
381 reg = <24>;
382 reset-deassert-us = <10000>;
383 reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
384
385 leds {
386 #address-cells = <1>;
387 #size-cells = <0>;
388
389 led@0 {
390 reg = <0>;
391 color = <LED_COLOR_ID_GREEN>;
392 function = LED_FUNCTION_WAN;
393 default-state = "keep";
394 };
395 };
396 };
397 };
398
399 &switch {
400 status = "okay";
401
402 switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
403 switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
404 switch_mac_mode = <MAC_MODE_QSGMII>; /* mac mode for uniphy instance0*/
405 switch_mac_mode1 = <MAC_MODE_SGMII_PLUS>; /* mac mode for uniphy instance1*/
406
407 qcom,port_phyinfo {
408 port@1 {
409 port_id = <1>;
410 phy_address = <0>;
411 };
412 port@2 {
413 port_id = <2>;
414 phy_address = <1>;
415 };
416 port@3 {
417 port_id = <3>;
418 phy_address = <2>;
419 };
420 port@4 {
421 port_id = <4>;
422 phy_address = <3>;
423 };
424 port@5 {
425 port_id = <5>;
426 phy_address = <24>;
427 port_mac_sel = "QGMAC_PORT";
428 };
429 };
430 };
431
432 &edma {
433 status = "okay";
434 };
435
436 &dp1 {
437 status = "okay";
438 phy-mode = "qsgmii";
439 phy-handle = <&qca8075_0>;
440 label = "lan4";
441 nvmem-cells = <&macaddr_dp1>;
442 nvmem-cell-names = "mac-address";
443 };
444
445 &dp2 {
446 status = "okay";
447 phy-mode = "qsgmii";
448 phy-handle = <&qca8075_1>;
449 label = "lan3";
450 nvmem-cells = <&macaddr_dp2>;
451 nvmem-cell-names = "mac-address";
452 };
453
454 &dp3 {
455 status = "okay";
456 phy-mode = "qsgmii";
457 phy-handle = <&qca8075_2>;
458 label = "lan2";
459 nvmem-cells = <&macaddr_dp3>;
460 nvmem-cell-names = "mac-address";
461 };
462
463 &dp4 {
464 status = "okay";
465 phy-mode = "qsgmii";
466 phy-handle = <&qca8075_3>;
467 label = "lan1";
468 nvmem-cells = <&macaddr_dp4>;
469 nvmem-cell-names = "mac-address";
470 };
471
472 &dp5 {
473 status = "okay";
474 phy-handle = <&qca8081>;
475 label = "wan";
476 nvmem-cells = <&macaddr_dp5>;
477 nvmem-cell-names = "mac-address";
478 };
479
480 &pcie_qmp0 {
481 status = "okay";
482 };
483
484 &pcie0 {
485 status = "okay";
486
487 perst-gpio = <&tlmm 58 GPIO_ACTIVE_LOW>;
488
489 bridge@0,0 {
490 reg = <0x00000000 0 0 0 0>;
491 #address-cells = <3>;
492 #size-cells = <2>;
493 ranges;
494
495 wifi@1,0 {
496 status = "okay";
497
498 /* ath11k has no DT compatible for PCI cards */
499 compatible = "pci17cb,1104";
500 reg = <0x00010000 0 0 0 0>;
501
502 qcom,ath11k-calibration-variant = "Xiaomi-AX9000";
503 };
504 };
505 };
506
507 &pcie_qmp1 {
508 status = "okay";
509 };
510
511 &pcie1 {
512 status = "okay";
513
514 perst-gpio = <&tlmm 62 GPIO_ACTIVE_HIGH>;
515
516 bridge@1,0 {
517 reg = <0x00010000 0 0 0 0>;
518 #address-cells = <3>;
519 #size-cells = <2>;
520 ranges;
521
522 wifi@1,0 {
523 status = "okay";
524
525 compatible = "qcom,ath10k";
526 reg = <0x00010000 0 0 0 0>;
527
528 qcom,ath10k-calibration-variant = "Xiaomi-AX9000";
529 nvmem-cell-names = "calibration";
530 nvmem-cells = <&caldata_qca9889>;
531 };
532 };
533 };
534
535 &wifi {
536 status = "okay";
537
538 qcom,ath11k-calibration-variant = "Xiaomi-AX9000";
539 };