• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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	vcc_sys: vcc-sys {
120		compatible = "regulator-fixed";
121		regulator-name = "vcc_sys";
122		regulator-always-on;
123		regulator-boot-on;
124		regulator-min-microvolt = <5000000>;
125		regulator-max-microvolt = <5000000>;
126		vin-supply = <&dc_12v>;
127	};
128
129	vcc5v0_host: vcc5v0-host-regulator {
130		compatible = "regulator-fixed";
131		enable-active-high;
132		gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
133		pinctrl-names = "default";
134		pinctrl-0 = <&vcc5v0_host_en>;
135		regulator-name = "vcc5v0_host";
136		regulator-always-on;
137		vin-supply = <&vcc_sys>;
138	};
139
140	vdd_log: vdd-log {
141		compatible = "pwm-regulator";
142		pwms = <&pwm2 0 25000 1>;
143		regulator-name = "vdd_log";
144		regulator-always-on;
145		regulator-boot-on;
146		regulator-min-microvolt = <800000>;
147		regulator-max-microvolt = <1400000>;
148		vin-supply = <&vcc_sys>;
149	};
150};
151
152&cpu_l0 {
153	cpu-supply = <&vdd_cpu_l>;
154};
155
156&cpu_l1 {
157	cpu-supply = <&vdd_cpu_l>;
158};
159
160&cpu_l2 {
161	cpu-supply = <&vdd_cpu_l>;
162};
163
164&cpu_l3 {
165	cpu-supply = <&vdd_cpu_l>;
166};
167
168&cpu_b0 {
169	cpu-supply = <&vdd_cpu_b>;
170};
171
172&cpu_b1 {
173	cpu-supply = <&vdd_cpu_b>;
174};
175
176&emmc_phy {
177	status = "okay";
178};
179
180&gmac {
181	assigned-clocks = <&cru SCLK_RMII_SRC>;
182	assigned-clock-parents = <&clkin_gmac>;
183	clock_in_out = "input";
184	phy-supply = <&vcc_lan>;
185	phy-mode = "rgmii";
186	pinctrl-names = "default";
187	pinctrl-0 = <&rgmii_pins>;
188	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
189	snps,reset-active-low;
190	snps,reset-delays-us = <0 10000 50000>;
191	tx_delay = <0x28>;
192	rx_delay = <0x11>;
193	status = "okay";
194};
195
196&gpu {
197	mali-supply = <&vdd_gpu>;
198	status = "okay";
199};
200
201&hdmi {
202	ddc-i2c-bus = <&i2c3>;
203	status = "okay";
204};
205
206&hdmi_sound {
207	status = "okay";
208};
209
210&i2c0 {
211	clock-frequency = <400000>;
212	i2c-scl-rising-time-ns = <168>;
213	i2c-scl-falling-time-ns = <4>;
214	status = "okay";
215
216	rk808: pmic@1b {
217		compatible = "rockchip,rk808";
218		reg = <0x1b>;
219		interrupt-parent = <&gpio1>;
220		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
221		#clock-cells = <1>;
222		clock-output-names = "xin32k", "rk808-clkout2";
223		pinctrl-names = "default";
224		pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
225		rockchip,system-power-controller;
226		wakeup-source;
227
228		vcc1-supply = <&vcc_sys>;
229		vcc2-supply = <&vcc_sys>;
230		vcc3-supply = <&vcc_sys>;
231		vcc4-supply = <&vcc_sys>;
232		vcc6-supply = <&vcc_sys>;
233		vcc7-supply = <&vcc_sys>;
234		vcc8-supply = <&vcc3v3_sys>;
235		vcc9-supply = <&vcc_sys>;
236		vcc10-supply = <&vcc_sys>;
237		vcc11-supply = <&vcc_sys>;
238		vcc12-supply = <&vcc3v3_sys>;
239		vddio-supply = <&vcc1v8_pmu>;
240
241		regulators {
242			vdd_center: DCDC_REG1 {
243				regulator-name = "vdd_center";
244				regulator-always-on;
245				regulator-boot-on;
246				regulator-min-microvolt = <750000>;
247				regulator-max-microvolt = <1350000>;
248				regulator-ramp-delay = <6001>;
249				regulator-state-mem {
250					regulator-off-in-suspend;
251				};
252			};
253
254			vdd_cpu_l: DCDC_REG2 {
255				regulator-name = "vdd_cpu_l";
256				regulator-always-on;
257				regulator-boot-on;
258				regulator-min-microvolt = <750000>;
259				regulator-max-microvolt = <1350000>;
260				regulator-ramp-delay = <6001>;
261				regulator-state-mem {
262					regulator-off-in-suspend;
263				};
264			};
265
266			vcc_ddr: DCDC_REG3 {
267				regulator-name = "vcc_ddr";
268				regulator-always-on;
269				regulator-boot-on;
270				regulator-state-mem {
271					regulator-on-in-suspend;
272				};
273			};
274
275			vcc_1v8: DCDC_REG4 {
276				regulator-name = "vcc_1v8";
277				regulator-always-on;
278				regulator-boot-on;
279				regulator-min-microvolt = <1800000>;
280				regulator-max-microvolt = <1800000>;
281				regulator-state-mem {
282					regulator-on-in-suspend;
283					regulator-suspend-microvolt = <1800000>;
284				};
285			};
286
287			vcc1v8_dvp: LDO_REG1 {
288				regulator-name = "vcc1v8_dvp";
289				regulator-always-on;
290				regulator-boot-on;
291				regulator-min-microvolt = <1800000>;
292				regulator-max-microvolt = <1800000>;
293				regulator-state-mem {
294					regulator-off-in-suspend;
295				};
296			};
297
298			vcc3v0_tp: LDO_REG2 {
299				regulator-name = "vcc3v0_tp";
300				regulator-always-on;
301				regulator-boot-on;
302				regulator-min-microvolt = <3000000>;
303				regulator-max-microvolt = <3000000>;
304				regulator-state-mem {
305					regulator-off-in-suspend;
306				};
307			};
308
309			vcc1v8_pmu: LDO_REG3 {
310				regulator-name = "vcc1v8_pmu";
311				regulator-always-on;
312				regulator-boot-on;
313				regulator-min-microvolt = <1800000>;
314				regulator-max-microvolt = <1800000>;
315				regulator-state-mem {
316					regulator-on-in-suspend;
317					regulator-suspend-microvolt = <1800000>;
318				};
319			};
320
321			vcc_sdio: LDO_REG4 {
322				regulator-name = "vcc_sdio";
323				regulator-always-on;
324				regulator-boot-on;
325				regulator-min-microvolt = <1800000>;
326				regulator-max-microvolt = <3300000>;
327				regulator-state-mem {
328					regulator-on-in-suspend;
329					regulator-suspend-microvolt = <3000000>;
330				};
331			};
332
333			vcca3v0_codec: LDO_REG5 {
334				regulator-name = "vcca3v0_codec";
335				regulator-always-on;
336				regulator-boot-on;
337				regulator-min-microvolt = <3000000>;
338				regulator-max-microvolt = <3000000>;
339				regulator-state-mem {
340					regulator-off-in-suspend;
341				};
342			};
343
344			vcc_1v5: LDO_REG6 {
345				regulator-name = "vcc_1v5";
346				regulator-always-on;
347				regulator-boot-on;
348				regulator-min-microvolt = <1500000>;
349				regulator-max-microvolt = <1500000>;
350				regulator-state-mem {
351					regulator-on-in-suspend;
352					regulator-suspend-microvolt = <1500000>;
353				};
354			};
355
356			vcca1v8_codec: LDO_REG7 {
357				regulator-name = "vcca1v8_codec";
358				regulator-always-on;
359				regulator-boot-on;
360				regulator-min-microvolt = <1800000>;
361				regulator-max-microvolt = <1800000>;
362				regulator-state-mem {
363					regulator-off-in-suspend;
364				};
365			};
366
367			vcc_3v0: LDO_REG8 {
368				regulator-name = "vcc_3v0";
369				regulator-always-on;
370				regulator-boot-on;
371				regulator-min-microvolt = <3000000>;
372				regulator-max-microvolt = <3000000>;
373				regulator-state-mem {
374					regulator-on-in-suspend;
375					regulator-suspend-microvolt = <3000000>;
376				};
377			};
378
379			vcc3v3_s3: vcc_lan: SWITCH_REG1 {
380				regulator-name = "vcc3v3_s3";
381				regulator-always-on;
382				regulator-boot-on;
383				regulator-state-mem {
384					regulator-off-in-suspend;
385				};
386			};
387
388			vcc3v3_s0: SWITCH_REG2 {
389				regulator-name = "vcc3v3_s0";
390				regulator-always-on;
391				regulator-boot-on;
392				regulator-state-mem {
393					regulator-off-in-suspend;
394				};
395			};
396		};
397	};
398
399	vdd_cpu_b: regulator@40 {
400		compatible = "silergy,syr827";
401		reg = <0x40>;
402		fcs,suspend-voltage-selector = <1>;
403		regulator-name = "vdd_cpu_b";
404		regulator-min-microvolt = <712500>;
405		regulator-max-microvolt = <1500000>;
406		regulator-ramp-delay = <1000>;
407		regulator-always-on;
408		regulator-boot-on;
409		vin-supply = <&vcc_sys>;
410
411		regulator-state-mem {
412			regulator-off-in-suspend;
413		};
414	};
415
416	vdd_gpu: regulator@41 {
417		compatible = "silergy,syr828";
418		reg = <0x41>;
419		fcs,suspend-voltage-selector = <1>;
420		regulator-name = "vdd_gpu";
421		regulator-min-microvolt = <712500>;
422		regulator-max-microvolt = <1500000>;
423		regulator-ramp-delay = <1000>;
424		regulator-always-on;
425		regulator-boot-on;
426		vin-supply = <&vcc_sys>;
427
428		regulator-state-mem {
429			regulator-off-in-suspend;
430		};
431	};
432};
433
434&i2c3 {
435	i2c-scl-rising-time-ns = <450>;
436	i2c-scl-falling-time-ns = <15>;
437	status = "okay";
438};
439
440&i2s2 {
441	status = "okay";
442};
443
444&io_domains {
445	status = "okay";
446
447	bt656-supply = <&vcc_3v0>;
448	audio-supply = <&vcca1v8_codec>;
449	sdmmc-supply = <&vcc_sdio>;
450	gpio1830-supply = <&vcc_3v0>;
451};
452
453&pmu_io_domains {
454	pmu1830-supply = <&vcc_3v0>;
455	status = "okay";
456};
457
458&pinctrl {
459	buttons {
460		pwr_btn: pwr-btn {
461			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
462		};
463	};
464
465	pmic {
466		pmic_int_l: pmic-int-l {
467			rockchip,pins =
468				<1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
469		};
470
471		pmic_dvs2: pmic-dvs2 {
472			rockchip,pins =
473				<1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
474		};
475
476		vsel1_gpio: vsel1-gpio {
477			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
478		};
479
480		vsel2_gpio: vsel2-gpio {
481			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
482		};
483	};
484
485	sd {
486		sdmmc0_pwr_h: sdmmc0-pwr-h {
487			rockchip,pins =
488				<RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
489		};
490	};
491
492	usb2 {
493		vcc5v0_host_en: vcc5v0-host-en {
494			rockchip,pins =
495				<4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
496		};
497	};
498};
499
500&pwm0 {
501	status = "okay";
502};
503
504&pwm2 {
505	status = "okay";
506};
507
508&saradc {
509	vref-supply = <&vcca1v8_s3>;
510	status = "okay";
511};
512
513&sdhci {
514	bus-width = <8>;
515	mmc-hs400-1_8v;
516	mmc-hs400-enhanced-strobe;
517	non-removable;
518	status = "okay";
519};
520
521&sdmmc {
522	broken-cd;
523	bus-width = <4>;
524	cap-mmc-highspeed;
525	cap-sd-highspeed;
526	clock-frequency = <150000000>;
527	disable-wp;
528	max-frequency = <150000000>;
529	pinctrl-names = "default";
530	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
531	vmmc-supply = <&vcc3v0_sd>;
532	vqmmc-supply = <&vcc_sdio>;
533	status = "okay";
534};
535
536&tcphy0 {
537	status = "okay";
538};
539
540&tcphy1 {
541	status = "okay";
542};
543
544&tsadc {
545	/* tshut mode 0:CRU 1:GPIO */
546	rockchip,hw-tshut-mode = <1>;
547	/* tshut polarity 0:LOW 1:HIGH */
548	rockchip,hw-tshut-polarity = <1>;
549	status = "okay";
550};
551
552&u2phy0 {
553	status = "okay";
554
555	u2phy0_otg: otg-port {
556		status = "okay";
557	};
558
559	u2phy0_host: host-port {
560		phy-supply = <&vcc5v0_host>;
561		status = "okay";
562	};
563};
564
565&u2phy1 {
566	status = "okay";
567
568	u2phy1_otg: otg-port {
569		status = "okay";
570	};
571
572	u2phy1_host: host-port {
573		phy-supply = <&vcc5v0_host>;
574		status = "okay";
575	};
576};
577
578&uart0 {
579	pinctrl-names = "default";
580	pinctrl-0 = <&uart0_xfer &uart0_cts>;
581	status = "okay";
582};
583
584&uart2 {
585	status = "okay";
586};
587
588&usb_host0_ehci {
589	status = "okay";
590};
591
592&usb_host0_ohci {
593	status = "okay";
594};
595
596&usb_host1_ehci {
597	status = "okay";
598};
599
600&usb_host1_ohci {
601	status = "okay";
602};
603
604&usbdrd3_0 {
605	status = "okay";
606};
607
608&usbdrd_dwc3_0 {
609	status = "okay";
610	dr_mode = "otg";
611};
612
613&usbdrd3_1 {
614	status = "okay";
615};
616
617&usbdrd_dwc3_1 {
618	status = "okay";
619	dr_mode = "host";
620};
621
622&vopb {
623	status = "okay";
624};
625
626&vopb_mmu {
627	status = "okay";
628};
629
630&vopl {
631	status = "okay";
632};
633
634&vopl_mmu {
635	status = "okay";
636};
637