ARM: dts: rk3288: add asoc simple card for DW-HDMI audio for EVB board
[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         hdmi-sound {
107                 compatible = "simple-audio-card";
108                 simple-audio-card,format = "i2s";
109                 simple-audio-card,name = "DW-HDMI";
110                 simple-audio-card,mclk-fs = <512>;
111
112                 simple-audio-card,cpu {
113                         sound-dai = <&i2s>;
114                 };
115
116                 simple-audio-card,codec {
117                         sound-dai = <&hdmi>;
118                 };
119         };
120
121         lvds_panel: lvds_panel {
122                 compatible ="auo,b101ew05","simple-panel";
123                 backlight = <&backlight>;
124                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
125                 pinctrl-0 = <&lcd_cs>;
126                 status = "disabled";
127         };
128
129         ext_gmac: external-gmac-clock {
130                 compatible = "fixed-clock";
131                 clock-frequency = <125000000>;
132                 clock-output-names = "ext_gmac";
133                 #clock-cells = <0>;
134         };
135
136         gpio-keys {
137                 compatible = "gpio-keys";
138                 #address-cells = <1>;
139                 #size-cells = <0>;
140                 autorepeat;
141
142                 pinctrl-names = "default";
143                 pinctrl-0 = <&pwrbtn>;
144
145                 button@0 {
146                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
147                         linux,code = <116>;
148                         label = "GPIO Key Power";
149                         linux,input-type = <1>;
150                         gpio-key,wakeup = <1>;
151                         debounce-interval = <100>;
152                 };
153         };
154
155         /* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
156         vcc_host: vcc-host-regulator {
157                 compatible = "regulator-fixed";
158                 enable-active-high;
159                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
160                 pinctrl-names = "default";
161                 pinctrl-0 = <&host_vbus_drv>;
162                 regulator-name = "vcc_host";
163                 regulator-always-on;
164                 regulator-boot-on;
165         };
166
167         vcc_phy: vcc-phy-regulator {
168                 compatible = "regulator-fixed";
169                 enable-active-high;
170                 gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
171                 pinctrl-names = "default";
172                 pinctrl-0 = <&eth_phy_pwr>;
173                 regulator-name = "vcc_phy";
174                 regulator-min-microvolt = <3300000>;
175                 regulator-max-microvolt = <3300000>;
176                 regulator-always-on;
177                 regulator-boot-on;
178         };
179
180         vcc_sys: vsys-regulator {
181                 compatible = "regulator-fixed";
182                 regulator-name = "vcc_sys";
183                 regulator-min-microvolt = <5000000>;
184                 regulator-max-microvolt = <5000000>;
185                 regulator-always-on;
186                 regulator-boot-on;
187         };
188
189         /* This switch DIO3222 HOST_DP_HOST to host2 (dwc2) */
190         vcc_3g: vcc-3g-regulator {
191                 compatible = "regulator-fixed";
192                 enable-active-high;
193                 gpio = <&gpio7 8 GPIO_ACTIVE_HIGH>;
194                 pinctrl-names = "default";
195                 pinctrl-0 = <&pwr_3g>;
196                 regulator-name = "vcc_3g";
197         };
198
199         /*
200          * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
201          * vcc_io directly.  Those boards won't be able to power cycle SD cards
202          * but it shouldn't hurt to toggle this pin there anyway.
203          */
204         vcc_sd: sdmmc-regulator {
205                 compatible = "regulator-fixed";
206                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
207                 pinctrl-names = "default";
208                 pinctrl-0 = <&sdmmc_pwr>;
209                 regulator-name = "vcc_sd";
210                 regulator-min-microvolt = <3300000>;
211                 regulator-max-microvolt = <3300000>;
212                 startup-delay-us = <100000>;
213                 vin-supply = <&vcc_io>;
214         };
215 };
216
217 &emmc {
218         bus-width = <8>;
219         cap-mmc-highspeed;
220         disable-wp;
221         non-removable;
222         num-slots = <1>;
223         pinctrl-names = "default";
224         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
225         status = "okay";
226 };
227
228 &hdmi {
229         #address-cells = <1>;
230         #size-cells = <0>;
231         #sound-dai-cells = <0>;
232         ddc-i2c-bus = <&i2c5>;
233         status = "okay";
234 };
235
236 &sdmmc {
237         supports-sd;
238         bus-width = <4>;
239         cap-mmc-highspeed;
240         cap-sd-highspeed;
241         card-detect-delay = <200>;
242         disable-wp;                     /* wp not hooked up */
243         num-slots = <1>;
244         pinctrl-names = "default";
245         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
246         status = "okay";
247         vmmc-supply = <&vcc_sd>;
248         vqmmc-supply = <&vccio_sd>;
249 };
250
251 &gmac {
252         phy-supply = <&vcc_phy>;
253         phy-mode = "rgmii";
254         clock_in_out = "input";
255         snps,reset-gpio = <&gpio4 7 0>;
256         snps,reset-active-low;
257         snps,reset-delays-us = <0 10000 1000000>;
258         assigned-clocks = <&cru SCLK_MAC>;
259         assigned-clock-parents = <&ext_gmac>;
260         pinctrl-names = "default";
261         pinctrl-0 = <&rgmii_pins>;
262         tx_delay = <0x30>;
263         rx_delay = <0x10>;
264         status = "ok";
265 };
266
267 &edp_phy {
268         status = "okay";
269 };
270
271 &edp {
272         force-hpd;
273         status = "okay";
274
275         ports {
276                 edp_out: port@1 {
277                         reg = <1>;
278                         #address-cells = <1>;
279                         #size-cells = <0>;
280                         edp_out_panel: endpoint {
281                                 reg = <0>;
282                                 remote-endpoint = <&panel_in_edp>;
283                         };
284                 };
285         };
286 };
287
288 &i2c0 {
289         status = "okay";
290 };
291
292 &i2c5 {
293         status = "okay";
294 };
295
296 &i2s {
297         #sound-dai-cells = <0>;
298         status = "okay";
299 };
300
301 &wdt {
302         status = "okay";
303 };
304
305 &pwm0 {
306         status = "okay";
307 };
308
309 &uart0 {
310         status = "okay";
311 };
312
313 &uart1 {
314         status = "okay";
315 };
316
317 &uart2 {
318         status = "okay";
319 };
320
321 &uart3 {
322         status = "okay";
323 };
324
325 &uart4 {
326         status = "okay";
327 };
328
329 &vpu {
330         status = "okay";
331 };
332
333 &tsadc {
334         rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
335         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
336         status = "okay";
337 };
338
339 &pinctrl {
340         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
341                 drive-strength = <8>;
342         };
343
344         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
345                 bias-pull-up;
346                 drive-strength = <8>;
347         };
348
349         backlight {
350                 bl_en: bl-en {
351                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
352                 };
353         };
354
355         buttons {
356                 pwrbtn: pwrbtn {
357                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
358                 };
359         };
360
361         pmic {
362                 pmic_int: pmic-int {
363                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
364                 };
365         };
366
367         sdmmc {
368                 /*
369                  * Default drive strength isn't enough to achieve even
370                  * high-speed mode on EVB board so bump up to 8ma.
371                  */
372                 sdmmc_bus4: sdmmc-bus4 {
373                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
374                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
375                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
376                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
377                 };
378
379                 sdmmc_clk: sdmmc-clk {
380                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
381                 };
382
383                 sdmmc_cmd: sdmmc-cmd {
384                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
385                 };
386
387                 sdmmc_pwr: sdmmc-pwr {
388                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
389                 };
390         };
391
392         usb {
393                 host_vbus_drv: host-vbus-drv {
394                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
395                 };
396
397                 pwr_3g: pwr-3g {
398                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
399                 };
400         };
401
402         eth_phy {
403                 eth_phy_pwr: eth-phy-pwr {
404                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
405                 };
406         };
407
408         lcd {
409                 lcd_cs: lcd-cs {
410                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
411                 };
412         };
413 };
414
415 &usbphy {
416         status = "okay";
417 };
418
419 &usb_host0_ehci {
420         status = "okay";
421 };
422
423 &usb_host1 {
424         status = "okay";
425 };
426
427 &lvds {
428         rockchip,data-mapping = "jeida";
429         rockchip,data-width = <24>;
430         rockchip,output = "lvds";
431         rockchip,panel = <&lvds_panel>;
432         status = "disabled";
433 };
434
435 &vopb {
436         status = "okay";
437 };
438
439 &vopb_mmu {
440         status = "okay";
441 };
442
443 &vopl {
444         status = "okay";
445 };
446
447 &vopl_mmu {
448         status = "okay";
449 };