xref: /OK3568_Linux_fs/kernel/arch/arm/boot/dts/rk3288-x7811-rk818-dual-dsi.dts (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1/*
2 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
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 "rk3288-evb.dtsi"
45#include "rk3288-android.dtsi"
46
47/ {
48	compatible = "rockchip,rk3288-evb-rk818", "rockchip,rk3288";
49
50	sdio_pwrseq: sdio-pwrseq {
51		compatible = "mmc-pwrseq-simple";
52		clocks = <&rk818 1>;
53		clock-names = "ext_clock";
54
55		/*
56		 * On the module itself this is one of these (depending
57		 * on the actual card populated):
58		 * - SDIO_RESET_L_WL_REG_ON
59		 * - PDN (power down when low)
60		 */
61		reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
62	};
63
64	wireless-bluetooth {
65		clocks = <&rk818 1>;
66		clock-names = "ext_clock";
67	};
68
69	/delete-node/ sdmmc-regulator;
70
71	vibrator {
72		compatible = "rk-vibrator-gpio";
73		vibrator-gpio = <&gpio7 21 GPIO_ACTIVE_LOW>;
74		status = "okay";
75	};
76
77	xin32k: xin32k {
78		compatible = "fixed-clock";
79		clock-frequency = <32768>;
80		clock-output-names = "xin32k";
81		#clock-cells = <0>;
82	};
83
84};
85
86&cpu0 {
87	cpu0-supply = <&vdd_cpu>;
88};
89
90&gpu {
91	status = "okay";
92	mali-supply = <&vdd_gpu>;
93};
94
95&i2c0 {
96	clock-frequency = <400000>;
97
98	vdd_cpu: syr827@40 {
99		compatible = "silergy,syr827";
100		reg = <0x40>;
101		vin-supply = <&vcc_sys>;
102		regulator-compatible = "fan53555-reg";
103		pinctrl-0 = <&vsel1_gpio>;
104		vsel-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
105		regulator-name = "vdd_cpu";
106		regulator-min-microvolt = <712500>;
107		regulator-max-microvolt = <1500000>;
108		regulator-ramp-delay = <1000>;
109		fcs,suspend-voltage-selector = <1>;
110		regulator-always-on;
111		regulator-boot-on;
112		regulator-initial-state = <3>;
113		regulator-state-mem {
114			regulator-off-in-suspend;
115		};
116	};
117
118	rk818: pmic@1c {
119		compatible = "rockchip,rk818";
120		reg = <0x1c>;
121		status = "okay";
122
123		clock-output-names = "rk818-clkout1", "wifibt_32kin";
124		interrupt-parent = <&gpio0>;
125		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
126		pinctrl-names = "default";
127		pinctrl-0 = <&pmic_int>;
128		rockchip,system-power-controller;
129		wakeup-source;
130		#clock-cells = <1>;
131
132		vcc1-supply = <&vcc_sys>;
133		vcc2-supply = <&vcc_sys>;
134		vcc3-supply = <&vcc_sys>;
135		vcc4-supply = <&vcc_sys>;
136		vcc6-supply = <&vcc_sys>;
137		vcc7-supply = <&vcc_sys>;
138		vcc8-supply = <&vcc_sys>;
139		vcc9-supply = <&vcc_io>;
140
141		regulators {
142			vdd_logic: DCDC_REG1 {
143				regulator-name = "vdd_logic";
144				regulator-always-on;
145				regulator-boot-on;
146				regulator-min-microvolt = <800000>;
147				regulator-max-microvolt = <1250000>;
148				regulator-ramp-delay = <6001>;
149				regulator-state-mem {
150					regulator-on-in-suspend;
151					regulator-suspend-microvolt = <1000000>;
152				};
153			};
154
155			vdd_gpu: DCDC_REG2 {
156				regulator-name = "vdd_gpu";
157				regulator-always-on;
158				regulator-boot-on;
159				regulator-min-microvolt = <800000>;
160				regulator-max-microvolt = <1250000>;
161				regulator-ramp-delay = <6001>;
162				regulator-state-mem {
163					regulator-on-in-suspend;
164					regulator-suspend-microvolt = <1000000>;
165				};
166			};
167
168			vcc_ddr: DCDC_REG3 {
169				regulator-always-on;
170				regulator-boot-on;
171				regulator-name = "vcc_ddr";
172				regulator-state-mem {
173					regulator-on-in-suspend;
174				};
175			};
176
177			vcc_io: DCDC_REG4 {
178				regulator-always-on;
179				regulator-boot-on;
180				regulator-min-microvolt = <3300000>;
181				regulator-max-microvolt = <3300000>;
182				regulator-name = "vcc_io";
183				regulator-state-mem {
184					regulator-off-in-suspend;
185				};
186			};
187
188			vcca_codec: LDO_REG1 {
189				regulator-always-on;
190				regulator-boot-on;
191				regulator-min-microvolt = <3300000>;
192				regulator-max-microvolt = <3300000>;
193				regulator-name = "vcca_codec";
194				regulator-state-mem {
195					regulator-off-in-suspend;
196				};
197			};
198
199			vcc_tp: LDO_REG2 {
200				regulator-always-on;
201				regulator-boot-on;
202				regulator-min-microvolt = <3300000>;
203				regulator-max-microvolt = <3300000>;
204				regulator-name = "vcc_tp";
205				regulator-state-mem {
206					regulator-off-in-suspend;
207				};
208			};
209
210			vdd_10: LDO_REG3 {
211				regulator-always-on;
212				regulator-boot-on;
213				regulator-min-microvolt = <1000000>;
214				regulator-max-microvolt = <1000000>;
215				regulator-name = "vdd_10";
216				regulator-state-mem {
217					regulator-on-in-suspend;
218					regulator-suspend-microvolt = <1000000>;
219				};
220			};
221
222			vcc18_lcd: LDO_REG4 {
223				regulator-always-on;
224				regulator-boot-on;
225				regulator-min-microvolt = <1800000>;
226				regulator-max-microvolt = <1800000>;
227				regulator-name = "vcc18_lcd";
228				regulator-state-mem {
229					regulator-off-in-suspend;
230				};
231			};
232
233			vcc_lcd:LDO_REG5 {
234				regulator-always-on;
235				regulator-boot-on;
236				regulator-min-microvolt = <3300000>;
237				regulator-max-microvolt = <3300000>;
238				regulator-name = "vcc_lcd";
239				regulator-state-mem {
240					regulator-on-in-suspend;
241					regulator-suspend-microvolt = <3300000>;
242				};
243			};
244
245			vdd10_lcd: LDO_REG6 {
246				regulator-always-on;
247				regulator-boot-on;
248				regulator-min-microvolt = <1000000>;
249				regulator-max-microvolt = <1000000>;
250				regulator-name = "vdd10_lcd";
251				regulator-state-mem {
252					regulator-off-in-suspend;
253				};
254			};
255
256			vcc_18: LDO_REG7 {
257				regulator-always-on;
258				regulator-boot-on;
259				regulator-min-microvolt = <1800000>;
260				regulator-max-microvolt = <1800000>;
261				regulator-name = "vcc_18";
262				regulator-state-mem {
263					regulator-on-in-suspend;
264					regulator-suspend-microvolt = <1800000>;
265				};
266			};
267
268			vccio_wl: LDO_REG8 {
269				regulator-always-on;
270				regulator-boot-on;
271				regulator-min-microvolt = <1800000>;
272				regulator-max-microvolt = <3300000>;
273				regulator-name = "vccio_wl";
274				regulator-state-mem {
275					regulator-on-in-suspend;
276					regulator-suspend-microvolt = <3300000>;
277				};
278			};
279
280			vccio_sd: LDO_REG9 {
281				regulator-always-on;
282				regulator-boot-on;
283				regulator-min-microvolt = <1800000>;
284				regulator-max-microvolt = <3300000>;
285				regulator-name = "vccio_sd";
286				regulator-state-mem {
287					regulator-on-in-suspend;
288					regulator-suspend-microvolt = <3300000>;
289				};
290			};
291
292			vcc_sd: SWITCH_REG {
293				regulator-always-on;
294				regulator-boot-on;
295				regulator-name = "vcc_sd";
296				regulator-state-mem {
297					regulator-on-in-suspend;
298				};
299			};
300		};
301	};
302};
303
304&i2c1 {
305	status = "okay";
306	clock-frequency = <400000>;
307
308	mpu6050@68 {
309		compatible = "invensense,mpu6050";
310		status = "okay";
311		pinctrl-names = "default";
312		pinctrl-0 = <&mpu6050_irq_gpio>;
313		reg = <0x68>;
314		irq-gpio = <&gpio8 0 IRQ_TYPE_EDGE_RISING>;
315		mpu-int_config = <0x10>;
316		mpu-level_shifter = <0>;
317		mpu-orientation = <0 1 0 1 0 0 0 0 1>;
318		orientation-x= <0>;
319		orientation-y= <1>;
320		orientation-z= <0>;
321		support-hw-poweroff = <1>;
322		mpu-debug = <1>;
323	};
324};
325
326&dsi0 {
327	rockchip,dual-channel = <&dsi1>;
328	rockchip,lane-rate = <900>;
329	status = "okay";
330
331	panel@0 {
332		compatible = "simple-panel-dsi";
333		reg = <0>;
334		backlight = <&backlight>;
335		power-supply = <&vcc_lcd>;
336		reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
337		reset-delay-ms = <120>;
338		init-delay-ms = <120>;
339		enable-delay-ms = <120>;
340		prepare-delay-ms = <120>;
341
342		dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
343			      MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
344		dsi,format = <MIPI_DSI_FMT_RGB888>;
345		dsi,lanes = <8>;
346
347		panel-init-sequence = [
348			05 64 01 11
349			05 14 01 29
350		];
351
352		panel-exit-sequence = [
353			05 64 01 28
354			05 96 01 10
355		];
356
357		display-timings {
358			native-mode = <&timing0>;
359
360			timing0: timing0 {
361				clock-frequency = <230000000>;
362				hactive = <1536>;
363				vactive = <2048>;
364				hback-porch = <180>;
365				hfront-porch = <180>;
366				vback-porch = <10>;
367				vfront-porch = <14>;
368				hsync-len = <48>;
369				vsync-len = <2>;
370				hsync-active = <0>;
371				vsync-active = <0>;
372				de-active = <0>;
373				pixelclk-active = <0>;
374			};
375		};
376	};
377};
378
379&dsi1 {
380	status = "okay";
381};
382
383&dsi0_in_vopl {
384	status = "okay";
385};
386
387&dsi0_in_vopb {
388	status = "disabled";
389};
390
391&route_dsi0 {
392	connect = <&vopl_out_dsi0>;
393	status = "okay";
394};
395
396&tsadc {
397	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
398};
399
400&pinctrl {
401	lcd {
402		lcd_en: lcd-en  {
403			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
404		};
405	};
406
407	mpu6050 {
408		mpu6050_irq_gpio: mpu6050-irq-gpio {
409			rockchip,pins = <8 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
410		};
411	};
412
413	pmic {
414		pmic_int: pmic-int {
415			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
416		};
417		vsel1_gpio: vsel1-gpio {
418			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>;
419		};
420	};
421};
422