dab45c1d53d5f34a6008cd1f9cb9c8ed18d491d3
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-android-next.dtsi
1 /*
2  * Copyright (c) 2016 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 #include <dt-bindings/display/drm_mipi_dsi.h>
44
45 / {
46         compatible = "rockchip,android", "rockchip,rk3399";
47
48         chosen {
49                 bootargs = "earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1";
50         };
51
52         ramoops_mem: ramoops_mem {
53                 reg = <0x0 0x110000 0x0 0xf0000>;
54                 reg-names = "ramoops_mem";
55         };
56
57         ramoops {
58                 compatible = "ramoops";
59                 record-size = <0x0 0x20000>;
60                 console-size = <0x0 0x80000>;
61                 ftrace-size = <0x0 0x00000>;
62                 pmsg-size = <0x0 0x50000>;
63                 memory-region = <&ramoops_mem>;
64         };
65
66         fiq_debugger: fiq-debugger {
67                 compatible = "rockchip,fiq-debugger";
68                 rockchip,serial-id = <2>;
69                 rockchip,signal-irq = <182>;
70                 rockchip,wake-irq = <0>;
71                 rockchip,irq-mode-enable = <1>;  /* If enable uart uses irq instead of fiq */
72                 rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
73                 pinctrl-names = "default";
74                 pinctrl-0 = <&uart2c_xfer>;
75         };
76
77         reserved-memory {
78                 #address-cells = <2>;
79                 #size-cells = <2>;
80                 ranges;
81
82                 drm_logo: drm-logo@00000000 {
83                         compatible = "rockchip,drm-logo";
84                         reg = <0x0 0x0 0x0 0x0>;
85                 };
86         };
87
88         rk_key: rockchip-key {
89                 compatible = "rockchip,key";
90                 status = "okay";
91
92                 io-channels = <&saradc 1>;
93
94                 vol-up-key {
95                         linux,code = <115>;
96                         label = "volume up";
97                         rockchip,adc_value = <1>;
98                 };
99
100                 vol-down-key {
101                         linux,code = <114>;
102                         label = "volume down";
103                         rockchip,adc_value = <170>;
104                 };
105
106                 power-key {
107                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
108                         linux,code = <116>;
109                         label = "power";
110                         gpio-key,wakeup;
111                 };
112
113                 menu-key {
114                         linux,code = <59>;
115                         label = "menu";
116                         rockchip,adc_value = <746>;
117                 };
118
119                 home-key {
120                         linux,code = <102>;
121                         label = "home";
122                         rockchip,adc_value = <355>;
123                 };
124
125                 back-key {
126                         linux,code = <158>;
127                         label = "back";
128                         rockchip,adc_value = <560>;
129                 };
130
131                 camera-key {
132                         linux,code = <212>;
133                         label = "camera";
134                         rockchip,adc_value = <450>;
135                 };
136         };
137
138         vpu: vpu_service@ff650000 {
139                 compatible = "rockchip,vpu_service";
140                 rockchip,grf = <&grf>;
141                 iommus = <&vpu_mmu>;
142                 reg = <0x0 0xff650000 0x0 0x800>;
143                 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 0>,
144                         <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH 0>;
145                 interrupt-names = "irq_dec", "irq_enc";
146                 clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
147                 clock-names = "aclk_vcodec", "hclk_vcodec";
148                 resets = <&cru SRST_H_VCODEC>, <&cru SRST_A_VCODEC>;
149                 reset-names = "video_h", "video_a";
150                 power-domains = <&power RK3399_PD_VCODEC>;
151                 name = "vpu_service";
152                 dev_mode = <0>;
153                 /* 0 means ion, 1 means drm */
154                 allocator = <1>;
155                 status = "disabled";
156         };
157
158         vpu_mmu: iommu@ff650800 {
159                 dbgname = "vpu";
160                 compatible = "rockchip,iommu";
161                 reg = <0x0 0xff650800 0x0 0x40>;
162                 interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH 0>;
163                 interrupt-names = "vpu_mmu";
164                 #iommu-cells = <0>;
165         };
166
167         rkvdec: rkvdec@ff660000 {
168                 compatible = "rockchip,rkvdec";
169                 rockchip,grf = <&grf>;
170                 iommus = <&vdec_mmu>;
171                 reg = <0x0 0xff660000 0x0 0x400>;
172                 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH 0>;
173                 interrupt-names = "irq_dec";
174                 clocks = <&cru ACLK_VDU>, <&cru HCLK_VDU>,<&cru SCLK_VDU_CA>,<&cru SCLK_VDU_CORE>;
175                 clock-names = "aclk_vcodec", "hclk_vcodec", "clk_cabac", "clk_core";
176                 resets = <&cru SRST_H_VDU>, <&cru SRST_A_VDU>;
177                 reset-names = "video_h", "video_a";
178                 power-domains = <&power RK3399_PD_VDU>;
179                 dev_mode = <2>;
180                 name = "rkvdec";
181                 /* 0 means ion, 1 means drm */
182                 allocator = <1>;
183                 status = "disabled";
184         };
185
186         vdec_mmu: iommu@ff660480 {
187                 dbgname = "vdec";
188                 compatible = "rockchip,iommu";
189                 reg = <0x0 0xff660480 0x0 0x40>, <0x0 0xff6604c0 0x0 0x40>;
190                 interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH 0>;
191                 interrupt-names = "vdec_mmu";
192                 #iommu-cells = <0>;
193         };
194
195         isp0: isp@ff910000 {
196                 compatible = "rockchip,rk3399-isp", "rockchip,isp";
197                 reg = <0x0 0xff910000 0x0 0x4000>;
198                 interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH 0>;
199                 clocks =
200                         <&cru SCLK_CIF_OUT>, <&cru SCLK_CIF_OUT>,
201                         <&cru SCLK_DPHY_TX1RX1_CFG>, <&cru SCLK_MIPIDPHY_REF>,
202                         <&cru ACLK_ISP0_NOC>, <&cru ACLK_ISP0_WRAPPER>,
203                         <&cru HCLK_ISP0_NOC>, <&cru HCLK_ISP0_WRAPPER>,
204                         <&cru SCLK_ISP0>, <&cru SCLK_DPHY_RX0_CFG>;
205                 clock-names =
206                         "clk_cif_out", "clk_cif_pll",
207                         "pclk_dphytxrx", "pclk_dphy_ref",
208                         "aclk_isp0_noc", "aclk_isp0_wrapper",
209                         "hclk_isp0_noc", "hclk_isp0_wrapper",
210                         "clk_isp0", "pclk_dphyrx";
211                 pinctrl-names =
212                         "cif_clkout", "isp_dvp8bit0", "isp_mipi_fl",
213                         "isp_mipi_fl_prefl", "isp_flash_as_gpio",
214                         "isp_flash_as_trigger_out";
215                 pinctrl-0 = <&cif_clkout>;
216                 pinctrl-1 = <&isp_dvp_d0d7>;
217                 pinctrl-2 = <&cif_clkout>;
218                 pinctrl-3 = <&isp_prelight>;
219                 pinctrl-4 = <&isp_flash_trigger_as_gpio>;
220                 pinctrl-5 = <&isp_flash_trigger>;
221                 rockchip,isp,mipiphy = <2>;
222                 rockchip,isp,cifphy = <1>;
223                 rockchip,isp,dsiphy,reg = <0xff968000 0x8000>;
224                 rockchip,grf = <&grf>;
225                 rockchip,cru = <&cru>;
226                 rockchip,gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
227                 rockchip,isp,iommu-enable = <1>;
228                 power-domains = <&power RK3399_PD_ISP0>;
229                 iommus = <&isp0_mmu>;
230                 status = "disabled";
231         };
232
233         isp1: isp@ff920000 {
234                 compatible = "rockchip,rk3399-isp", "rockchip,isp";
235                 reg = <0x0 0xff920000 0x0 0x4000>;
236                 interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH 0>;
237                 clocks =
238                         <&cru ACLK_ISP1_NOC>, <&cru ACLK_ISP1_WRAPPER>,
239                         <&cru HCLK_ISP1_NOC>, <&cru HCLK_ISP1_WRAPPER>,
240                         <&cru SCLK_ISP1>, <&cru SCLK_CIF_OUT>,
241                         <&cru SCLK_CIF_OUT>, <&cru SCLK_DPHY_TX1RX1_CFG>,
242                         <&cru SCLK_MIPIDPHY_REF>, <&cru PCLK_ISP1_WRAPPER>,
243                         <&cru SCLK_DPHY_RX0_CFG>, <&cru PCLK_MIPI_DSI1>,
244                         <&cru SCLK_MIPIDPHY_CFG>;
245                 clock-names =
246                         "aclk_isp1_noc", "aclk_isp1_wrapper",
247                         "hclk_isp1_noc", "hclk_isp1_wrapper",
248                         "clk_isp1", "clk_cif_out",
249                         "clk_cif_pll", "pclk_dphytxrx",
250                         "pclk_dphy_ref", "pclk_isp1",
251                         "pclk_dphyrx", "pclk_mipi_dsi",
252                         "mipi_dphy_cfg";
253                 pinctrl-names =
254                         "cif_clkout", "isp_dvp8bit0", "isp_mipi_fl",
255                         "isp_mipi_fl_prefl", "isp_flash_as_gpio",
256                         "isp_flash_as_trigger_out";
257                 pinctrl-0 = <&cif_clkout>;
258                 pinctrl-1 = <&isp_dvp_d0d7>;
259                 pinctrl-2 = <&cif_clkout>;
260                 pinctrl-3 = <&isp_prelight>;
261                 pinctrl-4 = <&isp_flash_trigger_as_gpio>;
262                 pinctrl-5 = <&isp_flash_trigger>;
263                 rockchip,isp,mipiphy = <2>;
264                 rockchip,isp,cifphy = <1>;
265                 rockchip,isp,dsiphy,reg = <0xff968000 0x8000>;
266                 rockchip,grf = <&grf>;
267                 rockchip,cru = <&cru>;
268                 rockchip,gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
269                 rockchip,isp,iommu-enable = <1>;
270                 power-domains = <&power RK3399_PD_ISP1>;
271                 iommus = <&isp1_mmu>;
272                 status = "disabled";
273         };
274
275         uboot-charge {
276                 compatible = "rockchip,uboot-charge";
277                 rockchip,uboot-charge-on = <1>;
278                 rockchip,android-charge-on = <0>;
279         };
280 };
281
282 &vopb {
283         status = "okay";
284 };
285
286 &vopb_mmu {
287         status = "okay";
288 };
289
290 &vopl {
291         status = "okay";
292 };
293
294 &vopl_mmu {
295         status = "okay";
296 };
297
298 &rga {
299         status = "okay";
300 };
301
302 &i2c3 {
303         status = "okay";
304         i2c-scl-rising-time-ns = <450>;
305         i2c-scl-falling-time-ns = <15>;
306 };
307
308 &hdmi {
309         ddc-i2c-bus = <&i2c3>;
310         status = "okay";
311 };
312
313 &display_subsystem {
314         status = "okay";
315
316         ports = <&vopb_out>, <&vopl_out>;
317         memory-region = <&drm_logo>;
318         route {
319                 route_hdmi: route-hdmi {
320                         status = "disabled";
321                         logo,uboot = "logo.bmp";
322                         logo,kernel = "logo_kernel.bmp";
323                         logo,mode = "fullscreen";
324                         charge_logo,mode = "center";
325                         connect = <&vopl_out_hdmi>;
326                 };
327
328                 route_mipi: route-mipi {
329                         status = "disabled";
330                         logo,uboot = "logo.bmp";
331                         logo,kernel = "logo_kernel.bmp";
332                         logo,mode = "fullscreen";
333                         charge_logo,mode = "center";
334                         connect = <&vopb_out_mipi>;
335                 };
336
337                 route_edp: route-edp {
338                         status = "disabled";
339                         logo,uboot = "logo.bmp";
340                         logo,kernel = "logo_kernel.bmp";
341                         logo,mode = "fullscreen";
342                         charge_logo,mode = "center";
343                         connect = <&vopb_out_edp>;
344                 };
345         };
346 };
347
348 &i2s2 {
349         #sound-dai-cells = <0>;
350 };
351
352 &usbdrd_dwc3_0 {
353         dr_mode = "otg";
354 };
355
356 &pinctrl {
357         isp {
358                 cif_clkout: cif-clkout {
359                         rockchip,pins =
360                                 /*cif_clkout*/
361                                 <2 11 RK_FUNC_3 &pcfg_pull_none>;
362                         };
363
364                         isp_dvp_d0d7: isp-dvp-d0d7 {
365                                 rockchip,pins =
366                                         /*cif_data0*/
367                                         <2 0 RK_FUNC_3 &pcfg_pull_none>,
368                                         /*cif_data1*/
369                                         <2 1 RK_FUNC_3 &pcfg_pull_none>,
370                                         /*cif_data2*/
371                                         <2 2 RK_FUNC_3 &pcfg_pull_none>,
372                                         /*cif_data3*/
373                                         <2 3 RK_FUNC_3 &pcfg_pull_none>,
374                                         /*cif_data4*/
375                                         <2 4 RK_FUNC_3 &pcfg_pull_none>,
376                                         /*cif_data5*/
377                                         <2 5 RK_FUNC_3 &pcfg_pull_none>,
378                                         /*cif_data6*/
379                                         <2 6 RK_FUNC_3 &pcfg_pull_none>,
380                                         /*cif_data7*/
381                                         <2 7 RK_FUNC_3 &pcfg_pull_none>,
382                                         /*cif_sync*/
383                                         <2 8 RK_FUNC_3 &pcfg_pull_none>,
384                                         /*cif_href*/
385                                         <2 9 RK_FUNC_3 &pcfg_pull_none>,
386                                         /*cif_clkin*/
387                                         <2 10 RK_FUNC_3 &pcfg_pull_none>;
388                         };
389
390                         isp_shutter: isp-shutter {
391                                 rockchip,pins =
392                                         /*SHUTTEREN*/
393                                         <1 1 RK_FUNC_1 &pcfg_pull_none>,
394                                         /*SHUTTERTRIG*/
395                                         <1 0 RK_FUNC_1 &pcfg_pull_none>;
396                         };
397
398                         isp_flash_trigger: isp-flash-trigger {
399                                 /*ISP_FLASHTRIGOU*/
400                                 rockchip,pins = <1 3 RK_FUNC_1 &pcfg_pull_none>;
401                         };
402
403                         isp_prelight: isp-prelight {
404                                 /*ISP_PRELIGHTTRIG*/
405                                 rockchip,pins = <1 4 RK_FUNC_1 &pcfg_pull_none>;
406                         };
407
408                         isp_flash_trigger_as_gpio: isp_flash_trigger_as_gpio {
409                                 /*ISP_FLASHTRIGOU*/
410                                 rockchip,pins =
411                                         <0 17 RK_FUNC_GPIO &pcfg_pull_none>;
412                         };
413                 };
414 };
415