xref: /freebsd/sys/contrib/device-tree/src/arm64/rockchip/rk3588-friendlyelec-cm3588.dtsi (revision 9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
4 * Copyright (c) 2023 Thomas McKahan
5 * Copyright (c) 2024 Sebastian Kropatsch
6 *
7 */
8
9/dts-v1/;
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/leds/common.h>
13#include <dt-bindings/pinctrl/rockchip.h>
14#include "rk3588.dtsi"
15
16/ {
17	model = "FriendlyElec CM3588";
18	compatible = "friendlyarm,cm3588", "rockchip,rk3588";
19
20	aliases {
21		mmc0 = &sdhci;
22		mmc1 = &sdmmc;
23	};
24
25	chosen {
26		stdout-path = "serial2:1500000n8";
27	};
28
29	leds {
30		compatible = "gpio-leds";
31
32		led_sys: led-0 {
33			color = <LED_COLOR_ID_AMBER>;
34			function = LED_FUNCTION_HEARTBEAT;
35			gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
36			linux,default-trigger = "heartbeat";
37			pinctrl-names = "default";
38			pinctrl-0 = <&led_sys_pin>;
39		};
40
41		led_usr: led-1 {
42			color = <LED_COLOR_ID_GREEN>;
43			function = LED_FUNCTION_INDICATOR;
44			gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
45			pinctrl-names = "default";
46			pinctrl-0 = <&led_usr_pin>;
47		};
48	};
49
50	/* vcc_4v0_sys powers the RK806 and RK860's */
51	vcc_4v0_sys: regulator-vcc-4v0-sys {
52		compatible = "regulator-fixed";
53		regulator-name = "vcc_4v0_sys";
54		regulator-always-on;
55		regulator-boot-on;
56		regulator-min-microvolt = <4000000>;
57		regulator-max-microvolt = <4000000>;
58	};
59
60	vcc_3v3_pcie20: regulator-vcc-3v3-pcie20 {
61		compatible = "regulator-fixed";
62		regulator-name = "vcc_3v3_pcie20";
63		regulator-always-on;
64		regulator-boot-on;
65		regulator-min-microvolt = <3300000>;
66		regulator-max-microvolt = <3300000>;
67		vin-supply = <&vcc_3v3_s3>;
68	};
69
70	vcc_3v3_sd_s0: regulator-vcc-3v3-sd-s0 {
71		compatible = "regulator-fixed";
72		gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
73		pinctrl-names = "default";
74		pinctrl-0 = <&sd_s0_pwr>;
75		regulator-boot-on;
76		regulator-max-microvolt = <3300000>;
77		regulator-min-microvolt = <3300000>;
78		regulator-name = "vcc_3v3_sd_s0";
79		vin-supply = <&vcc_3v3_s3>;
80	};
81
82	vcc_1v1_nldo_s3: regulator-vcc-1v1-nldo-s3 {
83		compatible = "regulator-fixed";
84		regulator-name = "vcc-1v1-nldo-s3";
85		regulator-always-on;
86		regulator-boot-on;
87		regulator-min-microvolt = <1100000>;
88		regulator-max-microvolt = <1100000>;
89		vin-supply = <&vcc_4v0_sys>;
90	};
91};
92
93/* Combo PHY 0 is configured to act as as PCIe 2.0 PHY */
94/* Used by PCIe controller 4 (pcie2x1l2) */
95&combphy0_ps {
96	status = "okay";
97};
98
99&cpu_l0 {
100	cpu-supply = <&vdd_cpu_lit_s0>;
101};
102
103&cpu_l1 {
104	cpu-supply = <&vdd_cpu_lit_s0>;
105};
106
107&cpu_l2 {
108	cpu-supply = <&vdd_cpu_lit_s0>;
109};
110
111&cpu_l3 {
112	cpu-supply = <&vdd_cpu_lit_s0>;
113};
114
115&cpu_b0 {
116	cpu-supply = <&vdd_cpu_big0_s0>;
117};
118
119&cpu_b1 {
120	cpu-supply = <&vdd_cpu_big0_s0>;
121};
122
123&cpu_b2 {
124	cpu-supply = <&vdd_cpu_big1_s0>;
125};
126
127&cpu_b3 {
128	cpu-supply = <&vdd_cpu_big1_s0>;
129};
130
131&gpu {
132	mali-supply = <&vdd_gpu_s0>;
133	sram-supply = <&vdd_gpu_mem_s0>;
134	status = "okay";
135};
136
137&i2c0 {
138	pinctrl-names = "default";
139	pinctrl-0 = <&i2c0m2_xfer>;
140	status = "okay";
141
142	vdd_cpu_big0_s0: regulator@42 {
143		compatible = "rockchip,rk8602";
144		reg = <0x42>;
145		fcs,suspend-voltage-selector = <1>;
146		regulator-name = "vdd_cpu_big0_s0";
147		regulator-always-on;
148		regulator-boot-on;
149		regulator-min-microvolt = <550000>;
150		regulator-max-microvolt = <1050000>;
151		regulator-ramp-delay = <2300>;
152		vin-supply = <&vcc_4v0_sys>;
153
154		regulator-state-mem {
155			regulator-off-in-suspend;
156		};
157	};
158
159	vdd_cpu_big1_s0: regulator@43 {
160		compatible = "rockchip,rk8603", "rockchip,rk8602";
161		reg = <0x43>;
162		fcs,suspend-voltage-selector = <1>;
163		regulator-name = "vdd_cpu_big1_s0";
164		regulator-always-on;
165		regulator-boot-on;
166		regulator-min-microvolt = <550000>;
167		regulator-max-microvolt = <1050000>;
168		regulator-ramp-delay = <2300>;
169		vin-supply = <&vcc_4v0_sys>;
170
171		regulator-state-mem {
172			regulator-off-in-suspend;
173		};
174	};
175};
176
177&i2c2 {
178	status = "okay";
179
180	vdd_npu_s0: regulator@42 {
181		compatible = "rockchip,rk8602";
182		reg = <0x42>;
183		fcs,suspend-voltage-selector = <1>;
184		regulator-name = "vdd_npu_s0";
185		regulator-always-on;
186		regulator-boot-on;
187		regulator-min-microvolt = <550000>;
188		regulator-max-microvolt = <950000>;
189		regulator-ramp-delay = <2300>;
190		vin-supply = <&vcc_4v0_sys>;
191
192		regulator-state-mem {
193			regulator-off-in-suspend;
194		};
195	};
196};
197
198&i2c6 {
199	clock-frequency = <200000>;
200	pinctrl-names = "default";
201	pinctrl-0 = <&i2c6m0_xfer>;
202	status = "okay";
203
204	hym8563: rtc@51 {
205		compatible = "haoyu,hym8563";
206		reg = <0x51>;
207		#clock-cells = <0>;
208		clock-output-names = "hym8563";
209		interrupt-parent = <&gpio0>;
210		interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
211		pinctrl-names = "default";
212		pinctrl-0 = <&hym8563_int>;
213		wakeup-source;
214	};
215};
216
217&i2c7 {
218	clock-frequency = <200000>;
219	status = "okay";
220
221	rt5616: audio-codec@1b {
222		compatible = "realtek,rt5616";
223		reg = <0x1b>;
224		#sound-dai-cells = <0>;
225		assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
226		assigned-clock-rates = <12288000>;
227		clocks = <&cru I2S0_8CH_MCLKOUT>;
228		clock-names = "mclk";
229	};
230};
231
232&i2s0_8ch {
233	pinctrl-names = "default";
234	pinctrl-0 = <&i2s0_lrck
235				&i2s0_mclk
236				&i2s0_sclk
237				&i2s0_sdi0
238				&i2s0_sdo0>;
239	status = "okay";
240};
241
242&i2s5_8ch {
243	status = "okay";
244};
245
246&i2s6_8ch {
247	status = "okay";
248};
249
250&i2s7_8ch {
251	status = "okay";
252};
253
254&pcie2x1l2 {
255	/* r8125 ethernet, @fe190000 */
256	pinctrl-names = "default";
257	pinctrl-0 = <&pcie2_2_rst>;
258	reset-gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>;
259	vpcie3v3-supply = <&vcc_3v3_pcie20>;
260	status = "okay";
261};
262
263&pd_gpu {
264	domain-supply = <&vdd_gpu_s0>;
265};
266
267&pinctrl {
268	gpio-leds {
269		led_sys_pin: led-sys-pin {
270			rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
271		};
272
273		led_usr_pin: led-usr-pin {
274			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
275		};
276	};
277
278	hym8563 {
279		hym8563_int: rtc-int {
280			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
281		};
282	};
283
284	pcie {
285		pcie2_2_rst: pcie2-2-rst {
286			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
287		};
288	};
289
290	sdmmc {
291		sd_s0_pwr: sd-s0-pwr {
292			rockchip,pins = <4 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
293		};
294	};
295};
296
297&saradc {
298	vref-supply = <&avcc_1v8_s0>;
299	status = "okay";
300};
301
302/* eMMC */
303&sdhci {
304	bus-width = <8>;
305	mmc-hs400-1_8v;
306	mmc-hs400-enhanced-strobe;
307	no-sd;
308	no-sdio;
309	non-removable;
310	vmmc-supply = <&vcc_3v3_s3>;
311	vqmmc-supply = <&vcc_1v8_s3>;
312	status = "okay";
313};
314
315/* microSD card */
316&sdmmc {
317	bus-width = <4>;
318	cap-sd-highspeed;
319	disable-wp;
320	max-frequency = <150000000>;
321	no-mmc;
322	no-sdio;
323	sd-uhs-sdr104;
324	vmmc-supply = <&vcc_3v3_sd_s0>;
325	vqmmc-supply = <&vccio_sd_s0>;
326};
327
328&spi2 {
329	assigned-clocks = <&cru CLK_SPI2>;
330	assigned-clock-rates = <200000000>;
331	num-cs = <1>;
332	pinctrl-names = "default";
333	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
334	status = "okay";
335
336	rk806_single: pmic@0 {
337		compatible = "rockchip,rk806";
338		reg = <0x0>;
339
340		interrupt-parent = <&gpio0>;
341		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
342
343		pinctrl-names = "default";
344		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
345			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
346
347		spi-max-frequency = <1000000>;
348		system-power-controller;
349
350		vcc1-supply = <&vcc_4v0_sys>;
351		vcc2-supply = <&vcc_4v0_sys>;
352		vcc3-supply = <&vcc_4v0_sys>;
353		vcc4-supply = <&vcc_4v0_sys>;
354		vcc5-supply = <&vcc_4v0_sys>;
355		vcc6-supply = <&vcc_4v0_sys>;
356		vcc7-supply = <&vcc_4v0_sys>;
357		vcc8-supply = <&vcc_4v0_sys>;
358		vcc9-supply = <&vcc_4v0_sys>;
359		vcc10-supply = <&vcc_4v0_sys>;
360		vcc11-supply = <&vcc_2v0_pldo_s3>;
361		vcc12-supply = <&vcc_4v0_sys>;
362		vcc13-supply = <&vcc_1v1_nldo_s3>;
363		vcc14-supply = <&vcc_1v1_nldo_s3>;
364		vcca-supply = <&vcc_4v0_sys>;
365
366		gpio-controller;
367		#gpio-cells = <2>;
368
369		rk806_dvs1_null: dvs1-null-pins {
370			pins = "gpio_pwrctrl1";
371			function = "pin_fun0";
372		};
373
374		rk806_dvs2_null: dvs2-null-pins {
375			pins = "gpio_pwrctrl2";
376			function = "pin_fun0";
377		};
378
379		rk806_dvs3_null: dvs3-null-pins {
380			pins = "gpio_pwrctrl3";
381			function = "pin_fun0";
382		};
383
384		regulators {
385			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
386				regulator-boot-on;
387				regulator-min-microvolt = <550000>;
388				regulator-max-microvolt = <950000>;
389				regulator-ramp-delay = <12500>;
390				regulator-name = "vdd_gpu_s0";
391				regulator-enable-ramp-delay = <400>;
392
393				regulator-state-mem {
394					regulator-off-in-suspend;
395				};
396			};
397
398			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
399				regulator-always-on;
400				regulator-boot-on;
401				regulator-min-microvolt = <550000>;
402				regulator-max-microvolt = <950000>;
403				regulator-ramp-delay = <12500>;
404				regulator-name = "vdd_cpu_lit_s0";
405
406				regulator-state-mem {
407					regulator-off-in-suspend;
408				};
409			};
410
411			vdd_log_s0: dcdc-reg3 {
412				regulator-always-on;
413				regulator-boot-on;
414				regulator-min-microvolt = <675000>;
415				regulator-max-microvolt = <750000>;
416				regulator-ramp-delay = <12500>;
417				regulator-name = "vdd_log_s0";
418
419				regulator-state-mem {
420					regulator-off-in-suspend;
421					regulator-suspend-microvolt = <750000>;
422				};
423			};
424
425			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
426				regulator-always-on;
427				regulator-boot-on;
428				regulator-min-microvolt = <550000>;
429				regulator-max-microvolt = <950000>;
430				regulator-ramp-delay = <12500>;
431				regulator-name = "vdd_vdenc_s0";
432
433				regulator-state-mem {
434					regulator-off-in-suspend;
435				};
436			};
437
438			vdd_ddr_s0: dcdc-reg5 {
439				regulator-always-on;
440				regulator-boot-on;
441				regulator-min-microvolt = <675000>;
442				regulator-max-microvolt = <900000>;
443				regulator-ramp-delay = <12500>;
444				regulator-name = "vdd_ddr_s0";
445
446				regulator-state-mem {
447					regulator-off-in-suspend;
448					regulator-suspend-microvolt = <850000>;
449				};
450			};
451
452			vdd2_ddr_s3: dcdc-reg6 {
453				regulator-always-on;
454				regulator-boot-on;
455				regulator-name = "vdd2_ddr_s3";
456
457				regulator-state-mem {
458					regulator-on-in-suspend;
459				};
460			};
461
462			vcc_2v0_pldo_s3: dcdc-reg7 {
463				regulator-always-on;
464				regulator-boot-on;
465				regulator-min-microvolt = <2000000>;
466				regulator-max-microvolt = <2000000>;
467				regulator-ramp-delay = <12500>;
468				regulator-name = "vdd_2v0_pldo_s3";
469
470				regulator-state-mem {
471					regulator-on-in-suspend;
472					regulator-suspend-microvolt = <2000000>;
473				};
474			};
475
476			vcc_3v3_s3: dcdc-reg8 {
477				regulator-always-on;
478				regulator-boot-on;
479				regulator-min-microvolt = <3300000>;
480				regulator-max-microvolt = <3300000>;
481				regulator-name = "vcc_3v3_s3";
482
483				regulator-state-mem {
484					regulator-on-in-suspend;
485					regulator-suspend-microvolt = <3300000>;
486				};
487			};
488
489			vddq_ddr_s0: dcdc-reg9 {
490				regulator-always-on;
491				regulator-boot-on;
492				regulator-name = "vddq_ddr_s0";
493
494				regulator-state-mem {
495					regulator-off-in-suspend;
496				};
497			};
498
499			vcc_1v8_s3: dcdc-reg10 {
500				regulator-always-on;
501				regulator-boot-on;
502				regulator-min-microvolt = <1800000>;
503				regulator-max-microvolt = <1800000>;
504				regulator-name = "vcc_1v8_s3";
505
506				regulator-state-mem {
507					regulator-on-in-suspend;
508					regulator-suspend-microvolt = <1800000>;
509				};
510			};
511
512			avcc_1v8_s0: pldo-reg1 {
513				regulator-always-on;
514				regulator-boot-on;
515				regulator-min-microvolt = <1800000>;
516				regulator-max-microvolt = <1800000>;
517				regulator-name = "avcc_1v8_s0";
518
519				regulator-state-mem {
520					regulator-off-in-suspend;
521				};
522			};
523
524			vcc_1v8_s0: pldo-reg2 {
525				regulator-always-on;
526				regulator-boot-on;
527				regulator-min-microvolt = <1800000>;
528				regulator-max-microvolt = <1800000>;
529				regulator-name = "vcc_1v8_s0";
530
531				regulator-state-mem {
532					regulator-off-in-suspend;
533					regulator-suspend-microvolt = <1800000>;
534				};
535			};
536
537			avdd_1v2_s0: pldo-reg3 {
538				regulator-always-on;
539				regulator-boot-on;
540				regulator-min-microvolt = <1200000>;
541				regulator-max-microvolt = <1200000>;
542				regulator-name = "avdd_1v2_s0";
543
544				regulator-state-mem {
545					regulator-off-in-suspend;
546				};
547			};
548
549			vcc_3v3_s0: pldo-reg4 {
550				regulator-always-on;
551				regulator-boot-on;
552				regulator-min-microvolt = <3300000>;
553				regulator-max-microvolt = <3300000>;
554				regulator-ramp-delay = <12500>;
555				regulator-name = "vcc_3v3_s0";
556
557				regulator-state-mem {
558					regulator-off-in-suspend;
559				};
560			};
561
562			vccio_sd_s0: pldo-reg5 {
563				regulator-always-on;
564				regulator-boot-on;
565				regulator-min-microvolt = <1800000>;
566				regulator-max-microvolt = <3300000>;
567				regulator-ramp-delay = <12500>;
568				regulator-name = "vccio_sd_s0";
569
570				regulator-state-mem {
571					regulator-off-in-suspend;
572				};
573			};
574
575			pldo6_s3: pldo-reg6 {
576				regulator-always-on;
577				regulator-boot-on;
578				regulator-min-microvolt = <1800000>;
579				regulator-max-microvolt = <1800000>;
580				regulator-name = "pldo6_s3";
581
582				regulator-state-mem {
583					regulator-on-in-suspend;
584					regulator-suspend-microvolt = <1800000>;
585				};
586			};
587
588			vdd_0v75_s3: nldo-reg1 {
589				regulator-always-on;
590				regulator-boot-on;
591				regulator-min-microvolt = <750000>;
592				regulator-max-microvolt = <750000>;
593				regulator-name = "vdd_0v75_s3";
594
595				regulator-state-mem {
596					regulator-on-in-suspend;
597					regulator-suspend-microvolt = <750000>;
598				};
599			};
600
601			vdd_ddr_pll_s0: nldo-reg2 {
602				regulator-always-on;
603				regulator-boot-on;
604				regulator-min-microvolt = <850000>;
605				regulator-max-microvolt = <850000>;
606				regulator-name = "vdd_ddr_pll_s0";
607
608				regulator-state-mem {
609					regulator-off-in-suspend;
610					regulator-suspend-microvolt = <850000>;
611				};
612			};
613
614			avdd_0v75_s0: nldo-reg3 {
615				regulator-always-on;
616				regulator-boot-on;
617				regulator-min-microvolt = <750000>;
618				regulator-max-microvolt = <750000>;
619				regulator-name = "avdd_0v75_s0";
620
621				regulator-state-mem {
622					regulator-off-in-suspend;
623				};
624			};
625
626			vdd_0v85_s0: nldo-reg4 {
627				regulator-always-on;
628				regulator-boot-on;
629				regulator-min-microvolt = <850000>;
630				regulator-max-microvolt = <850000>;
631				regulator-name = "vdd_0v85_s0";
632
633				regulator-state-mem {
634					regulator-off-in-suspend;
635				};
636			};
637
638			vdd_0v75_s0: nldo-reg5 {
639				regulator-always-on;
640				regulator-boot-on;
641				regulator-min-microvolt = <750000>;
642				regulator-max-microvolt = <750000>;
643				regulator-name = "vdd_0v75_s0";
644
645				regulator-state-mem {
646					regulator-off-in-suspend;
647				};
648			};
649		};
650	};
651};
652
653&tsadc {
654	status = "okay";
655};
656
657/* Debug UART */
658&uart2 {
659	pinctrl-names = "default";
660	pinctrl-0 = <&uart2m0_xfer>;
661};
662