xref: /OK3568_Linux_fs/kernel/arch/arm64/boot/dts/rockchip/rk3399-videostrong-linux.dts (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1/*
2 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
3 *
4 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5 */
6
7/dts-v1/;
8
9#include "rk3399-sapphire.dtsi"
10#include "rk3399-linux.dtsi"
11#include <dt-bindings/input/input.h>
12
13/ {
14	model = "Rockchip RK3399 Videostrong Board (Linux Opensource)";
15	compatible = "rockchip,rk3399-videostrong-linux", "rockchip,rk3399";
16
17	fiq_debugger: fiq-debugger {
18		compatible = "rockchip,fiq-debugger";
19		rockchip,serial-id = <2>;
20		rockchip,signal-irq = <182>;
21		rockchip,wake-irq = <0>;
22		rockchip,irq-mode-enable = <1>;  /* If enable uart uses irq instead of fiq */
23		rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
24		pinctrl-names = "default";
25		pinctrl-0 = <&uart2c_xfer>;
26	};
27
28	gpio-keys {
29		compatible = "gpio-keys";
30		#address-cells = <1>;
31		#size-cells = <0>;
32		autorepeat;
33
34		pinctrl-names = "default";
35		pinctrl-0 = <&pwrbtn>;
36
37		button@0 {
38			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
39			linux,code = <KEY_POWER>;
40			label = "GPIO Key Power";
41			linux,input-type = <1>;
42			gpio-key,wakeup = <1>;
43			debounce-interval = <100>;
44		};
45	};
46
47	hdmi_sound: hdmi-sound {
48		status = "okay";
49	};
50
51	rt5640-sound {
52		compatible = "simple-audio-card";
53		simple-audio-card,format = "i2s";
54		simple-audio-card,name = "rockchip,rt5640-codec";
55		simple-audio-card,mclk-fs = <256>;
56		simple-audio-card,widgets =
57			"Microphone", "Mic Jack",
58			"Headphone", "Headphone Jack";
59		simple-audio-card,routing =
60			"Mic Jack", "MICBIAS1",
61			"IN1P", "Mic Jack",
62			"Headphone Jack", "HPOL",
63			"Headphone Jack", "HPOR";
64		simple-audio-card,cpu {
65			sound-dai = <&i2s1>;
66		};
67		simple-audio-card,codec {
68			sound-dai = <&rt5640>;
69		};
70	};
71
72	sdio_pwrseq: sdio-pwrseq {
73		compatible = "mmc-pwrseq-simple";
74		clocks = <&rk808 1>;
75		clock-names = "ext_clock";
76		pinctrl-names = "default";
77		pinctrl-0 = <&wifi_enable_h>;
78
79		/*
80		 * On the module itself this is one of these (depending
81		 * on the actual card populated):
82		 * - SDIO_RESET_L_WL_REG_ON
83		 * - PDN (power down when low)
84		 */
85		reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
86	};
87
88	spdif-sound {
89		status = "okay";
90		compatible = "simple-audio-card";
91		simple-audio-card,name = "ROCKCHIP,SPDIF";
92		simple-audio-card,mclk-fs = <128>;
93		simple-audio-card,cpu {
94			sound-dai = <&spdif>;
95		};
96		simple-audio-card,codec {
97			sound-dai = <&spdif_out>;
98		};
99	};
100
101	spdif_out: spdif-out {
102		status = "okay";
103		compatible = "linux,spdif-dit";
104		#sound-dai-cells = <0>;
105	};
106
107	vccadc_ref: vccadc-ref {
108		compatible = "regulator-fixed";
109		regulator-name = "vcc1v8_sys";
110		regulator-always-on;
111		regulator-boot-on;
112		regulator-min-microvolt = <1800000>;
113		regulator-max-microvolt = <1800000>;
114	};
115
116	wireless-bluetooth {
117		compatible = "bluetooth-platdata";
118		clocks = <&rk808 1>;
119		clock-names = "ext_clock";
120		uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
121		pinctrl-names = "default", "rts_gpio";
122		pinctrl-0 = <&uart0_rts>;
123		pinctrl-1 = <&uart0_gpios>;
124		BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
125		BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
126		BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
127		status = "okay";
128	};
129
130	wireless-wlan {
131		compatible = "wlan-platdata";
132		rockchip,grf = <&grf>;
133		wifi_chip_type = "ap6354";
134		sdio_vref = <1800>;
135		WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
136		status = "okay";
137	};
138};
139
140&dfi {
141	status = "okay";
142};
143
144&display_subsystem {
145	status = "okay";
146};
147
148&dmc {
149	status = "okay";
150	center-supply = <&vdd_center>;
151	upthreshold = <40>;
152	downdifferential = <20>;
153	system-status-freq = <
154		/* system status	freq(KHz) */
155		SYS_STATUS_NORMAL       800000
156		SYS_STATUS_REBOOT       528000
157		SYS_STATUS_SUSPEND      200000
158		SYS_STATUS_VIDEO_1080P  200000
159		SYS_STATUS_VIDEO_4K     600000
160		SYS_STATUS_VIDEO_4K_10B 800000
161		SYS_STATUS_PERFORMANCE  800000
162		SYS_STATUS_BOOST        400000
163		SYS_STATUS_DUALVIEW     600000
164		SYS_STATUS_ISP          600000
165	>;
166	vop-bw-dmc-freq = <
167	/* min_bw(MB/s) max_bw(MB/s) freq(KHz) */
168		0       577      200000
169		578     1701     300000
170		1702    99999    400000
171	>;
172	auto-min-freq = <200000>;
173};
174
175&hdmi {
176	/* remove the hdmi_cec, reused by edp_hpd */
177	pinctrl-0 = <&hdmi_i2c_xfer>;
178	#address-cells = <1>;
179	#size-cells = <0>;
180	#sound-dai-cells = <0>;
181	status = "okay";
182};
183
184&i2c1 {
185	status = "okay";
186	i2c-scl-rising-time-ns = <300>;
187	i2c-scl-falling-time-ns = <15>;
188
189	rt5640: rt5640@1c {
190		#sound-dai-cells = <0>;
191		compatible = "realtek,rt5640";
192		reg = <0x1c>;
193		clocks = <&cru SCLK_I2S_8CH_OUT>;
194		clock-names = "mclk";
195		realtek,in1-differential;
196		pinctrl-names = "default";
197		pinctrl-0 = <&i2s_8ch_mclk>;
198	};
199};
200
201&i2s1 {
202	status = "okay";
203	rockchip,i2s-broken-burst-len;
204	rockchip,playback-channels = <2>;
205	rockchip,capture-channels = <2>;
206	#sound-dai-cells = <0>;
207};
208
209&rkvdec {
210	status = "okay";
211	/* 0 means ion, 1 means drm */
212	//allocator = <0>;
213};
214
215&rockchip_suspend {
216	status = "okay";
217	rockchip,sleep-debug-en = <1>;
218	rockchip,sleep-mode-config = <
219		(0
220		| RKPM_SLP_ARMPD
221		| RKPM_SLP_PERILPPD
222		| RKPM_SLP_DDR_RET
223		| RKPM_SLP_PLLPD
224		| RKPM_SLP_CENTER_PD
225		| RKPM_SLP_AP_PWROFF
226		)
227		>;
228	rockchip,wakeup-config = <
229		(0
230		| RKPM_GPIO_WKUP_EN
231		| RKPM_PWM_WKUP_EN
232		)
233		>;
234		rockchip,pwm-regulator-config = <
235		(0
236		| PWM2_REGULATOR_EN
237		)
238		>;
239		rockchip,power-ctrl =
240		<&gpio1 17 GPIO_ACTIVE_HIGH>,
241		<&gpio1 14 GPIO_ACTIVE_HIGH>;
242};
243
244&spdif {
245	status = "okay";
246	pinctrl-0 = <&spdif_bus>;
247	i2c-scl-rising-time-ns = <450>;
248	i2c-scl-falling-time-ns = <15>;
249	#sound-dai-cells = <0>;
250};
251
252&uart0 {
253	pinctrl-names = "default";
254	pinctrl-0 = <&uart0_xfer &uart0_cts>;
255	status = "okay";
256};
257
258&vopb {
259	status = "okay";
260};
261
262&vopb_mmu {
263	status = "okay";
264};
265
266&vopl {
267	status = "okay";
268};
269
270&vopl_mmu {
271	status = "okay";
272};
273
274&pinctrl {
275	buttons {
276		pwrbtn: pwrbtn {
277			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
278		};
279	};
280
281	sdio-pwrseq {
282		wifi_enable_h: wifi-enable-h {
283			rockchip,pins =
284				<0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
285		};
286	};
287
288	wireless-bluetooth {
289		uart0_gpios: uart0-gpios {
290			rockchip,pins =
291				<2 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
292		};
293	};
294};
295