1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
4 *
5 */
6
7/dts-v1/;
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/pinctrl/rockchip.h>
10#include "rk3568.dtsi"
11
12/ {
13	model = "Rockchip RK3568 EVB1 DDR4 V10 Board";
14	compatible = "rockchip,rk3568-evb1-v10", "rockchip,rk3568";
15
16	aliases {
17		ethernet0 = &gmac0;
18		ethernet1 = &gmac1;
19		mmc0 = &sdmmc0;
20		mmc1 = &sdhci;
21	};
22
23	chosen: chosen {
24		stdout-path = "serial2:1500000n8";
25	};
26
27	dc_12v: dc-12v {
28		compatible = "regulator-fixed";
29		regulator-name = "dc_12v";
30		regulator-always-on;
31		regulator-boot-on;
32		regulator-min-microvolt = <12000000>;
33		regulator-max-microvolt = <12000000>;
34	};
35
36	vcc3v3_sys: vcc3v3-sys {
37		compatible = "regulator-fixed";
38		regulator-name = "vcc3v3_sys";
39		regulator-always-on;
40		regulator-boot-on;
41		regulator-min-microvolt = <3300000>;
42		regulator-max-microvolt = <3300000>;
43		vin-supply = <&dc_12v>;
44	};
45
46	vcc5v0_sys: vcc5v0-sys {
47		compatible = "regulator-fixed";
48		regulator-name = "vcc5v0_sys";
49		regulator-always-on;
50		regulator-boot-on;
51		regulator-min-microvolt = <5000000>;
52		regulator-max-microvolt = <5000000>;
53		vin-supply = <&dc_12v>;
54	};
55
56	vcc3v3_lcd0_n: vcc3v3-lcd0-n {
57		compatible = "regulator-fixed";
58		regulator-name = "vcc3v3_lcd0_n";
59		regulator-min-microvolt = <3300000>;
60		regulator-max-microvolt = <3300000>;
61		enable-active-high;
62		gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
63		vin-supply = <&vcc3v3_sys>;
64		pinctrl-names = "default";
65		pinctrl-0 = <&vcc3v3_lcd0_n_en>;
66
67		regulator-state-mem {
68			regulator-off-in-suspend;
69		};
70	};
71
72	vcc3v3_lcd1_n: vcc3v3-lcd1-n {
73		compatible = "regulator-fixed";
74		regulator-name = "vcc3v3_lcd1_n";
75		regulator-min-microvolt = <3300000>;
76		regulator-max-microvolt = <3300000>;
77		enable-active-high;
78		gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
79		vin-supply = <&vcc3v3_sys>;
80		pinctrl-names = "default";
81		pinctrl-0 = <&vcc3v3_lcd1_n_en>;
82
83		regulator-state-mem {
84			regulator-off-in-suspend;
85		};
86	};
87};
88
89&gmac0 {
90	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
91	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
92	assigned-clock-rates = <0>, <125000000>;
93	clock_in_out = "output";
94	phy-handle = <&rgmii_phy0>;
95	phy-mode = "rgmii-id";
96	pinctrl-names = "default";
97	pinctrl-0 = <&gmac0_miim
98		     &gmac0_tx_bus2
99		     &gmac0_rx_bus2
100		     &gmac0_rgmii_clk
101		     &gmac0_rgmii_bus>;
102	status = "okay";
103};
104
105&gmac1 {
106	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
107	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
108	assigned-clock-rates = <0>, <125000000>;
109	clock_in_out = "output";
110	phy-handle = <&rgmii_phy1>;
111	phy-mode = "rgmii-id";
112	pinctrl-names = "default";
113	pinctrl-0 = <&gmac1m1_miim
114		     &gmac1m1_tx_bus2
115		     &gmac1m1_rx_bus2
116		     &gmac1m1_rgmii_clk
117		     &gmac1m1_rgmii_bus>;
118	status = "okay";
119};
120
121&i2c0 {
122	status = "okay";
123
124	rk809: pmic@20 {
125		compatible = "rockchip,rk809";
126		reg = <0x20>;
127		interrupt-parent = <&gpio0>;
128		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
129		#clock-cells = <1>;
130		pinctrl-names = "default";
131		pinctrl-0 = <&pmic_int>;
132		rockchip,system-power-controller;
133		vcc1-supply = <&vcc3v3_sys>;
134		vcc2-supply = <&vcc3v3_sys>;
135		vcc3-supply = <&vcc3v3_sys>;
136		vcc4-supply = <&vcc3v3_sys>;
137		vcc5-supply = <&vcc3v3_sys>;
138		vcc6-supply = <&vcc3v3_sys>;
139		vcc7-supply = <&vcc3v3_sys>;
140		vcc8-supply = <&vcc3v3_sys>;
141		vcc9-supply = <&vcc3v3_sys>;
142		wakeup-source;
143
144		regulators {
145			vdd_logic: DCDC_REG1 {
146				regulator-name = "vdd_logic";
147				regulator-always-on;
148				regulator-boot-on;
149				regulator-init-microvolt = <900000>;
150				regulator-initial-mode = <0x2>;
151				regulator-min-microvolt = <500000>;
152				regulator-max-microvolt = <1350000>;
153				regulator-ramp-delay = <6001>;
154
155				regulator-state-mem {
156					regulator-off-in-suspend;
157				};
158			};
159
160			vdd_gpu: DCDC_REG2 {
161				regulator-name = "vdd_gpu";
162				regulator-init-microvolt = <900000>;
163				regulator-initial-mode = <0x2>;
164				regulator-min-microvolt = <500000>;
165				regulator-max-microvolt = <1350000>;
166				regulator-ramp-delay = <6001>;
167
168				regulator-state-mem {
169					regulator-off-in-suspend;
170				};
171			};
172
173			vcc_ddr: DCDC_REG3 {
174				regulator-name = "vcc_ddr";
175				regulator-always-on;
176				regulator-boot-on;
177				regulator-initial-mode = <0x2>;
178
179				regulator-state-mem {
180					regulator-on-in-suspend;
181				};
182			};
183
184			vdd_npu: DCDC_REG4 {
185				regulator-name = "vdd_npu";
186				regulator-init-microvolt = <900000>;
187				regulator-initial-mode = <0x2>;
188				regulator-min-microvolt = <500000>;
189				regulator-max-microvolt = <1350000>;
190				regulator-ramp-delay = <6001>;
191
192				regulator-state-mem {
193					regulator-off-in-suspend;
194				};
195			};
196
197			vcc_1v8: DCDC_REG5 {
198				regulator-name = "vcc_1v8";
199				regulator-always-on;
200				regulator-boot-on;
201				regulator-min-microvolt = <1800000>;
202				regulator-max-microvolt = <1800000>;
203
204				regulator-state-mem {
205					regulator-off-in-suspend;
206				};
207			};
208
209			vdda0v9_image: LDO_REG1 {
210				regulator-name = "vdda0v9_image";
211				regulator-min-microvolt = <900000>;
212				regulator-max-microvolt = <900000>;
213
214				regulator-state-mem {
215					regulator-off-in-suspend;
216				};
217			};
218
219			vdda_0v9: LDO_REG2 {
220				regulator-name = "vdda_0v9";
221				regulator-always-on;
222				regulator-boot-on;
223				regulator-min-microvolt = <900000>;
224				regulator-max-microvolt = <900000>;
225
226				regulator-state-mem {
227					regulator-off-in-suspend;
228				};
229			};
230
231			vdda0v9_pmu: LDO_REG3 {
232				regulator-name = "vdda0v9_pmu";
233				regulator-always-on;
234				regulator-boot-on;
235				regulator-min-microvolt = <900000>;
236				regulator-max-microvolt = <900000>;
237
238				regulator-state-mem {
239					regulator-on-in-suspend;
240					regulator-suspend-microvolt = <900000>;
241				};
242			};
243
244			vccio_acodec: LDO_REG4 {
245				regulator-name = "vccio_acodec";
246				regulator-min-microvolt = <3300000>;
247				regulator-max-microvolt = <3300000>;
248
249				regulator-state-mem {
250					regulator-off-in-suspend;
251				};
252			};
253
254			vccio_sd: LDO_REG5 {
255				regulator-name = "vccio_sd";
256				regulator-min-microvolt = <1800000>;
257				regulator-max-microvolt = <3300000>;
258
259				regulator-state-mem {
260					regulator-off-in-suspend;
261				};
262			};
263
264			vcc3v3_pmu: LDO_REG6 {
265				regulator-name = "vcc3v3_pmu";
266				regulator-always-on;
267				regulator-boot-on;
268				regulator-min-microvolt = <3300000>;
269				regulator-max-microvolt = <3300000>;
270
271				regulator-state-mem {
272					regulator-on-in-suspend;
273					regulator-suspend-microvolt = <3300000>;
274				};
275			};
276
277			vcca_1v8: LDO_REG7 {
278				regulator-name = "vcca_1v8";
279				regulator-always-on;
280				regulator-boot-on;
281				regulator-min-microvolt = <1800000>;
282				regulator-max-microvolt = <1800000>;
283
284				regulator-state-mem {
285					regulator-off-in-suspend;
286				};
287			};
288
289			vcca1v8_pmu: LDO_REG8 {
290				regulator-name = "vcca1v8_pmu";
291				regulator-always-on;
292				regulator-boot-on;
293				regulator-min-microvolt = <1800000>;
294				regulator-max-microvolt = <1800000>;
295
296				regulator-state-mem {
297					regulator-on-in-suspend;
298					regulator-suspend-microvolt = <1800000>;
299				};
300			};
301
302			vcca1v8_image: LDO_REG9 {
303				regulator-name = "vcca1v8_image";
304				regulator-min-microvolt = <1800000>;
305				regulator-max-microvolt = <1800000>;
306
307				regulator-state-mem {
308					regulator-off-in-suspend;
309				};
310			};
311
312			vcc_3v3: SWITCH_REG1 {
313				regulator-name = "vcc_3v3";
314				regulator-always-on;
315				regulator-boot-on;
316
317				regulator-state-mem {
318					regulator-off-in-suspend;
319				};
320			};
321
322			vcc3v3_sd: SWITCH_REG2 {
323				regulator-name = "vcc3v3_sd";
324
325				regulator-state-mem {
326					regulator-off-in-suspend;
327				};
328			};
329		};
330	};
331};
332
333&i2c1 {
334	status = "okay";
335
336	touchscreen0: goodix@14 {
337		compatible = "goodix,gt1151";
338		reg = <0x14>;
339		interrupt-parent = <&gpio0>;
340		interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
341		AVDD28-supply = <&vcc3v3_lcd0_n>;
342		irq-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
343		pinctrl-names = "default";
344		pinctrl-0 = <&touch_int &touch_rst>;
345		reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
346		VDDIO-supply = <&vcc3v3_lcd0_n>;
347	};
348};
349
350&mdio0 {
351	rgmii_phy0: ethernet-phy@0 {
352		compatible = "ethernet-phy-ieee802.3-c22";
353		reg = <0x0>;
354		reset-assert-us = <20000>;
355		reset-deassert-us = <100000>;
356		reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
357	};
358};
359
360&mdio1 {
361	rgmii_phy1: ethernet-phy@0 {
362		compatible = "ethernet-phy-ieee802.3-c22";
363		reg = <0x0>;
364		reset-assert-us = <20000>;
365		reset-deassert-us = <100000>;
366		reset-gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>;
367	};
368};
369
370&pinctrl {
371	display {
372		vcc3v3_lcd0_n_en: vcc3v3_lcd0_n_en {
373			rockchip,pins = <0 RK_PC7 0 &pcfg_pull_none>;
374		};
375		vcc3v3_lcd1_n_en: vcc3v3_lcd1_n_en {
376			rockchip,pins = <0 RK_PC5 0 &pcfg_pull_none>;
377		};
378	};
379
380	pmic {
381		pmic_int: pmic_int {
382			rockchip,pins =
383				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
384		};
385	};
386
387	touchscreen {
388		touch_int: touch_int {
389			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
390		};
391		touch_rst: touch_rst {
392			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
393		};
394	};
395};
396
397&pmu_io_domains {
398	pmuio1-supply = <&vcc3v3_pmu>;
399	pmuio2-supply = <&vcc3v3_pmu>;
400	vccio1-supply = <&vccio_acodec>;
401	vccio2-supply = <&vcc_1v8>;
402	vccio3-supply = <&vccio_sd>;
403	vccio4-supply = <&vcc_1v8>;
404	vccio5-supply = <&vcc_3v3>;
405	vccio6-supply = <&vcc_1v8>;
406	vccio7-supply = <&vcc_3v3>;
407	status = "okay";
408};
409
410&saradc {
411	vref-supply = <&vcca_1v8>;
412	status = "okay";
413};
414
415&sdhci {
416	bus-width = <8>;
417	max-frequency = <200000000>;
418	non-removable;
419	pinctrl-names = "default";
420	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
421	status = "okay";
422};
423
424&sdmmc0 {
425	bus-width = <4>;
426	cap-sd-highspeed;
427	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
428	disable-wp;
429	pinctrl-names = "default";
430	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
431	sd-uhs-sdr104;
432	vmmc-supply = <&vcc3v3_sd>;
433	vqmmc-supply = <&vccio_sd>;
434	status = "okay";
435};
436
437&uart2 {
438	status = "okay";
439};
440