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