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_led: led-0 {
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_led: led-1 {
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	mmc-pwrseq = <&emmc_pwrseq>;
165	mmc-hs200-1_2v;
166	mmc-hs200-1_8v;
167	non-removable;
168	pinctrl-names = "default";
169	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
170	status = "okay";
171};
172
173&gmac {
174	assigned-clocks = <&cru SCLK_MAC>;
175	assigned-clock-parents = <&ext_gmac>;
176	clock_in_out = "input";
177	phy-supply = <&vcc_lan>;
178	phy-mode = "rgmii";
179	pinctrl-names = "default";
180	pinctrl-0 = <&rgmii_pins>;
181	snps,reset-gpio = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
182	snps,reset-active-low;
183	snps,reset-delays-us = <0 10000 1000000>;
184	tx_delay = <0x30>;
185	rx_delay = <0x10>;
186	status = "ok";
187};
188
189&i2c0 {
190	status = "okay";
191
192	vdd_cpu: syr827@40 {
193		compatible = "silergy,syr827";
194		reg = <0x40>;
195		fcs,suspend-voltage-selector = <1>;
196		regulator-name = "vdd_cpu";
197		regulator-enable-ramp-delay = <300>;
198		regulator-min-microvolt = <712500>;
199		regulator-max-microvolt = <1500000>;
200		regulator-ramp-delay = <8000>;
201		regulator-always-on;
202		regulator-boot-on;
203		vin-supply = <&vcc_sys>;
204	};
205
206	hym8563: hym8563@51 {
207		compatible = "haoyu,hym8563";
208		reg = <0x51>;
209		#clock-cells = <0>;
210		clock-frequency = <32768>;
211		clock-output-names = "xin32k";
212		/* rtc_int is not connected */
213	};
214};
215
216&pinctrl {
217	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
218		bias-disable;
219		drive-strength = <8>;
220	};
221
222	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
223		bias-pull-up;
224		drive-strength = <8>;
225	};
226
227	emmc {
228		emmc_bus8: emmc-bus8 {
229			rockchip,pins = <1 RK_PC2 2 &pcfg_pull_up_drv_8ma>,
230					<1 RK_PC3 2 &pcfg_pull_up_drv_8ma>,
231					<1 RK_PC4 2 &pcfg_pull_up_drv_8ma>,
232					<1 RK_PC5 2 &pcfg_pull_up_drv_8ma>,
233					<1 RK_PC6 2 &pcfg_pull_up_drv_8ma>,
234					<1 RK_PC7 2 &pcfg_pull_up_drv_8ma>,
235					<1 RK_PD0 2 &pcfg_pull_up_drv_8ma>,
236					<1 RK_PD1 2 &pcfg_pull_up_drv_8ma>;
237		};
238
239		emmc-clk {
240			rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none_drv_8ma>;
241		};
242
243		emmc-cmd {
244			rockchip,pins = <1 RK_PD2 2 &pcfg_pull_up_drv_8ma>;
245		};
246
247		emmc_reset: emmc-reset {
248			rockchip,pins = <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
249		};
250	};
251
252	keys {
253		pwr_key: pwr-key {
254			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>;
255		};
256	};
257
258	leds {
259		stby_pwren: stby-pwren {
260			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
261		};
262
263		led_ctl: led-ctl {
264			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
265		};
266	};
267
268	sdmmc {
269		sdmmc_clk: sdmmc-clk {
270			rockchip,pins = <2 RK_PB1 1 &pcfg_pull_none_drv_8ma>;
271		};
272
273		sdmmc_cmd: sdmmc-cmd {
274			rockchip,pins = <2 RK_PB2 1 &pcfg_pull_up_drv_8ma>;
275		};
276
277		sdmmc_cd: sdmmc-cd {
278			rockchip,pins = <2 RK_PB3 1 &pcfg_pull_up_drv_8ma>;
279		};
280
281		sdmmc_bus1: sdmmc-bus1 {
282			rockchip,pins = <2 RK_PA5 1 &pcfg_pull_up_drv_8ma>;
283		};
284
285		sdmmc_bus4: sdmmc-bus4 {
286			rockchip,pins = <2 RK_PA5 1 &pcfg_pull_up_drv_8ma>,
287					<2 RK_PA6 1 &pcfg_pull_up_drv_8ma>,
288					<2 RK_PA7 1 &pcfg_pull_up_drv_8ma>,
289					<2 RK_PB0 1 &pcfg_pull_up_drv_8ma>;
290		};
291	};
292
293	usb {
294		host_vbus_drv: host-vbus-drv {
295			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
296		};
297	};
298};
299
300&saradc {
301	vref-supply = <&vcc_18>;
302	status = "okay";
303};
304
305&sdmmc {
306	bus-width = <4>;
307	clock-frequency = <50000000>;
308	max-frequency = <50000000>;
309	cap-sd-highspeed;
310	card-detect-delay = <200>;
311	pinctrl-names = "default";
312	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
313	vmmc-supply = <&vcc_sd>;
314	vqmmc-supply = <&vccio_sd>;
315	status = "okay";
316};
317
318&uart2 {
319	status = "okay";
320};
321
322&uart4 {
323	pinctrl-names = "default";
324	pinctrl-0 = <&uart4_xfer>;
325	status = "okay";
326};
327
328&usb_host0_ehci {
329	status = "okay";
330};
331
332&usb_otg {
333	status = "okay";
334};
335
336&wdt {
337	status = "okay";
338};
339