1// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3/dts-v1/;
4#include <dt-bindings/gpio/gpio.h>
5#include <dt-bindings/input/input.h>
6#include <dt-bindings/leds/common.h>
7#include <dt-bindings/pinctrl/rockchip.h>
8#include <dt-bindings/soc/rockchip,vop2.h>
9#include "rk3568.dtsi"
10
11/ {
12	chosen: chosen {
13		stdout-path = "serial2:1500000n8";
14	};
15
16	gpio-keys {
17		compatible = "gpio-keys";
18		pinctrl-names = "default";
19		pinctrl-0 = <&reset_button_pin>;
20
21		button-reset {
22			debounce-interval = <50>;
23			gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
24			label = "reset";
25			linux,code = <KEY_RESTART>;
26		};
27	};
28
29	gpio-leds {
30		compatible = "gpio-leds";
31		pinctrl-names = "default";
32		pinctrl-0 = <&status_led_pin>;
33
34		status_led: led-status {
35			color = <LED_COLOR_ID_BLUE>;
36			function = LED_FUNCTION_STATUS;
37			gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
38			linux,default-trigger = "heartbeat";
39		};
40	};
41
42	vcc12v_dcin: vcc12v-dcin-regulator {
43		compatible = "regulator-fixed";
44		regulator-name = "vcc12v_dcin";
45		regulator-always-on;
46		regulator-boot-on;
47		regulator-min-microvolt = <12000000>;
48		regulator-max-microvolt = <12000000>;
49	};
50
51	vcc3v3_pcie: vcc3v3-pcie-regulator {
52		compatible = "regulator-fixed";
53		regulator-name = "vcc3v3_pcie";
54		regulator-always-on;
55		regulator-boot-on;
56		regulator-min-microvolt = <3300000>;
57		regulator-max-microvolt = <3300000>;
58		vin-supply = <&vcc5v0_sys>;
59	};
60
61	vcc3v3_sys: vcc3v3-sys-regulator {
62		compatible = "regulator-fixed";
63		regulator-name = "vcc3v3_sys";
64		regulator-always-on;
65		regulator-boot-on;
66		regulator-min-microvolt = <3300000>;
67		regulator-max-microvolt = <3300000>;
68		vin-supply = <&vcc12v_dcin>;
69	};
70
71	vcc5v0_sys: vcc5v0-sys-regulator {
72		compatible = "regulator-fixed";
73		regulator-name = "vcc5v0_sys";
74		regulator-always-on;
75		regulator-boot-on;
76		regulator-min-microvolt = <5000000>;
77		regulator-max-microvolt = <5000000>;
78		vin-supply = <&vcc12v_dcin>;
79	};
80
81	vcc5v0_usb_otg: vcc5v0-usb-otg-regulator {
82		compatible = "regulator-fixed";
83		enable-active-high;
84		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
85		pinctrl-names = "default";
86		pinctrl-0 = <&vcc5v0_usb_otg_en>;
87		regulator-name = "vcc5v0_usb_otg";
88		regulator-min-microvolt = <5000000>;
89		regulator-max-microvolt = <5000000>;
90		vin-supply = <&vcc5v0_sys>;
91	};
92};
93
94&combphy0 {
95	status = "okay";
96};
97
98&combphy1 {
99	status = "okay";
100};
101
102&cpu0 {
103	cpu-supply = <&vdd_cpu>;
104};
105
106&cpu1 {
107	cpu-supply = <&vdd_cpu>;
108};
109
110&cpu2 {
111	cpu-supply = <&vdd_cpu>;
112};
113
114&cpu3 {
115	cpu-supply = <&vdd_cpu>;
116};
117
118&display_subsystem {
119	status = "disabled";
120};
121
122&gpu {
123	mali-supply = <&vdd_gpu>;
124	status = "okay";
125};
126
127&i2c0 {
128	status = "okay";
129
130	vdd_cpu: regulator@1c {
131		compatible = "tcs,tcs4525";
132		reg = <0x1c>;
133		fcs,suspend-voltage-selector = <1>;
134		regulator-name = "vdd_cpu";
135		regulator-always-on;
136		regulator-boot-on;
137		regulator-min-microvolt = <800000>;
138		regulator-max-microvolt = <1150000>;
139		regulator-ramp-delay = <2300>;
140		vin-supply = <&vcc5v0_sys>;
141
142		regulator-state-mem {
143			regulator-off-in-suspend;
144		};
145	};
146
147	rk809: pmic@20 {
148		compatible = "rockchip,rk809";
149		reg = <0x20>;
150		interrupt-parent = <&gpio0>;
151		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
152		#clock-cells = <1>;
153		pinctrl-names = "default";
154		pinctrl-0 = <&pmic_int>;
155		rockchip,system-power-controller;
156		vcc1-supply = <&vcc3v3_sys>;
157		vcc2-supply = <&vcc3v3_sys>;
158		vcc3-supply = <&vcc3v3_sys>;
159		vcc4-supply = <&vcc3v3_sys>;
160		vcc5-supply = <&vcc3v3_sys>;
161		vcc6-supply = <&vcc3v3_sys>;
162		vcc7-supply = <&vcc3v3_sys>;
163		vcc8-supply = <&vcc3v3_sys>;
164		vcc9-supply = <&vcc3v3_sys>;
165		wakeup-source;
166
167		regulators {
168			vdd_logic: DCDC_REG1 {
169				regulator-name = "vdd_logic";
170				regulator-always-on;
171				regulator-boot-on;
172				regulator-initial-mode = <0x2>;
173				regulator-min-microvolt = <500000>;
174				regulator-max-microvolt = <1350000>;
175				regulator-ramp-delay = <6001>;
176
177				regulator-state-mem {
178					regulator-off-in-suspend;
179				};
180			};
181
182			vdd_gpu: DCDC_REG2 {
183				regulator-name = "vdd_gpu";
184				regulator-always-on;
185				regulator-initial-mode = <0x2>;
186				regulator-min-microvolt = <500000>;
187				regulator-max-microvolt = <1350000>;
188				regulator-ramp-delay = <6001>;
189
190				regulator-state-mem {
191					regulator-off-in-suspend;
192				};
193			};
194
195			vcc_ddr: DCDC_REG3 {
196				regulator-name = "vcc_ddr";
197				regulator-always-on;
198				regulator-boot-on;
199				regulator-initial-mode = <0x2>;
200
201				regulator-state-mem {
202					regulator-on-in-suspend;
203				};
204			};
205
206			vdd_npu: DCDC_REG4 {
207				regulator-name = "vdd_npu";
208				regulator-initial-mode = <0x2>;
209				regulator-min-microvolt = <500000>;
210				regulator-max-microvolt = <1350000>;
211				regulator-ramp-delay = <6001>;
212
213				regulator-state-mem {
214					regulator-off-in-suspend;
215				};
216			};
217
218			vcc_1v8: DCDC_REG5 {
219				regulator-name = "vcc_1v8";
220				regulator-always-on;
221				regulator-boot-on;
222				regulator-min-microvolt = <1800000>;
223				regulator-max-microvolt = <1800000>;
224
225				regulator-state-mem {
226					regulator-off-in-suspend;
227				};
228			};
229
230			vdda0v9_image: LDO_REG1 {
231				regulator-name = "vdda0v9_image";
232				regulator-min-microvolt = <950000>;
233				regulator-max-microvolt = <950000>;
234
235				regulator-state-mem {
236					regulator-off-in-suspend;
237				};
238			};
239
240			vdda_0v9: LDO_REG2 {
241				regulator-name = "vdda_0v9";
242				regulator-always-on;
243				regulator-boot-on;
244				regulator-min-microvolt = <900000>;
245				regulator-max-microvolt = <900000>;
246
247				regulator-state-mem {
248					regulator-off-in-suspend;
249				};
250			};
251
252			vdda0v9_pmu: LDO_REG3 {
253				regulator-name = "vdda0v9_pmu";
254				regulator-always-on;
255				regulator-boot-on;
256				regulator-min-microvolt = <900000>;
257				regulator-max-microvolt = <900000>;
258
259				regulator-state-mem {
260					regulator-on-in-suspend;
261					regulator-suspend-microvolt = <900000>;
262				};
263			};
264
265			vccio_acodec: LDO_REG4 {
266				regulator-name = "vccio_acodec";
267				regulator-always-on;
268				regulator-min-microvolt = <3300000>;
269				regulator-max-microvolt = <3300000>;
270
271				regulator-state-mem {
272					regulator-off-in-suspend;
273				};
274			};
275
276			vccio_sd: LDO_REG5 {
277				regulator-name = "vccio_sd";
278				regulator-min-microvolt = <1800000>;
279				regulator-max-microvolt = <3300000>;
280
281				regulator-state-mem {
282					regulator-off-in-suspend;
283				};
284			};
285
286			vcc3v3_pmu: LDO_REG6 {
287				regulator-name = "vcc3v3_pmu";
288				regulator-always-on;
289				regulator-boot-on;
290				regulator-min-microvolt = <3300000>;
291				regulator-max-microvolt = <3300000>;
292
293				regulator-state-mem {
294					regulator-on-in-suspend;
295					regulator-suspend-microvolt = <3300000>;
296				};
297			};
298
299			vcca_1v8: LDO_REG7 {
300				regulator-name = "vcca_1v8";
301				regulator-always-on;
302				regulator-boot-on;
303				regulator-min-microvolt = <1800000>;
304				regulator-max-microvolt = <1800000>;
305
306				regulator-state-mem {
307					regulator-off-in-suspend;
308				};
309			};
310
311			vcca1v8_pmu: LDO_REG8 {
312				regulator-name = "vcca1v8_pmu";
313				regulator-always-on;
314				regulator-boot-on;
315				regulator-min-microvolt = <1800000>;
316				regulator-max-microvolt = <1800000>;
317
318				regulator-state-mem {
319					regulator-on-in-suspend;
320					regulator-suspend-microvolt = <1800000>;
321				};
322			};
323
324			vcca1v8_image: LDO_REG9 {
325				regulator-name = "vcca1v8_image";
326				regulator-min-microvolt = <950000>;
327				regulator-max-microvolt = <1800000>;
328
329				regulator-state-mem {
330					regulator-off-in-suspend;
331					regulator-suspend-microvolt = <950000>;
332				};
333			};
334
335			vcc_3v3: SWITCH_REG1 {
336				regulator-name = "vcc_3v3";
337				regulator-always-on;
338				regulator-boot-on;
339
340				regulator-state-mem {
341					regulator-off-in-suspend;
342				};
343			};
344
345			vcc3v3_sd: SWITCH_REG2 {
346				regulator-name = "vcc3v3_sd";
347
348				regulator-state-mem {
349					regulator-off-in-suspend;
350				};
351			};
352		};
353	};
354};
355
356&pcie30phy {
357	data-lanes = <1 2>;
358	status = "okay";
359};
360
361&pcie3x1 {
362	num-lanes = <1>;
363	reset-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>;
364	vpcie3v3-supply = <&vcc3v3_pcie>;
365	status = "okay";
366};
367
368&pcie3x2 {
369	num-lanes = <1>;
370	reset-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
371	vpcie3v3-supply = <&vcc3v3_pcie>;
372	status = "okay";
373};
374
375&pinctrl {
376	gpio-leds {
377		status_led_pin: status-led-pin {
378			rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
379		};
380	};
381
382	pmic {
383		pmic_int: pmic-int {
384			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
385		};
386	};
387
388	rockchip-key {
389		reset_button_pin: reset-button-pin {
390			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
391		};
392	};
393
394	usb {
395		vcc5v0_usb_otg_en: vcc5v0-usb-otg-en {
396			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
397		};
398	};
399};
400
401&pmu_io_domains {
402	pmuio1-supply = <&vcc3v3_pmu>;
403	pmuio2-supply = <&vcc3v3_pmu>;
404	vccio1-supply = <&vcc_3v3>;
405	vccio2-supply = <&vcc_1v8>;
406	vccio4-supply = <&vcc_1v8>;
407	vccio5-supply = <&vcc_3v3>;
408	vccio6-supply = <&vcc_1v8>;
409	vccio7-supply = <&vcc_3v3>;
410	status = "okay";
411};
412
413&saradc {
414	vref-supply = <&vcca_1v8>;
415	status = "okay";
416};
417
418&tsadc {
419	rockchip,hw-tshut-mode = <1>;
420	rockchip,hw-tshut-polarity = <0>;
421	status = "okay";
422};
423
424&uart2 {
425	status = "okay";
426};
427
428&usb_host0_xhci {
429	dr_mode = "host";
430	extcon = <&usb2phy0>;
431	status = "okay";
432};
433
434&usb_host1_xhci {
435	status = "okay";
436};
437
438&usb2phy0 {
439	status = "okay";
440};
441
442&usb2phy0_host {
443	phy-supply = <&vcc5v0_sys>;
444	status = "okay";
445};
446
447&usb2phy0_otg {
448	phy-supply = <&vcc5v0_usb_otg>;
449	status = "okay";
450};
451
452&vop {
453	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
454	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
455	status = "okay";
456};
457
458&vop_mmu {
459	status = "okay";
460};
461