acb8513e6134d6c1a5a5215de40ebc3d28f94c2c
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3368-android.dtsi
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 / {
44         chosen {
45                 bootargs = "earlycon=uart8250,mmio32,0xff1b0000 swiotlb=1 firmware_class.path=/system/vendor/firmware";
46         };
47
48         fiq_debugger: fiq-debugger {
49                 compatible = "rockchip,fiq-debugger";
50                 rockchip,serial-id = <3>;
51                 rockchip,signal-irq = <186>;
52                 rockchip,wake-irq = <0>;
53                 rockchip,irq-mode-enable = <1>;  /* If enable uart uses irq instead of fiq */
54                 rockchip,baudrate = <115200>;  /* Only 115200 and 1500000 */
55                 pinctrl-names = "default";
56                 pinctrl-0 = <&uart3_xfer>;
57         };
58
59         reserved-memory {
60                 #address-cells = <2>;
61                 #size-cells = <2>;
62                 ranges;
63
64                 drm_logo: drm-logo@00000000 {
65                         compatible = "rockchip,drm-logo";
66                         reg = <0x0 0x0 0x0 0x0>;
67                 };
68
69                 /* global autoconfigured region for contiguous allocations */
70                 linux,cma {
71                         compatible = "shared-dma-pool";
72                         reusable;
73                         size = <0x0 0x8000000>;
74                         linux,cma-default;
75                 };
76         };
77
78         ion {
79                 compatible = "rockchip,ion";
80                 #address-cells = <1>;
81                 #size-cells = <0>;
82
83                 cma-heap {
84                         reg = <0x00000000 0x02000000>;
85                 };
86
87                 system-heap {
88                 };
89         };
90
91         rga@ff920000 {
92                 compatible = "rockchip,rga2";
93                 dev_mode = <1>;
94                 reg = <0x0 0xff920000 0x0 0x1000>;
95                 interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
96                 clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru SCLK_RGA>;
97                 clock-names = "aclk_rga", "hclk_rga", "clk_rga";
98                 dma-coherent;
99                 status = "okay";
100         };
101
102         dwc_control_usb: dwc-control-usb {
103                 compatible = "rockchip,rk3368-dwc-control-usb";
104                 status = "okay";
105
106                 rockchip,grf = <&grf>;
107                 grf-offset = <0x04bc>; /* GRF_SOC_STATUS for USB2.0 OTG */
108                 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
109                              <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
110                              <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
111                              <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
112                 interrupt-names = "otg_id", "otg_bvalid",
113                                   "otg_linestate", "host0_linestate";
114                 clocks = <&cru HCLK_USB_PERI>;
115                 clock-names = "hclk_usb_peri";
116
117                 otg_drv_gpio = <&gpio0 25 GPIO_ACTIVE_LOW>;
118                 rockchip,remote_wakeup;
119                 rockchip,usb_irq_wakeup;
120
121                 usb_bc {
122                         compatible = "inno,phy";
123                         regbase = &dwc_control_usb;
124                         rk_usb,bvalid     = <0x4bc 23 1>;
125                         rk_usb,iddig      = <0x4bc 26 1>;
126                         rk_usb,vdmsrcen   = <0x718 12 1>;
127                         rk_usb,vdpsrcen   = <0x718 11 1>;
128                         rk_usb,rdmpden    = <0x718 10 1>;
129                         rk_usb,idpsrcen   = <0x718  9 1>;
130                         rk_usb,idmsinken  = <0x718  8 1>;
131                         rk_usb,idpsinken  = <0x718  7 1>;
132                         rk_usb,dpattach   = <0x4b8 31 1>;
133                         rk_usb,cpdet      = <0x4b8 30 1>;
134                         rk_usb,dcpattach  = <0x4b8 29 1>;
135                 };
136         };
137 };
138
139 &display_subsystem {
140         status = "okay";
141
142         memory-region = <&drm_logo>;
143         route {
144                 route_mipi: route-mipi {
145                         status = "disabled";
146                         logo,uboot = "logo.bmp";
147                         logo,kernel = "logo_kernel.bmp";
148                         logo,mode = "center";
149                         charge_logo,mode = "center";
150                         connect = <&vop_out_mipi>;
151                 };
152
153                 route_edp: route-edp {
154                         status = "disabled";
155                         logo,uboot = "logo.bmp";
156                         logo,kernel = "logo_kernel.bmp";
157                         logo,mode = "center";
158                         charge_logo,mode = "center";
159                         connect = <&vop_out_edp>;
160                 };
161
162                 route_hdmi: route-hdmi {
163                         status = "disabled";
164                         logo,uboot = "logo.bmp";
165                         logo,kernel = "logo_kernel.bmp";
166                         logo,mode = "center";
167                         charge_logo,mode = "center";
168                         connect = <&vop_out_hdmi>;
169                 };
170         };
171 };
172
173 &uart3 {
174         status = "okay";
175 };
176
177 &iep {
178         status = "okay";
179 };
180
181 &iep_mmu {
182         status = "okay";
183 };
184
185 &mailbox {
186         status = "okay";
187 };
188
189 &mailbox_scpi {
190         status = "okay";
191 };
192
193 &vpu_combo {
194         status = "okay";
195 };
196
197 &vpu_mmu {
198         status = "okay";
199 };
200
201 &hevc_mmu {
202         status = "okay";
203 };
204
205 &vop {
206         status = "okay";
207 };
208
209 &vop_mmu {
210         status = "okay";
211 };
212
213 &isp {
214         status = "okay";
215 };
216
217 &isp_mmu {
218         status = "okay";
219 };
220
221 &usb_otg {
222         status = "okay";
223         clocks = <&cru SCLK_OTGPHY0>, <&cru HCLK_OTG0>;
224         clock-names = "sclk_otgphy0", "otg";
225         resets = <&cru SRST_USBOTG_AHB>,
226                  <&cru SRST_USBOTG_PHY>,
227                  <&cru SRST_USBOTG_CON>;
228         reset-names = "otg_ahb", "otg_phy", "otg_controller";
229         /* 0 - Normal, 1 - Force Host, 2 - Force Device */
230         rockchip,usb-mode = <0>;
231 };
232
233 &pinctrl {
234         isp {
235                 cif_clkout: cif-clkout {
236                         rockchip,pins = <1 11 RK_FUNC_1 &pcfg_pull_none>;//cif_clkout
237                 };
238
239                 isp_dvp_d2d9: isp-dvp-d2d9 {
240                         rockchip,pins =
241                                         <1 0 RK_FUNC_1 &pcfg_pull_none>,//cif_data2
242                                         <1 1 RK_FUNC_1 &pcfg_pull_none>,//cif_data3
243                                         <1 2 RK_FUNC_1 &pcfg_pull_none>,//cif_data4
244                                         <1 3 RK_FUNC_1 &pcfg_pull_none>,//cif_data5
245                                         <1 4 RK_FUNC_1 &pcfg_pull_none>,//cif_data6
246                                         <1 5 RK_FUNC_1 &pcfg_pull_none>,//cif_data7
247                                         <1 6 RK_FUNC_1 &pcfg_pull_none>,//cif_data8
248                                         <1 7 RK_FUNC_1 &pcfg_pull_none>,//cif_data9
249                                         <1 8 RK_FUNC_1 &pcfg_pull_none>,//cif_sync
250                                         <1 9 RK_FUNC_1 &pcfg_pull_none>,//cif_href
251                                         <1 10 RK_FUNC_1 &pcfg_pull_none>,//cif_clkin
252                                         <1 11 RK_FUNC_1 &pcfg_pull_none>;//cif_clkout
253                 };
254
255                 isp_dvp_d0d1: isp-dvp-d0d1 {
256                         rockchip,pins =
257                                         <1 12 RK_FUNC_1 &pcfg_pull_none>,//cif_data0
258                                         <1 13 RK_FUNC_1 &pcfg_pull_none>;//cif_data1
259                 };
260
261                 isp_dvp_d10d11:isp_d10d11 {
262                         rockchip,pins =
263                                         <1 14 RK_FUNC_1 &pcfg_pull_none>,//cif_data10
264                                         <1 15 RK_FUNC_1 &pcfg_pull_none>;//cif_data11
265                 };
266
267                 isp_dvp_d0d7: isp-dvp-d0d7 {
268                         rockchip,pins =
269                                         <1 12 RK_FUNC_1 &pcfg_pull_none>,//cif_data0
270                                         <1 13 RK_FUNC_1 &pcfg_pull_none>,//cif_data1
271                                         <1 0 RK_FUNC_1 &pcfg_pull_none>,//cif_data2
272                                         <1 1 RK_FUNC_1 &pcfg_pull_none>,//cif_data3
273                                         <1 2 RK_FUNC_1 &pcfg_pull_none>,//cif_data4
274                                         <1 3 RK_FUNC_1 &pcfg_pull_none>,//cif_data5
275                                         <1 4 RK_FUNC_1 &pcfg_pull_none>,//cif_data6
276                                         <1 5 RK_FUNC_1 &pcfg_pull_none>;//cif_data7
277                 };
278
279                 isp_dvp_d4d11: isp-dvp-d4d11 {
280                         rockchip,pins =
281                                         <1 2 RK_FUNC_1 &pcfg_pull_none>,//cif_data4
282                                         <1 3 RK_FUNC_1 &pcfg_pull_none>,//cif_data5
283                                         <1 4 RK_FUNC_1 &pcfg_pull_none>,//cif_data6
284                                         <1 5 RK_FUNC_1 &pcfg_pull_none>,//cif_data7
285                                         <1 6 RK_FUNC_1 &pcfg_pull_none>,//cif_data8
286                                         <1 7 RK_FUNC_1 &pcfg_pull_none>,//cif_data9
287                                         <1 14 RK_FUNC_1 &pcfg_pull_none>,//cif_data10
288                                         <1 17 RK_FUNC_1 &pcfg_pull_none>;//cif_data11
289                 };
290
291                 isp_shutter: isp-shutter {
292                         rockchip,pins =
293                                         <3 19 RK_FUNC_2 &pcfg_pull_none>, //SHUTTEREN
294                                         <3 22 RK_FUNC_2 &pcfg_pull_none>;//SHUTTERTRIG
295                 };
296
297                 isp_flash_trigger: isp-flash-trigger {
298                         rockchip,pins = <3 20 RK_FUNC_2 &pcfg_pull_none>; //ISP_FLASHTRIGOU
299                 };
300
301                 isp_prelight: isp-prelight {
302                         rockchip,pins = <3 21 RK_FUNC_2 &pcfg_pull_none>;//ISP_PRELIGHTTRIG
303                 };
304
305                 isp_flash_trigger_as_gpio: isp_flash_trigger_as_gpio {
306                         rockchip,pins = <3 20 RK_FUNC_GPIO &pcfg_pull_none>;//ISP_FLASHTRIGOU
307                 };
308         };
309 };