ARM: shmobile: koelsch: Add DU HDMI output support
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / arm / boot / dts / r8a7791-koelsch.dts
1 /*
2  * Device Tree Source for the Koelsch board
3  *
4  * Copyright (C) 2013 Renesas Electronics Corporation
5  * Copyright (C) 2013-2014 Renesas Solutions Corp.
6  * Copyright (C) 2014 Cogent Embedded, Inc.
7  *
8  * This file is licensed under the terms of the GNU General Public License
9  * version 2.  This program is licensed "as is" without any warranty of any
10  * kind, whether express or implied.
11  */
12
13 /*
14  * SSI-AK4643
15  *
16  * SW1: 1: AK4643
17  *      2: CN22
18  *      3: ADV7511
19  *
20  * This command is required when Playback/Capture
21  *
22  *      amixer set "LINEOUT Mixer DACL" on
23  *      amixer set "DVC Out" 100%
24  *      amixer set "DVC In" 100%
25  *
26  * You can use Mute
27  *
28  *      amixer set "DVC Out Mute" on
29  *      amixer set "DVC In Mute" on
30  *
31  * You can use Volume Ramp
32  *
33  *      amixer set "DVC Out Ramp Up Rate"   "0.125 dB/64 steps"
34  *      amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
35  *      amixer set "DVC Out Ramp" on
36  *      aplay xxx.wav &
37  *      amixer set "DVC Out"  80%  // Volume Down
38  *      amixer set "DVC Out" 100%  // Volume Up
39  */
40
41 /dts-v1/;
42 #include "r8a7791.dtsi"
43 #include <dt-bindings/gpio/gpio.h>
44 #include <dt-bindings/input/input.h>
45
46 / {
47         model = "Koelsch";
48         compatible = "renesas,koelsch", "renesas,r8a7791";
49
50         aliases {
51                 serial6 = &scif0;
52                 serial7 = &scif1;
53         };
54
55         chosen {
56                 bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
57                 stdout-path = &scif0;
58         };
59
60         memory@40000000 {
61                 device_type = "memory";
62                 reg = <0 0x40000000 0 0x40000000>;
63         };
64
65         memory@200000000 {
66                 device_type = "memory";
67                 reg = <2 0x00000000 0 0x40000000>;
68         };
69
70         lbsc {
71                 #address-cells = <1>;
72                 #size-cells = <1>;
73         };
74
75         keyboard {
76                 compatible = "gpio-keys";
77
78                 key-1 {
79                         gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
80                         linux,code = <KEY_1>;
81                         label = "SW2-1";
82                         gpio-key,wakeup;
83                         debounce-interval = <20>;
84                 };
85                 key-2 {
86                         gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
87                         linux,code = <KEY_2>;
88                         label = "SW2-2";
89                         gpio-key,wakeup;
90                         debounce-interval = <20>;
91                 };
92                 key-3 {
93                         gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
94                         linux,code = <KEY_3>;
95                         label = "SW2-3";
96                         gpio-key,wakeup;
97                         debounce-interval = <20>;
98                 };
99                 key-4 {
100                         gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
101                         linux,code = <KEY_4>;
102                         label = "SW2-4";
103                         gpio-key,wakeup;
104                         debounce-interval = <20>;
105                 };
106                 key-a {
107                         gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
108                         linux,code = <KEY_A>;
109                         label = "SW30";
110                         gpio-key,wakeup;
111                         debounce-interval = <20>;
112                 };
113                 key-b {
114                         gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
115                         linux,code = <KEY_B>;
116                         label = "SW31";
117                         gpio-key,wakeup;
118                         debounce-interval = <20>;
119                 };
120                 key-c {
121                         gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
122                         linux,code = <KEY_C>;
123                         label = "SW32";
124                         gpio-key,wakeup;
125                         debounce-interval = <20>;
126                 };
127                 key-d {
128                         gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
129                         linux,code = <KEY_D>;
130                         label = "SW33";
131                         gpio-key,wakeup;
132                         debounce-interval = <20>;
133                 };
134                 key-e {
135                         gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
136                         linux,code = <KEY_E>;
137                         label = "SW34";
138                         gpio-key,wakeup;
139                         debounce-interval = <20>;
140                 };
141                 key-f {
142                         gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
143                         linux,code = <KEY_F>;
144                         label = "SW35";
145                         gpio-key,wakeup;
146                         debounce-interval = <20>;
147                 };
148                 key-g {
149                         gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
150                         linux,code = <KEY_G>;
151                         label = "SW36";
152                         gpio-key,wakeup;
153                         debounce-interval = <20>;
154                 };
155         };
156
157         leds {
158                 compatible = "gpio-leds";
159                 led6 {
160                         gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>;
161                         label = "LED6";
162                 };
163                 led7 {
164                         gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
165                         label = "LED7";
166                 };
167                 led8 {
168                         gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
169                         label = "LED8";
170                 };
171         };
172
173         vcc_sdhi0: regulator@0 {
174                 compatible = "regulator-fixed";
175
176                 regulator-name = "SDHI0 Vcc";
177                 regulator-min-microvolt = <3300000>;
178                 regulator-max-microvolt = <3300000>;
179
180                 gpio = <&gpio7 17 GPIO_ACTIVE_HIGH>;
181                 enable-active-high;
182         };
183
184         vccq_sdhi0: regulator@1 {
185                 compatible = "regulator-gpio";
186
187                 regulator-name = "SDHI0 VccQ";
188                 regulator-min-microvolt = <1800000>;
189                 regulator-max-microvolt = <3300000>;
190
191                 gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
192                 gpios-states = <1>;
193                 states = <3300000 1
194                           1800000 0>;
195         };
196
197         vcc_sdhi1: regulator@2 {
198                 compatible = "regulator-fixed";
199
200                 regulator-name = "SDHI1 Vcc";
201                 regulator-min-microvolt = <3300000>;
202                 regulator-max-microvolt = <3300000>;
203
204                 gpio = <&gpio7 18 GPIO_ACTIVE_HIGH>;
205                 enable-active-high;
206         };
207
208         vccq_sdhi1: regulator@3 {
209                 compatible = "regulator-gpio";
210
211                 regulator-name = "SDHI1 VccQ";
212                 regulator-min-microvolt = <1800000>;
213                 regulator-max-microvolt = <3300000>;
214
215                 gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
216                 gpios-states = <1>;
217                 states = <3300000 1
218                           1800000 0>;
219         };
220
221         vcc_sdhi2: regulator@4 {
222                 compatible = "regulator-fixed";
223
224                 regulator-name = "SDHI2 Vcc";
225                 regulator-min-microvolt = <3300000>;
226                 regulator-max-microvolt = <3300000>;
227
228                 gpio = <&gpio7 19 GPIO_ACTIVE_HIGH>;
229                 enable-active-high;
230         };
231
232         vccq_sdhi2: regulator@5 {
233                 compatible = "regulator-gpio";
234
235                 regulator-name = "SDHI2 VccQ";
236                 regulator-min-microvolt = <1800000>;
237                 regulator-max-microvolt = <3300000>;
238
239                 gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
240                 gpios-states = <1>;
241                 states = <3300000 1
242                           1800000 0>;
243         };
244
245         sound {
246                 compatible = "simple-audio-card";
247
248                 simple-audio-card,format = "left_j";
249                 simple-audio-card,bitclock-master = <&sndcodec>;
250                 simple-audio-card,frame-master = <&sndcodec>;
251
252                 sndcpu: simple-audio-card,cpu {
253                         sound-dai = <&rcar_sound>;
254                 };
255
256                 sndcodec: simple-audio-card,codec {
257                         sound-dai = <&ak4643>;
258                         system-clock-frequency = <11289600>;
259                 };
260         };
261
262         hdmi-out {
263                 compatible = "hdmi-connector";
264                 type = "a";
265
266                 port {
267                         hdmi_con: endpoint {
268                                 remote-endpoint = <&adv7511_out>;
269                         };
270                 };
271         };
272 };
273
274 &du {
275         pinctrl-0 = <&du_pins>;
276         pinctrl-names = "default";
277         status = "okay";
278
279         ports {
280                 port@0 {
281                         endpoint {
282                                 remote-endpoint = <&adv7511_in>;
283                         };
284                 };
285                 port@1 {
286                         lvds_connector: endpoint {
287                         };
288                 };
289         };
290 };
291
292 &extal_clk {
293         clock-frequency = <20000000>;
294 };
295
296 &pfc {
297         i2c2_pins: i2c2 {
298                 renesas,groups = "i2c2";
299                 renesas,function = "i2c2";
300         };
301
302         du_pins: du {
303                 renesas,groups = "du_rgb666", "du_sync", "du_disp", "du_clk_out_0";
304                 renesas,function = "du";
305         };
306
307         scif0_pins: serial0 {
308                 renesas,groups = "scif0_data_d";
309                 renesas,function = "scif0";
310         };
311
312         scif1_pins: serial1 {
313                 renesas,groups = "scif1_data_d";
314                 renesas,function = "scif1";
315         };
316
317         ether_pins: ether {
318                 renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
319                 renesas,function = "eth";
320         };
321
322         phy1_pins: phy1 {
323                 renesas,groups = "intc_irq0";
324                 renesas,function = "intc";
325         };
326
327         sdhi0_pins: sd0 {
328                 renesas,groups = "sdhi0_data4", "sdhi0_ctrl";
329                 renesas,function = "sdhi0";
330         };
331
332         sdhi1_pins: sd1 {
333                 renesas,groups = "sdhi1_data4", "sdhi1_ctrl";
334                 renesas,function = "sdhi1";
335         };
336
337         sdhi2_pins: sd2 {
338                 renesas,groups = "sdhi2_data4", "sdhi2_ctrl";
339                 renesas,function = "sdhi2";
340         };
341
342         qspi_pins: spi0 {
343                 renesas,groups = "qspi_ctrl", "qspi_data4";
344                 renesas,function = "qspi";
345         };
346
347         msiof0_pins: spi1 {
348                 renesas,groups = "msiof0_clk", "msiof0_sync", "msiof0_rx",
349                                  "msiof0_tx";
350                 renesas,function = "msiof0";
351         };
352
353         usb0_pins: usb0 {
354                 renesas,groups = "usb0";
355                 renesas,function = "usb0";
356         };
357
358         usb1_pins: usb1 {
359                 renesas,groups = "usb1";
360                 renesas,function = "usb1";
361         };
362
363         vin1_pins: vin1 {
364                 renesas,groups = "vin1_data8", "vin1_clk";
365                 renesas,function = "vin1";
366         };
367
368         sound_pins: sound {
369                 renesas,groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
370                 renesas,function = "ssi";
371         };
372
373         sound_clk_pins: sound_clk {
374                 renesas,groups = "audio_clk_a";
375                 renesas,function = "audio_clk";
376         };
377 };
378
379 &ether {
380         pinctrl-0 = <&ether_pins &phy1_pins>;
381         pinctrl-names = "default";
382
383         phy-handle = <&phy1>;
384         renesas,ether-link-active-low;
385         status = "ok";
386
387         phy1: ethernet-phy@1 {
388                 reg = <1>;
389                 interrupt-parent = <&irqc0>;
390                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
391                 micrel,led-mode = <1>;
392         };
393 };
394
395 &cmt0 {
396         status = "ok";
397 };
398
399 &sata0 {
400         status = "okay";
401 };
402
403 &scif0 {
404         pinctrl-0 = <&scif0_pins>;
405         pinctrl-names = "default";
406
407         status = "okay";
408 };
409
410 &scif1 {
411         pinctrl-0 = <&scif1_pins>;
412         pinctrl-names = "default";
413
414         status = "okay";
415 };
416
417 &sdhi0 {
418         pinctrl-0 = <&sdhi0_pins>;
419         pinctrl-names = "default";
420
421         vmmc-supply = <&vcc_sdhi0>;
422         vqmmc-supply = <&vccq_sdhi0>;
423         cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
424         wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
425         status = "okay";
426 };
427
428 &sdhi1 {
429         pinctrl-0 = <&sdhi1_pins>;
430         pinctrl-names = "default";
431
432         vmmc-supply = <&vcc_sdhi1>;
433         vqmmc-supply = <&vccq_sdhi1>;
434         cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
435         wp-gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
436         status = "okay";
437 };
438
439 &sdhi2 {
440         pinctrl-0 = <&sdhi2_pins>;
441         pinctrl-names = "default";
442
443         vmmc-supply = <&vcc_sdhi2>;
444         vqmmc-supply = <&vccq_sdhi2>;
445         cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
446         status = "okay";
447 };
448
449 &qspi {
450         pinctrl-0 = <&qspi_pins>;
451         pinctrl-names = "default";
452
453         status = "okay";
454
455         flash: flash@0 {
456                 #address-cells = <1>;
457                 #size-cells = <1>;
458                 compatible = "spansion,s25fl512s";
459                 reg = <0>;
460                 spi-max-frequency = <30000000>;
461                 spi-tx-bus-width = <4>;
462                 spi-rx-bus-width = <4>;
463                 m25p,fast-read;
464
465                 partition@0 {
466                         label = "loader";
467                         reg = <0x00000000 0x00080000>;
468                         read-only;
469                 };
470                 partition@80000 {
471                         label = "bootenv";
472                         reg = <0x00080000 0x00080000>;
473                         read-only;
474                 };
475                 partition@100000 {
476                         label = "data";
477                         reg = <0x00100000 0x03f00000>;
478                 };
479         };
480 };
481
482 &msiof0 {
483         pinctrl-0 = <&msiof0_pins>;
484         pinctrl-names = "default";
485
486         status = "okay";
487
488         pmic: pmic@0 {
489                 compatible = "renesas,r2a11302ft";
490                 reg = <0>;
491                 spi-max-frequency = <6000000>;
492                 spi-cpol;
493                 spi-cpha;
494         };
495 };
496
497 &i2c2 {
498         pinctrl-0 = <&i2c2_pins>;
499         pinctrl-names = "default";
500
501         status = "okay";
502         clock-frequency = <100000>;
503
504         ak4643: sound-codec@12 {
505                 compatible = "asahi-kasei,ak4643";
506                 #sound-dai-cells = <0>;
507                 reg = <0x12>;
508         };
509
510         composite-in@20 {
511                 compatible = "adi,adv7180";
512                 reg = <0x20>;
513                 remote = <&vin1>;
514
515                 port {
516                         adv7180: endpoint {
517                                 bus-width = <8>;
518                                 remote-endpoint = <&vin1ep>;
519                         };
520                 };
521         };
522
523         hdmi@39 {
524                 compatible = "adi,adv7511w";
525                 reg = <0x39>;
526                 interrupt-parent = <&gpio3>;
527                 interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
528
529                 adi,input-depth = <8>;
530                 adi,input-colorspace = "rgb";
531                 adi,input-clock = "1x";
532                 adi,input-style = <1>;
533                 adi,input-justification = "evenly";
534
535                 ports {
536                         #address-cells = <1>;
537                         #size-cells = <0>;
538
539                         port@0 {
540                                 reg = <0>;
541                                 adv7511_in: endpoint {
542                                         remote-endpoint = <&du_out_rgb>;
543                                 };
544                         };
545
546                         port@1 {
547                                 reg = <1>;
548                                 adv7511_out: endpoint {
549                                         remote-endpoint = <&hdmi_con>;
550                                 };
551                         };
552                 };
553         };
554
555         eeprom@50 {
556                 compatible = "renesas,24c02";
557                 reg = <0x50>;
558                 pagesize = <16>;
559         };
560 };
561
562 &i2c6 {
563         status = "okay";
564         clock-frequency = <100000>;
565
566         vdd_dvfs: regulator@68 {
567                 compatible = "dlg,da9210";
568                 reg = <0x68>;
569
570                 regulator-min-microvolt = <1000000>;
571                 regulator-max-microvolt = <1000000>;
572                 regulator-boot-on;
573                 regulator-always-on;
574         };
575 };
576
577 &pci0 {
578         status = "okay";
579         pinctrl-0 = <&usb0_pins>;
580         pinctrl-names = "default";
581 };
582
583 &pci1 {
584         status = "okay";
585         pinctrl-0 = <&usb1_pins>;
586         pinctrl-names = "default";
587 };
588
589 &hsusb {
590         status = "okay";
591         pinctrl-0 = <&usb0_pins>;
592         pinctrl-names = "default";
593         renesas,enable-gpio = <&gpio5 31 GPIO_ACTIVE_HIGH>;
594 };
595
596 &usbphy {
597         status = "okay";
598 };
599
600 &pcie_bus_clk {
601         status = "okay";
602 };
603
604 &pciec {
605         status = "okay";
606 };
607
608 &cpu0 {
609         cpu0-supply = <&vdd_dvfs>;
610 };
611
612 /* composite video input */
613 &vin1 {
614         status = "ok";
615         pinctrl-0 = <&vin1_pins>;
616         pinctrl-names = "default";
617
618         port {
619                 #address-cells = <1>;
620                 #size-cells = <0>;
621
622                 vin1ep: endpoint {
623                         remote-endpoint = <&adv7180>;
624                         bus-width = <8>;
625                 };
626         };
627 };
628
629 &rcar_sound {
630         pinctrl-0 = <&sound_pins &sound_clk_pins>;
631         pinctrl-names = "default";
632
633         #sound-dai-cells = <0>;
634
635         status = "okay";
636
637         rcar_sound,dai {
638                 dai0 {
639                         playback = <&ssi0 &src2 &dvc0>;
640                         capture  = <&ssi1 &src3 &dvc1>;
641                 };
642         };
643 };
644
645 &ssi1 {
646         shared-pin;
647 };