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		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
38		pinctrl-names = "default";
39		pinctrl-0 = <&usb20_host_drv>;
40		regulator-name = "vcc_host_5v";
41		regulator-always-on;
42		regulator-boot-on;
43		vin-supply = <&vcc_sys>;
44	};
45
46	vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
47		compatible = "regulator-fixed";
48		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
49		pinctrl-names = "default";
50		pinctrl-0 = <&usb20_host_drv>;
51		regulator-name = "vcc_host1_5v";
52		regulator-always-on;
53		regulator-boot-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	ir-receiver {
67		compatible = "gpio-ir-receiver";
68		gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
69		pinctrl-0 = <&ir_int>;
70		pinctrl-names = "default";
71	};
72
73	leds {
74		compatible = "gpio-leds";
75
76		power {
77			gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
78			linux,default-trigger = "mmc0";
79		};
80
81		standby {
82			gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
83			linux,default-trigger = "heartbeat";
84		};
85	};
86
87	sound {
88		compatible = "audio-graph-card";
89		label = "rockchip,rk3328";
90		dais = <&i2s1_p0
91			&spdif_p0>;
92	};
93
94	spdif-dit {
95		compatible = "linux,spdif-dit";
96		#sound-dai-cells = <0>;
97
98		port {
99			dit_p0_0: endpoint {
100				remote-endpoint = <&spdif_p0_0>;
101			};
102		};
103	};
104};
105
106&codec {
107	status = "okay";
108
109	port@0 {
110		codec_p0_0: endpoint {
111			remote-endpoint = <&i2s1_p0_0>;
112		};
113	};
114};
115
116&cpu0 {
117	cpu-supply = <&vdd_arm>;
118};
119
120&cpu1 {
121	cpu-supply = <&vdd_arm>;
122};
123
124&cpu2 {
125	cpu-supply = <&vdd_arm>;
126};
127
128&cpu3 {
129	cpu-supply = <&vdd_arm>;
130};
131
132&emmc {
133	bus-width = <8>;
134	cap-mmc-highspeed;
135	mmc-hs200-1_8v;
136	non-removable;
137	pinctrl-names = "default";
138	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
139	vmmc-supply = <&vcc_io>;
140	vqmmc-supply = <&vcc18_emmc>;
141	status = "okay";
142};
143
144&gmac2io {
145	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
146	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
147	clock_in_out = "input";
148	phy-supply = <&vcc_io>;
149	phy-mode = "rgmii";
150	pinctrl-names = "default";
151	pinctrl-0 = <&rgmiim1_pins>;
152	snps,force_thresh_dma_mode;
153	snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
154	snps,reset-active-low;
155	snps,reset-delays-us = <0 10000 50000>;
156	tx_delay = <0x24>;
157	rx_delay = <0x18>;
158	status = "okay";
159};
160
161&hdmi {
162	status = "okay";
163};
164
165&hdmiphy {
166	status = "okay";
167};
168
169&i2c1 {
170	status = "okay";
171
172	rk805: rk805@18 {
173		compatible = "rockchip,rk805";
174		reg = <0x18>;
175		interrupt-parent = <&gpio2>;
176		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
177		#clock-cells = <1>;
178		clock-output-names = "xin32k", "rk805-clkout2";
179		gpio-controller;
180		#gpio-cells = <2>;
181		pinctrl-names = "default";
182		pinctrl-0 = <&pmic_int_l>;
183		rockchip,system-power-controller;
184		wakeup-source;
185
186		vcc1-supply = <&vcc_sys>;
187		vcc2-supply = <&vcc_sys>;
188		vcc3-supply = <&vcc_sys>;
189		vcc4-supply = <&vcc_sys>;
190		vcc5-supply = <&vcc_io>;
191		vcc6-supply = <&vcc_sys>;
192
193		regulators {
194			vdd_logic: DCDC_REG1 {
195				regulator-name = "vdd_logic";
196				regulator-min-microvolt = <712500>;
197				regulator-max-microvolt = <1450000>;
198				regulator-ramp-delay = <12500>;
199				regulator-always-on;
200				regulator-boot-on;
201				regulator-state-mem {
202					regulator-on-in-suspend;
203					regulator-suspend-microvolt = <1000000>;
204				};
205			};
206
207			vdd_arm: DCDC_REG2 {
208				regulator-name = "vdd_arm";
209				regulator-min-microvolt = <712500>;
210				regulator-max-microvolt = <1450000>;
211				regulator-ramp-delay = <12500>;
212				regulator-always-on;
213				regulator-boot-on;
214				regulator-state-mem {
215					regulator-on-in-suspend;
216					regulator-suspend-microvolt = <950000>;
217				};
218			};
219
220			vcc_ddr: DCDC_REG3 {
221				regulator-name = "vcc_ddr";
222				regulator-always-on;
223				regulator-boot-on;
224				regulator-state-mem {
225					regulator-on-in-suspend;
226				};
227			};
228
229			vcc_io: DCDC_REG4 {
230				regulator-name = "vcc_io";
231				regulator-min-microvolt = <3300000>;
232				regulator-max-microvolt = <3300000>;
233				regulator-always-on;
234				regulator-boot-on;
235				regulator-state-mem {
236					regulator-on-in-suspend;
237					regulator-suspend-microvolt = <3300000>;
238				};
239			};
240
241			vcc_18: LDO_REG1 {
242				regulator-name = "vcc_18";
243				regulator-min-microvolt = <1800000>;
244				regulator-max-microvolt = <1800000>;
245				regulator-always-on;
246				regulator-boot-on;
247				regulator-state-mem {
248					regulator-on-in-suspend;
249					regulator-suspend-microvolt = <1800000>;
250				};
251			};
252
253			vcc18_emmc: LDO_REG2 {
254				regulator-name = "vcc18_emmc";
255				regulator-min-microvolt = <1800000>;
256				regulator-max-microvolt = <1800000>;
257				regulator-always-on;
258				regulator-boot-on;
259				regulator-state-mem {
260					regulator-on-in-suspend;
261					regulator-suspend-microvolt = <1800000>;
262				};
263			};
264
265			vdd_10: LDO_REG3 {
266				regulator-name = "vdd_10";
267				regulator-min-microvolt = <1000000>;
268				regulator-max-microvolt = <1000000>;
269				regulator-always-on;
270				regulator-boot-on;
271				regulator-state-mem {
272					regulator-on-in-suspend;
273					regulator-suspend-microvolt = <1000000>;
274				};
275			};
276		};
277	};
278};
279
280&i2s1 {
281	status = "okay";
282
283	i2s1_p0: port {
284		i2s1_p0_0: endpoint {
285			dai-format = "i2s";
286			mclk-fs = <256>;
287			remote-endpoint = <&codec_p0_0>;
288		};
289	};
290};
291
292&io_domains {
293	status = "okay";
294
295	vccio1-supply = <&vcc_io>;
296	vccio2-supply = <&vcc18_emmc>;
297	vccio3-supply = <&vcc_io>;
298	vccio4-supply = <&vcc_18>;
299	vccio5-supply = <&vcc_io>;
300	vccio6-supply = <&vcc_io>;
301	pmuio-supply = <&vcc_io>;
302};
303
304&pinctrl {
305	ir {
306		ir_int: ir-int {
307			rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
308		};
309	};
310
311	pmic {
312		pmic_int_l: pmic-int-l {
313			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
314		};
315	};
316
317	usb2 {
318		usb20_host_drv: usb20-host-drv {
319			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
320		};
321	};
322};
323
324&sdmmc {
325	bus-width = <4>;
326	cap-mmc-highspeed;
327	cap-sd-highspeed;
328	disable-wp;
329	max-frequency = <150000000>;
330	pinctrl-names = "default";
331	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
332	vmmc-supply = <&vcc_sd>;
333	status = "okay";
334};
335
336&spdif {
337	pinctrl-0 = <&spdifm0_tx>;
338	status = "okay";
339
340	spdif_p0: port {
341		spdif_p0_0: endpoint {
342			remote-endpoint = <&dit_p0_0>;
343		};
344	};
345};
346
347&spi0 {
348	status = "okay";
349
350	spiflash@0 {
351		compatible = "jedec,spi-nor";
352		reg = <0>;
353
354		/* maximum speed for Rockchip SPI */
355		spi-max-frequency = <50000000>;
356	};
357};
358
359&tsadc {
360	rockchip,hw-tshut-mode = <0>;
361	rockchip,hw-tshut-polarity = <0>;
362	status = "okay";
363};
364
365&uart2 {
366	status = "okay";
367};
368
369&u2phy {
370	status = "okay";
371
372	u2phy_host: host-port {
373		status = "okay";
374	};
375
376	u2phy_otg: otg-port {
377		status = "okay";
378	};
379};
380
381&usb20_otg {
382	dr_mode = "host";
383	status = "okay";
384};
385
386&usb_host0_ehci {
387	status = "okay";
388};
389
390&usb_host0_ohci {
391	status = "okay";
392};
393
394&vop {
395	status = "okay";
396};
397
398&vop_mmu {
399	status = "okay";
400};
401