1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
4 */
5
6/dts-v1/;
7#include <dt-bindings/input/input.h>
8#include "rk3188.dtsi"
9
10/ {
11	model = "Radxa Rock";
12	compatible = "radxa,rock", "rockchip,rk3188";
13
14	memory@60000000 {
15		device_type = "memory";
16		reg = <0x60000000 0x80000000>;
17	};
18
19	gpio-keys {
20		compatible = "gpio-keys";
21		autorepeat;
22
23		power {
24			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
25			linux,code = <KEY_POWER>;
26			label = "GPIO Key Power";
27			linux,input-type = <1>;
28			wakeup-source;
29			debounce-interval = <100>;
30		};
31	};
32
33	gpio-leds {
34		compatible = "gpio-leds";
35
36		green {
37			label = "rock:green:user1";
38			gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_LOW>;
39			default-state = "off";
40		};
41
42		blue {
43			label = "rock:blue:user2";
44			gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
45			default-state = "off";
46		};
47
48		sleep {
49			label = "rock:red:power";
50			gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
51			default-state = "off";
52		};
53	};
54
55	sound {
56		compatible = "simple-audio-card";
57		simple-audio-card,name = "SPDIF";
58
59		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
60			cpu { sound-dai = <&spdif>; };
61			codec { sound-dai = <&spdif_out>; };
62		};
63	};
64
65	spdif_out: spdif-out {
66		compatible = "linux,spdif-dit";
67		#sound-dai-cells = <0>;
68	};
69
70	ir_recv: gpio-ir-receiver {
71		compatible = "gpio-ir-receiver";
72		gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
73		pinctrl-names = "default";
74		pinctrl-0 = <&ir_recv_pin>;
75	};
76
77	vcc_otg: usb-otg-regulator {
78		compatible = "regulator-fixed";
79		enable-active-high;
80		gpio = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
81		pinctrl-names = "default";
82		pinctrl-0 = <&otg_vbus_drv>;
83		regulator-name = "otg-vbus";
84		regulator-min-microvolt = <5000000>;
85		regulator-max-microvolt = <5000000>;
86		regulator-always-on;
87		regulator-boot-on;
88	};
89
90	vcc_sd0: sdmmc-regulator {
91		compatible = "regulator-fixed";
92		regulator-name = "sdmmc-supply";
93		regulator-min-microvolt = <3300000>;
94		regulator-max-microvolt = <3300000>;
95		gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
96		startup-delay-us = <100000>;
97		vin-supply = <&vcc_io>;
98	};
99
100	vcc_host: usb-host-regulator {
101		compatible = "regulator-fixed";
102		enable-active-high;
103		gpio = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
104		pinctrl-names = "default";
105		pinctrl-0 = <&host_vbus_drv>;
106		regulator-name = "host-pwr";
107		regulator-min-microvolt = <5000000>;
108		regulator-max-microvolt = <5000000>;
109		regulator-always-on;
110		regulator-boot-on;
111	};
112
113	vsys: vsys-regulator {
114		compatible = "regulator-fixed";
115		regulator-name = "vsys";
116		regulator-min-microvolt = <5000000>;
117		regulator-max-microvolt = <5000000>;
118		regulator-boot-on;
119	};
120};
121
122&emac {
123	status = "okay";
124
125	pinctrl-names = "default";
126	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
127
128	phy = <&phy0>;
129	phy-supply = <&vcc_rmii>;
130
131	phy0: ethernet-phy@0 {
132		reg = <0>;
133		interrupt-parent = <&gpio3>;
134		interrupts = <RK_PD2 IRQ_TYPE_LEVEL_LOW>;
135	};
136};
137
138&cpu0 {
139	cpu0-supply = <&vdd_arm>;
140};
141
142&gpu {
143	status = "okay";
144};
145
146&i2c1 {
147	status = "okay";
148	clock-frequency = <400000>;
149
150	rtc@51 {
151		compatible = "haoyu,hym8563";
152		reg = <0x51>;
153		interrupt-parent = <&gpio0>;
154		interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
155		pinctrl-names = "default";
156		pinctrl-0 = <&rtc_int>;
157		#clock-cells = <0>;
158		clock-output-names = "xin32k";
159	};
160
161	act8846: act8846@5a {
162		compatible = "active-semi,act8846";
163		reg = <0x5a>;
164		status = "okay";
165		system-power-controller;
166
167		pinctrl-names = "default";
168		pinctrl-0 = <&act8846_dvs0_ctl>;
169
170		vp1-supply = <&vsys>;
171		vp2-supply = <&vsys>;
172		vp3-supply = <&vsys>;
173		vp4-supply = <&vsys>;
174		inl1-supply = <&vcc_io>;
175		inl2-supply = <&vsys>;
176		inl3-supply = <&vsys>;
177
178		regulators {
179			vcc_ddr: REG1 {
180				regulator-name = "VCC_DDR";
181				regulator-min-microvolt = <1200000>;
182				regulator-max-microvolt = <1200000>;
183				regulator-always-on;
184			};
185
186			vdd_log: REG2 {
187				regulator-name = "VDD_LOG";
188				regulator-min-microvolt = <1000000>;
189				regulator-max-microvolt = <1000000>;
190				regulator-always-on;
191			};
192
193			vdd_arm: REG3 {
194				regulator-name = "VDD_ARM";
195				regulator-min-microvolt = <875000>;
196				regulator-max-microvolt = <1350000>;
197				regulator-always-on;
198			};
199
200			vcc_io: REG4 {
201				regulator-name = "VCC_IO";
202				regulator-min-microvolt = <3300000>;
203				regulator-max-microvolt = <3300000>;
204				regulator-always-on;
205			};
206
207			vdd_10: REG5 {
208				regulator-name = "VDD_10";
209				regulator-min-microvolt = <1000000>;
210				regulator-max-microvolt = <1000000>;
211				regulator-always-on;
212			};
213
214			vdd_hdmi: REG6 {
215				regulator-name = "VDD_HDMI";
216				regulator-min-microvolt = <2500000>;
217				regulator-max-microvolt = <2500000>;
218				regulator-always-on;
219			};
220
221			vcc18: REG7 {
222				regulator-name = "VCC_18";
223				regulator-min-microvolt = <1800000>;
224				regulator-max-microvolt = <1800000>;
225				regulator-always-on;
226			};
227
228			vcca_33: REG8 {
229				regulator-name = "VCCA_33";
230				regulator-min-microvolt = <3300000>;
231				regulator-max-microvolt = <3300000>;
232				regulator-always-on;
233			};
234
235			vcc_rmii: REG9 {
236				regulator-name = "VCC_RMII";
237				regulator-min-microvolt = <3300000>;
238				regulator-max-microvolt = <3300000>;
239			};
240
241			vccio_wl: REG10 {
242				regulator-name = "VCCIO_WL";
243				regulator-min-microvolt = <3300000>;
244				regulator-max-microvolt = <3300000>;
245				regulator-always-on;
246			};
247
248			vcc_18: REG11 {
249				regulator-name = "VCC18_IO";
250				regulator-min-microvolt = <1800000>;
251				regulator-max-microvolt = <1800000>;
252				regulator-always-on;
253			};
254
255			vcc28: REG12 {
256				regulator-name = "VCC_28";
257				regulator-min-microvolt = <2800000>;
258				regulator-max-microvolt = <2800000>;
259				regulator-always-on;
260			};
261		};
262	};
263};
264
265&mmc0 {
266	status = "okay";
267	pinctrl-names = "default";
268	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
269	vmmc-supply = <&vcc_sd0>;
270
271	bus-width = <4>;
272	cap-mmc-highspeed;
273	cap-sd-highspeed;
274	disable-wp;
275};
276
277&pwm1 {
278	status = "okay";
279};
280
281&pwm2 {
282	status = "okay";
283};
284
285&pwm3 {
286	status = "okay";
287};
288
289&pinctrl {
290	pcfg_output_low: pcfg-output-low {
291		output-low;
292	};
293
294	act8846 {
295		act8846_dvs0_ctl: act8846-dvs0-ctl {
296			rockchip,pins = <RK_GPIO3 27 RK_FUNC_GPIO &pcfg_output_low>;
297		};
298	};
299
300	hym8563 {
301		rtc_int: rtc-int {
302			rockchip,pins = <RK_GPIO0 0 RK_FUNC_GPIO &pcfg_pull_up>;
303		};
304	};
305
306	lan8720a  {
307		phy_int: phy-int {
308			rockchip,pins = <RK_GPIO3 26 RK_FUNC_GPIO &pcfg_pull_up>;
309		};
310	};
311
312	ir-receiver {
313		ir_recv_pin: ir-recv-pin {
314			rockchip,pins = <RK_GPIO0 10 RK_FUNC_GPIO &pcfg_pull_none>;
315		};
316	};
317
318	usb {
319		host_vbus_drv: host-vbus-drv {
320			rockchip,pins = <0 3 RK_FUNC_GPIO &pcfg_pull_none>;
321		};
322		otg_vbus_drv: otg-vbus-drv {
323			rockchip,pins = <2 31 RK_FUNC_GPIO &pcfg_pull_none>;
324		};
325	};
326};
327
328&spdif {
329	status = "okay";
330};
331
332&uart0 {
333	status = "okay";
334};
335
336&uart1 {
337	status = "okay";
338};
339
340&uart2 {
341	status = "okay";
342};
343
344&uart3 {
345	status = "okay";
346};
347
348&usbphy {
349	status = "okay";
350};
351
352&usb_host {
353	status = "okay";
354};
355
356&usb_otg {
357	status = "okay";
358};
359
360&wdt {
361	status = "okay";
362};
363