671b592e67a744a721c49910c7ed680dbf2a61d6
[openwrt/staging/robimarko.git] / target / linux / mvebu / files / arch / arm64 / boot / dts / marvell / cn9132-puzzle-m902.dts
1 // SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
2 /*
3 * Copyright (C) 2019 Marvell International Ltd.
4 *
5 * Device tree for the CN9132-DB board.
6 */
7
8 #include "cn9130.dtsi"
9 #include "puzzle-thermal.dtsi"
10
11 #include <dt-bindings/gpio/gpio.h>
12 #include <dt-bindings/input/input.h>
13
14 / {
15 model = "iEi Puzzle-M902";
16 compatible = "iei,puzzle-m902",
17 "marvell,armada-ap807-quad", "marvell,armada-ap807";
18
19 chosen {
20 stdout-path = "serial0:115200n8";
21 };
22
23 aliases {
24 i2c0 = &cp1_i2c0;
25 i2c1 = &cp0_i2c0;
26 gpio1 = &cp0_gpio1;
27 gpio2 = &cp0_gpio2;
28 gpio3 = &cp1_gpio1;
29 gpio4 = &cp1_gpio2;
30 gpio5 = &cp2_gpio1;
31 gpio6 = &cp2_gpio2;
32 ethernet0 = &cp0_eth0;
33 ethernet1 = &cp0_eth1;
34 ethernet2 = &cp0_eth2;
35 ethernet3 = &cp1_eth0;
36 ethernet4 = &cp1_eth1;
37 ethernet5 = &cp1_eth2;
38 ethernet6 = &cp2_eth0;
39 ethernet7 = &cp2_eth1;
40 ethernet8 = &cp2_eth2;
41 spi1 = &cp0_spi0;
42 spi2 = &cp0_spi1;
43 led-boot = &led_power;
44 led-failsafe = &led_info;
45 led-running = &led_power;
46 led-upgrade = &led_info;
47 };
48
49 memory@00000000 {
50 device_type = "memory";
51 reg = <0x0 0x0 0x0 0x80000000>;
52 };
53
54 gpio_keys {
55 compatible = "gpio-keys";
56
57 reset {
58 label = "Reset";
59 linux,code = <KEY_RESTART>;
60 gpios = <&cp0_gpio2 4 GPIO_ACTIVE_LOW>;
61 };
62 };
63
64 cp2_reg_usb3_vbus0: cp2_usb3_vbus@0 {
65 compatible = "regulator-fixed";
66 regulator-name = "cp2-xhci0-vbus";
67 regulator-min-microvolt = <5000000>;
68 regulator-max-microvolt = <5000000>;
69 enable-active-high;
70 gpio = <&cp2_gpio1 2 GPIO_ACTIVE_HIGH>;
71 };
72
73 cp2_usb3_0_phy0: cp2_usb3_phy0 {
74 compatible = "usb-nop-xceiv";
75 vcc-supply = <&cp2_reg_usb3_vbus0>;
76 };
77
78 cp2_reg_usb3_vbus1: cp2_usb3_vbus@1 {
79 compatible = "regulator-fixed";
80 regulator-name = "cp2-xhci1-vbus";
81 regulator-min-microvolt = <5000000>;
82 regulator-max-microvolt = <5000000>;
83 enable-active-high;
84 gpio = <&cp2_gpio1 3 GPIO_ACTIVE_HIGH>;
85 };
86
87 cp2_usb3_0_phy1: cp2_usb3_phy1 {
88 compatible = "usb-nop-xceiv";
89 vcc-supply = <&cp2_reg_usb3_vbus1>;
90 };
91
92 cp2_sfp_eth0: sfp-eth0 {
93 compatible = "sff,sfp";
94 i2c-bus = <&cp2_sfpp0_i2c>;
95 los-gpio = <&cp2_module_expander1 11 GPIO_ACTIVE_HIGH>;
96 mod-def0-gpio = <&cp2_module_expander1 10 GPIO_ACTIVE_LOW>;
97 tx-disable-gpio = <&cp2_module_expander1 9 GPIO_ACTIVE_HIGH>;
98 tx-fault-gpio = <&cp2_module_expander1 8 GPIO_ACTIVE_HIGH>;
99 status = "disabled";
100 };
101 };
102
103 &uart0 {
104 status = "okay";
105 };
106
107 &cp0_uart0 {
108 status = "okay";
109
110 puzzle-mcu {
111 compatible = "iei,wt61p803-puzzle";
112 #address-cells = <1>;
113 #size-cells = <1>;
114 current-speed = <115200>;
115 enable-beep;
116 status = "okay";
117
118 leds {
119 compatible = "iei,wt61p803-puzzle-leds";
120 #address-cells = <1>;
121 #size-cells = <0>;
122 status = "okay";
123
124 led@0 {
125 reg = <0>;
126 label = "white:network";
127 active-low;
128 };
129
130 led@1 {
131 reg = <1>;
132 label = "green:cloud";
133 active-low;
134 };
135
136 led_info: led@2 {
137 reg = <2>;
138 label = "orange:info";
139 active-low;
140 };
141
142 led_power: led@3 {
143 reg = <3>;
144 label = "yellow:power";
145 active-low;
146 default-state = "on";
147 };
148 };
149
150 hwmon {
151 compatible = "iei,wt61p803-puzzle-hwmon";
152 #address-cells = <1>;
153 #size-cells = <0>;
154
155 chassis_fan_group0: fan-group@0 {
156 #cooling-cells = <2>;
157 reg = <0x00>;
158 cooling-levels = <80 102 170 230 255>;
159 };
160 };
161 };
162 };
163
164 &ap_thermal_ic {
165 PUZZLE_FAN_THERMAL(ic, &chassis_fan_group0);
166 };
167
168 &cp0_thermal_ic {
169 PUZZLE_FAN_THERMAL(cp0, &chassis_fan_group0);
170 };
171
172
173 /* on-board eMMC - U9 */
174 &ap_sdhci0 {
175 pinctrl-names = "default";
176 bus-width = <8>;
177 status = "okay";
178 mmc-ddr-1_8v;
179 mmc-hs400-1_8v;
180 };
181
182 &cp0_crypto {
183 status = "okay";
184 };
185
186 &cp0_xmdio {
187 status = "okay";
188 cp0_nbaset_phy0: ethernet-phy@0 {
189 compatible = "ethernet-phy-ieee802.3-c45";
190 reg = <2>;
191 };
192 cp0_nbaset_phy1: ethernet-phy@1 {
193 compatible = "ethernet-phy-ieee802.3-c45";
194 reg = <0>;
195 };
196 cp0_nbaset_phy2: ethernet-phy@2 {
197 compatible = "ethernet-phy-ieee802.3-c45";
198 reg = <8>;
199 };
200 };
201
202 &cp0_ethernet {
203 status = "okay";
204 };
205
206 /* SLM-1521-V2, CON9 */
207 &cp0_eth0 {
208 status = "okay";
209 phy-mode = "10gbase-kr";
210 phys = <&cp0_comphy2 0>;
211 phy = <&cp0_nbaset_phy0>;
212 };
213
214 &cp0_eth1 {
215 status = "okay";
216 phy-mode = "2500base-x";
217 phys = <&cp0_comphy4 1>;
218 phy = <&cp0_nbaset_phy1>;
219 };
220
221 &cp0_eth2 {
222 status = "okay";
223 phy-mode = "2500base-x";
224 phys = <&cp0_comphy1 2>;
225 phy = <&cp0_nbaset_phy2>;
226 };
227
228 &cp0_gpio1 {
229 status = "okay";
230 };
231
232 &cp0_gpio2 {
233 status = "okay";
234 };
235
236 &cp0_i2c0 {
237 pinctrl-names = "default";
238 pinctrl-0 = <&cp0_i2c0_pins>;
239 status = "okay";
240 clock-frequency = <100000>;
241 rtc@32 {
242 compatible = "epson,rx8130";
243 reg = <0x32>;
244 wakeup-source;
245 };
246 };
247
248 &cp0_i2c1 {
249 clock-frequency = <100000>;
250 };
251
252 /* SLM-1521-V2, CON6 */
253 &cp0_sata0 {
254 status = "okay";
255 sata-port@1 {
256 status = "okay";
257 phys = <&cp0_comphy0 1>;
258 };
259 };
260
261 &cp0_pcie2 {
262 status = "okay";
263 num-lanes = <1>;
264 num-viewport = <8>;
265 phys = <&cp0_comphy5 2>;
266 };
267
268 /* U55 */
269 &cp0_spi1 {
270 pinctrl-names = "default";
271 pinctrl-0 = <&cp0_spi0_pins>;
272 reg = <0x700680 0x50>, /* control */
273 <0x2000000 0x1000000>; /* CS0 */
274 status = "okay";
275 spi-flash@0 {
276 #address-cells = <0x1>;
277 #size-cells = <0x1>;
278 compatible = "jedec,spi-nor";
279 reg = <0x0>;
280 spi-max-frequency = <40000000>;
281 partitions {
282 compatible = "fixed-partitions";
283 #address-cells = <1>;
284 #size-cells = <1>;
285 partition@0 {
286 label = "U-Boot";
287 reg = <0x0 0x1f0000>;
288 };
289 partition@1f0000 {
290 label = "U-Boot ENV Factory";
291 reg = <0x1f0000 0x10000>;
292 };
293 partition@200000 {
294 label = "Reserved";
295 reg = <0x200000 0x1f0000>;
296 };
297 partition@3f0000 {
298 label = "U-Boot ENV";
299 reg = <0x3f0000 0x10000>;
300 };
301 };
302 };
303 };
304
305 &cp0_rtc {
306 status = "disabled";
307 };
308
309 &cp0_syscon0 {
310 cp0_pinctrl: pinctrl {
311 compatible = "marvell,cp115-standalone-pinctrl";
312 cp0_i2c0_pins: cp0-i2c-pins-0 {
313 marvell,pins = "mpp37", "mpp38";
314 marvell,function = "i2c0";
315 };
316 cp0_i2c1_pins: cp0-i2c-pins-1 {
317 marvell,pins = "mpp35", "mpp36";
318 marvell,function = "i2c1";
319 };
320 cp0_ge1_rgmii_pins: cp0-ge-rgmii-pins-0 {
321 marvell,pins = "mpp0", "mpp1", "mpp2",
322 "mpp3", "mpp4", "mpp5",
323 "mpp6", "mpp7", "mpp8",
324 "mpp9", "mpp10", "mpp11";
325 marvell,function = "ge0";
326 };
327 cp0_ge2_rgmii_pins: cp0-ge-rgmii-pins-1 {
328 marvell,pins = "mpp44", "mpp45", "mpp46",
329 "mpp47", "mpp48", "mpp49",
330 "mpp50", "mpp51", "mpp52",
331 "mpp53", "mpp54", "mpp55";
332 marvell,function = "ge1";
333 };
334 cp0_spi0_pins: cp0-spi-pins-0 {
335 marvell,pins = "mpp13", "mpp14", "mpp15", "mpp16";
336 marvell,function = "spi1";
337 };
338 };
339 };
340
341 &cp0_usb3_1 {
342 status = "okay";
343 phys = <&cp0_comphy3 1>;
344 phy-names = "usb";
345 };
346
347 /*
348 * Instantiate the first connected CP115
349 */
350
351 #define CP11X_NAME cp1
352 #define CP11X_BASE f4000000
353 #define CP11X_PCIEx_MEM_BASE(iface) (0xe2000000 + (iface * 0x1000000))
354 #define CP11X_PCIEx_MEM_SIZE(iface) 0xf00000
355 #define CP11X_PCIE0_BASE f4600000
356 #define CP11X_PCIE1_BASE f4620000
357 #define CP11X_PCIE2_BASE f4640000
358
359 #include "armada-cp115.dtsi"
360
361 #undef CP11X_NAME
362 #undef CP11X_BASE
363 #undef CP11X_PCIEx_MEM_BASE
364 #undef CP11X_PCIEx_MEM_SIZE
365 #undef CP11X_PCIE0_BASE
366 #undef CP11X_PCIE1_BASE
367 #undef CP11X_PCIE2_BASE
368
369 &cp1_crypto {
370 status = "okay";
371 };
372
373 &cp1_xmdio {
374 status = "okay";
375 cp1_nbaset_phy0: ethernet-phy@3 {
376 compatible = "ethernet-phy-ieee802.3-c45";
377 reg = <2>;
378 };
379 cp1_nbaset_phy1: ethernet-phy@4 {
380 compatible = "ethernet-phy-ieee802.3-c45";
381 reg = <0>;
382 };
383 cp1_nbaset_phy2: ethernet-phy@5 {
384 compatible = "ethernet-phy-ieee802.3-c45";
385 reg = <8>;
386 };
387 };
388
389 &cp1_ethernet {
390 status = "okay";
391 };
392
393 /* CON50 */
394 &cp1_eth0 {
395 status = "okay";
396 phy-mode = "10gbase-kr";
397 phys = <&cp1_comphy2 0>;
398 phy = <&cp1_nbaset_phy0>;
399 };
400
401 &cp1_eth1 {
402 status = "okay";
403 phy-mode = "2500base-x";
404 phys = <&cp1_comphy4 1>;
405 phy = <&cp1_nbaset_phy1>;
406 };
407
408 &cp1_eth2 {
409 status = "okay";
410 phy-mode = "2500base-x";
411 phys = <&cp1_comphy1 2>;
412 phy = <&cp1_nbaset_phy2>;
413 };
414
415 &cp1_gpio1 {
416 status = "okay";
417 };
418
419 &cp1_gpio2 {
420 status = "okay";
421 };
422
423 &cp1_i2c0 {
424 status = "okay";
425 pinctrl-names = "default";
426 pinctrl-0 = <&cp1_i2c0_pins>;
427 clock-frequency = <100000>;
428 };
429
430 &cp1_rtc {
431 status = "disabled";
432 };
433
434 &cp1_syscon0 {
435 cp1_pinctrl: pinctrl {
436 compatible = "marvell,cp115-standalone-pinctrl";
437 cp1_i2c0_pins: cp1-i2c-pins-0 {
438 marvell,pins = "mpp37", "mpp38";
439 marvell,function = "i2c0";
440 };
441 cp1_spi0_pins: cp1-spi-pins-0 {
442 marvell,pins = "mpp13", "mpp14", "mpp15", "mpp16";
443 marvell,function = "spi1";
444 };
445 cp1_xhci0_vbus_pins: cp1-xhci0-vbus-pins {
446 marvell,pins = "mpp3";
447 marvell,function = "gpio";
448 };
449 };
450 };
451
452 &cp1_thermal_ic {
453 PUZZLE_FAN_THERMAL(cp1, &chassis_fan_group0);
454 };
455
456 /*
457 * Instantiate the second connected CP115
458 */
459
460 #define CP11X_NAME cp2
461 #define CP11X_BASE f6000000
462 #define CP11X_PCIEx_MEM_BASE(iface) (0xe5000000 + (iface * 0x1000000))
463 #define CP11X_PCIEx_MEM_SIZE(iface) 0xf00000
464 #define CP11X_PCIE0_BASE f6600000
465 #define CP11X_PCIE1_BASE f6620000
466 #define CP11X_PCIE2_BASE f6640000
467
468 #include "armada-cp115.dtsi"
469
470 #undef CP11X_NAME
471 #undef CP11X_BASE
472 #undef CP11X_PCIEx_MEM_BASE
473 #undef CP11X_PCIEx_MEM_SIZE
474 #undef CP11X_PCIE0_BASE
475 #undef CP11X_PCIE1_BASE
476 #undef CP11X_PCIE2_BASE
477
478 &cp2_crypto {
479 status = "okay";
480 };
481
482 &cp2_ethernet {
483 status = "okay";
484 };
485
486 &cp2_xmdio {
487 status = "okay";
488 cp2_nbaset_phy0: ethernet-phy@6 {
489 compatible = "ethernet-phy-ieee802.3-c45";
490 reg = <2>;
491 };
492 cp2_nbaset_phy1: ethernet-phy@7 {
493 compatible = "ethernet-phy-ieee802.3-c45";
494 reg = <0>;
495 };
496 cp2_nbaset_phy2: ethernet-phy@8 {
497 compatible = "ethernet-phy-ieee802.3-c45";
498 reg = <8>;
499 };
500 };
501
502 /* SLM-1521-V2, CON9 */
503 &cp2_eth0 {
504 status = "okay";
505 phy-mode = "10gbase-kr";
506 phys = <&cp2_comphy2 0>;
507 phy = <&cp2_nbaset_phy0>;
508 };
509
510 &cp2_eth1 {
511 status = "okay";
512 phy-mode = "2500base-x";
513 phys = <&cp2_comphy4 1>;
514 phy = <&cp2_nbaset_phy1>;
515 };
516
517 &cp2_eth2 {
518 status = "okay";
519 phy-mode = "2500base-x";
520 phys = <&cp2_comphy1 2>;
521 phy = <&cp2_nbaset_phy2>;
522 };
523
524 &cp2_gpio1 {
525 status = "okay";
526 };
527
528 &cp2_gpio2 {
529 status = "okay";
530 };
531
532 &cp2_i2c0 {
533 clock-frequency = <100000>;
534 /* SLM-1521-V2 - U3 */
535 i2c-mux@72 {
536 compatible = "nxp,pca9544";
537 #address-cells = <1>;
538 #size-cells = <0>;
539 reg = <0x72>;
540 cp2_sfpp0_i2c: i2c@0 {
541 #address-cells = <1>;
542 #size-cells = <0>;
543 reg = <0>;
544 };
545
546 i2c@1 {
547 #address-cells = <1>;
548 #size-cells = <0>;
549 reg = <1>;
550 /* U12 */
551 cp2_module_expander1: pca9555@21 {
552 compatible = "nxp,pca9555";
553 pinctrl-names = "default";
554 gpio-controller;
555 #gpio-cells = <2>;
556 reg = <0x21>;
557 };
558 };
559 };
560 };
561
562 &cp2_rtc {
563 status = "disabled";
564 };
565
566 &cp2_syscon0 {
567 cp2_pinctrl: pinctrl {
568 compatible = "marvell,cp115-standalone-pinctrl";
569 cp2_i2c0_pins: cp2-i2c-pins-0 {
570 marvell,pins = "mpp37", "mpp38";
571 marvell,function = "i2c0";
572 };
573 };
574 };
575
576 &cp2_thermal_ic {
577 PUZZLE_FAN_THERMAL(cp2, &chassis_fan_group0);
578 };