xref: /openbmc/linux/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts (revision 05cf4fe738242183f1237f1b3a28b4479348c0a1)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
4 * Copyright (c) 2018 Akash Gajjar <Akash_Gajjar@mentor.com>
5 */
6
7/dts-v1/;
8#include <dt-bindings/input/linux-event-codes.h>
9#include <dt-bindings/pwm/pwm.h>
10#include "rk3399.dtsi"
11#include "rk3399-opp.dtsi"
12
13/ {
14	model = "Pine64 RockPro64";
15	compatible = "pine64,rockpro64", "rockchip,rk3399";
16
17	chosen {
18		stdout-path = "serial2:1500000n8";
19	};
20
21	clkin_gmac: external-gmac-clock {
22		compatible = "fixed-clock";
23		clock-frequency = <125000000>;
24		clock-output-names = "clkin_gmac";
25		#clock-cells = <0>;
26	};
27
28	dc_12v: dc-12v {
29		compatible = "regulator-fixed";
30		regulator-name = "dc_12v";
31		regulator-always-on;
32		regulator-boot-on;
33		regulator-min-microvolt = <12000000>;
34		regulator-max-microvolt = <12000000>;
35	};
36
37	gpio-keys {
38		compatible = "gpio-keys";
39		autorepeat;
40		pinctrl-names = "default";
41		pinctrl-0 = <&pwrbtn>;
42
43		power {
44			debounce-interval = <100>;
45			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
46			label = "GPIO Key Power";
47			linux,code = <KEY_POWER>;
48			wakeup-source;
49		};
50	};
51
52	leds {
53		compatible = "gpio-leds";
54		pinctrl-names = "default";
55		pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>;
56
57		work-led {
58			label = "work";
59			default-state = "on";
60			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
61		};
62
63		diy-led {
64			label = "diy";
65			default-state = "off";
66			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
67		};
68	};
69
70	sdio_pwrseq: sdio-pwrseq {
71		compatible = "mmc-pwrseq-simple";
72		clocks = <&rk808 1>;
73		clock-names = "ext_clock";
74		pinctrl-names = "default";
75		pinctrl-0 = <&wifi_enable_h>;
76
77		/*
78		 * On the module itself this is one of these (depending
79		 * on the actual card populated):
80		 * - SDIO_RESET_L_WL_REG_ON
81		 * - PDN (power down when low)
82		 */
83		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
84	};
85
86	/* switched by pmic_sleep */
87	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
88		compatible = "regulator-fixed";
89		regulator-name = "vcc1v8_s3";
90		regulator-always-on;
91		regulator-boot-on;
92		regulator-min-microvolt = <1800000>;
93		regulator-max-microvolt = <1800000>;
94		vin-supply = <&vcc_1v8>;
95	};
96
97	vcc3v3_pcie: vcc3v3-pcie-regulator {
98		compatible = "regulator-fixed";
99		enable-active-high;
100		gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
101		pinctrl-names = "default";
102		pinctrl-0 = <&pcie_pwr_en>;
103		regulator-name = "vcc3v3_pcie";
104		regulator-always-on;
105		regulator-boot-on;
106		vin-supply = <&dc_12v>;
107	};
108
109	vcc3v3_sys: vcc3v3-sys {
110		compatible = "regulator-fixed";
111		regulator-name = "vcc3v3_sys";
112		regulator-always-on;
113		regulator-boot-on;
114		regulator-min-microvolt = <3300000>;
115		regulator-max-microvolt = <3300000>;
116		vin-supply = <&vcc_sys>;
117	};
118
119	/* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
120	vcc5v0_host: vcc5v0-host-regulator {
121		compatible = "regulator-fixed";
122		enable-active-high;
123		gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
124		pinctrl-names = "default";
125		pinctrl-0 = <&vcc5v0_host_en>;
126		regulator-name = "vcc5v0_host";
127		regulator-always-on;
128		vin-supply = <&vcc_sys>;
129	};
130
131	vcc5v0_typec: vcc5v0-typec-regulator {
132		compatible = "regulator-fixed";
133		enable-active-high;
134		gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
135		pinctrl-names = "default";
136		pinctrl-0 = <&vcc5v0_typec_en>;
137		regulator-name = "vcc5v0_typec";
138		regulator-always-on;
139		vin-supply = <&vcc_sys>;
140	};
141
142	vcc_sys: vcc-sys {
143		compatible = "regulator-fixed";
144		regulator-name = "vcc_sys";
145		regulator-always-on;
146		regulator-boot-on;
147		regulator-min-microvolt = <5000000>;
148		regulator-max-microvolt = <5000000>;
149		vin-supply = <&dc_12v>;
150	};
151
152	vdd_log: vdd-log {
153		compatible = "pwm-regulator";
154		pwms = <&pwm2 0 25000 1>;
155		regulator-name = "vdd_log";
156		regulator-always-on;
157		regulator-boot-on;
158		regulator-min-microvolt = <800000>;
159		regulator-max-microvolt = <1400000>;
160		vin-supply = <&vcc_sys>;
161	};
162};
163
164&cpu_l0 {
165	cpu-supply = <&vdd_cpu_l>;
166};
167
168&cpu_l1 {
169	cpu-supply = <&vdd_cpu_l>;
170};
171
172&cpu_l2 {
173	cpu-supply = <&vdd_cpu_l>;
174};
175
176&cpu_l3 {
177	cpu-supply = <&vdd_cpu_l>;
178};
179
180&cpu_b0 {
181	cpu-supply = <&vdd_cpu_b>;
182};
183
184&cpu_b1 {
185	cpu-supply = <&vdd_cpu_b>;
186};
187
188&emmc_phy {
189	status = "okay";
190};
191
192&gmac {
193	assigned-clocks = <&cru SCLK_RMII_SRC>;
194	assigned-clock-parents = <&clkin_gmac>;
195	clock_in_out = "input";
196	phy-supply = <&vcc_lan>;
197	phy-mode = "rgmii";
198	pinctrl-names = "default";
199	pinctrl-0 = <&rgmii_pins>;
200	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
201	snps,reset-active-low;
202	snps,reset-delays-us = <0 10000 50000>;
203	tx_delay = <0x28>;
204	rx_delay = <0x11>;
205	status = "okay";
206};
207
208&i2c0 {
209	clock-frequency = <400000>;
210	i2c-scl-rising-time-ns = <168>;
211	i2c-scl-falling-time-ns = <4>;
212	status = "okay";
213
214	rk808: pmic@1b {
215		compatible = "rockchip,rk808";
216		reg = <0x1b>;
217		interrupt-parent = <&gpio1>;
218		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
219		#clock-cells = <1>;
220		clock-output-names = "xin32k", "rk808-clkout2";
221		pinctrl-names = "default";
222		pinctrl-0 = <&pmic_int_l>;
223		rockchip,system-power-controller;
224		wakeup-source;
225
226		vcc1-supply = <&vcc_sys>;
227		vcc2-supply = <&vcc_sys>;
228		vcc3-supply = <&vcc_sys>;
229		vcc4-supply = <&vcc_sys>;
230		vcc6-supply = <&vcc_sys>;
231		vcc7-supply = <&vcc_sys>;
232		vcc8-supply = <&vcc3v3_sys>;
233		vcc9-supply = <&vcc_sys>;
234		vcc10-supply = <&vcc_sys>;
235		vcc11-supply = <&vcc_sys>;
236		vcc12-supply = <&vcc3v3_sys>;
237		vddio-supply = <&vcc1v8_pmu>;
238
239		regulators {
240			vdd_center: DCDC_REG1 {
241				regulator-name = "vdd_center";
242				regulator-always-on;
243				regulator-boot-on;
244				regulator-min-microvolt = <750000>;
245				regulator-max-microvolt = <1350000>;
246				regulator-ramp-delay = <6001>;
247				regulator-state-mem {
248					regulator-off-in-suspend;
249				};
250			};
251
252			vdd_cpu_l: DCDC_REG2 {
253				regulator-name = "vdd_cpu_l";
254				regulator-always-on;
255				regulator-boot-on;
256				regulator-min-microvolt = <750000>;
257				regulator-max-microvolt = <1350000>;
258				regulator-ramp-delay = <6001>;
259				regulator-state-mem {
260					regulator-off-in-suspend;
261				};
262			};
263
264			vcc_ddr: DCDC_REG3 {
265				regulator-name = "vcc_ddr";
266				regulator-always-on;
267				regulator-boot-on;
268				regulator-state-mem {
269					regulator-on-in-suspend;
270				};
271			};
272
273			vcc_1v8: DCDC_REG4 {
274				regulator-name = "vcc_1v8";
275				regulator-always-on;
276				regulator-boot-on;
277				regulator-min-microvolt = <1800000>;
278				regulator-max-microvolt = <1800000>;
279				regulator-state-mem {
280					regulator-on-in-suspend;
281					regulator-suspend-microvolt = <1800000>;
282				};
283			};
284
285			vcc1v8_dvp: LDO_REG1 {
286				regulator-name = "vcc1v8_dvp";
287				regulator-always-on;
288				regulator-boot-on;
289				regulator-min-microvolt = <1800000>;
290				regulator-max-microvolt = <1800000>;
291				regulator-state-mem {
292					regulator-off-in-suspend;
293				};
294			};
295
296			vcc2v8_dvp: LDO_REG2 {
297				regulator-name = "vcc2v8_dvp";
298				regulator-always-on;
299				regulator-boot-on;
300				regulator-min-microvolt = <2800000>;
301				regulator-max-microvolt = <2800000>;
302				regulator-state-mem {
303					regulator-off-in-suspend;
304				};
305			};
306
307			vcc1v8_pmu: LDO_REG3 {
308				regulator-name = "vcc1v8_pmu";
309				regulator-always-on;
310				regulator-boot-on;
311				regulator-min-microvolt = <1800000>;
312				regulator-max-microvolt = <1800000>;
313				regulator-state-mem {
314					regulator-on-in-suspend;
315					regulator-suspend-microvolt = <1800000>;
316				};
317			};
318
319			vcc_sdio: LDO_REG4 {
320				regulator-name = "vcc_sdio";
321				regulator-always-on;
322				regulator-boot-on;
323				regulator-min-microvolt = <1800000>;
324				regulator-max-microvolt = <3000000>;
325				regulator-state-mem {
326					regulator-on-in-suspend;
327					regulator-suspend-microvolt = <3000000>;
328				};
329			};
330
331			vcca3v0_codec: LDO_REG5 {
332				regulator-name = "vcca3v0_codec";
333				regulator-always-on;
334				regulator-boot-on;
335				regulator-min-microvolt = <3000000>;
336				regulator-max-microvolt = <3000000>;
337				regulator-state-mem {
338					regulator-off-in-suspend;
339				};
340			};
341
342			vcc_1v5: LDO_REG6 {
343				regulator-name = "vcc_1v5";
344				regulator-always-on;
345				regulator-boot-on;
346				regulator-min-microvolt = <1500000>;
347				regulator-max-microvolt = <1500000>;
348				regulator-state-mem {
349					regulator-on-in-suspend;
350					regulator-suspend-microvolt = <1500000>;
351				};
352			};
353
354			vcca1v8_codec: LDO_REG7 {
355				regulator-name = "vcca1v8_codec";
356				regulator-always-on;
357				regulator-boot-on;
358				regulator-min-microvolt = <1800000>;
359				regulator-max-microvolt = <1800000>;
360				regulator-state-mem {
361					regulator-off-in-suspend;
362				};
363			};
364
365			vcc_3v0: LDO_REG8 {
366				regulator-name = "vcc_3v0";
367				regulator-always-on;
368				regulator-boot-on;
369				regulator-min-microvolt = <3000000>;
370				regulator-max-microvolt = <3000000>;
371				regulator-state-mem {
372					regulator-on-in-suspend;
373					regulator-suspend-microvolt = <3000000>;
374				};
375			};
376
377			vcc3v3_s3: vcc_lan: SWITCH_REG1 {
378				regulator-name = "vcc3v3_s3";
379				regulator-always-on;
380				regulator-boot-on;
381				regulator-state-mem {
382					regulator-off-in-suspend;
383				};
384			};
385
386			vcc3v3_s0: SWITCH_REG2 {
387				regulator-name = "vcc3v3_s0";
388				regulator-always-on;
389				regulator-boot-on;
390				regulator-state-mem {
391					regulator-off-in-suspend;
392				};
393			};
394		};
395	};
396
397	vdd_cpu_b: regulator@40 {
398		compatible = "silergy,syr827";
399		reg = <0x40>;
400		fcs,suspend-voltage-selector = <0>;
401		regulator-name = "vdd_cpu_b";
402		regulator-min-microvolt = <712500>;
403		regulator-max-microvolt = <1500000>;
404		regulator-ramp-delay = <1000>;
405		regulator-always-on;
406		regulator-boot-on;
407		vin-supply = <&vcc_sys>;
408
409		regulator-state-mem {
410			regulator-off-in-suspend;
411		};
412	};
413
414	vdd_gpu: regulator@41 {
415		compatible = "silergy,syr828";
416		reg = <0x41>;
417		fcs,suspend-voltage-selector = <1>;
418		regulator-name = "vdd_gpu";
419		regulator-min-microvolt = <712500>;
420		regulator-max-microvolt = <1500000>;
421		regulator-ramp-delay = <1000>;
422		regulator-always-on;
423		regulator-boot-on;
424		vin-supply = <&vcc_sys>;
425
426		regulator-state-mem {
427			regulator-off-in-suspend;
428		};
429	};
430};
431
432&i2c1 {
433	i2c-scl-rising-time-ns = <300>;
434	i2c-scl-falling-time-ns = <15>;
435	status = "okay";
436};
437
438&i2c3 {
439	i2c-scl-rising-time-ns = <450>;
440	i2c-scl-falling-time-ns = <15>;
441	status = "okay";
442};
443
444&i2c4 {
445	i2c-scl-rising-time-ns = <600>;
446	i2c-scl-falling-time-ns = <20>;
447	status = "okay";
448
449	fusb0: typec-portc@22 {
450		compatible = "fcs,fusb302";
451		reg = <0x22>;
452		interrupt-parent = <&gpio1>;
453		interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
454		pinctrl-names = "default";
455		pinctrl-0 = <&fusb0_int>;
456		vbus-supply = <&vcc5v0_typec>;
457		status = "okay";
458	};
459};
460
461&i2s0 {
462	rockchip,playback-channels = <8>;
463	rockchip,capture-channels = <8>;
464	status = "okay";
465};
466
467&i2s1 {
468	rockchip,playback-channels = <2>;
469	rockchip,capture-channels = <2>;
470	status = "okay";
471};
472
473&i2s2 {
474	status = "okay";
475};
476
477&io_domains {
478	status = "okay";
479
480	bt656-supply = <&vcc1v8_dvp>;
481	audio-supply = <&vcca1v8_codec>;
482	sdmmc-supply = <&vcc_sdio>;
483	gpio1830-supply = <&vcc_3v0>;
484};
485
486&pmu_io_domains {
487	pmu1830-supply = <&vcc_3v0>;
488	status = "okay";
489};
490
491&pinctrl {
492	buttons {
493		pwrbtn: pwrbtn {
494			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
495		};
496	};
497
498	fusb302x {
499		fusb0_int: fusb0-int {
500			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
501		};
502	};
503
504	leds {
505		work_led_gpio: work_led-gpio {
506			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
507		};
508
509		diy_led_gpio: diy_led-gpio {
510			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
511		};
512	};
513
514	lcd-panel {
515		lcd_panel_reset: lcd-panel-reset {
516			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
517		};
518	};
519
520	pcie {
521		pcie_pwr_en: pcie-pwr-en {
522			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
523		};
524	};
525
526	pmic {
527		pmic_int_l: pmic-int-l {
528			rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
529		};
530
531		vsel1_gpio: vsel1-gpio {
532			rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
533		};
534
535		vsel2_gpio: vsel2-gpio {
536			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
537		};
538	};
539
540	sdio-pwrseq {
541		wifi_enable_h: wifi-enable-h {
542			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
543		};
544	};
545
546	usb-typec {
547		vcc5v0_typec_en: vcc5v0_typec_en {
548			rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
549		};
550	};
551
552	usb2 {
553		vcc5v0_host_en: vcc5v0-host-en {
554			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
555		};
556	};
557};
558
559&pwm0 {
560	status = "okay";
561};
562
563&pwm2 {
564	status = "okay";
565};
566
567&saradc {
568	vref-supply = <&vcca1v8_s3>;
569	status = "okay";
570};
571
572&sdmmc {
573	bus-width = <4>;
574	cap-mmc-highspeed;
575	cap-sd-highspeed;
576	cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
577	disable-wp;
578	max-frequency = <150000000>;
579	pinctrl-names = "default";
580	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
581	status = "okay";
582};
583
584&sdhci {
585	bus-width = <8>;
586	mmc-hs400-1_8v;
587	mmc-hs400-enhanced-strobe;
588	non-removable;
589	status = "okay";
590};
591
592&tcphy0 {
593	status = "okay";
594};
595
596&tcphy1 {
597	status = "okay";
598};
599
600&tsadc {
601	/* tshut mode 0:CRU 1:GPIO */
602	rockchip,hw-tshut-mode = <1>;
603	/* tshut polarity 0:LOW 1:HIGH */
604	rockchip,hw-tshut-polarity = <1>;
605	status = "okay";
606};
607
608&u2phy0 {
609	status = "okay";
610
611	u2phy0_otg: otg-port {
612		status = "okay";
613	};
614
615	u2phy0_host: host-port {
616		phy-supply = <&vcc5v0_host>;
617		status = "okay";
618	};
619};
620
621&u2phy1 {
622	status = "okay";
623
624	u2phy1_otg: otg-port {
625		status = "okay";
626	};
627
628	u2phy1_host: host-port {
629		phy-supply = <&vcc5v0_host>;
630		status = "okay";
631	};
632};
633
634&uart0 {
635	pinctrl-names = "default";
636	pinctrl-0 = <&uart0_xfer &uart0_cts>;
637	status = "okay";
638};
639
640&uart2 {
641	status = "okay";
642};
643
644&usb_host0_ehci {
645	status = "okay";
646};
647
648&usb_host0_ohci {
649	status = "okay";
650};
651
652&usb_host1_ehci {
653	status = "okay";
654};
655
656&usb_host1_ohci {
657	status = "okay";
658};
659
660&usbdrd3_0 {
661	status = "okay";
662};
663
664&usbdrd_dwc3_0 {
665	status = "okay";
666	dr_mode = "otg";
667};
668
669&usbdrd3_1 {
670	status = "okay";
671};
672
673&usbdrd_dwc3_1 {
674	status = "okay";
675	dr_mode = "host";
676};
677
678&vopb {
679	status = "okay";
680};
681
682&vopb_mmu {
683	status = "okay";
684};
685
686&vopl {
687	status = "okay";
688};
689
690&vopl_mmu {
691	status = "okay";
692};
693