xref: /linux/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts (revision d53b8e36925256097a08d7cb749198d85cbf9b2b)
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: vcc3v3-pcie-wl-regulator {
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: vcc5v0-host-regulator {
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: vcc5v0-sys-regulator {
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: vcc-1v1-nldo-s3-regulator {
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: vdd-3v3-sd-regulator {
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
288&pwm11 {
289	pinctrl-names = "default";
290	pinctrl-0 = <&pwm11m1_pins>;
291	status = "okay";
292};
293
294&pwm14 {
295	pinctrl-names = "default";
296	pinctrl-0 = <&pwm14m1_pins>;
297	status = "okay";
298};
299
300&pwm15 {
301	pinctrl-names = "default";
302	pinctrl-0 = <&pwm15m1_pins>;
303	status = "okay";
304};
305
306&saradc {
307	vref-supply = <&avcc_1v8_s0>;
308	status = "okay";
309};
310
311&sdhci {
312	bus-width = <8>;
313	no-sdio;
314	no-sd;
315	non-removable;
316	mmc-hs400-1_8v;
317	mmc-hs400-enhanced-strobe;
318	status = "okay";
319};
320
321&sdmmc {
322	bus-width = <4>;
323	cap-sd-highspeed;
324	disable-wp;
325	no-mmc;
326	no-sdio;
327	sd-uhs-sdr104;
328	vmmc-supply = <&vdd_3v3_sd>;
329	vqmmc-supply = <&vccio_sd_s0>;
330	status = "okay";
331};
332
333&sfc {
334	pinctrl-names = "default";
335	pinctrl-0 = <&fspim2_pins>;
336	status = "okay";
337
338	flash@0 {
339		compatible = "jedec,spi-nor";
340		reg = <0x0>;
341		spi-max-frequency = <100000000>;
342		spi-rx-bus-width = <4>;
343		spi-tx-bus-width = <1>;
344	};
345};
346
347&spi2 {
348	assigned-clocks = <&cru CLK_SPI2>;
349	assigned-clock-rates = <200000000>;
350	num-cs = <1>;
351	pinctrl-names = "default";
352	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
353	status = "okay";
354
355	pmic@0 {
356		compatible = "rockchip,rk806";
357		reg = <0x0>;
358		interrupt-parent = <&gpio0>;
359		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
360		pinctrl-names = "default";
361		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
362			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
363		spi-max-frequency = <1000000>;
364		system-power-controller;
365
366		vcc1-supply = <&vcc5v0_sys>;
367		vcc2-supply = <&vcc5v0_sys>;
368		vcc3-supply = <&vcc5v0_sys>;
369		vcc4-supply = <&vcc5v0_sys>;
370		vcc5-supply = <&vcc5v0_sys>;
371		vcc6-supply = <&vcc5v0_sys>;
372		vcc7-supply = <&vcc5v0_sys>;
373		vcc8-supply = <&vcc5v0_sys>;
374		vcc9-supply = <&vcc5v0_sys>;
375		vcc10-supply = <&vcc5v0_sys>;
376		vcc11-supply = <&vcc_2v0_pldo_s3>;
377		vcc12-supply = <&vcc5v0_sys>;
378		vcc13-supply = <&vcc_1v1_nldo_s3>;
379		vcc14-supply = <&vcc_1v1_nldo_s3>;
380		vcca-supply = <&vcc5v0_sys>;
381
382		gpio-controller;
383		#gpio-cells = <2>;
384
385		rk806_dvs1_null: dvs1-null-pins {
386			pins = "gpio_pwrctrl1";
387			function = "pin_fun0";
388		};
389
390		rk806_dvs2_null: dvs2-null-pins {
391			pins = "gpio_pwrctrl2";
392			function = "pin_fun0";
393		};
394
395		rk806_dvs3_null: dvs3-null-pins {
396			pins = "gpio_pwrctrl3";
397			function = "pin_fun0";
398		};
399
400		regulators {
401			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
402				regulator-boot-on;
403				regulator-enable-ramp-delay = <400>;
404				regulator-min-microvolt = <550000>;
405				regulator-max-microvolt = <950000>;
406				regulator-name = "vdd_gpu_s0";
407				regulator-ramp-delay = <12500>;
408
409				regulator-state-mem {
410					regulator-off-in-suspend;
411				};
412			};
413
414			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
415				regulator-always-on;
416				regulator-boot-on;
417				regulator-min-microvolt = <550000>;
418				regulator-max-microvolt = <950000>;
419				regulator-name = "vdd_cpu_lit_s0";
420				regulator-ramp-delay = <12500>;
421
422				regulator-state-mem {
423					regulator-off-in-suspend;
424				};
425			};
426
427			vdd_log_s0: dcdc-reg3 {
428				regulator-always-on;
429				regulator-boot-on;
430				regulator-min-microvolt = <675000>;
431				regulator-max-microvolt = <750000>;
432				regulator-name = "vdd_log_s0";
433				regulator-ramp-delay = <12500>;
434
435				regulator-state-mem {
436					regulator-off-in-suspend;
437					regulator-suspend-microvolt = <750000>;
438				};
439			};
440
441			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
442				regulator-always-on;
443				regulator-boot-on;
444				regulator-min-microvolt = <550000>;
445				regulator-max-microvolt = <950000>;
446				regulator-name = "vdd_vdenc_s0";
447				regulator-ramp-delay = <12500>;
448
449				regulator-state-mem {
450					regulator-off-in-suspend;
451				};
452			};
453
454			vdd_ddr_s0: dcdc-reg5 {
455				regulator-always-on;
456				regulator-boot-on;
457				regulator-min-microvolt = <675000>;
458				regulator-max-microvolt = <900000>;
459				regulator-name = "vdd_ddr_s0";
460				regulator-ramp-delay = <12500>;
461
462				regulator-state-mem {
463					regulator-off-in-suspend;
464					regulator-suspend-microvolt = <850000>;
465				};
466			};
467
468			vdd2_ddr_s3: dcdc-reg6 {
469				regulator-always-on;
470				regulator-boot-on;
471				regulator-name = "vdd2_ddr_s3";
472
473				regulator-state-mem {
474					regulator-on-in-suspend;
475				};
476			};
477
478			vcc_2v0_pldo_s3: dcdc-reg7 {
479				regulator-always-on;
480				regulator-boot-on;
481				regulator-min-microvolt = <2000000>;
482				regulator-max-microvolt = <2000000>;
483				regulator-name = "vdd_2v0_pldo_s3";
484				regulator-ramp-delay = <12500>;
485
486				regulator-state-mem {
487					regulator-on-in-suspend;
488					regulator-suspend-microvolt = <2000000>;
489				};
490			};
491
492			vcc_3v3_s3: dcdc-reg8 {
493				regulator-always-on;
494				regulator-boot-on;
495				regulator-min-microvolt = <3300000>;
496				regulator-max-microvolt = <3300000>;
497				regulator-name = "vcc_3v3_s3";
498
499				regulator-state-mem {
500					regulator-on-in-suspend;
501					regulator-suspend-microvolt = <3300000>;
502				};
503			};
504
505			vddq_ddr_s0: dcdc-reg9 {
506				regulator-always-on;
507				regulator-boot-on;
508				regulator-name = "vddq_ddr_s0";
509
510				regulator-state-mem {
511					regulator-off-in-suspend;
512				};
513			};
514
515			vcc_1v8_s3: dcdc-reg10 {
516				regulator-always-on;
517				regulator-boot-on;
518				regulator-min-microvolt = <1800000>;
519				regulator-max-microvolt = <1800000>;
520				regulator-name = "vcc_1v8_s3";
521
522				regulator-state-mem {
523					regulator-on-in-suspend;
524					regulator-suspend-microvolt = <1800000>;
525				};
526			};
527
528			avcc_1v8_s0: pldo-reg1 {
529				regulator-always-on;
530				regulator-boot-on;
531				regulator-min-microvolt = <1800000>;
532				regulator-max-microvolt = <1800000>;
533				regulator-name = "avcc_1v8_s0";
534
535				regulator-state-mem {
536					regulator-off-in-suspend;
537				};
538			};
539
540			vcc_1v8_s0: pldo-reg2 {
541				regulator-always-on;
542				regulator-boot-on;
543				regulator-min-microvolt = <1800000>;
544				regulator-max-microvolt = <1800000>;
545				regulator-name = "vcc_1v8_s0";
546
547				regulator-state-mem {
548					regulator-off-in-suspend;
549					regulator-suspend-microvolt = <1800000>;
550				};
551			};
552
553			avdd_1v2_s0: pldo-reg3 {
554				regulator-always-on;
555				regulator-boot-on;
556				regulator-min-microvolt = <1200000>;
557				regulator-max-microvolt = <1200000>;
558				regulator-name = "avdd_1v2_s0";
559
560				regulator-state-mem {
561					regulator-off-in-suspend;
562				};
563			};
564
565			vcc_3v3_s0: pldo-reg4 {
566				regulator-always-on;
567				regulator-boot-on;
568				regulator-min-microvolt = <3300000>;
569				regulator-max-microvolt = <3300000>;
570				regulator-ramp-delay = <12500>;
571				regulator-name = "vcc_3v3_s0";
572
573				regulator-state-mem {
574					regulator-off-in-suspend;
575				};
576			};
577
578			vccio_sd_s0: pldo-reg5 {
579				regulator-always-on;
580				regulator-boot-on;
581				regulator-min-microvolt = <1800000>;
582				regulator-max-microvolt = <3300000>;
583				regulator-ramp-delay = <12500>;
584				regulator-name = "vccio_sd_s0";
585
586				regulator-state-mem {
587					regulator-off-in-suspend;
588				};
589			};
590
591			pldo6_s3: pldo-reg6 {
592				regulator-always-on;
593				regulator-boot-on;
594				regulator-min-microvolt = <1800000>;
595				regulator-max-microvolt = <1800000>;
596				regulator-name = "pldo6_s3";
597
598				regulator-state-mem {
599					regulator-on-in-suspend;
600					regulator-suspend-microvolt = <1800000>;
601				};
602			};
603
604			vdd_0v75_s3: nldo-reg1 {
605				regulator-always-on;
606				regulator-boot-on;
607				regulator-min-microvolt = <750000>;
608				regulator-max-microvolt = <750000>;
609				regulator-name = "vdd_0v75_s3";
610
611				regulator-state-mem {
612					regulator-on-in-suspend;
613					regulator-suspend-microvolt = <750000>;
614				};
615			};
616
617			vdd_ddr_pll_s0: nldo-reg2 {
618				regulator-always-on;
619				regulator-boot-on;
620				regulator-min-microvolt = <850000>;
621				regulator-max-microvolt = <850000>;
622				regulator-name = "vdd_ddr_pll_s0";
623
624				regulator-state-mem {
625					regulator-off-in-suspend;
626					regulator-suspend-microvolt = <850000>;
627				};
628			};
629
630			avdd_0v75_s0: nldo-reg3 {
631				regulator-always-on;
632				regulator-boot-on;
633				regulator-min-microvolt = <750000>;
634				regulator-max-microvolt = <750000>;
635				regulator-name = "avdd_0v75_s0";
636
637				regulator-state-mem {
638					regulator-off-in-suspend;
639				};
640			};
641
642			vdd_0v85_s0: nldo-reg4 {
643				regulator-always-on;
644				regulator-boot-on;
645				regulator-min-microvolt = <850000>;
646				regulator-max-microvolt = <850000>;
647				regulator-name = "vdd_0v85_s0";
648
649				regulator-state-mem {
650					regulator-off-in-suspend;
651				};
652			};
653
654			vdd_0v75_s0: nldo-reg5 {
655				regulator-always-on;
656				regulator-boot-on;
657				regulator-min-microvolt = <750000>;
658				regulator-max-microvolt = <750000>;
659				regulator-name = "vdd_0v75_s0";
660
661				regulator-state-mem {
662					regulator-off-in-suspend;
663				};
664			};
665		};
666	};
667};
668
669&tsadc {
670	status = "okay";
671};
672
673&uart2 {
674	pinctrl-0 = <&uart2m0_xfer>;
675	status = "okay";
676};
677
678&uart9 {
679	pinctrl-names = "default";
680	pinctrl-0 = <&uart9m2_xfer &uart9m2_ctsn>;
681	status = "okay";
682};
683
684&u2phy2 {
685	status = "okay";
686};
687
688&u2phy2_host {
689	phy-supply = <&vcc5v0_host>;
690	status = "okay";
691};
692
693&u2phy3 {
694	status = "okay";
695};
696
697&u2phy3_host {
698	phy-supply = <&vcc5v0_host>;
699	status = "okay";
700};
701
702&usb_host0_ehci {
703	status = "okay";
704};
705
706&usb_host0_ohci {
707	status = "okay";
708};
709
710&usb_host1_ehci {
711	status = "okay";
712};
713
714&usb_host1_ohci {
715	status = "okay";
716};
717
718&usb_host2_xhci {
719	status = "okay";
720};
721