cb5c8d8c1852fd5ab7d330781c00391e5d2e07eb
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-evb.dtsi
1 /*
2  * This file is dual-licensed: you can use it either under the terms
3  * of the GPL or the X11 license, at your option. Note that this dual
4  * licensing only applies to this file, and not this project as a
5  * whole.
6  *
7  *  a) This file is free software; you can redistribute it and/or
8  *     modify it under the terms of the GNU General Public License as
9  *     published by the Free Software Foundation; either version 2 of the
10  *     License, or (at your option) any later version.
11  *
12  *     This file is distributed in the hope that it will be useful,
13  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *     GNU General Public License for more details.
16  *
17  * Or, alternatively,
18  *
19  *  b) Permission is hereby granted, free of charge, to any person
20  *     obtaining a copy of this software and associated documentation
21  *     files (the "Software"), to deal in the Software without
22  *     restriction, including without limitation the rights to use,
23  *     copy, modify, merge, publish, distribute, sublicense, and/or
24  *     sell copies of the Software, and to permit persons to whom the
25  *     Software is furnished to do so, subject to the following
26  *     conditions:
27  *
28  *     The above copyright notice and this permission notice shall be
29  *     included in all copies or substantial portions of the Software.
30  *
31  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38  *     OTHER DEALINGS IN THE SOFTWARE.
39  */
40
41 #include <dt-bindings/pwm/pwm.h>
42 #include "rk3288.dtsi"
43
44 / {
45         memory {
46                 device_type = "memory";
47                 reg = <0x0 0x80000000>;
48         };
49
50         backlight: backlight {
51                 compatible = "pwm-backlight";
52                 brightness-levels = <
53                           0   1   2   3   4   5   6   7
54                           8   9  10  11  12  13  14  15
55                          16  17  18  19  20  21  22  23
56                          24  25  26  27  28  29  30  31
57                          32  33  34  35  36  37  38  39
58                          40  41  42  43  44  45  46  47
59                          48  49  50  51  52  53  54  55
60                          56  57  58  59  60  61  62  63
61                          64  65  66  67  68  69  70  71
62                          72  73  74  75  76  77  78  79
63                          80  81  82  83  84  85  86  87
64                          88  89  90  91  92  93  94  95
65                          96  97  98  99 100 101 102 103
66                         104 105 106 107 108 109 110 111
67                         112 113 114 115 116 117 118 119
68                         120 121 122 123 124 125 126 127
69                         128 129 130 131 132 133 134 135
70                         136 137 138 139 140 141 142 143
71                         144 145 146 147 148 149 150 151
72                         152 153 154 155 156 157 158 159
73                         160 161 162 163 164 165 166 167
74                         168 169 170 171 172 173 174 175
75                         176 177 178 179 180 181 182 183
76                         184 185 186 187 188 189 190 191
77                         192 193 194 195 196 197 198 199
78                         200 201 202 203 204 205 206 207
79                         208 209 210 211 212 213 214 215
80                         216 217 218 219 220 221 222 223
81                         224 225 226 227 228 229 230 231
82                         232 233 234 235 236 237 238 239
83                         240 241 242 243 244 245 246 247
84                         248 249 250 251 252 253 254 255>;
85                 default-brightness-level = <128>;
86                 enable-gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
87                 pinctrl-names = "default";
88                 pinctrl-0 = <&bl_en>;
89                 pwms = <&pwm0 0 1000000 PWM_POLARITY_INVERTED>;
90         };
91
92         panel: panel {
93                 compatible ="lg,lp079qx1-sp0v", "simple-panel";
94                 backlight = <&backlight>;
95                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
96                 pinctrl-0 = <&lcd_cs>;
97                 ports {
98                         panel_in: port {
99                                 panel_in_edp: endpoint {
100                                         remote-endpoint = <&edp_out_panel>;
101                                 };
102                         };
103                 };
104         };
105
106         lvds_panel: lvds_panel {
107                 compatible ="auo,b101ew05","simple-panel";
108                 backlight = <&backlight>;
109                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
110                 pinctrl-0 = <&lcd_cs>;
111                 status = "disabled";
112         };
113
114         ext_gmac: external-gmac-clock {
115                 compatible = "fixed-clock";
116                 clock-frequency = <125000000>;
117                 clock-output-names = "ext_gmac";
118                 #clock-cells = <0>;
119         };
120
121         gpio-keys {
122                 compatible = "gpio-keys";
123                 #address-cells = <1>;
124                 #size-cells = <0>;
125                 autorepeat;
126
127                 pinctrl-names = "default";
128                 pinctrl-0 = <&pwrbtn>;
129
130                 button@0 {
131                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
132                         linux,code = <116>;
133                         label = "GPIO Key Power";
134                         linux,input-type = <1>;
135                         gpio-key,wakeup = <1>;
136                         debounce-interval = <100>;
137                 };
138         };
139
140         /* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
141         vcc_host: vcc-host-regulator {
142                 compatible = "regulator-fixed";
143                 enable-active-high;
144                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
145                 pinctrl-names = "default";
146                 pinctrl-0 = <&host_vbus_drv>;
147                 regulator-name = "vcc_host";
148                 regulator-always-on;
149                 regulator-boot-on;
150         };
151
152         vcc_phy: vcc-phy-regulator {
153                 compatible = "regulator-fixed";
154                 enable-active-high;
155                 gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
156                 pinctrl-names = "default";
157                 pinctrl-0 = <&eth_phy_pwr>;
158                 regulator-name = "vcc_phy";
159                 regulator-min-microvolt = <3300000>;
160                 regulator-max-microvolt = <3300000>;
161                 regulator-always-on;
162                 regulator-boot-on;
163         };
164
165         vcc_sys: vsys-regulator {
166                 compatible = "regulator-fixed";
167                 regulator-name = "vcc_sys";
168                 regulator-min-microvolt = <5000000>;
169                 regulator-max-microvolt = <5000000>;
170                 regulator-always-on;
171                 regulator-boot-on;
172         };
173
174         /* This switch DIO3222 HOST_DP_HOST to host2 (dwc2) */
175         vcc_3g: vcc-3g-regulator {
176                 compatible = "regulator-fixed";
177                 enable-active-high;
178                 gpio = <&gpio7 8 GPIO_ACTIVE_HIGH>;
179                 pinctrl-names = "default";
180                 pinctrl-0 = <&pwr_3g>;
181                 regulator-name = "vcc_3g";
182         };
183
184         /*
185          * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
186          * vcc_io directly.  Those boards won't be able to power cycle SD cards
187          * but it shouldn't hurt to toggle this pin there anyway.
188          */
189         vcc_sd: sdmmc-regulator {
190                 compatible = "regulator-fixed";
191                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
192                 pinctrl-names = "default";
193                 pinctrl-0 = <&sdmmc_pwr>;
194                 regulator-name = "vcc_sd";
195                 regulator-min-microvolt = <3300000>;
196                 regulator-max-microvolt = <3300000>;
197                 startup-delay-us = <100000>;
198                 vin-supply = <&vcc_io>;
199         };
200 };
201
202 &emmc {
203         bus-width = <8>;
204         cap-mmc-highspeed;
205         disable-wp;
206         non-removable;
207         num-slots = <1>;
208         pinctrl-names = "default";
209         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
210         status = "okay";
211 };
212
213 &hdmi {
214         ddc-i2c-bus = <&i2c5>;
215         status = "okay";
216 };
217
218 &sdmmc {
219         bus-width = <4>;
220         cap-mmc-highspeed;
221         cap-sd-highspeed;
222         card-detect-delay = <200>;
223         disable-wp;                     /* wp not hooked up */
224         num-slots = <1>;
225         pinctrl-names = "default";
226         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
227         status = "okay";
228         vmmc-supply = <&vcc_sd>;
229         vqmmc-supply = <&vccio_sd>;
230 };
231
232 &gmac {
233         phy-supply = <&vcc_phy>;
234         phy-mode = "rgmii";
235         clock_in_out = "input";
236         snps,reset-gpio = <&gpio4 7 0>;
237         snps,reset-active-low;
238         snps,reset-delays-us = <0 10000 1000000>;
239         assigned-clocks = <&cru SCLK_MAC>;
240         assigned-clock-parents = <&ext_gmac>;
241         pinctrl-names = "default";
242         pinctrl-0 = <&rgmii_pins>;
243         tx_delay = <0x30>;
244         rx_delay = <0x10>;
245         status = "ok";
246 };
247
248 &edp_phy {
249         status = "okay";
250 };
251
252 &edp {
253         force-hpd;
254         status = "okay";
255
256         ports {
257                 edp_out: port@1 {
258                         reg = <1>;
259                         #address-cells = <1>;
260                         #size-cells = <0>;
261                         edp_out_panel: endpoint {
262                                 reg = <0>;
263                                 remote-endpoint = <&panel_in_edp>;
264                         };
265                 };
266         };
267 };
268
269 &i2c0 {
270         status = "okay";
271 };
272
273 &i2c5 {
274         status = "okay";
275 };
276
277 &wdt {
278         status = "okay";
279 };
280
281 &pwm0 {
282         status = "okay";
283 };
284
285 &uart0 {
286         status = "okay";
287 };
288
289 &uart1 {
290         status = "okay";
291 };
292
293 &uart2 {
294         status = "okay";
295 };
296
297 &uart3 {
298         status = "okay";
299 };
300
301 &uart4 {
302         status = "okay";
303 };
304
305 &vpu {
306         status = "okay";
307 };
308
309 &tsadc {
310         rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
311         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
312         status = "okay";
313 };
314
315 &pinctrl {
316         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
317                 drive-strength = <8>;
318         };
319
320         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
321                 bias-pull-up;
322                 drive-strength = <8>;
323         };
324
325         backlight {
326                 bl_en: bl-en {
327                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
328                 };
329         };
330
331         buttons {
332                 pwrbtn: pwrbtn {
333                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
334                 };
335         };
336
337         pmic {
338                 pmic_int: pmic-int {
339                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
340                 };
341         };
342
343         sdmmc {
344                 /*
345                  * Default drive strength isn't enough to achieve even
346                  * high-speed mode on EVB board so bump up to 8ma.
347                  */
348                 sdmmc_bus4: sdmmc-bus4 {
349                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
350                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
351                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
352                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
353                 };
354
355                 sdmmc_clk: sdmmc-clk {
356                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
357                 };
358
359                 sdmmc_cmd: sdmmc-cmd {
360                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
361                 };
362
363                 sdmmc_pwr: sdmmc-pwr {
364                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
365                 };
366         };
367
368         usb {
369                 host_vbus_drv: host-vbus-drv {
370                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
371                 };
372
373                 pwr_3g: pwr-3g {
374                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
375                 };
376         };
377
378         eth_phy {
379                 eth_phy_pwr: eth-phy-pwr {
380                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
381                 };
382         };
383
384         lcd {
385                 lcd_cs: lcd-cs {
386                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
387                 };
388         };
389 };
390
391 &usbphy {
392         status = "okay";
393 };
394
395 &usb_host0_ehci {
396         status = "okay";
397 };
398
399 &usb_host1 {
400         status = "okay";
401 };
402
403 &lvds {
404         rockchip,data-mapping = "jeida";
405         rockchip,data-width = <24>;
406         rockchip,output = "lvds";
407         rockchip,panel = <&lvds_panel>;
408         status = "disabled";
409 };
410
411 &vopb {
412         status = "okay";
413 };
414
415 &vopb_mmu {
416         status = "okay";
417 };
418
419 &vopl {
420         status = "okay";
421 };
422
423 &vopl_mmu {
424         status = "okay";
425 };