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