Merge tag 'imx-dt-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
[cascardo/linux.git] / arch / arm / boot / dts / r8a7791-porter.dts
1 /*
2  * Device Tree Source for the Porter board
3  *
4  * Copyright (C) 2015 Cogent Embedded, Inc.
5  *
6  * This file is licensed under the terms of the GNU General Public License
7  * version 2.  This program is licensed "as is" without any warranty of any
8  * kind, whether express or implied.
9  */
10
11 /*
12  * SSI-AK4642
13  *
14  * JP3: 2-1: AK4642
15  *      2-3: ADV7511
16  *
17  * This command is required before playback/capture:
18  *
19  *      amixer set "LINEOUT Mixer DACL" on
20  */
21
22 /dts-v1/;
23 #include "r8a7791.dtsi"
24 #include <dt-bindings/gpio/gpio.h>
25
26 / {
27         model = "Porter";
28         compatible = "renesas,porter", "renesas,r8a7791";
29
30         aliases {
31                 serial0 = &scif0;
32         };
33
34         chosen {
35                 bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
36                 stdout-path = "serial0:115200n8";
37         };
38
39         memory@40000000 {
40                 device_type = "memory";
41                 reg = <0 0x40000000 0 0x40000000>;
42         };
43
44         memory@200000000 {
45                 device_type = "memory";
46                 reg = <2 0x00000000 0 0x40000000>;
47         };
48
49         vcc_sdhi0: regulator@0 {
50                 compatible = "regulator-fixed";
51
52                 regulator-name = "SDHI0 Vcc";
53                 regulator-min-microvolt = <3300000>;
54                 regulator-max-microvolt = <3300000>;
55                 regulator-always-on;
56         };
57
58         vccq_sdhi0: regulator@1 {
59                 compatible = "regulator-gpio";
60
61                 regulator-name = "SDHI0 VccQ";
62                 regulator-min-microvolt = <1800000>;
63                 regulator-max-microvolt = <3300000>;
64
65                 gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
66                 gpios-states = <1>;
67                 states = <3300000 1
68                           1800000 0>;
69         };
70
71         vcc_sdhi2: regulator@2 {
72                 compatible = "regulator-fixed";
73
74                 regulator-name = "SDHI2 Vcc";
75                 regulator-min-microvolt = <3300000>;
76                 regulator-max-microvolt = <3300000>;
77                 regulator-always-on;
78         };
79
80         vccq_sdhi2: regulator@3 {
81                 compatible = "regulator-gpio";
82
83                 regulator-name = "SDHI2 VccQ";
84                 regulator-min-microvolt = <1800000>;
85                 regulator-max-microvolt = <3300000>;
86
87                 gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
88                 gpios-states = <1>;
89                 states = <3300000 1
90                           1800000 0>;
91         };
92
93         hdmi-out {
94                 compatible = "hdmi-connector";
95                 type = "a";
96
97                 port {
98                         hdmi_con: endpoint {
99                                 remote-endpoint = <&adv7511_out>;
100                         };
101                 };
102         };
103
104         x3_clk: x3-clock {
105                 compatible = "fixed-clock";
106                 #clock-cells = <0>;
107                 clock-frequency = <148500000>;
108         };
109
110         x16_clk: x16-clock {
111                 compatible = "fixed-clock";
112                 #clock-cells = <0>;
113                 clock-frequency = <74250000>;
114         };
115
116         x14_clk: audio_clock {
117                 compatible = "fixed-clock";
118                 #clock-cells = <0>;
119                 clock-frequency = <11289600>;
120         };
121
122         sound {
123                 compatible = "simple-audio-card";
124
125                 simple-audio-card,format = "left_j";
126                 simple-audio-card,bitclock-master = <&soundcodec>;
127                 simple-audio-card,frame-master = <&soundcodec>;
128
129                 simple-audio-card,cpu {
130                         sound-dai = <&rcar_sound>;
131                 };
132
133                 soundcodec: simple-audio-card,codec {
134                         sound-dai = <&ak4642>;
135                         clocks = <&x14_clk>;
136                 };
137         };
138 };
139
140 &extal_clk {
141         clock-frequency = <20000000>;
142 };
143
144 &pfc {
145         pinctrl-0 = <&scif_clk_pins>;
146         pinctrl-names = "default";
147
148         scif0_pins: serial0 {
149                 groups = "scif0_data_d";
150                 function = "scif0";
151         };
152
153         scif_clk_pins: scif_clk {
154                 groups = "scif_clk";
155                 function = "scif_clk";
156         };
157
158         ether_pins: ether {
159                 groups = "eth_link", "eth_mdio", "eth_rmii";
160                 function = "eth";
161         };
162
163         phy1_pins: phy1 {
164                 groups = "intc_irq0";
165                 function = "intc";
166         };
167
168         sdhi0_pins: sd0 {
169                 groups = "sdhi0_data4", "sdhi0_ctrl";
170                 function = "sdhi0";
171         };
172
173         sdhi2_pins: sd2 {
174                 groups = "sdhi2_data4", "sdhi2_ctrl";
175                 function = "sdhi2";
176         };
177
178         qspi_pins: spi0 {
179                 groups = "qspi_ctrl", "qspi_data4";
180                 function = "qspi";
181         };
182
183         i2c2_pins: i2c2 {
184                 groups = "i2c2";
185                 function = "i2c2";
186         };
187
188         usb0_pins: usb0 {
189                 groups = "usb0";
190                 function = "usb0";
191         };
192
193         usb1_pins: usb1 {
194                 groups = "usb1";
195                 function = "usb1";
196         };
197
198         vin0_pins: vin0 {
199                 groups = "vin0_data8", "vin0_clk";
200                 function = "vin0";
201         };
202
203         can0_pins: can0 {
204                 groups = "can0_data";
205                 function = "can0";
206         };
207
208         du_pins: du {
209                 groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
210                 function = "du";
211         };
212
213         ssi_pins: sound {
214                 groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
215                 function = "ssi";
216         };
217
218         audio_clk_pins: audio_clk {
219                 groups = "audio_clk_a";
220                 function = "audio_clk";
221         };
222 };
223
224 &scif0 {
225         pinctrl-0 = <&scif0_pins>;
226         pinctrl-names = "default";
227
228         status = "okay";
229 };
230
231 &scif_clk {
232         clock-frequency = <14745600>;
233         status = "okay";
234 };
235
236 &ether {
237         pinctrl-0 = <&ether_pins &phy1_pins>;
238         pinctrl-names = "default";
239
240         phy-handle = <&phy1>;
241         renesas,ether-link-active-low;
242         status = "ok";
243
244         phy1: ethernet-phy@1 {
245                 reg = <1>;
246                 interrupt-parent = <&irqc0>;
247                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
248                 micrel,led-mode = <1>;
249         };
250 };
251
252 &sdhi0 {
253         pinctrl-0 = <&sdhi0_pins>;
254         pinctrl-names = "default";
255
256         vmmc-supply = <&vcc_sdhi0>;
257         vqmmc-supply = <&vccq_sdhi0>;
258         cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
259         wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
260         status = "okay";
261 };
262
263 &sdhi2 {
264         pinctrl-0 = <&sdhi2_pins>;
265         pinctrl-names = "default";
266
267         vmmc-supply = <&vcc_sdhi2>;
268         vqmmc-supply = <&vccq_sdhi2>;
269         cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
270         status = "okay";
271 };
272
273 &qspi {
274         pinctrl-0 = <&qspi_pins>;
275         pinctrl-names = "default";
276
277         status = "okay";
278
279         flash@0 {
280                 compatible = "spansion,s25fl512s", "jedec,spi-nor";
281                 reg = <0>;
282                 spi-max-frequency = <30000000>;
283                 spi-tx-bus-width = <4>;
284                 spi-rx-bus-width = <4>;
285                 m25p,fast-read;
286
287                 partitions {
288                         compatible = "fixed-partitions";
289                         #address-cells = <1>;
290                         #size-cells = <1>;
291
292                         partition@0 {
293                                 label = "loader_prg";
294                                 reg = <0x00000000 0x00040000>;
295                                 read-only;
296                         };
297                         partition@40000 {
298                                 label = "user_prg";
299                                 reg = <0x00040000 0x00400000>;
300                                 read-only;
301                         };
302                         partition@440000 {
303                                 label = "flash_fs";
304                                 reg = <0x00440000 0x03bc0000>;
305                         };
306                 };
307         };
308 };
309
310 &i2c2 {
311         pinctrl-0 = <&i2c2_pins>;
312         pinctrl-names = "default";
313
314         status = "okay";
315         clock-frequency = <400000>;
316
317         ak4642: codec@12 {
318                 compatible = "asahi-kasei,ak4642";
319                 #sound-dai-cells = <0>;
320                 reg = <0x12>;
321         };
322
323         composite-in@20 {
324                 compatible = "adi,adv7180";
325                 reg = <0x20>;
326                 remote = <&vin0>;
327
328                 port {
329                         adv7180: endpoint {
330                                 bus-width = <8>;
331                                 remote-endpoint = <&vin0ep>;
332                         };
333                 };
334         };
335
336         hdmi@39 {
337                 compatible = "adi,adv7511w";
338                 reg = <0x39>;
339                 interrupt-parent = <&gpio3>;
340                 interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
341
342                 adi,input-depth = <8>;
343                 adi,input-colorspace = "rgb";
344                 adi,input-clock = "1x";
345                 adi,input-style = <1>;
346                 adi,input-justification = "evenly";
347
348                 ports {
349                         #address-cells = <1>;
350                         #size-cells = <0>;
351
352                         port@0 {
353                                 reg = <0>;
354                                 adv7511_in: endpoint {
355                                         remote-endpoint = <&du_out_rgb>;
356                                 };
357                         };
358
359                         port@1 {
360                                 reg = <1>;
361                                 adv7511_out: endpoint {
362                                         remote-endpoint = <&hdmi_con>;
363                                 };
364                         };
365                 };
366         };
367 };
368
369 &sata0 {
370         status = "okay";
371 };
372
373 /* composite video input */
374 &vin0 {
375         status = "ok";
376         pinctrl-0 = <&vin0_pins>;
377         pinctrl-names = "default";
378
379         port {
380                 #address-cells = <1>;
381                 #size-cells = <0>;
382
383                 vin0ep: endpoint {
384                         remote-endpoint = <&adv7180>;
385                         bus-width = <8>;
386                 };
387         };
388 };
389
390 &pci0 {
391         pinctrl-0 = <&usb0_pins>;
392         pinctrl-names = "default";
393
394         status = "okay";
395 };
396
397 &pci1 {
398         pinctrl-0 = <&usb1_pins>;
399         pinctrl-names = "default";
400
401         status = "okay";
402 };
403
404 &hsusb {
405         pinctrl-0 = <&usb0_pins>;
406         pinctrl-names = "default";
407
408         status = "okay";
409 };
410
411 &usbphy {
412         status = "okay";
413 };
414
415 &pcie_bus_clk {
416         status = "okay";
417 };
418
419 &pciec {
420         status = "okay";
421 };
422
423 &can0 {
424         pinctrl-0 = <&can0_pins>;
425         pinctrl-names = "default";
426
427         status = "okay";
428 };
429
430 &du {
431         pinctrl-0 = <&du_pins>;
432         pinctrl-names = "default";
433         status = "okay";
434
435         clocks = <&mstp7_clks R8A7791_CLK_DU0>,
436                  <&mstp7_clks R8A7791_CLK_DU1>,
437                  <&mstp7_clks R8A7791_CLK_LVDS0>,
438                  <&x3_clk>, <&x16_clk>;
439         clock-names = "du.0", "du.1", "lvds.0",
440                       "dclkin.0", "dclkin.1";
441
442         ports {
443                 port@1 {
444                         endpoint {
445                                 remote-endpoint = <&adv7511_in>;
446                         };
447                 };
448         };
449 };
450
451 &rcar_sound {
452         pinctrl-0 = <&ssi_pins &audio_clk_pins>;
453         pinctrl-names = "default";
454         status = "okay";
455
456         /* Single DAI */
457         #sound-dai-cells = <0>;
458
459         rcar_sound,dai {
460                 dai0 {
461                         playback = <&ssi0>;
462                         capture  = <&ssi1>;
463                 };
464         };
465 };
466
467 &ssi1 {
468         shared-pin;
469 };