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