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