xref: /linux/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4
5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/input/input.h>
7#include <dt-bindings/pinctrl/rockchip.h>
8#include <dt-bindings/leds/common.h>
9#include "rk3588s.dtsi"
10
11/ {
12	model = "Khadas Edge2";
13	compatible = "khadas,edge2", "rockchip,rk3588s";
14
15	aliases {
16		mmc0 = &sdhci;
17		mmc1 = &sdmmc;
18	};
19
20	chosen {
21		stdout-path = "serial2:1500000n8";
22	};
23
24	adc-keys {
25		compatible = "adc-keys";
26		io-channels = <&saradc 1>;
27		io-channel-names = "buttons";
28		keyup-threshold-microvolt = <1800000>;
29		poll-interval = <100>;
30
31		button-function {
32			label = "Function";
33			linux,code = <KEY_FN>;
34			press-threshold-microvolt = <17000>;
35		};
36	};
37
38	ir-receiver {
39		compatible = "gpio-ir-receiver";
40		gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_LOW>;
41		pinctrl-names = "default";
42		pinctrl-0 = <&ir_receiver_pin>;
43	};
44
45	leds {
46		compatible = "pwm-leds";
47
48		red_led: led-0 {
49			label = "red_led";
50			color = <LED_COLOR_ID_RED>;
51			default-state = "off";
52			function = LED_FUNCTION_INDICATOR;
53			linux,default-trigger = "none";
54			max-brightness = <255>;
55			pwms = <&pwm11 0 25000 0>;
56		};
57
58		green_led: led-1 {
59			label = "green_led";
60			color = <LED_COLOR_ID_GREEN>;
61			default-state = "on";
62			function = LED_FUNCTION_POWER;
63			linux,default-trigger = "default-on";
64			max-brightness = <255>;
65			pwms = <&pwm14 0 25000 0>;
66		};
67
68		blue_led: led-2 {
69			label = "blue_led";
70			color = <LED_COLOR_ID_BLUE>;
71			default-state = "off";
72			function = LED_FUNCTION_INDICATOR;
73			linux,default-trigger = "none";
74			max-brightness = <255>;
75			pwms = <&pwm15 0 25000 0>;
76		};
77	};
78
79	vcc3v3_pcie_wl: regulator-vcc3v3-pcie-wl {
80		compatible = "regulator-fixed";
81		enable-active-high;
82		gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
83		pinctrl-names = "default";
84		pinctrl-0 = <&pcie2_2_vcc3v3_en>;
85		regulator-name = "vcc3v3_pcie_wl";
86		regulator-min-microvolt = <3300000>;
87		regulator-max-microvolt = <3300000>;
88		startup-delay-us = <5000>;
89		vin-supply = <&vcc5v0_sys>;
90	};
91
92	vcc5v0_host: regulator-vcc5v0-host {
93		compatible = "regulator-fixed";
94		regulator-name = "vcc5v0_host";
95		regulator-boot-on;
96		regulator-always-on;
97		regulator-min-microvolt = <5000000>;
98		regulator-max-microvolt = <5000000>;
99		enable-active-high;
100		gpio = <&gpio1 RK_PB1 GPIO_ACTIVE_HIGH>;
101		pinctrl-names = "default";
102		pinctrl-0 = <&vcc5v0_host_en>;
103		vin-supply = <&vcc5v0_sys>;
104	};
105
106	vcc5v0_sys: regulator-vcc5v0-sys {
107		compatible = "regulator-fixed";
108		regulator-name = "vcc5v0_sys";
109		regulator-always-on;
110		regulator-boot-on;
111		regulator-min-microvolt = <5000000>;
112		regulator-max-microvolt = <5000000>;
113	};
114
115	vcc_1v1_nldo_s3: regulator-vcc-1v1-nldo-s3 {
116		compatible = "regulator-fixed";
117		regulator-name = "vcc_1v1_nldo_s3";
118		regulator-always-on;
119		regulator-boot-on;
120		regulator-min-microvolt = <1100000>;
121		regulator-max-microvolt = <1100000>;
122		vin-supply = <&vcc5v0_sys>;
123	};
124
125	vdd_3v3_sd: regulator-vdd-3v3-sd {
126		compatible = "regulator-fixed";
127		regulator-name = "vdd_3v3_sd";
128		gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
129		regulator-boot-on;
130		enable-active-high;
131		regulator-min-microvolt = <3300000>;
132		regulator-max-microvolt = <3300000>;
133		vin-supply = <&vcc_3v3_s3>;
134		pinctrl-names = "default";
135		pinctrl-0 = <&vdd_sd_en>;
136	};
137};
138
139&cpu_b0 {
140	cpu-supply = <&vdd_cpu_big0_s0>;
141};
142
143&cpu_b1 {
144	cpu-supply = <&vdd_cpu_big0_s0>;
145};
146
147&cpu_b2 {
148	cpu-supply = <&vdd_cpu_big1_s0>;
149};
150
151&cpu_b3 {
152	cpu-supply = <&vdd_cpu_big1_s0>;
153};
154
155&cpu_l0 {
156	cpu-supply = <&vdd_cpu_lit_s0>;
157};
158
159&cpu_l1 {
160	cpu-supply = <&vdd_cpu_lit_s0>;
161};
162
163&cpu_l2 {
164	cpu-supply = <&vdd_cpu_lit_s0>;
165};
166
167&cpu_l3 {
168	cpu-supply = <&vdd_cpu_lit_s0>;
169};
170
171&combphy0_ps {
172	status = "okay";
173};
174
175&combphy2_psu {
176	status = "okay";
177};
178
179&gpu {
180	mali-supply = <&vdd_gpu_s0>;
181	status = "okay";
182};
183
184&i2c0 {
185	pinctrl-names = "default";
186	pinctrl-0 = <&i2c0m2_xfer>;
187	status = "okay";
188
189	vdd_cpu_big0_s0: regulator@42 {
190		compatible = "rockchip,rk8602";
191		reg = <0x42>;
192		fcs,suspend-voltage-selector = <1>;
193		regulator-name = "vdd_cpu_big0_s0";
194		regulator-always-on;
195		regulator-boot-on;
196		regulator-min-microvolt = <550000>;
197		regulator-max-microvolt = <1050000>;
198		regulator-ramp-delay = <2300>;
199		vin-supply = <&vcc5v0_sys>;
200
201		regulator-state-mem {
202			regulator-off-in-suspend;
203		};
204	};
205
206	vdd_cpu_big1_s0: regulator@43 {
207		compatible = "rockchip,rk8603", "rockchip,rk8602";
208		reg = <0x43>;
209		fcs,suspend-voltage-selector = <1>;
210		regulator-name = "vdd_cpu_big1_s0";
211		regulator-always-on;
212		regulator-boot-on;
213		regulator-min-microvolt = <550000>;
214		regulator-max-microvolt = <1050000>;
215		regulator-ramp-delay = <2300>;
216		vin-supply = <&vcc5v0_sys>;
217
218		regulator-state-mem {
219			regulator-off-in-suspend;
220		};
221	};
222};
223
224&i2c2 {
225	status = "okay";
226
227	hym8563: rtc@51 {
228		compatible = "haoyu,hym8563";
229		reg = <0x51>;
230		#clock-cells = <0>;
231		clock-output-names = "hym8563";
232		wakeup-source;
233	};
234};
235
236&pinctrl {
237	vdd_sd {
238		vdd_sd_en: vdd-sd-en {
239			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
240		};
241	};
242
243	pcie2 {
244		pcie2_2_rst: pcie2-2-rst {
245			rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
246		};
247
248		pcie2_2_vcc3v3_en: pcie2-2-vcc-en {
249			rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
250		};
251	};
252
253	usb {
254		vcc5v0_host_en: vcc5v0-host-en {
255			rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
256		};
257	};
258
259	ir-receiver {
260		ir_receiver_pin: ir-receiver-pin {
261			rockchip,pins = <1  RK_PA7  RK_FUNC_GPIO  &pcfg_pull_none>;
262		};
263	};
264
265	wireless-bluetooth {
266		bt_reset_pin: bt-reset-pin {
267			rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
268		};
269
270		bt_wake_pin: bt-wake-pin {
271			rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
272		};
273
274		bt_wake_host_irq: bt-wake-host-irq {
275			rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
276		};
277	};
278};
279
280&pcie2x1l2 {
281	pinctrl-names = "default";
282	pinctrl-0 = <&pcie2_2_rst>;
283	reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
284	vpcie3v3-supply = <&vcc3v3_pcie_wl>;
285	status = "okay";
286
287	pcie@0,0 {
288		reg = <0x400000 0 0 0 0>;
289		#address-cells = <3>;
290		#size-cells = <2>;
291		ranges;
292		device_type = "pci";
293		bus-range = <0x40 0x4f>;
294
295		wifi: wifi@0,0 {
296			compatible = "pci14e4,449d";
297			reg = <0x410000 0 0 0 0>;
298			clocks = <&hym8563>;
299			clock-names = "lpo";
300		};
301	};
302};
303
304&pwm11 {
305	pinctrl-names = "default";
306	pinctrl-0 = <&pwm11m1_pins>;
307	status = "okay";
308};
309
310&pwm14 {
311	pinctrl-names = "default";
312	pinctrl-0 = <&pwm14m1_pins>;
313	status = "okay";
314};
315
316&pwm15 {
317	pinctrl-names = "default";
318	pinctrl-0 = <&pwm15m1_pins>;
319	status = "okay";
320};
321
322&saradc {
323	vref-supply = <&avcc_1v8_s0>;
324	status = "okay";
325};
326
327&sdhci {
328	bus-width = <8>;
329	no-sdio;
330	no-sd;
331	non-removable;
332	mmc-hs400-1_8v;
333	mmc-hs400-enhanced-strobe;
334	status = "okay";
335};
336
337&sdmmc {
338	bus-width = <4>;
339	cap-sd-highspeed;
340	disable-wp;
341	no-mmc;
342	no-sdio;
343	sd-uhs-sdr104;
344	vmmc-supply = <&vdd_3v3_sd>;
345	vqmmc-supply = <&vccio_sd_s0>;
346	status = "okay";
347};
348
349&sfc {
350	pinctrl-names = "default";
351	pinctrl-0 = <&fspim2_pins>;
352	status = "okay";
353
354	flash@0 {
355		compatible = "jedec,spi-nor";
356		reg = <0x0>;
357		spi-max-frequency = <100000000>;
358		spi-rx-bus-width = <4>;
359		spi-tx-bus-width = <1>;
360	};
361};
362
363&spi2 {
364	assigned-clocks = <&cru CLK_SPI2>;
365	assigned-clock-rates = <200000000>;
366	num-cs = <1>;
367	pinctrl-names = "default";
368	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
369	status = "okay";
370
371	pmic@0 {
372		compatible = "rockchip,rk806";
373		reg = <0x0>;
374		interrupt-parent = <&gpio0>;
375		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
376		pinctrl-names = "default";
377		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
378			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
379		spi-max-frequency = <1000000>;
380		system-power-controller;
381
382		vcc1-supply = <&vcc5v0_sys>;
383		vcc2-supply = <&vcc5v0_sys>;
384		vcc3-supply = <&vcc5v0_sys>;
385		vcc4-supply = <&vcc5v0_sys>;
386		vcc5-supply = <&vcc5v0_sys>;
387		vcc6-supply = <&vcc5v0_sys>;
388		vcc7-supply = <&vcc5v0_sys>;
389		vcc8-supply = <&vcc5v0_sys>;
390		vcc9-supply = <&vcc5v0_sys>;
391		vcc10-supply = <&vcc5v0_sys>;
392		vcc11-supply = <&vcc_2v0_pldo_s3>;
393		vcc12-supply = <&vcc5v0_sys>;
394		vcc13-supply = <&vcc_1v1_nldo_s3>;
395		vcc14-supply = <&vcc_1v1_nldo_s3>;
396		vcca-supply = <&vcc5v0_sys>;
397
398		gpio-controller;
399		#gpio-cells = <2>;
400
401		rk806_dvs1_null: dvs1-null-pins {
402			pins = "gpio_pwrctrl1";
403			function = "pin_fun0";
404		};
405
406		rk806_dvs2_null: dvs2-null-pins {
407			pins = "gpio_pwrctrl2";
408			function = "pin_fun0";
409		};
410
411		rk806_dvs3_null: dvs3-null-pins {
412			pins = "gpio_pwrctrl3";
413			function = "pin_fun0";
414		};
415
416		regulators {
417			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
418				regulator-boot-on;
419				regulator-enable-ramp-delay = <400>;
420				regulator-min-microvolt = <550000>;
421				regulator-max-microvolt = <950000>;
422				regulator-name = "vdd_gpu_s0";
423				regulator-ramp-delay = <12500>;
424
425				regulator-state-mem {
426					regulator-off-in-suspend;
427				};
428			};
429
430			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
431				regulator-always-on;
432				regulator-boot-on;
433				regulator-min-microvolt = <550000>;
434				regulator-max-microvolt = <950000>;
435				regulator-name = "vdd_cpu_lit_s0";
436				regulator-ramp-delay = <12500>;
437
438				regulator-state-mem {
439					regulator-off-in-suspend;
440				};
441			};
442
443			vdd_log_s0: dcdc-reg3 {
444				regulator-always-on;
445				regulator-boot-on;
446				regulator-min-microvolt = <675000>;
447				regulator-max-microvolt = <750000>;
448				regulator-name = "vdd_log_s0";
449				regulator-ramp-delay = <12500>;
450
451				regulator-state-mem {
452					regulator-off-in-suspend;
453					regulator-suspend-microvolt = <750000>;
454				};
455			};
456
457			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
458				regulator-always-on;
459				regulator-boot-on;
460				regulator-min-microvolt = <550000>;
461				regulator-max-microvolt = <950000>;
462				regulator-name = "vdd_vdenc_s0";
463				regulator-ramp-delay = <12500>;
464
465				regulator-state-mem {
466					regulator-off-in-suspend;
467				};
468			};
469
470			vdd_ddr_s0: dcdc-reg5 {
471				regulator-always-on;
472				regulator-boot-on;
473				regulator-min-microvolt = <675000>;
474				regulator-max-microvolt = <900000>;
475				regulator-name = "vdd_ddr_s0";
476				regulator-ramp-delay = <12500>;
477
478				regulator-state-mem {
479					regulator-off-in-suspend;
480					regulator-suspend-microvolt = <850000>;
481				};
482			};
483
484			vdd2_ddr_s3: dcdc-reg6 {
485				regulator-always-on;
486				regulator-boot-on;
487				regulator-name = "vdd2_ddr_s3";
488
489				regulator-state-mem {
490					regulator-on-in-suspend;
491				};
492			};
493
494			vcc_2v0_pldo_s3: dcdc-reg7 {
495				regulator-always-on;
496				regulator-boot-on;
497				regulator-min-microvolt = <2000000>;
498				regulator-max-microvolt = <2000000>;
499				regulator-name = "vdd_2v0_pldo_s3";
500				regulator-ramp-delay = <12500>;
501
502				regulator-state-mem {
503					regulator-on-in-suspend;
504					regulator-suspend-microvolt = <2000000>;
505				};
506			};
507
508			vcc_3v3_s3: dcdc-reg8 {
509				regulator-always-on;
510				regulator-boot-on;
511				regulator-min-microvolt = <3300000>;
512				regulator-max-microvolt = <3300000>;
513				regulator-name = "vcc_3v3_s3";
514
515				regulator-state-mem {
516					regulator-on-in-suspend;
517					regulator-suspend-microvolt = <3300000>;
518				};
519			};
520
521			vddq_ddr_s0: dcdc-reg9 {
522				regulator-always-on;
523				regulator-boot-on;
524				regulator-name = "vddq_ddr_s0";
525
526				regulator-state-mem {
527					regulator-off-in-suspend;
528				};
529			};
530
531			vcc_1v8_s3: dcdc-reg10 {
532				regulator-always-on;
533				regulator-boot-on;
534				regulator-min-microvolt = <1800000>;
535				regulator-max-microvolt = <1800000>;
536				regulator-name = "vcc_1v8_s3";
537
538				regulator-state-mem {
539					regulator-on-in-suspend;
540					regulator-suspend-microvolt = <1800000>;
541				};
542			};
543
544			avcc_1v8_s0: pldo-reg1 {
545				regulator-always-on;
546				regulator-boot-on;
547				regulator-min-microvolt = <1800000>;
548				regulator-max-microvolt = <1800000>;
549				regulator-name = "avcc_1v8_s0";
550
551				regulator-state-mem {
552					regulator-off-in-suspend;
553				};
554			};
555
556			vcc_1v8_s0: pldo-reg2 {
557				regulator-always-on;
558				regulator-boot-on;
559				regulator-min-microvolt = <1800000>;
560				regulator-max-microvolt = <1800000>;
561				regulator-name = "vcc_1v8_s0";
562
563				regulator-state-mem {
564					regulator-off-in-suspend;
565					regulator-suspend-microvolt = <1800000>;
566				};
567			};
568
569			avdd_1v2_s0: pldo-reg3 {
570				regulator-always-on;
571				regulator-boot-on;
572				regulator-min-microvolt = <1200000>;
573				regulator-max-microvolt = <1200000>;
574				regulator-name = "avdd_1v2_s0";
575
576				regulator-state-mem {
577					regulator-off-in-suspend;
578				};
579			};
580
581			vcc_3v3_s0: pldo-reg4 {
582				regulator-always-on;
583				regulator-boot-on;
584				regulator-min-microvolt = <3300000>;
585				regulator-max-microvolt = <3300000>;
586				regulator-ramp-delay = <12500>;
587				regulator-name = "vcc_3v3_s0";
588
589				regulator-state-mem {
590					regulator-off-in-suspend;
591				};
592			};
593
594			vccio_sd_s0: pldo-reg5 {
595				regulator-always-on;
596				regulator-boot-on;
597				regulator-min-microvolt = <1800000>;
598				regulator-max-microvolt = <3300000>;
599				regulator-ramp-delay = <12500>;
600				regulator-name = "vccio_sd_s0";
601
602				regulator-state-mem {
603					regulator-off-in-suspend;
604				};
605			};
606
607			pldo6_s3: pldo-reg6 {
608				regulator-always-on;
609				regulator-boot-on;
610				regulator-min-microvolt = <1800000>;
611				regulator-max-microvolt = <1800000>;
612				regulator-name = "pldo6_s3";
613
614				regulator-state-mem {
615					regulator-on-in-suspend;
616					regulator-suspend-microvolt = <1800000>;
617				};
618			};
619
620			vdd_0v75_s3: nldo-reg1 {
621				regulator-always-on;
622				regulator-boot-on;
623				regulator-min-microvolt = <750000>;
624				regulator-max-microvolt = <750000>;
625				regulator-name = "vdd_0v75_s3";
626
627				regulator-state-mem {
628					regulator-on-in-suspend;
629					regulator-suspend-microvolt = <750000>;
630				};
631			};
632
633			vdd_ddr_pll_s0: nldo-reg2 {
634				regulator-always-on;
635				regulator-boot-on;
636				regulator-min-microvolt = <850000>;
637				regulator-max-microvolt = <850000>;
638				regulator-name = "vdd_ddr_pll_s0";
639
640				regulator-state-mem {
641					regulator-off-in-suspend;
642					regulator-suspend-microvolt = <850000>;
643				};
644			};
645
646			avdd_0v75_s0: nldo-reg3 {
647				regulator-always-on;
648				regulator-boot-on;
649				regulator-min-microvolt = <750000>;
650				regulator-max-microvolt = <750000>;
651				regulator-name = "avdd_0v75_s0";
652
653				regulator-state-mem {
654					regulator-off-in-suspend;
655				};
656			};
657
658			vdd_0v85_s0: nldo-reg4 {
659				regulator-always-on;
660				regulator-boot-on;
661				regulator-min-microvolt = <850000>;
662				regulator-max-microvolt = <850000>;
663				regulator-name = "vdd_0v85_s0";
664
665				regulator-state-mem {
666					regulator-off-in-suspend;
667				};
668			};
669
670			vdd_0v75_s0: nldo-reg5 {
671				regulator-always-on;
672				regulator-boot-on;
673				regulator-min-microvolt = <750000>;
674				regulator-max-microvolt = <750000>;
675				regulator-name = "vdd_0v75_s0";
676
677				regulator-state-mem {
678					regulator-off-in-suspend;
679				};
680			};
681		};
682	};
683};
684
685&tsadc {
686	status = "okay";
687};
688
689&uart2 {
690	pinctrl-0 = <&uart2m0_xfer>;
691	status = "okay";
692};
693
694&uart9 {
695	pinctrl-names = "default";
696	pinctrl-0 = <&uart9m2_xfer &uart9m2_ctsn>;
697	status = "okay";
698};
699
700&u2phy2 {
701	status = "okay";
702};
703
704&u2phy2_host {
705	phy-supply = <&vcc5v0_host>;
706	status = "okay";
707};
708
709&u2phy3 {
710	status = "okay";
711};
712
713&u2phy3_host {
714	phy-supply = <&vcc5v0_host>;
715	status = "okay";
716};
717
718&usb_host0_ehci {
719	status = "okay";
720};
721
722&usb_host0_ohci {
723	status = "okay";
724};
725
726&usb_host1_ehci {
727	status = "okay";
728};
729
730&usb_host1_ohci {
731	status = "okay";
732};
733
734&usb_host2_xhci {
735	status = "okay";
736};
737