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