ae0f58eb2be8f26a68f95105297ef78575919321
[linux-2.6-microblaze.git] / arch / arm64 / boot / dts / renesas / beacon-renesom-baseboard.dtsi
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright 2020, Compass Electronics Group, LLC
4  */
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8 #include <dt-bindings/clk/versaclock.h>
9
10 / {
11         backlight_lvds: backlight-lvds {
12                 compatible = "pwm-backlight";
13                 power-supply = <&reg_lcd>;
14                 enable-gpios = <&gpio_exp1 3 GPIO_ACTIVE_HIGH>;
15                 pwms = <&pwm2 0 25000>;
16                 brightness-levels = <0 4 8 16 32 64 128 255>;
17                 default-brightness-level = <6>;
18         };
19
20         backlight_dpi: backlight-dpi {
21                 compatible = "pwm-backlight";
22                 power-supply = <&reg_lcd>;
23                 enable-gpios = <&gpio_exp1 7 GPIO_ACTIVE_LOW>;
24                 pwms = <&pwm0 0 25000>;
25                 brightness-levels = <0 25 33 50 63 75 88 100>;
26                 default-brightness-level = <6>;
27         };
28
29         hdmi0-out {
30                 compatible = "hdmi-connector";
31                 type = "a";
32
33                 port {
34                         hdmi0_con: endpoint {
35                                 remote-endpoint = <&rcar_dw_hdmi0_out>;
36                         };
37                 };
38         };
39
40         keys {
41                 compatible = "gpio-keys";
42
43                 key-1 { /* S19 */
44                         gpios = <&gpio4 6 GPIO_ACTIVE_LOW>;
45                         linux,code = <KEY_UP>;
46                         label = "Up";
47                         wakeup-source;
48                         debounce-interval = <20>;
49                 };
50                 key-2 { /*S20 */
51                         gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
52                         linux,code = <KEY_LEFT>;
53                         label = "Left";
54                         wakeup-source;
55                         debounce-interval = <20>;
56                 };
57                 key-3 { /* S21 */
58                         gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
59                         linux,code = <KEY_DOWN>;
60                         label = "Down";
61                         wakeup-source;
62                         debounce-interval = <20>;
63                 };
64                 key-4 { /* S22 */
65                         gpios = <&gpio5 20 GPIO_ACTIVE_LOW>;
66                         linux,code = <KEY_RIGHT>;
67                         label = "Right";
68                         wakeup-source;
69                         debounce-interval = <20>;
70                 };
71                 key-5 { /* S23 */
72                         gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
73                         linux,code = <KEY_ENTER>;
74                         label = "Center";
75                         wakeup-source;
76                         debounce-interval = <20>;
77                 };
78         };
79
80         leds {
81                 compatible = "gpio-leds";
82                 pinctrl-0 = <&led_pins>;
83                 pinctrl-names = "default";
84
85                 led0 {
86                         gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
87                         label = "LED0";
88                         linux,default-trigger = "heartbeat";
89                 };
90                 led1 {
91                         gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
92                         label = "LED1";
93                 };
94                 led2 {
95                         gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
96                         label = "LED2";
97                 };
98                 led3 {
99                         gpios = <&gpio7 3 GPIO_ACTIVE_HIGH>;
100                         label = "LED3";
101                 };
102         };
103
104         lvds {
105                 compatible = "panel-lvds";
106                 power-supply = <&reg_lcd_reset>;
107                 width-mm = <223>;
108                 height-mm = <125>;
109                 backlight = <&backlight_lvds>;
110                 data-mapping = "vesa-24";
111
112                 panel-timing {
113                         /* 800x480@60Hz */
114                         clock-frequency = <30000000>;
115                         hactive = <800>;
116                         vactive = <480>;
117                         hsync-len = <48>;
118                         hfront-porch = <40>;
119                         hback-porch = <40>;
120                         vfront-porch = <13>;
121                         vback-porch = <29>;
122                         vsync-len = <1>;
123                         hsync-active = <1>;
124                         vsync-active = <3>;
125                         de-active = <1>;
126                         pixelclk-active = <0>;
127                 };
128
129                 port {
130                         panel_in: endpoint {
131                                 remote-endpoint = <&lvds0_out>;
132                         };
133                 };
134         };
135
136         rgb {
137                 /* Different LCD with compatible timings */
138                 compatible = "rocktech,rk070er9427";
139                 backlight = <&backlight_dpi>;
140                 enable-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
141                 power-supply = <&reg_lcd>;
142                 port {
143                         rgb_panel: endpoint {
144                                 remote-endpoint = <&du_out_rgb>;
145                         };
146                 };
147         };
148
149         reg_audio: regulator_audio {
150                 compatible = "regulator-fixed";
151                 regulator-name = "audio-1.8V";
152                 regulator-min-microvolt = <1800000>;
153                 regulator-max-microvolt = <1800000>;
154                 gpio = <&gpio_exp4 1 GPIO_ACTIVE_HIGH>;
155                 enable-active-high;
156         };
157
158         reg_lcd: regulator-lcd {
159                 compatible = "regulator-fixed";
160                 regulator-name = "lcd_panel_pwr";
161                 regulator-min-microvolt = <3300000>;
162                 regulator-max-microvolt = <3300000>;
163                 gpio = <&gpio_exp1 1 GPIO_ACTIVE_HIGH>;
164                 enable-active-high;
165         };
166
167         reg_lcd_reset: regulator-lcd-reset {
168                 compatible = "regulator-fixed";
169                 regulator-name = "nLCD_RESET";
170                 regulator-min-microvolt = <3300000>;
171                 regulator-max-microvolt = <3300000>;
172                 gpio = <&gpio5 3 GPIO_ACTIVE_HIGH>;
173                 enable-active-high;
174                 vin-supply = <&reg_lcd>;
175         };
176
177         reg_cam0: regulator_camera {
178                 compatible = "regulator-fixed";
179                 regulator-name = "reg_cam0";
180                 regulator-min-microvolt = <1800000>;
181                 regulator-max-microvolt = <1800000>;
182                 gpio = <&gpio_exp2 2 GPIO_ACTIVE_HIGH>;
183                 enable-active-high;
184         };
185
186         reg_cam1: regulator_camera {
187                 compatible = "regulator-fixed";
188                 regulator-name = "reg_cam1";
189                 regulator-min-microvolt = <1800000>;
190                 regulator-max-microvolt = <1800000>;
191                 gpio = <&gpio_exp2 5 GPIO_ACTIVE_HIGH>;
192                 enable-active-high;
193                 startup-delay-us = <100000>;
194         };
195
196         sound_card {
197                 compatible = "audio-graph-card";
198                 label = "rcar-sound";
199                 dais = <&rsnd_port0>, <&rsnd_port1>;
200         };
201
202         vccq_sdhi0: regulator-vccq-sdhi0 {
203                 compatible = "regulator-gpio";
204                 regulator-name = "SDHI0 VccQ";
205                 regulator-min-microvolt = <1800000>;
206                 regulator-max-microvolt = <3300000>;
207                 gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
208                 gpios-states = <1>;
209                 states = <3300000 1>, <1800000 0>;
210         };
211
212         /* External DU dot clocks */
213         x302_clk: x302-clock {
214                 compatible = "fixed-clock";
215                 #clock-cells = <0>;
216                 clock-frequency = <33000000>;
217         };
218
219         x304_clk: x304-clock {
220                 compatible = "fixed-clock";
221                 #clock-cells = <0>;
222                 clock-frequency = <25000000>;
223         };
224
225         connector {
226                 compatible = "usb-c-connector";
227                 label = "USB-C";
228                 data-role = "dual";
229
230                 ports {
231                         #address-cells = <1>;
232                         #size-cells = <0>;
233                         port@0 {
234                                 reg = <0>;
235                                 hs_ep: endpoint {
236                                         remote-endpoint = <&usb3_hs_ep>;
237                                 };
238                         };
239                         port@1 {
240                                 reg = <1>;
241                                 ss_ep: endpoint {
242                                         remote-endpoint = <&hd3ss3220_in_ep>;
243                                 };
244                         };
245                 };
246         };
247 };
248
249 &audio_clk_b {
250         clock-frequency = <22579200>;
251 };
252
253 &can0 {
254         pinctrl-0 = <&can0_pins>;
255         pinctrl-names = "default";
256         renesas,can-clock-select = <0x0>;
257         status = "okay";
258 };
259
260 &can1 {
261         pinctrl-0 = <&can1_pins>;
262         pinctrl-names = "default";
263         renesas,can-clock-select = <0x0>;
264         status = "okay";
265 };
266
267 &du {
268         pinctrl-0 = <&du_pins>;
269         pinctrl-names = "default";
270         status = "okay";
271
272         clocks = <&cpg CPG_MOD 724>,
273                 <&cpg CPG_MOD 723>,
274                 <&cpg CPG_MOD 722>,
275                 <&versaclock5 1>,
276                 <&x302_clk>,
277                 <&versaclock5 2>;
278         clock-names = "du.0", "du.1", "du.2",
279                 "dclkin.0", "dclkin.1", "dclkin.2";
280 };
281
282 &du_out_rgb {
283         remote-endpoint = <&rgb_panel>;
284 };
285
286 &ehci0 {
287         dr_mode = "otg";
288         status = "okay";
289         clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
290 };
291
292 &ehci1 {
293         status = "okay";
294         clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
295 };
296
297 &hdmi0 {
298         status = "okay";
299         ports {
300                 #address-cells = <1>;
301                 #size-cells = <0>;
302                 port@0 {
303                         reg = <0>;
304                         dw_hdmi0_in: endpoint {
305                                 remote-endpoint = <&du_out_hdmi0>;
306                         };
307                 };
308                 port@1 {
309                         reg = <1>;
310                         rcar_dw_hdmi0_out: endpoint {
311                                 remote-endpoint = <&hdmi0_con>;
312                         };
313                 };
314                 port@2 {
315                         reg = <2>;
316                         dw_hdmi0_snd_in: endpoint {
317                                 remote-endpoint = <&rsnd_endpoint1>;
318                         };
319                 };
320         };
321 };
322
323 &hscif1 {
324         pinctrl-0 = <&hscif1_pins>;
325         pinctrl-names = "default";
326         uart-has-rtscts;
327         status = "okay";
328 };
329
330 &hsusb {
331         dr_mode = "otg";
332         status = "okay";
333 };
334
335 &i2c2 {
336         status = "okay";
337         clock-frequency = <400000>;
338         pinctrl-0 = <&i2c2_pins>;
339         pinctrl-names = "default";
340
341         gpio_exp2: gpio@21 {
342                 compatible = "onnn,pca9654";
343                 reg = <0x21>;
344                 gpio-controller;
345                 #gpio-cells = <2>;
346         };
347
348         gpio_exp3: gpio@22 {
349                 compatible = "onnn,pca9654";
350                 reg = <0x22>;
351                 gpio-controller;
352                 #gpio-cells = <2>;
353         };
354
355         gpio_exp4: gpio@23 {
356                 compatible = "onnn,pca9654";
357                 reg = <0x23>;
358                 gpio-controller;
359                 #gpio-cells = <2>;
360         };
361
362         versaclock6_bb: clock-controller@6a {
363                 compatible = "idt,5p49v6965";
364                 reg = <0x6a>;
365                 #clock-cells = <1>;
366                 clocks = <&x304_clk>;
367                 clock-names = "xin";
368
369                 assigned-clocks = <&versaclock6_bb 1>,
370                                    <&versaclock6_bb 2>,
371                                    <&versaclock6_bb 3>,
372                                    <&versaclock6_bb 4>;
373                 assigned-clock-rates =  <24000000>, <24000000>, <24000000>, <24576000>;
374
375                 OUT1 {
376                         idt,mode = <VC5_CMOS>;
377                         idt,voltage-microvolt = <1800000>;
378                         idt,slew-percent = <100>;
379                 };
380
381                 OUT2 {
382                         idt,mode = <VC5_CMOS>;
383                         idt,voltage-microvolt = <1800000>;
384                         idt,slew-percent = <100>;
385                 };
386
387                 OUT3 {
388                         idt,mode = <VC5_CMOS>;
389                         idt,voltage-microvolt = <3300000>;
390                         idt,slew-percent = <100>;
391                 };
392
393                 OUT4 {
394                         idt,mode = <VC5_CMOS>;
395                         idt,voltage-microvolt = <3300000>;
396                         idt,slew-percent = <100>;
397                 };
398         };
399 };
400
401 &i2c0 {
402         status = "okay";
403         clock-frequency = <400000>;
404
405         pinctrl-0 = <&i2c0_pins>;
406         pinctrl-names = "default";
407 };
408
409 &i2c5 {
410         status = "okay";
411         clock-frequency = <400000>;
412         pinctrl-0 = <&i2c5_pins>;
413         pinctrl-names = "default";
414
415         codec: wm8962@1a {
416                 compatible = "wlf,wm8962";
417                 reg = <0x1a>;
418                 clocks = <&versaclock6_bb 3>;
419                 DCVDD-supply = <&reg_audio>;
420                 DBVDD-supply = <&reg_audio>;
421                 AVDD-supply = <&reg_audio>;
422                 CPVDD-supply = <&reg_audio>;
423                 MICVDD-supply = <&reg_audio>;
424                 PLLVDD-supply = <&reg_audio>;
425                 SPKVDD1-supply = <&reg_audio>;
426                 SPKVDD2-supply = <&reg_audio>;
427                 gpio-cfg = <
428                         0x0000 /* 0:Default */
429                         0x0000 /* 1:Default */
430                         0x0000 /* 2:Default */
431                         0x0000 /* 3:Default */
432                         0x0000 /* 4:Default */
433                         0x0000 /* 5:Default */
434                 >;
435                 port {
436                         wm8962_endpoint: endpoint {
437                                 remote-endpoint = <&rsnd_endpoint0>;
438                         };
439                 };
440         };
441
442         /* 0 - lcd_reset */
443         /* 1 - lcd_pwr */
444         /* 2 - lcd_select */
445         /* 3 - backlight-enable */
446         /* 4 - Touch_shdwn */
447         /* 5 - LCD_H_pol */
448         /* 6 - lcd_V_pol */
449         gpio_exp1: gpio@20 {
450                 compatible = "onnn,pca9654";
451                 reg = <0x20>;
452                 gpio-controller;
453                 #gpio-cells = <2>;
454         };
455
456         touchscreen@26 {
457                 compatible = "ilitek,ili2117";
458                 reg = <0x26>;
459                 interrupt-parent = <&gpio5>;
460                 interrupts = <9 IRQ_TYPE_EDGE_RISING>;
461                 wakeup-source;
462         };
463
464         hd3ss3220@47 {
465                 compatible = "ti,hd3ss3220";
466                 reg = <0x47>;
467                 interrupt-parent = <&gpio6>;
468                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
469
470                 ports {
471                         #address-cells = <1>;
472                         #size-cells = <0>;
473                         port@0 {
474                                 reg = <0>;
475                                 hd3ss3220_in_ep: endpoint {
476                                         remote-endpoint = <&ss_ep>;
477                                 };
478                         };
479                         port@1 {
480                                 reg = <1>;
481                                 hd3ss3220_out_ep: endpoint {
482                                         remote-endpoint = <&usb3_role_switch>;
483                                 };
484                         };
485                 };
486         };
487 };
488
489 &lvds0 {
490         status = "okay";
491
492         ports {
493                 port@1 {
494                         lvds0_out: endpoint {
495                                 remote-endpoint = <&panel_in>;
496                         };
497                 };
498         };
499 };
500
501 &msiof1 {
502         pinctrl-0 = <&msiof1_pins>;
503         pinctrl-names = "default";
504         status = "okay";
505         cs-gpios = <&gpio3 10 GPIO_ACTIVE_LOW>;
506 };
507
508 &ohci0 {
509         dr_mode = "otg";
510         status = "okay";
511 };
512
513 &ohci1 {
514         status = "okay";
515 };
516
517 &pciec0 {
518         status = "okay";
519 };
520
521 &pciec1 {
522         status = "okay";
523 };
524
525 &pcie_bus_clk {
526         clock-frequency = <100000000>;
527 };
528
529 &pfc {
530         can0_pins: can0 {
531                 groups = "can0_data_a";
532                 function = "can0";
533         };
534
535         can1_pins: can1 {
536                 groups = "can1_data";
537                 function = "can1";
538         };
539
540         du_pins: du {
541                 groups = "du_rgb888", "du_sync", "du_clk_out_1", "du_disp";
542                 function = "du";
543         };
544
545         i2c2_pins: i2c2 {
546                 groups = "i2c2_a";
547                 function = "i2c2";
548         };
549
550         i2c5_pins: i2c5 {
551                 groups = "i2c5";
552                 function = "i2c5";
553         };
554
555         led_pins: leds {
556                 /* GP_0_4 , AVS1, AVS2, GP_7_3 */
557                 pins = "GP_0_4", "GP_7_0", "GP_7_1", "GP_7_3";
558                 bias-pull-down;
559         };
560
561         msiof1_pins: msiof1 {
562                 groups = "msiof1_clk_g", "msiof1_rxd_g", "msiof1_txd_g";
563                 function = "msiof1";
564         };
565
566         pwm0_pins: pwm0 {
567                 groups = "pwm0";
568                 function = "pwm0";
569         };
570
571         pwm2_pins: pwm2 {
572                 groups = "pwm2_a";
573                 function = "pwm2";
574         };
575
576         sdhi0_pins: sd0 {
577                 groups = "sdhi0_data4", "sdhi0_ctrl";
578                 function = "sdhi0";
579                 power-source = <3300>;
580         };
581
582         sdhi0_pins_uhs: sd0_uhs {
583                 groups = "sdhi0_data4", "sdhi0_ctrl";
584                 function = "sdhi0";
585                 power-source = <1800>;
586         };
587
588         sound_pins: sound {
589                 groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
590                 function = "ssi";
591         };
592
593         sound_clk_pins: sound_clk {
594                 groups = "audio_clk_a_a", "audio_clk_b_a";
595                 function = "audio_clk";
596         };
597
598         usb0_pins: usb0 {
599                 mux {
600                         groups = "usb0";
601                         function = "usb0";
602                 };
603         };
604
605         usb1_pins: usb1 {
606                 mux {
607                         groups = "usb1";
608                         function = "usb1";
609                 };
610         };
611
612         usb30_pins: usb30 {
613                 mux {
614                         groups = "usb30";
615                         function = "usb30";
616                 };
617         };
618 };
619
620 &pwm0 {
621         pinctrl-0 = <&pwm0_pins>;
622         pinctrl-names = "default";
623         status = "okay";
624 };
625
626 &pwm2 {
627         pinctrl-0 = <&pwm2_pins>;
628         pinctrl-names = "default";
629         status = "okay";
630 };
631
632 &rcar_sound {
633         pinctrl-0 = <&sound_pins &sound_clk_pins>;
634         pinctrl-names = "default";
635
636         /* Single DAI */
637         #sound-dai-cells = <0>;
638
639         /* audio_clkout0/1/2/3 */
640         #clock-cells = <1>;
641         clock-frequency = <11289600>;
642
643         status = "okay";
644
645         ports {
646                 #address-cells = <1>;
647                 #size-cells = <0>;
648                 rsnd_port0: port@0 {
649                         reg = <0>;
650                         rsnd_endpoint0: endpoint {
651                                 remote-endpoint = <&wm8962_endpoint>;
652
653                                 dai-format = "i2s";
654                                 bitclock-master = <&rsnd_endpoint0>;
655                                 frame-master = <&rsnd_endpoint0>;
656
657                                 playback = <&ssi1 &dvc1 &src1>;
658                                 capture = <&ssi0>;
659                         };
660                 };
661                 rsnd_port1: port@1 {
662                     reg = <0x01>;
663                         rsnd_endpoint1: endpoint {
664                                 remote-endpoint = <&dw_hdmi0_snd_in>;
665
666                                 dai-format = "i2s";
667                                 bitclock-master = <&rsnd_endpoint1>;
668                                 frame-master = <&rsnd_endpoint1>;
669
670                                 playback = <&ssi2>;
671                         };
672                 };
673         };
674 };
675
676 &rwdt {
677         status = "okay";
678         timeout-sec = <60>;
679 };
680
681 &scif0 {
682         pinctrl-0 = <&scif0_pins>;
683         pinctrl-names = "default";
684         status = "okay";
685 };
686
687 &scif5 {
688         pinctrl-0 = <&scif5_pins>;
689         pinctrl-names = "default";
690         status = "okay";
691 };
692
693 &scif_clk {
694         clock-frequency = <14745600>;
695 };
696
697 &sdhi0 {
698         pinctrl-0 = <&sdhi0_pins>;
699         pinctrl-1 = <&sdhi0_pins_uhs>;
700         pinctrl-names = "default", "state_uhs";
701         vmmc-supply = <&reg_3p3v>;
702         vqmmc-supply = <&vccq_sdhi0>;
703         cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
704         bus-width = <4>;
705         sd-uhs-sdr50;
706         sd-uhs-sdr104;
707         status = "okay";
708 };
709
710 &ssi1 {
711         shared-pin;
712 };
713
714 &tmu0 {
715         status = "okay";
716 };
717
718 &tmu1 {
719         status = "okay";
720 };
721
722 &tmu2 {
723         status = "okay";
724 };
725
726 &tmu3 {
727         status = "okay";
728 };
729
730 &tmu4 {
731         status = "okay";
732 };
733
734 &usb2_phy0 {
735         pinctrl-0 = <&usb0_pins>;
736         pinctrl-names = "default";
737         status = "okay";
738 };
739
740 &usb2_phy1 {
741         pinctrl-0 = <&usb1_pins>;
742         pinctrl-names = "default";
743         status = "okay";
744 };
745
746 &usb3_peri0 {
747         companion = <&xhci0>;
748         status = "okay";
749         usb-role-switch;
750
751         ports {
752                 #address-cells = <1>;
753                 #size-cells = <0>;
754                 port@0 {
755                         reg = <0>;
756                         usb3_hs_ep: endpoint {
757                                 remote-endpoint = <&hs_ep>;
758                         };
759                 };
760                 port@1 {
761                         reg = <1>;
762                         usb3_role_switch: endpoint {
763                                 remote-endpoint = <&hd3ss3220_out_ep>;
764                         };
765                 };
766         };
767 };
768
769 &usb3_phy0 {
770         status = "okay";
771 };
772
773 &vin0 {
774         status = "okay";
775 };
776 &vin1 {
777         status = "okay";
778 };
779 &vin2 {
780         status = "okay";
781 };
782 &vin3 {
783         status = "okay";
784 };
785 &vin4 {
786         status = "okay";
787 };
788 &vin5 {
789         status = "okay";
790 };
791 &vin6 {
792         status = "okay";
793 };
794 &vin7 {
795         status = "okay";
796 };
797
798 &xhci0
799 {
800         pinctrl-0 = <&usb30_pins>;
801         pinctrl-names = "default";
802         status = "okay";
803 };