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