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	dc_12v: dc-12v-regulator {
43		compatible = "regulator-fixed";
44		regulator-name = "dc_12v";
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 = <&dc_12v>;
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 = <&dc_12v>;
79	};
80
81	vcc5v0_usb_host: vcc5v0-usb-host-regulator {
82		compatible = "regulator-fixed";
83		regulator-name = "vcc5v0_usb_host";
84		regulator-always-on;
85		regulator-boot-on;
86		regulator-min-microvolt = <5000000>;
87		regulator-max-microvolt = <5000000>;
88	};
89
90	vcc5v0_usb_otg: vcc5v0-usb-otg-regulator {
91		compatible = "regulator-fixed";
92		enable-active-high;
93		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
94		pinctrl-names = "default";
95		pinctrl-0 = <&vcc5v0_usb_otg_en>;
96		regulator-name = "vcc5v0_usb_otg";
97		regulator-always-on;
98		regulator-boot-on;
99	};
100};
101
102&combphy0 {
103	status = "okay";
104};
105
106&combphy1 {
107	status = "okay";
108};
109
110&cpu0 {
111	cpu-supply = <&vdd_cpu>;
112};
113
114&cpu1 {
115	cpu-supply = <&vdd_cpu>;
116};
117
118&cpu2 {
119	cpu-supply = <&vdd_cpu>;
120};
121
122&cpu3 {
123	cpu-supply = <&vdd_cpu>;
124};
125
126&gpu {
127	mali-supply = <&vdd_gpu>;
128	status = "okay";
129};
130
131&i2c0 {
132	status = "okay";
133
134	vdd_cpu: regulator@1c {
135		compatible = "tcs,tcs4525";
136		reg = <0x1c>;
137		fcs,suspend-voltage-selector = <1>;
138		regulator-name = "vdd_cpu";
139		regulator-always-on;
140		regulator-boot-on;
141		regulator-min-microvolt = <800000>;
142		regulator-max-microvolt = <1150000>;
143		regulator-ramp-delay = <2300>;
144		vin-supply = <&vcc5v0_sys>;
145
146		regulator-state-mem {
147			regulator-off-in-suspend;
148		};
149	};
150
151	rk809: pmic@20 {
152		compatible = "rockchip,rk809";
153		reg = <0x20>;
154		interrupt-parent = <&gpio0>;
155		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
156		#clock-cells = <1>;
157		pinctrl-names = "default";
158		pinctrl-0 = <&pmic_int>;
159		rockchip,system-power-controller;
160		vcc1-supply = <&vcc3v3_sys>;
161		vcc2-supply = <&vcc3v3_sys>;
162		vcc3-supply = <&vcc3v3_sys>;
163		vcc4-supply = <&vcc3v3_sys>;
164		vcc5-supply = <&vcc3v3_sys>;
165		vcc6-supply = <&vcc3v3_sys>;
166		vcc7-supply = <&vcc3v3_sys>;
167		vcc8-supply = <&vcc3v3_sys>;
168		vcc9-supply = <&vcc3v3_sys>;
169		wakeup-source;
170
171		regulators {
172			vdd_logic: DCDC_REG1 {
173				regulator-name = "vdd_logic";
174				regulator-always-on;
175				regulator-boot-on;
176				regulator-init-microvolt = <900000>;
177				regulator-initial-mode = <0x2>;
178				regulator-min-microvolt = <500000>;
179				regulator-max-microvolt = <1350000>;
180				regulator-ramp-delay = <6001>;
181
182				regulator-state-mem {
183					regulator-off-in-suspend;
184				};
185			};
186
187			vdd_gpu: DCDC_REG2 {
188				regulator-name = "vdd_gpu";
189				regulator-always-on;
190				regulator-init-microvolt = <900000>;
191				regulator-initial-mode = <0x2>;
192				regulator-min-microvolt = <500000>;
193				regulator-max-microvolt = <1350000>;
194				regulator-ramp-delay = <6001>;
195
196				regulator-state-mem {
197					regulator-off-in-suspend;
198				};
199			};
200
201			vcc_ddr: DCDC_REG3 {
202				regulator-name = "vcc_ddr";
203				regulator-always-on;
204				regulator-boot-on;
205				regulator-initial-mode = <0x2>;
206
207				regulator-state-mem {
208					regulator-on-in-suspend;
209				};
210			};
211
212			vdd_npu: DCDC_REG4 {
213				regulator-name = "vdd_npu";
214				regulator-init-microvolt = <900000>;
215				regulator-initial-mode = <0x2>;
216				regulator-min-microvolt = <500000>;
217				regulator-max-microvolt = <1350000>;
218				regulator-ramp-delay = <6001>;
219
220				regulator-state-mem {
221					regulator-off-in-suspend;
222				};
223			};
224
225			vcc_1v8: DCDC_REG5 {
226				regulator-name = "vcc_1v8";
227				regulator-always-on;
228				regulator-boot-on;
229				regulator-min-microvolt = <1800000>;
230				regulator-max-microvolt = <1800000>;
231
232				regulator-state-mem {
233					regulator-off-in-suspend;
234				};
235			};
236
237			vdda0v9_image: LDO_REG1 {
238				regulator-name = "vdda0v9_image";
239				regulator-min-microvolt = <950000>;
240				regulator-max-microvolt = <950000>;
241
242				regulator-state-mem {
243					regulator-off-in-suspend;
244				};
245			};
246
247			vdda_0v9: LDO_REG2 {
248				regulator-name = "vdda_0v9";
249				regulator-always-on;
250				regulator-boot-on;
251				regulator-min-microvolt = <900000>;
252				regulator-max-microvolt = <900000>;
253
254				regulator-state-mem {
255					regulator-off-in-suspend;
256				};
257			};
258
259			vdda0v9_pmu: LDO_REG3 {
260				regulator-name = "vdda0v9_pmu";
261				regulator-always-on;
262				regulator-boot-on;
263				regulator-min-microvolt = <900000>;
264				regulator-max-microvolt = <900000>;
265
266				regulator-state-mem {
267					regulator-on-in-suspend;
268					regulator-suspend-microvolt = <900000>;
269				};
270			};
271
272			vccio_acodec: LDO_REG4 {
273				regulator-name = "vccio_acodec";
274				regulator-always-on;
275				regulator-min-microvolt = <3300000>;
276				regulator-max-microvolt = <3300000>;
277
278				regulator-state-mem {
279					regulator-off-in-suspend;
280				};
281			};
282
283			vccio_sd: LDO_REG5 {
284				regulator-name = "vccio_sd";
285				regulator-min-microvolt = <1800000>;
286				regulator-max-microvolt = <3300000>;
287
288				regulator-state-mem {
289					regulator-off-in-suspend;
290				};
291			};
292
293			vcc3v3_pmu: LDO_REG6 {
294				regulator-name = "vcc3v3_pmu";
295				regulator-always-on;
296				regulator-boot-on;
297				regulator-min-microvolt = <3300000>;
298				regulator-max-microvolt = <3300000>;
299
300				regulator-state-mem {
301					regulator-on-in-suspend;
302					regulator-suspend-microvolt = <3300000>;
303				};
304			};
305
306			vcca_1v8: LDO_REG7 {
307				regulator-name = "vcca_1v8";
308				regulator-always-on;
309				regulator-boot-on;
310				regulator-min-microvolt = <1800000>;
311				regulator-max-microvolt = <1800000>;
312
313				regulator-state-mem {
314					regulator-off-in-suspend;
315				};
316			};
317
318			vcca1v8_pmu: LDO_REG8 {
319				regulator-name = "vcca1v8_pmu";
320				regulator-always-on;
321				regulator-boot-on;
322				regulator-min-microvolt = <1800000>;
323				regulator-max-microvolt = <1800000>;
324
325				regulator-state-mem {
326					regulator-on-in-suspend;
327					regulator-suspend-microvolt = <1800000>;
328				};
329			};
330
331			vcca1v8_image: LDO_REG9 {
332				regulator-name = "vcca1v8_image";
333				regulator-init-microvolt = <950000>;
334				regulator-min-microvolt = <950000>;
335				regulator-max-microvolt = <1800000>;
336
337				regulator-state-mem {
338					regulator-off-in-suspend;
339					regulator-suspend-microvolt = <950000>;
340				};
341			};
342
343			vcc_3v3: SWITCH_REG1 {
344				regulator-name = "vcc_3v3";
345				regulator-always-on;
346				regulator-boot-on;
347
348				regulator-state-mem {
349					regulator-off-in-suspend;
350				};
351			};
352
353			vcc3v3_sd: SWITCH_REG2 {
354				regulator-name = "vcc3v3_sd";
355
356				regulator-state-mem {
357					regulator-off-in-suspend;
358				};
359			};
360		};
361	};
362};
363
364&pcie30phy {
365	data-lanes = <1 2>;
366	status = "okay";
367};
368
369&pcie3x1 {
370	num-lanes = <1>;
371	reset-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>;
372	vpcie3v3-supply = <&vcc3v3_pcie>;
373	status = "okay";
374};
375
376&pcie3x2 {
377	num-lanes = <1>;
378	reset-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
379	vpcie3v3-supply = <&vcc3v3_pcie>;
380	status = "okay";
381};
382
383&pinctrl {
384	gpio-leds {
385		status_led_pin: status-led-pin {
386			rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
387		};
388	};
389
390	pmic {
391		pmic_int: pmic-int {
392			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
393		};
394	};
395
396	rockchip-key {
397		reset_button_pin: reset-button-pin {
398			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
399		};
400	};
401
402	usb {
403		vcc5v0_usb_otg_en: vcc5v0-usb-otg-en {
404			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
405		};
406	};
407};
408
409&pmu_io_domains {
410	pmuio1-supply = <&vcc3v3_pmu>;
411	pmuio2-supply = <&vcc3v3_pmu>;
412	vccio1-supply = <&vccio_acodec>;
413	vccio3-supply = <&vccio_sd>;
414	vccio4-supply = <&vcc_1v8>;
415	vccio5-supply = <&vcc_3v3>;
416	vccio6-supply = <&vcc_1v8>;
417	vccio7-supply = <&vcc_3v3>;
418	status = "okay";
419};
420
421&saradc {
422	vref-supply = <&vcca_1v8>;
423	status = "okay";
424};
425
426&tsadc {
427	rockchip,hw-tshut-mode = <1>;
428	rockchip,hw-tshut-polarity = <0>;
429	status = "okay";
430};
431
432&uart2 {
433	status = "okay";
434};
435
436&usb_host0_ehci {
437	status = "okay";
438};
439
440&usb_host0_ohci {
441	status = "okay";
442};
443
444&usb_host0_xhci {
445	dr_mode = "host";
446	extcon = <&usb2phy0>;
447	status = "okay";
448};
449
450&usb_host1_ehci {
451	status = "okay";
452};
453
454&usb_host1_ohci {
455	status = "okay";
456};
457
458&usb_host1_xhci {
459	status = "okay";
460};
461
462&usb2phy0 {
463	status = "okay";
464};
465
466&usb2phy0_host {
467	phy-supply = <&vcc5v0_usb_host>;
468	status = "okay";
469};
470
471&usb2phy0_otg {
472	phy-supply = <&vcc5v0_usb_otg>;
473	status = "okay";
474};
475
476&vop {
477	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
478	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
479	status = "okay";
480};
481
482&vop_mmu {
483	status = "okay";
484};
485