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