xref: /linux/arch/arm64/boot/dts/rockchip/rk3368-r88.dts (revision e5c86679d5e864947a52fb31e45a425dea3e7fa9)
1/*
2 * Copyright (c) 2015 Heiko Stuebner <heiko@sntech.de>
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 *  a) This file is free software; you can redistribute it and/or
10 *     modify it under the terms of the GNU General Public License as
11 *     published by the Free Software Foundation; either version 2 of the
12 *     License, or (at your option) any later version.
13 *
14 *     This file is distributed in the hope that it will be useful,
15 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *     GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 *  b) Permission is hereby granted, free of charge, to any person
22 *     obtaining a copy of this software and associated documentation
23 *     files (the "Software"), to deal in the Software without
24 *     restriction, including without limitation the rights to use,
25 *     copy, modify, merge, publish, distribute, sublicense, and/or
26 *     sell copies of the Software, and to permit persons to whom the
27 *     Software is furnished to do so, subject to the following
28 *     conditions:
29 *
30 *     The above copyright notice and this permission notice shall be
31 *     included in all copies or substantial portions of the Software.
32 *
33 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 *     OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/dts-v1/;
44#include "rk3368.dtsi"
45#include <dt-bindings/input/input.h>
46
47/ {
48	model = "Rockchip R88";
49	compatible = "rockchip,r88", "rockchip,rk3368";
50
51	chosen {
52		stdout-path = "serial2:115200n8";
53	};
54
55	memory {
56		device_type = "memory";
57		reg = <0x0 0x0 0x0 0x40000000>;
58	};
59
60	emmc_pwrseq: emmc-pwrseq {
61		compatible = "mmc-pwrseq-emmc";
62		pinctrl-0 = <&emmc_reset>;
63		pinctrl-names = "default";
64		reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
65	};
66
67	keys: gpio-keys {
68		compatible = "gpio-keys";
69		pinctrl-names = "default";
70		pinctrl-0 = <&pwr_key>;
71
72		power {
73			wakeup-source;
74			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
75			label = "GPIO Power";
76			linux,code = <KEY_POWER>;
77		};
78	};
79
80	leds: gpio-leds {
81		compatible = "gpio-leds";
82
83		work {
84			gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
85			label = "r88:green:led";
86			pinctrl-names = "default";
87			pinctrl-0 = <&led_ctl>;
88		};
89	};
90
91	ir: ir-receiver {
92		compatible = "gpio-ir-receiver";
93		gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_LOW>;
94		pinctrl-names = "default";
95		pinctrl-0 = <&ir_int>;
96	};
97
98	sdio_pwrseq: sdio-pwrseq {
99		compatible = "mmc-pwrseq-simple";
100		clocks = <&hym8563>;
101		clock-names = "ext_clock";
102		pinctrl-names = "default";
103		pinctrl-0 = <&bt_rst>, <&wifi_reg_on>;
104
105		reset-gpios =
106			/* BT_RST_N */
107			<&gpio3 RK_PA5 GPIO_ACTIVE_LOW>,
108
109			/* WL_REG_ON */
110			<&gpio3 RK_PA4 GPIO_ACTIVE_LOW>;
111	};
112
113	vcc_18: vcc18-regulator {
114		compatible = "regulator-fixed";
115		regulator-name = "vcc_18";
116		regulator-min-microvolt = <1800000>;
117		regulator-max-microvolt = <1800000>;
118		regulator-always-on;
119		regulator-boot-on;
120		vin-supply = <&vcc_sys>;
121	};
122
123	/* supplies both host and otg */
124	vcc_host: vcc-host-regulator {
125		compatible = "regulator-fixed";
126		enable-active-high;
127		gpio = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
128		pinctrl-names = "default";
129		pinctrl-0 = <&host_vbus_drv>;
130		regulator-name = "vcc_host";
131		regulator-always-on;
132		regulator-boot-on;
133		vin-supply = <&vcc_sys>;
134	};
135
136	vcc_io: vcc-io-regulator {
137		compatible = "regulator-fixed";
138		regulator-name = "vcc_io";
139		regulator-min-microvolt = <3300000>;
140		regulator-max-microvolt = <3300000>;
141		regulator-always-on;
142		regulator-boot-on;
143		vin-supply = <&vcc_sys>;
144	};
145
146	vcc_lan: vcc-lan-regulator {
147		compatible = "regulator-fixed";
148		regulator-name = "vcc_lan";
149		regulator-min-microvolt = <3300000>;
150		regulator-max-microvolt = <3300000>;
151		regulator-always-on;
152		regulator-boot-on;
153		vin-supply = <&vcc_io>;
154	};
155
156	vcc_sys: vcc-sys-regulator {
157		compatible = "regulator-fixed";
158		regulator-name = "vcc_sys";
159		regulator-min-microvolt = <5000000>;
160		regulator-max-microvolt = <5000000>;
161		regulator-always-on;
162		regulator-boot-on;
163	};
164
165	vccio_wl: vccio-wl-regulator {
166		compatible = "regulator-fixed";
167		regulator-name = "vccio_wl";
168		regulator-min-microvolt = <3300000>;
169		regulator-max-microvolt = <3300000>;
170		regulator-always-on;
171		regulator-boot-on;
172		vin-supply = <&vcc_io>;
173	};
174
175	vdd_10: vdd-10-regulator {
176		compatible = "regulator-fixed";
177		regulator-name = "vdd_10";
178		regulator-min-microvolt = <1000000>;
179		regulator-max-microvolt = <1000000>;
180		regulator-always-on;
181		regulator-boot-on;
182		vin-supply = <&vcc_sys>;
183	};
184};
185
186&emmc {
187	bus-width = <8>;
188	cap-mmc-highspeed;
189	disable-wp;
190	mmc-pwrseq = <&emmc_pwrseq>;
191	non-removable;
192	num-slots = <1>;
193	pinctrl-names = "default";
194	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
195	status = "okay";
196};
197
198&gmac {
199	phy-supply = <&vcc_lan>;
200	phy-mode = "rmii";
201	clock_in_out = "output";
202	snps,reset-gpio = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
203	snps,reset-active-low;
204	snps,reset-delays-us = <0 10000 1000000>;
205	pinctrl-names = "default";
206	pinctrl-0 = <&rmii_pins>;
207	tx_delay = <0x30>;
208	rx_delay = <0x10>;
209	status = "ok";
210};
211
212&i2c0 {
213	status = "okay";
214
215	vdd_cpu: syr827@40 {
216		compatible = "silergy,syr827";
217		reg = <0x40>;
218		fcs,suspend-voltage-selector = <1>;
219		regulator-name = "vdd_cpu";
220		regulator-enable-ramp-delay = <300>;
221		regulator-min-microvolt = <712500>;
222		regulator-max-microvolt = <1500000>;
223		regulator-ramp-delay = <8000>;
224		regulator-always-on;
225		regulator-boot-on;
226		vin-supply = <&vcc_sys>;
227	};
228
229	hym8563: hym8563@51 {
230		compatible = "haoyu,hym8563";
231		reg = <0x51>;
232		#clock-cells = <0>;
233		clock-frequency = <32768>;
234		clock-output-names = "xin32k";
235		/* rtc_int is not connected */
236	};
237};
238
239&io_domains {
240	status = "ok";
241
242	audio-supply = <&vcc_io>;
243	gpio30-supply = <&vcc_io>;
244	gpio1830-supply = <&vcc_io>;
245	wifi-supply = <&vccio_wl>;
246};
247
248&sdio0 {
249	assigned-clocks = <&cru SCLK_SDIO0>;
250	assigned-clock-parents = <&cru PLL_CPLL>;
251	bus-width = <4>;
252	cap-sd-highspeed;
253	cap-sdio-irq;
254	keep-power-in-suspend;
255	mmc-pwrseq = <&sdio_pwrseq>;
256	non-removable;
257	num-slots = <1>;
258	pinctrl-names = "default";
259	pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_bus4>;
260	vmmc-supply = <&vcc_io>;
261	vqmmc-supply = <&vccio_wl>;
262	status = "okay";
263};
264
265&pinctrl {
266	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
267		bias-disable;
268		drive-strength = <8>;
269	};
270
271	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
272		bias-pull-up;
273		drive-strength = <8>;
274	};
275
276	emmc {
277		emmc_bus8: emmc-bus8 {
278			rockchip,pins = <1 18 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
279					<1 19 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
280					<1 20 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
281					<1 21 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
282					<1 22 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
283					<1 23 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
284					<1 24 RK_FUNC_2 &pcfg_pull_up_drv_8ma>,
285					<1 25 RK_FUNC_2 &pcfg_pull_up_drv_8ma>;
286		};
287
288		emmc-clk {
289			rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none_drv_8ma>;
290		};
291
292		emmc-cmd {
293			rockchip,pins = <1 26 RK_FUNC_2 &pcfg_pull_up_drv_8ma>;
294		};
295
296		emmc_reset: emmc-reset {
297			rockchip,pins = <2 3 RK_FUNC_GPIO &pcfg_pull_none>;
298		};
299	};
300
301	ir {
302		ir_int: ir-int {
303			rockchip,pins = <3 30 RK_FUNC_GPIO &pcfg_pull_up>;
304		};
305	};
306
307	keys {
308		pwr_key: pwr-key {
309			rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
310		};
311	};
312
313	leds {
314		stby_pwren: stby-pwren {
315			rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
316		};
317
318		led_ctl: led-ctl {
319			rockchip,pins = <3 29 RK_FUNC_GPIO &pcfg_pull_none>;
320		};
321	};
322
323	sdio {
324		wifi_reg_on: wifi-reg-on {
325			rockchip,pins = <3 4 RK_FUNC_GPIO &pcfg_pull_none>;
326		};
327
328		bt_rst: bt-rst {
329			rockchip,pins = <3 5 RK_FUNC_GPIO &pcfg_pull_none>;
330		};
331	};
332
333	usb {
334		host_vbus_drv: host-vbus-drv {
335			rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_none>;
336		};
337	};
338};
339
340&pmu_io_domains {
341	status = "okay";
342
343	pmu-supply = <&vcc_io>;
344	vop-supply = <&vcc_io>;
345};
346
347&saradc {
348	vref-supply = <&vcc_18>;
349	status = "okay";
350};
351
352&tsadc {
353	rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
354	rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
355	status = "okay";
356};
357
358&uart2 {
359	status = "okay";
360};
361
362&usb_host0_ehci {
363	status = "okay";
364};
365
366&usb_otg {
367	dr_mode = "host";
368	status = "okay";
369};
370
371&wdt {
372	status = "okay";
373};
374