1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Matthias Brugger <mbrugger@suse.com>
4 */
5
6/dts-v1/;
7#include <dt-bindings/input/input.h>
8#include "rk3368.dtsi"
9
10/ {
11	model = "Rockchip Orion R68";
12	compatible = "tronsmart,orion-r68-meta", "rockchip,rk3368";
13
14	chosen {
15		stdout-path = "serial2:115200n8";
16	};
17
18	memory {
19		device_type = "memory";
20		reg = <0x0 0x0 0x0 0x80000000>;
21	};
22
23	emmc_pwrseq: emmc-pwrseq {
24		compatible = "mmc-pwrseq-emmc";
25		pinctrl-0 = <&emmc_reset>;
26		pinctrl-names = "default";
27		reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
28	};
29
30	ext_gmac: external-gmac-clock {
31		compatible = "fixed-clock";
32		#clock-cells = <0>;
33		clock-frequency = <125000000>;
34		clock-output-names = "ext_gmac";
35	};
36
37	keys: gpio-keys {
38		compatible = "gpio-keys";
39		pinctrl-names = "default";
40		pinctrl-0 = <&pwr_key>;
41
42		power {
43			wakeup-source;
44			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
45			label = "GPIO Power";
46			linux,code = <KEY_POWER>;
47		};
48	};
49
50	leds: gpio-leds {
51		compatible = "gpio-leds";
52
53		red {
54			gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
55			label = "orion:red:led";
56			pinctrl-names = "default";
57			pinctrl-0 = <&led_ctl>;
58			default-state = "on";
59		};
60
61		blue {
62			gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
63			label = "orion:blue:led";
64			pinctrl-names = "default";
65			pinctrl-0 = <&stby_pwren>;
66			default-state = "off";
67		};
68	};
69
70	vcc_18: vcc18-regulator {
71		compatible = "regulator-fixed";
72		regulator-name = "vcc_18";
73		regulator-min-microvolt = <1800000>;
74		regulator-max-microvolt = <1800000>;
75		regulator-always-on;
76		regulator-boot-on;
77		vin-supply = <&vcc_sys>;
78	};
79
80	/* supplies both host and otg */
81	vcc_host: vcc-host-regulator {
82		compatible = "regulator-fixed";
83		gpio = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
84		pinctrl-names = "default";
85		pinctrl-0 = <&host_vbus_drv>;
86		regulator-name = "vcc_host";
87		regulator-always-on;
88		regulator-boot-on;
89		vin-supply = <&vcc_sys>;
90	};
91
92	vcc_io: vcc-io-regulator {
93		compatible = "regulator-fixed";
94		regulator-name = "vcc_io";
95		regulator-min-microvolt = <3300000>;
96		regulator-max-microvolt = <3300000>;
97		regulator-always-on;
98		regulator-boot-on;
99		vin-supply = <&vcc_sys>;
100	};
101
102	vcc_lan: vcc-lan-regulator {
103		compatible = "regulator-fixed";
104		regulator-name = "vcc_lan";
105		regulator-min-microvolt = <3300000>;
106		regulator-max-microvolt = <3300000>;
107		regulator-always-on;
108		regulator-boot-on;
109		vin-supply = <&vcc_io>;
110	};
111
112	vcc_sd: vcc-sd-regulator {
113		compatible = "regulator-fixed";
114		regulator-name = "vcc_sd";
115		gpio = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
116		regulator-min-microvolt = <1800000>;
117		regulator-max-microvolt = <3300000>;
118		vin-supply = <&vcc_io>;
119	};
120
121	vcc_sys: vcc-sys-regulator {
122		compatible = "regulator-fixed";
123		regulator-name = "vcc_sys";
124		regulator-min-microvolt = <5000000>;
125		regulator-max-microvolt = <5000000>;
126		regulator-always-on;
127		regulator-boot-on;
128	};
129
130	vccio_sd: vcc-io-sd-regulator {
131		compatible = "regulator-fixed";
132		regulator-name= "vccio_sd";
133		regulator-min-microvolt = <1800000>;
134		regulator-max-microvolt = <3300000>;
135		regulator-always-on;
136		regulator-boot-on;
137		vin-supply = <&vcc_io>;
138	};
139
140	vccio_wl: vccio-wl-regulator {
141		compatible = "regulator-fixed";
142		regulator-name = "vccio_wl";
143		regulator-min-microvolt = <3300000>;
144		regulator-max-microvolt = <3300000>;
145		regulator-always-on;
146		regulator-boot-on;
147		vin-supply = <&vcc_io>;
148	};
149
150	vdd_10: vdd-10-regulator {
151		compatible = "regulator-fixed";
152		regulator-name = "vdd_10";
153		regulator-min-microvolt = <1000000>;
154		regulator-max-microvolt = <1000000>;
155		regulator-always-on;
156		regulator-boot-on;
157		vin-supply = <&vcc_sys>;
158	};
159};
160
161&emmc {
162	bus-width = <8>;
163	cap-mmc-highspeed;
164	disable-wp;
165	mmc-pwrseq = <&emmc_pwrseq>;
166	mmc-hs200-1_2v;
167	mmc-hs200-1_8v;
168	non-removable;
169	pinctrl-names = "default";
170	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
171	status = "okay";
172};
173
174&gmac {
175	assigned-clocks = <&cru SCLK_MAC>;
176	assigned-clock-parents = <&ext_gmac>;
177	clock_in_out = "input";
178	phy-supply = <&vcc_lan>;
179	phy-mode = "rgmii";
180	pinctrl-names = "default";
181	pinctrl-0 = <&rgmii_pins>;
182	snps,reset-gpio = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
183	snps,reset-active-low;
184	snps,reset-delays-us = <0 10000 1000000>;
185	tx_delay = <0x30>;
186	rx_delay = <0x10>;
187	status = "ok";
188};
189
190&i2c0 {
191	status = "okay";
192
193	vdd_cpu: syr827@40 {
194		compatible = "silergy,syr827";
195		reg = <0x40>;
196		fcs,suspend-voltage-selector = <1>;
197		regulator-name = "vdd_cpu";
198		regulator-enable-ramp-delay = <300>;
199		regulator-min-microvolt = <712500>;
200		regulator-max-microvolt = <1500000>;
201		regulator-ramp-delay = <8000>;
202		regulator-always-on;
203		regulator-boot-on;
204		vin-supply = <&vcc_sys>;
205	};
206
207	hym8563: hym8563@51 {
208		compatible = "haoyu,hym8563";
209		reg = <0x51>;
210		#clock-cells = <0>;
211		clock-frequency = <32768>;
212		clock-output-names = "xin32k";
213		/* rtc_int is not connected */
214	};
215};
216
217&pinctrl {
218	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
219		bias-disable;
220		drive-strength = <8>;
221	};
222
223	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
224		bias-pull-up;
225		drive-strength = <8>;
226	};
227
228	emmc {
229		emmc_bus8: emmc-bus8 {
230			rockchip,pins = <1 18 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
231					<1 19 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
232					<1 20 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
233					<1 21 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
234					<1 22 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
235					<1 23 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
236					<1 24 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
237					<1 25 RK_FUNC_2 &pcfg_pull_up_drv_8ma>;
238		};
239
240		emmc-clk {
241			rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none_drv_8ma>;
242		};
243
244		emmc-cmd {
245			rockchip,pins = <1 26 RK_FUNC_2 &pcfg_pull_up_drv_8ma>;
246		};
247
248		emmc_reset: emmc-reset {
249			rockchip,pins = <2 3 RK_FUNC_GPIO &pcfg_pull_none>;
250		};
251	};
252
253	keys {
254		pwr_key: pwr-key {
255			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_down>;
256		};
257	};
258
259	leds {
260		stby_pwren: stby-pwren {
261			rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
262		};
263
264		led_ctl: led-ctl {
265			rockchip,pins = <3 29 RK_FUNC_GPIO &pcfg_pull_none>;
266		};
267	};
268
269	sdmmc {
270		sdmmc_clk: sdmmc-clk {
271			rockchip,pins = <2 9 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
272		};
273
274		sdmmc_cmd: sdmmc-cmd {
275			rockchip,pins = <2 10 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
276		};
277
278		sdmmc_cd: sdmmc-cd {
279			rockchip,pins = <2 11 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
280		};
281
282		sdmmc_bus1: sdmmc-bus1 {
283			rockchip,pins = <2 5 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
284		};
285
286		sdmmc_bus4: sdmmc-bus4 {
287			rockchip,pins = <2 5 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
288					<2 6 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
289					<2 7 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
290					<2 8 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
291		};
292	};
293
294	usb {
295		host_vbus_drv: host-vbus-drv {
296			rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_none>;
297		};
298	};
299};
300
301&saradc {
302	vref-supply = <&vcc_18>;
303	status = "okay";
304};
305
306&sdmmc {
307	bus-width = <4>;
308	clock-frequency = <50000000>;
309	max-frequency = <50000000>;
310	cap-sd-highspeed;
311	card-detect-delay = <200>;
312	pinctrl-names = "default";
313	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
314	vmmc-supply = <&vcc_sd>;
315	vqmmc-supply = <&vccio_sd>;
316	status = "okay";
317};
318
319&uart2 {
320	status = "okay";
321};
322
323&uart4 {
324	pinctrl-names = "default";
325	pinctrl-0 = <&uart4_xfer>;
326	status = "okay";
327};
328
329&usb_host0_ehci {
330	status = "okay";
331};
332
333&usb_otg {
334	status = "okay";
335};
336
337&wdt {
338	status = "okay";
339};
340