x86/mm: Limit mmap() of /dev/mem to valid physical addresses
[sfrench/cifs-2.6.git] / arch / arm64 / boot / dts / renesas / salvator-common.dtsi
1 /*
2  * Device Tree Source for common parts of Salvator-X board variants
3  *
4  * Copyright (C) 2015-2016 Renesas Electronics Corp.
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-AK4613
13  *
14  * This command is required when Playback/Capture
15  *
16  *      amixer set "DVC Out" 100%
17  *      amixer set "DVC In" 100%
18  *
19  * You can use Mute
20  *
21  *      amixer set "DVC Out Mute" on
22  *      amixer set "DVC In Mute" on
23  *
24  * You can use Volume Ramp
25  *
26  *      amixer set "DVC Out Ramp Up Rate"   "0.125 dB/64 steps"
27  *      amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
28  *      amixer set "DVC Out Ramp" on
29  *      aplay xxx.wav &
30  *      amixer set "DVC Out"  80%  // Volume Down
31  *      amixer set "DVC Out" 100%  // Volume Up
32  */
33
34 #include <dt-bindings/gpio/gpio.h>
35
36 / {
37         aliases {
38                 serial0 = &scif2;
39                 serial1 = &scif1;
40                 ethernet0 = &avb;
41         };
42
43         chosen {
44                 bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
45                 stdout-path = "serial0:115200n8";
46         };
47
48         audio_clkout: audio-clkout {
49                 /*
50                  * This is same as <&rcar_sound 0>
51                  * but needed to avoid cs2000/rcar_sound probe dead-lock
52                  */
53                 compatible = "fixed-clock";
54                 #clock-cells = <0>;
55                 clock-frequency = <11289600>;
56         };
57
58         backlight: backlight {
59                 compatible = "pwm-backlight";
60                 pwms = <&pwm1 0 50000>;
61
62                 brightness-levels = <256 128 64 16 8 4 0>;
63                 default-brightness-level = <6>;
64
65                 enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
66         };
67
68         reg_1p8v: regulator0 {
69                 compatible = "regulator-fixed";
70                 regulator-name = "fixed-1.8V";
71                 regulator-min-microvolt = <1800000>;
72                 regulator-max-microvolt = <1800000>;
73                 regulator-boot-on;
74                 regulator-always-on;
75         };
76
77         reg_3p3v: regulator1 {
78                 compatible = "regulator-fixed";
79                 regulator-name = "fixed-3.3V";
80                 regulator-min-microvolt = <3300000>;
81                 regulator-max-microvolt = <3300000>;
82                 regulator-boot-on;
83                 regulator-always-on;
84         };
85
86         rsnd_ak4613: sound {
87                 compatible = "simple-audio-card";
88
89                 simple-audio-card,format = "left_j";
90                 simple-audio-card,bitclock-master = <&sndcpu>;
91                 simple-audio-card,frame-master = <&sndcpu>;
92
93                 sndcpu: simple-audio-card,cpu {
94                         sound-dai = <&rcar_sound>;
95                 };
96
97                 sndcodec: simple-audio-card,codec {
98                         sound-dai = <&ak4613>;
99                 };
100         };
101
102         vbus0_usb2: regulator-vbus0-usb2 {
103                 compatible = "regulator-fixed";
104
105                 regulator-name = "USB20_VBUS0";
106                 regulator-min-microvolt = <5000000>;
107                 regulator-max-microvolt = <5000000>;
108
109                 gpio = <&gpio6 16 GPIO_ACTIVE_HIGH>;
110                 enable-active-high;
111         };
112
113         vcc_sdhi0: regulator-vcc-sdhi0 {
114                 compatible = "regulator-fixed";
115
116                 regulator-name = "SDHI0 Vcc";
117                 regulator-min-microvolt = <3300000>;
118                 regulator-max-microvolt = <3300000>;
119
120                 gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>;
121                 enable-active-high;
122         };
123
124         vccq_sdhi0: regulator-vccq-sdhi0 {
125                 compatible = "regulator-gpio";
126
127                 regulator-name = "SDHI0 VccQ";
128                 regulator-min-microvolt = <1800000>;
129                 regulator-max-microvolt = <3300000>;
130
131                 gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
132                 gpios-states = <1>;
133                 states = <3300000 1
134                           1800000 0>;
135         };
136
137         vcc_sdhi3: regulator-vcc-sdhi3 {
138                 compatible = "regulator-fixed";
139
140                 regulator-name = "SDHI3 Vcc";
141                 regulator-min-microvolt = <3300000>;
142                 regulator-max-microvolt = <3300000>;
143
144                 gpio = <&gpio3 15 GPIO_ACTIVE_HIGH>;
145                 enable-active-high;
146         };
147
148         vccq_sdhi3: regulator-vccq-sdhi3 {
149                 compatible = "regulator-gpio";
150
151                 regulator-name = "SDHI3 VccQ";
152                 regulator-min-microvolt = <1800000>;
153                 regulator-max-microvolt = <3300000>;
154
155                 gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
156                 gpios-states = <1>;
157                 states = <3300000 1
158                           1800000 0>;
159         };
160
161         hdmi0-out {
162                 compatible = "hdmi-connector";
163                 label = "HDMI0 OUT";
164                 type = "a";
165
166                 port {
167                         hdmi0_con: endpoint {
168                         };
169                 };
170         };
171
172         hdmi1-out {
173                 compatible = "hdmi-connector";
174                 label = "HDMI1 OUT";
175                 type = "a";
176
177                 port {
178                         hdmi1_con: endpoint {
179                         };
180                 };
181         };
182
183         vga {
184                 compatible = "vga-connector";
185
186                 port {
187                         vga_in: endpoint {
188                                 remote-endpoint = <&adv7123_out>;
189                         };
190                 };
191         };
192
193         vga-encoder {
194                 compatible = "adi,adv7123";
195
196                 ports {
197                         #address-cells = <1>;
198                         #size-cells = <0>;
199
200                         port@0 {
201                                 reg = <0>;
202                                 adv7123_in: endpoint {
203                                         remote-endpoint = <&du_out_rgb>;
204                                 };
205                         };
206                         port@1 {
207                                 reg = <1>;
208                                 adv7123_out: endpoint {
209                                         remote-endpoint = <&vga_in>;
210                                 };
211                         };
212                 };
213         };
214
215         x12_clk: x12 {
216                 compatible = "fixed-clock";
217                 #clock-cells = <0>;
218                 clock-frequency = <24576000>;
219         };
220
221         /* External DU dot clocks */
222         x21_clk: x21-clock {
223                 compatible = "fixed-clock";
224                 #clock-cells = <0>;
225                 clock-frequency = <33000000>;
226         };
227
228         x22_clk: x22-clock {
229                 compatible = "fixed-clock";
230                 #clock-cells = <0>;
231                 clock-frequency = <33000000>;
232         };
233
234         x23_clk: x23-clock {
235                 compatible = "fixed-clock";
236                 #clock-cells = <0>;
237                 clock-frequency = <25000000>;
238         };
239 };
240
241 &audio_clk_a {
242         clock-frequency = <22579200>;
243 };
244
245 &avb {
246         pinctrl-0 = <&avb_pins>;
247         pinctrl-names = "default";
248         renesas,no-ether-link;
249         phy-handle = <&phy0>;
250         status = "okay";
251
252         phy0: ethernet-phy@0 {
253                 rxc-skew-ps = <1500>;
254                 reg = <0>;
255                 interrupt-parent = <&gpio2>;
256                 interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
257         };
258 };
259
260 &du {
261         pinctrl-0 = <&du_pins>;
262         pinctrl-names = "default";
263         status = "okay";
264
265         ports {
266                 port@0 {
267                         endpoint {
268                                 remote-endpoint = <&adv7123_in>;
269                         };
270                 };
271         };
272 };
273
274 &ehci0 {
275         status = "okay";
276 };
277
278 &ehci1 {
279         status = "okay";
280 };
281
282 &extalr_clk {
283         clock-frequency = <32768>;
284 };
285
286 &hsusb {
287         status = "okay";
288 };
289
290 &i2c2 {
291         pinctrl-0 = <&i2c2_pins>;
292         pinctrl-names = "default";
293
294         status = "okay";
295
296         clock-frequency = <100000>;
297
298         ak4613: codec@10 {
299                 compatible = "asahi-kasei,ak4613";
300                 #sound-dai-cells = <0>;
301                 reg = <0x10>;
302                 clocks = <&rcar_sound 3>;
303
304                 asahi-kasei,in1-single-end;
305                 asahi-kasei,in2-single-end;
306                 asahi-kasei,out1-single-end;
307                 asahi-kasei,out2-single-end;
308                 asahi-kasei,out3-single-end;
309                 asahi-kasei,out4-single-end;
310                 asahi-kasei,out5-single-end;
311                 asahi-kasei,out6-single-end;
312         };
313
314         cs2000: clk_multiplier@4f {
315                 #clock-cells = <0>;
316                 compatible = "cirrus,cs2000-cp";
317                 reg = <0x4f>;
318                 clocks = <&audio_clkout>, <&x12_clk>;
319                 clock-names = "clk_in", "ref_clk";
320
321                 assigned-clocks = <&cs2000>;
322                 assigned-clock-rates = <24576000>; /* 1/1 divide */
323         };
324 };
325
326 &i2c4 {
327         status = "okay";
328
329         csa_vdd: adc@7c {
330                 compatible = "maxim,max9611";
331                 reg = <0x7c>;
332
333                 shunt-resistor-micro-ohms = <5000>;
334         };
335
336         csa_dvfs: adc@7f {
337                 compatible = "maxim,max9611";
338                 reg = <0x7f>;
339
340                 shunt-resistor-micro-ohms = <5000>;
341         };
342 };
343
344 &i2c_dvfs {
345         status = "okay";
346 };
347
348 &ohci0 {
349         status = "okay";
350 };
351
352 &ohci1 {
353         status = "okay";
354 };
355
356 &pcie_bus_clk {
357         clock-frequency = <100000000>;
358 };
359
360 &pciec0 {
361         status = "okay";
362 };
363
364 &pciec1 {
365         status = "okay";
366 };
367
368 &pfc {
369         pinctrl-0 = <&scif_clk_pins>;
370         pinctrl-names = "default";
371
372         avb_pins: avb {
373                 mux {
374                         groups = "avb_link", "avb_phy_int", "avb_mdc",
375                                  "avb_mii";
376                         function = "avb";
377                 };
378
379                 pins_mdc {
380                         groups = "avb_mdc";
381                         drive-strength = <24>;
382                 };
383
384                 pins_mii_tx {
385                         pins = "PIN_AVB_TX_CTL", "PIN_AVB_TXC", "PIN_AVB_TD0",
386                                "PIN_AVB_TD1", "PIN_AVB_TD2", "PIN_AVB_TD3";
387                         drive-strength = <12>;
388                 };
389         };
390
391         du_pins: du {
392                 groups = "du_rgb888", "du_sync", "du_oddf", "du_clk_out_0";
393                 function = "du";
394         };
395
396         i2c2_pins: i2c2 {
397                 groups = "i2c2_a";
398                 function = "i2c2";
399         };
400
401         pwm1_pins: pwm1 {
402                 groups = "pwm1_a";
403                 function = "pwm1";
404         };
405
406         scif1_pins: scif1 {
407                 groups = "scif1_data_a", "scif1_ctrl";
408                 function = "scif1";
409         };
410
411         scif2_pins: scif2 {
412                 groups = "scif2_data_a";
413                 function = "scif2";
414         };
415
416         scif_clk_pins: scif_clk {
417                 groups = "scif_clk_a";
418                 function = "scif_clk";
419         };
420
421         sdhi0_pins: sd0 {
422                 groups = "sdhi0_data4", "sdhi0_ctrl";
423                 function = "sdhi0";
424                 power-source = <3300>;
425         };
426
427         sdhi0_pins_uhs: sd0_uhs {
428                 groups = "sdhi0_data4", "sdhi0_ctrl";
429                 function = "sdhi0";
430                 power-source = <1800>;
431         };
432
433         sdhi2_pins: sd2 {
434                 groups = "sdhi2_data8", "sdhi2_ctrl";
435                 function = "sdhi2";
436                 power-source = <3300>;
437         };
438
439         sdhi2_pins_uhs: sd2_uhs {
440                 groups = "sdhi2_data8", "sdhi2_ctrl";
441                 function = "sdhi2";
442                 power-source = <1800>;
443         };
444
445         sdhi3_pins: sd3 {
446                 groups = "sdhi3_data4", "sdhi3_ctrl";
447                 function = "sdhi3";
448                 power-source = <3300>;
449         };
450
451         sdhi3_pins_uhs: sd3_uhs {
452                 groups = "sdhi3_data4", "sdhi3_ctrl";
453                 function = "sdhi3";
454                 power-source = <1800>;
455         };
456
457         sound_pins: sound {
458                 groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
459                 function = "ssi";
460         };
461
462         sound_clk_pins: sound_clk {
463                 groups = "audio_clk_a_a", "audio_clk_b_a", "audio_clk_c_a",
464                          "audio_clkout_a", "audio_clkout3_a";
465                 function = "audio_clk";
466         };
467
468         usb0_pins: usb0 {
469                 groups = "usb0";
470                 function = "usb0";
471         };
472
473         usb1_pins: usb1 {
474                 mux {
475                         groups = "usb1";
476                         function = "usb1";
477                 };
478
479                 ovc {
480                         pins = "GP_6_27";
481                         bias-pull-up;
482                 };
483
484                 pwen {
485                         pins = "GP_6_26";
486                         bias-pull-down;
487                 };
488         };
489 };
490
491 &pwm1 {
492         pinctrl-0 = <&pwm1_pins>;
493         pinctrl-names = "default";
494
495         status = "okay";
496 };
497
498 &rcar_sound {
499         pinctrl-0 = <&sound_pins &sound_clk_pins>;
500         pinctrl-names = "default";
501
502         /* Single DAI */
503         #sound-dai-cells = <0>;
504
505         /* audio_clkout0/1/2/3 */
506         #clock-cells = <1>;
507         clock-frequency = <12288000 11289600>;
508
509         status = "okay";
510
511         /* update <audio_clk_b> to <cs2000> */
512         clocks = <&cpg CPG_MOD 1005>,
513                  <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
514                  <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
515                  <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
516                  <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
517                  <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
518                  <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
519                  <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
520                  <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
521                  <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
522                  <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
523                  <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
524                  <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
525                  <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
526                  <&audio_clk_a>, <&cs2000>,
527                  <&audio_clk_c>,
528                  <&cpg CPG_CORE CPG_AUDIO_CLK_I>;
529
530         rcar_sound,dai {
531                 dai0 {
532                         playback = <&ssi0 &src0 &dvc0>;
533                         capture  = <&ssi1 &src1 &dvc1>;
534                 };
535         };
536 };
537
538 &scif1 {
539         pinctrl-0 = <&scif1_pins>;
540         pinctrl-names = "default";
541
542         uart-has-rtscts;
543         status = "okay";
544 };
545
546 &scif2 {
547         pinctrl-0 = <&scif2_pins>;
548         pinctrl-names = "default";
549
550         status = "okay";
551 };
552
553 &scif_clk {
554         clock-frequency = <14745600>;
555 };
556
557 &sdhi0 {
558         pinctrl-0 = <&sdhi0_pins>;
559         pinctrl-1 = <&sdhi0_pins_uhs>;
560         pinctrl-names = "default", "state_uhs";
561
562         vmmc-supply = <&vcc_sdhi0>;
563         vqmmc-supply = <&vccq_sdhi0>;
564         cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
565         wp-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
566         bus-width = <4>;
567         sd-uhs-sdr50;
568         status = "okay";
569 };
570
571 &sdhi2 {
572         /* used for on-board 8bit eMMC */
573         pinctrl-0 = <&sdhi2_pins>;
574         pinctrl-1 = <&sdhi2_pins_uhs>;
575         pinctrl-names = "default", "state_uhs";
576
577         vmmc-supply = <&reg_3p3v>;
578         vqmmc-supply = <&reg_1p8v>;
579         bus-width = <8>;
580         mmc-hs200-1_8v;
581         non-removable;
582         status = "okay";
583 };
584
585 &sdhi3 {
586         pinctrl-0 = <&sdhi3_pins>;
587         pinctrl-1 = <&sdhi3_pins_uhs>;
588         pinctrl-names = "default", "state_uhs";
589
590         vmmc-supply = <&vcc_sdhi3>;
591         vqmmc-supply = <&vccq_sdhi3>;
592         cd-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
593         wp-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
594         bus-width = <4>;
595         sd-uhs-sdr50;
596         status = "okay";
597 };
598
599 &ssi1 {
600         shared-pin;
601 };
602
603 &usb2_phy0 {
604         pinctrl-0 = <&usb0_pins>;
605         pinctrl-names = "default";
606
607         vbus-supply = <&vbus0_usb2>;
608         status = "okay";
609 };
610
611 &usb2_phy1 {
612         pinctrl-0 = <&usb1_pins>;
613         pinctrl-names = "default";
614
615         status = "okay";
616 };
617
618 &wdt0 {
619         timeout-sec = <60>;
620         status = "okay";
621 };
622
623 &xhci0 {
624         status = "okay";
625 };