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