1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 PINE64
4 */
5
6/dts-v1/;
7#include "rk3328.dtsi"
8
9/ {
10	model = "Pine64 Rock64";
11	compatible = "pine64,rock64", "rockchip,rk3328";
12
13	chosen {
14		stdout-path = "serial2:1500000n8";
15	};
16
17	gmac_clkin: external-gmac-clock {
18		compatible = "fixed-clock";
19		clock-frequency = <125000000>;
20		clock-output-names = "gmac_clkin";
21		#clock-cells = <0>;
22	};
23
24	vcc_sd: sdmmc-regulator {
25		compatible = "regulator-fixed";
26		gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
27		pinctrl-names = "default";
28		pinctrl-0 = <&sdmmc0m1_gpio>;
29		regulator-name = "vcc_sd";
30		regulator-min-microvolt = <3300000>;
31		regulator-max-microvolt = <3300000>;
32		vin-supply = <&vcc_io>;
33	};
34
35	vcc_host_5v: vcc-host-5v-regulator {
36		compatible = "regulator-fixed";
37		enable-active-high;
38		gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
39		pinctrl-names = "default";
40		pinctrl-0 = <&usb30_host_drv>;
41		regulator-name = "vcc_host_5v";
42		regulator-always-on;
43		vin-supply = <&vcc_sys>;
44	};
45
46	vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
47		compatible = "regulator-fixed";
48		enable-active-high;
49		gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
50		pinctrl-names = "default";
51		pinctrl-0 = <&usb20_host_drv>;
52		regulator-name = "vcc_host1_5v";
53		regulator-always-on;
54		vin-supply = <&vcc_sys>;
55	};
56
57	vcc_sys: vcc-sys {
58		compatible = "regulator-fixed";
59		regulator-name = "vcc_sys";
60		regulator-always-on;
61		regulator-boot-on;
62		regulator-min-microvolt = <5000000>;
63		regulator-max-microvolt = <5000000>;
64	};
65};
66
67&cpu0 {
68	cpu-supply = <&vdd_arm>;
69};
70
71&cpu1 {
72	cpu-supply = <&vdd_arm>;
73};
74
75&cpu2 {
76	cpu-supply = <&vdd_arm>;
77};
78
79&cpu3 {
80	cpu-supply = <&vdd_arm>;
81};
82
83&emmc {
84	bus-width = <8>;
85	cap-mmc-highspeed;
86	non-removable;
87	pinctrl-names = "default";
88	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
89	vmmc-supply = <&vcc_io>;
90	vqmmc-supply = <&vcc18_emmc>;
91	status = "okay";
92};
93
94&gmac2io {
95	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
96	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
97	clock_in_out = "input";
98	phy-supply = <&vcc_io>;
99	phy-mode = "rgmii";
100	pinctrl-names = "default";
101	pinctrl-0 = <&rgmiim1_pins>;
102	snps,force_thresh_dma_mode;
103	snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
104	snps,reset-active-low;
105	snps,reset-delays-us = <0 10000 50000>;
106	tx_delay = <0x24>;
107	rx_delay = <0x18>;
108	status = "okay";
109};
110
111&i2c1 {
112	status = "okay";
113
114	rk805: rk805@18 {
115		compatible = "rockchip,rk805";
116		reg = <0x18>;
117		interrupt-parent = <&gpio2>;
118		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
119		#clock-cells = <1>;
120		clock-output-names = "xin32k", "rk805-clkout2";
121		pinctrl-names = "default";
122		pinctrl-0 = <&pmic_int_l>;
123		rockchip,system-power-controller;
124		wakeup-source;
125
126		vcc1-supply = <&vcc_sys>;
127		vcc2-supply = <&vcc_sys>;
128		vcc3-supply = <&vcc_sys>;
129		vcc4-supply = <&vcc_sys>;
130		vcc5-supply = <&vcc_io>;
131		vcc6-supply = <&vcc_sys>;
132
133		regulators {
134			vdd_logic: DCDC_REG1 {
135				regulator-name = "vdd_logic";
136				regulator-min-microvolt = <712500>;
137				regulator-max-microvolt = <1450000>;
138				regulator-ramp-delay = <12500>;
139				regulator-always-on;
140				regulator-boot-on;
141				regulator-state-mem {
142					regulator-on-in-suspend;
143					regulator-suspend-microvolt = <1000000>;
144				};
145			};
146
147			vdd_arm: DCDC_REG2 {
148				regulator-name = "vdd_arm";
149				regulator-min-microvolt = <712500>;
150				regulator-max-microvolt = <1450000>;
151				regulator-ramp-delay = <12500>;
152				regulator-always-on;
153				regulator-boot-on;
154				regulator-state-mem {
155					regulator-on-in-suspend;
156					regulator-suspend-microvolt = <950000>;
157				};
158			};
159
160			vcc_ddr: DCDC_REG3 {
161				regulator-name = "vcc_ddr";
162				regulator-always-on;
163				regulator-boot-on;
164				regulator-state-mem {
165					regulator-on-in-suspend;
166				};
167			};
168
169			vcc_io: DCDC_REG4 {
170				regulator-name = "vcc_io";
171				regulator-min-microvolt = <3300000>;
172				regulator-max-microvolt = <3300000>;
173				regulator-always-on;
174				regulator-boot-on;
175				regulator-state-mem {
176					regulator-on-in-suspend;
177					regulator-suspend-microvolt = <3300000>;
178				};
179			};
180
181			vcc_18: LDO_REG1 {
182				regulator-name = "vdd_18";
183				regulator-min-microvolt = <1800000>;
184				regulator-max-microvolt = <1800000>;
185				regulator-always-on;
186				regulator-boot-on;
187				regulator-state-mem {
188					regulator-on-in-suspend;
189					regulator-suspend-microvolt = <1800000>;
190				};
191			};
192
193			vcc18_emmc: LDO_REG2 {
194				regulator-name = "vcc_18emmc";
195				regulator-min-microvolt = <1800000>;
196				regulator-max-microvolt = <1800000>;
197				regulator-always-on;
198				regulator-boot-on;
199				regulator-state-mem {
200					regulator-on-in-suspend;
201					regulator-suspend-microvolt = <1800000>;
202				};
203			};
204
205			vdd_10: LDO_REG3 {
206				regulator-name = "vdd_10";
207				regulator-min-microvolt = <1000000>;
208				regulator-max-microvolt = <1000000>;
209				regulator-always-on;
210				regulator-boot-on;
211				regulator-state-mem {
212					regulator-on-in-suspend;
213					regulator-suspend-microvolt = <1000000>;
214				};
215			};
216		};
217	};
218};
219
220&io_domains {
221	status = "okay";
222
223	vccio1-supply = <&vcc_io>;
224	vccio2-supply = <&vcc18_emmc>;
225	vccio3-supply = <&vcc_io>;
226	vccio4-supply = <&vcc_18>;
227	vccio5-supply = <&vcc_io>;
228	vccio6-supply = <&vcc_io>;
229	pmuio-supply = <&vcc_io>;
230};
231
232&pinctrl {
233	pmic {
234		pmic_int_l: pmic-int-l {
235			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
236		};
237	};
238
239	usb2 {
240		usb20_host_drv: usb20-host-drv {
241			rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
242		};
243	};
244
245	usb3 {
246		usb30_host_drv: usb30-host-drv {
247			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
248		};
249	};
250};
251
252&sdmmc {
253	bus-width = <4>;
254	cap-mmc-highspeed;
255	cap-sd-highspeed;
256	disable-wp;
257	max-frequency = <150000000>;
258	pinctrl-names = "default";
259	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
260	vmmc-supply = <&vcc_sd>;
261	status = "okay";
262};
263
264&tsadc {
265	rockchip,hw-tshut-mode = <0>;
266	rockchip,hw-tshut-polarity = <0>;
267	status = "okay";
268};
269
270&uart2 {
271	status = "okay";
272};
273
274&u2phy {
275	status = "okay";
276
277	u2phy_host: host-port {
278		status = "okay";
279	};
280
281	u2phy_otg: otg-port {
282		status = "okay";
283	};
284};
285
286&usb20_otg {
287	dr_mode = "host";
288	status = "okay";
289};
290
291&usb_host0_ehci {
292	status = "okay";
293};
294
295&usb_host0_ohci {
296	status = "okay";
297};
298