1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Collabora Ltd.
4 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd.
5 * Copyright (c) 2018 Linaro Ltd.
6 */
7
8#include "rk3399.dtsi"
9#include "rk3399-opp.dtsi"
10
11/ {
12	vcc1v8_s0: vcc1v8-s0 {
13		compatible = "regulator-fixed";
14		regulator-name = "vcc1v8_s0";
15		regulator-min-microvolt = <1800000>;
16		regulator-max-microvolt = <1800000>;
17		regulator-always-on;
18	};
19
20	vcc_sys: vcc-sys {
21		compatible = "regulator-fixed";
22		regulator-name = "vcc_sys";
23		regulator-min-microvolt = <5000000>;
24		regulator-max-microvolt = <5000000>;
25		regulator-always-on;
26	};
27
28	vcc3v3_sys: vcc3v3-sys {
29		compatible = "regulator-fixed";
30		regulator-name = "vcc3v3_sys";
31		regulator-min-microvolt = <3300000>;
32		regulator-max-microvolt = <3300000>;
33		regulator-always-on;
34		vin-supply = <&vcc_sys>;
35	};
36
37	vcc3v3_pcie: vcc3v3-pcie-regulator {
38		compatible = "regulator-fixed";
39		enable-active-high;
40		pinctrl-names = "default";
41		pinctrl-0 = <&pcie_drv>;
42		regulator-boot-on;
43		regulator-name = "vcc3v3_pcie";
44		regulator-min-microvolt = <3300000>;
45		regulator-max-microvolt = <3300000>;
46		vin-supply = <&vcc3v3_sys>;
47	};
48
49	vcc5v0_host: vcc5v0-host-regulator {
50		compatible = "regulator-fixed";
51		enable-active-high;
52		pinctrl-names = "default";
53		pinctrl-0 = <&host_vbus_drv>;
54		regulator-name = "vcc5v0_host";
55		regulator-min-microvolt = <5000000>;
56		regulator-max-microvolt = <5000000>;
57		regulator-always-on;
58		vin-supply = <&vcc_sys>;
59	};
60};
61
62&cpu_l0 {
63	cpu-supply = <&vdd_cpu_l>;
64};
65
66&cpu_l1 {
67	cpu-supply = <&vdd_cpu_l>;
68};
69
70&cpu_l2 {
71	cpu-supply = <&vdd_cpu_l>;
72};
73
74&cpu_l3 {
75	cpu-supply = <&vdd_cpu_l>;
76};
77
78&cpu_b0 {
79	cpu-supply = <&vdd_cpu_b>;
80};
81
82&cpu_b1 {
83	cpu-supply = <&vdd_cpu_b>;
84};
85
86&emmc_phy {
87	status = "okay";
88};
89
90&hdmi {
91	ddc-i2c-bus = <&i2c3>;
92	pinctrl-names = "default";
93	pinctrl-0 = <&hdmi_cec>;
94	status = "okay";
95};
96
97&hdmi_sound {
98	status = "okay";
99};
100
101&i2c0 {
102	clock-frequency = <400000>;
103	i2c-scl-rising-time-ns = <168>;
104	i2c-scl-falling-time-ns = <4>;
105	status = "okay";
106
107	vdd_cpu_b: regulator@40 {
108		compatible = "silergy,syr827";
109		reg = <0x40>;
110		fcs,suspend-voltage-selector = <1>;
111		regulator-name = "vdd_cpu_b";
112		regulator-min-microvolt = <712500>;
113		regulator-max-microvolt = <1500000>;
114		regulator-ramp-delay = <1000>;
115		regulator-always-on;
116		regulator-boot-on;
117		vin-supply = <&vcc_sys>;
118		status = "okay";
119
120		regulator-state-mem {
121			regulator-off-in-suspend;
122		};
123	};
124
125	vdd_gpu: regulator@41 {
126		compatible = "silergy,syr828";
127		reg = <0x41>;
128		fcs,suspend-voltage-selector = <1>;
129		regulator-name = "vdd_gpu";
130		regulator-min-microvolt = <712500>;
131		regulator-max-microvolt = <1500000>;
132		regulator-ramp-delay = <1000>;
133		regulator-always-on;
134		regulator-boot-on;
135		vin-supply = <&vcc_sys>;
136		regulator-state-mem {
137			regulator-off-in-suspend;
138		};
139	};
140
141	rk808: pmic@1b {
142		compatible = "rockchip,rk808";
143		reg = <0x1b>;
144		interrupt-parent = <&gpio1>;
145		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
146		pinctrl-names = "default";
147		pinctrl-0 = <&pmic_int_l>;
148		rockchip,system-power-controller;
149		wakeup-source;
150		#clock-cells = <1>;
151		clock-output-names = "xin32k", "rk808-clkout2";
152
153		vcc1-supply = <&vcc_sys>;
154		vcc2-supply = <&vcc_sys>;
155		vcc3-supply = <&vcc_sys>;
156		vcc4-supply = <&vcc_sys>;
157		vcc6-supply = <&vcc_sys>;
158		vcc7-supply = <&vcc_sys>;
159		vcc8-supply = <&vcc3v3_sys>;
160		vcc9-supply = <&vcc_sys>;
161		vcc10-supply = <&vcc_sys>;
162		vcc11-supply = <&vcc_sys>;
163		vcc12-supply = <&vcc3v3_sys>;
164		vddio-supply = <&vcc_1v8>;
165
166		regulators {
167			vdd_center: DCDC_REG1 {
168				regulator-name = "vdd_center";
169				regulator-min-microvolt = <750000>;
170				regulator-max-microvolt = <1350000>;
171				regulator-always-on;
172				regulator-boot-on;
173				regulator-state-mem {
174					regulator-off-in-suspend;
175				};
176			};
177
178			vdd_cpu_l: DCDC_REG2 {
179				regulator-name = "vdd_cpu_l";
180				regulator-min-microvolt = <750000>;
181				regulator-max-microvolt = <1350000>;
182				regulator-always-on;
183				regulator-boot-on;
184				regulator-state-mem {
185					regulator-off-in-suspend;
186				};
187			};
188
189			vcc_ddr: DCDC_REG3 {
190				regulator-name = "vcc_ddr";
191				regulator-always-on;
192				regulator-boot-on;
193				regulator-state-mem {
194					regulator-on-in-suspend;
195				};
196			};
197
198			vcc_1v8: DCDC_REG4 {
199				regulator-name = "vcc_1v8";
200				regulator-min-microvolt = <1800000>;
201				regulator-max-microvolt = <1800000>;
202				regulator-always-on;
203				regulator-boot-on;
204				regulator-state-mem {
205					regulator-on-in-suspend;
206					regulator-suspend-microvolt = <1800000>;
207				};
208			};
209
210			vcc1v8_dvp: LDO_REG1 {
211				regulator-name = "vcc1v8_dvp";
212				regulator-min-microvolt = <1800000>;
213				regulator-max-microvolt = <1800000>;
214				regulator-always-on;
215				regulator-boot-on;
216				regulator-state-mem {
217					regulator-on-in-suspend;
218					regulator-suspend-microvolt = <1800000>;
219				};
220			};
221
222			vcca1v8_hdmi: LDO_REG2 {
223				regulator-name = "vcca1v8_hdmi";
224				regulator-min-microvolt = <1800000>;
225				regulator-max-microvolt = <1800000>;
226				regulator-always-on;
227				regulator-boot-on;
228				regulator-state-mem {
229					regulator-on-in-suspend;
230					regulator-suspend-microvolt = <1800000>;
231				};
232			};
233
234			vcca_1v8: LDO_REG3 {
235				regulator-name = "vcca_1v8";
236				regulator-min-microvolt = <1800000>;
237				regulator-max-microvolt = <1800000>;
238				regulator-always-on;
239				regulator-boot-on;
240				regulator-state-mem {
241					regulator-on-in-suspend;
242					regulator-suspend-microvolt = <1800000>;
243				};
244			};
245
246			vcc_sd: LDO_REG4 {
247				regulator-name = "vcc_sd";
248				regulator-min-microvolt = <1800000>;
249				regulator-max-microvolt = <3300000>;
250				regulator-always-on;
251				regulator-boot-on;
252				regulator-state-mem {
253					regulator-on-in-suspend;
254					regulator-suspend-microvolt = <3300000>;
255				};
256			};
257
258			vcc3v0_sd: LDO_REG5 {
259				regulator-name = "vcc3v0_sd";
260				regulator-min-microvolt = <3000000>;
261				regulator-max-microvolt = <3000000>;
262				regulator-always-on;
263				regulator-boot-on;
264				regulator-state-mem {
265					regulator-on-in-suspend;
266					regulator-suspend-microvolt = <3000000>;
267				};
268			};
269
270			vcc_1v5: LDO_REG6 {
271				regulator-name = "vcc_1v5";
272				regulator-min-microvolt = <1500000>;
273				regulator-max-microvolt = <1500000>;
274				regulator-always-on;
275				regulator-boot-on;
276				regulator-state-mem {
277					regulator-on-in-suspend;
278					regulator-suspend-microvolt = <1500000>;
279				};
280			};
281
282			vcca0v9_hdmi: LDO_REG7 {
283				regulator-name = "vcca0v9_hdmi";
284				regulator-min-microvolt = <900000>;
285				regulator-max-microvolt = <900000>;
286				regulator-always-on;
287				regulator-boot-on;
288				regulator-state-mem {
289					regulator-on-in-suspend;
290					regulator-suspend-microvolt = <900000>;
291				};
292			};
293
294			vcc_3v0: LDO_REG8 {
295				regulator-name = "vcc_3v0";
296				regulator-min-microvolt = <3000000>;
297				regulator-max-microvolt = <3000000>;
298				regulator-always-on;
299				regulator-boot-on;
300				regulator-state-mem {
301					regulator-on-in-suspend;
302					regulator-suspend-microvolt = <3000000>;
303				};
304			};
305
306			vcc3v3_s3: SWITCH_REG1 {
307				regulator-name = "vcc3v3_s3";
308				regulator-always-on;
309				regulator-boot-on;
310				regulator-state-mem {
311					regulator-on-in-suspend;
312				};
313			};
314
315			vcc3v3_s0: SWITCH_REG2 {
316				regulator-name = "vcc3v3_s0";
317				regulator-always-on;
318				regulator-boot-on;
319				regulator-state-mem {
320					regulator-on-in-suspend;
321				};
322			};
323		};
324	};
325};
326
327&i2c1 {
328	status = "okay";
329};
330
331&i2c2 {
332	status = "okay";
333};
334
335&i2c3 {
336	status = "okay";
337};
338
339&i2c4 {
340	status = "okay";
341};
342
343&i2s2 {
344        status = "okay";
345};
346
347&io_domains {
348	bt656-supply = <&vcc1v8_s0>; /* bt656_gpio2ab_ms */
349	audio-supply = <&vcc1v8_s0>; /* audio_gpio3d4a_ms */
350	sdmmc-supply = <&vcc_sd>; /* sdmmc_gpio4b_ms */
351	gpio1830-supply = <&vcc_3v0>; /* gpio1833_gpio4cd_ms */
352	status = "okay";
353};
354
355&pcie_phy {
356	status = "okay";
357};
358
359&pcie0 {
360	num-lanes = <4>;
361	pinctrl-names = "default";
362	pinctrl-0 = <&pcie_clkreqn_cpm>;
363	vpcie3v3-supply = <&vcc3v3_pcie>;
364	status = "okay";
365};
366
367&pmu_io_domains {
368	pmu1830-supply = <&vcc_1v8>;
369	status = "okay";
370};
371
372&pinctrl {
373	sdmmc {
374		sdmmc_bus1: sdmmc-bus1 {
375			rockchip,pins =
376				<4 8 RK_FUNC_1 &pcfg_pull_up_8ma>;
377		};
378
379		sdmmc_bus4: sdmmc-bus4 {
380			rockchip,pins =
381				<4 8 RK_FUNC_1 &pcfg_pull_up_8ma>,
382				<4 9 RK_FUNC_1 &pcfg_pull_up_8ma>,
383				<4 10 RK_FUNC_1 &pcfg_pull_up_8ma>,
384				<4 11 RK_FUNC_1 &pcfg_pull_up_8ma>;
385		};
386
387		sdmmc_clk: sdmmc-clk {
388			rockchip,pins =
389				<4 12 RK_FUNC_1 &pcfg_pull_none_18ma>;
390		};
391
392		sdmmc_cmd: sdmmc-cmd {
393			rockchip,pins =
394				<4 13 RK_FUNC_1 &pcfg_pull_up_8ma>;
395		};
396	};
397
398	pmic {
399		pmic_int_l: pmic-int-l {
400			rockchip,pins =
401				<1 21 RK_FUNC_GPIO &pcfg_pull_up>;
402		};
403
404		vsel1_gpio: vsel1-gpio {
405			rockchip,pins =
406				<1 17 RK_FUNC_GPIO &pcfg_pull_down>;
407		};
408
409		vsel2_gpio: vsel2-gpio {
410			rockchip,pins =
411				<1 14 RK_FUNC_GPIO &pcfg_pull_down>;
412		};
413	};
414};
415
416&pwm2 {
417	status = "okay";
418};
419
420&pwm3 {
421	status = "okay";
422};
423
424&sdhci {
425	bus-width = <8>;
426	mmc-hs400-1_8v;
427	mmc-hs400-enhanced-strobe;
428	non-removable;
429	status = "okay";
430};
431
432&sdmmc {
433	bus-width = <4>;
434	cap-mmc-highspeed;
435	cap-sd-highspeed;
436	clock-frequency = <100000000>;
437	clock-freq-min-max = <100000 100000000>;
438	cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
439	disable-wp;
440	sd-uhs-sdr104;
441	vqmmc-supply = <&vcc_sd>;
442	card-detect-delay = <800>;
443	pinctrl-names = "default";
444	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
445	status = "okay";
446};
447
448&uart0 {
449	pinctrl-names = "default";
450	pinctrl-0 = <&uart0_xfer &uart0_cts>;
451	status = "okay";
452};
453
454&uart2 {
455	status = "okay";
456};
457
458&tcphy0 {
459	status = "okay";
460};
461
462&tcphy1 {
463	status = "okay";
464};
465
466&u2phy0 {
467	status = "okay";
468};
469
470&u2phy1 {
471	status = "okay";
472};
473
474&u2phy0_host {
475	phy-supply = <&vcc5v0_host>;
476	status = "okay";
477};
478
479&u2phy1_host {
480	phy-supply = <&vcc5v0_host>;
481	status = "okay";
482};
483
484&u2phy0_otg {
485	status = "okay";
486};
487
488&u2phy1_otg {
489	status = "okay";
490};
491
492&usb_host0_ehci {
493	status = "okay";
494};
495
496&usb_host0_ohci {
497	status = "okay";
498};
499
500&usb_host1_ehci {
501	status = "okay";
502};
503
504&usb_host1_ohci {
505	status = "okay";
506};
507
508&usbdrd3_0 {
509	status = "okay";
510};
511
512&usbdrd_dwc3_0 {
513	status = "okay";
514};
515
516&usbdrd3_1 {
517	status = "okay";
518};
519
520&usbdrd_dwc3_1 {
521	status = "okay";
522};
523
524&vopb {
525	status = "okay";
526};
527
528&vopb_mmu {
529	status = "okay";
530};
531
532&vopl {
533	status = "okay";
534};
535
536&vopl_mmu {
537	status = "okay";
538};
539