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