0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003 * Copyright 2020, Compass Electronics Group, LLC
0004 */
0005
0006 #include <dt-bindings/gpio/gpio.h>
0007 #include <dt-bindings/input/input.h>
0008 #include <dt-bindings/clk/versaclock.h>
0009
0010 / {
0011 backlight_lvds: backlight-lvds {
0012 compatible = "pwm-backlight";
0013 power-supply = <®_lcd>;
0014 enable-gpios = <&gpio_exp1 3 GPIO_ACTIVE_HIGH>;
0015 pwms = <&pwm2 0 25000>;
0016 brightness-levels = <0 4 8 16 32 64 128 255>;
0017 default-brightness-level = <6>;
0018 };
0019
0020 backlight_dpi: backlight-dpi {
0021 compatible = "pwm-backlight";
0022 power-supply = <®_lcd>;
0023 enable-gpios = <&gpio_exp1 7 GPIO_ACTIVE_LOW>;
0024 pwms = <&pwm0 0 25000>;
0025 brightness-levels = <0 25 33 50 63 75 88 100>;
0026 default-brightness-level = <6>;
0027 };
0028
0029 hdmi0-out {
0030 compatible = "hdmi-connector";
0031 type = "a";
0032
0033 port {
0034 hdmi0_con: endpoint {
0035 remote-endpoint = <&rcar_dw_hdmi0_out>;
0036 };
0037 };
0038 };
0039
0040 keys {
0041 compatible = "gpio-keys";
0042
0043 key-1 { /* S19 */
0044 gpios = <&gpio4 6 GPIO_ACTIVE_LOW>;
0045 linux,code = <KEY_UP>;
0046 label = "Up";
0047 wakeup-source;
0048 debounce-interval = <20>;
0049 };
0050 key-2 { /*S20 */
0051 gpios = <&gpio3 13 GPIO_ACTIVE_LOW>;
0052 linux,code = <KEY_LEFT>;
0053 label = "Left";
0054 wakeup-source;
0055 debounce-interval = <20>;
0056 };
0057 key-3 { /* S21 */
0058 gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
0059 linux,code = <KEY_DOWN>;
0060 label = "Down";
0061 wakeup-source;
0062 debounce-interval = <20>;
0063 };
0064 key-4 { /* S22 */
0065 gpios = <&gpio5 20 GPIO_ACTIVE_LOW>;
0066 linux,code = <KEY_RIGHT>;
0067 label = "Right";
0068 wakeup-source;
0069 debounce-interval = <20>;
0070 };
0071 key-5 { /* S23 */
0072 gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
0073 linux,code = <KEY_ENTER>;
0074 label = "Center";
0075 wakeup-source;
0076 debounce-interval = <20>;
0077 };
0078 };
0079
0080 leds {
0081 compatible = "gpio-leds";
0082 pinctrl-0 = <&led_pins>;
0083 pinctrl-names = "default";
0084
0085 led0 {
0086 gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
0087 label = "LED0";
0088 linux,default-trigger = "heartbeat";
0089 };
0090 led1 {
0091 gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
0092 label = "LED1";
0093 };
0094 led2 {
0095 gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
0096 label = "LED2";
0097 };
0098 led3 {
0099 gpios = <&gpio7 3 GPIO_ACTIVE_HIGH>;
0100 label = "LED3";
0101 };
0102 };
0103
0104 lvds {
0105 compatible = "panel-lvds";
0106 power-supply = <®_lcd_reset>;
0107 width-mm = <223>;
0108 height-mm = <125>;
0109 backlight = <&backlight_lvds>;
0110 data-mapping = "vesa-24";
0111
0112 panel-timing {
0113 /* 800x480@60Hz */
0114 clock-frequency = <30000000>;
0115 hactive = <800>;
0116 vactive = <480>;
0117 hsync-len = <48>;
0118 hfront-porch = <40>;
0119 hback-porch = <40>;
0120 vfront-porch = <13>;
0121 vback-porch = <29>;
0122 vsync-len = <1>;
0123 hsync-active = <1>;
0124 vsync-active = <3>;
0125 de-active = <1>;
0126 pixelclk-active = <0>;
0127 };
0128
0129 port {
0130 panel_in: endpoint {
0131 remote-endpoint = <&lvds0_out>;
0132 };
0133 };
0134 };
0135
0136 rgb {
0137 /* Different LCD with compatible timings */
0138 compatible = "rocktech,rk070er9427";
0139 backlight = <&backlight_dpi>;
0140 enable-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
0141 power-supply = <®_lcd>;
0142 port {
0143 rgb_panel: endpoint {
0144 remote-endpoint = <&du_out_rgb>;
0145 };
0146 };
0147 };
0148
0149 reg_audio: regulator-audio {
0150 compatible = "regulator-fixed";
0151 regulator-name = "audio-1.8V";
0152 regulator-min-microvolt = <1800000>;
0153 regulator-max-microvolt = <1800000>;
0154 gpio = <&gpio_exp4 1 GPIO_ACTIVE_HIGH>;
0155 enable-active-high;
0156 };
0157
0158 reg_lcd: regulator-lcd {
0159 compatible = "regulator-fixed";
0160 regulator-name = "lcd_panel_pwr";
0161 regulator-min-microvolt = <3300000>;
0162 regulator-max-microvolt = <3300000>;
0163 gpio = <&gpio_exp1 1 GPIO_ACTIVE_HIGH>;
0164 enable-active-high;
0165 };
0166
0167 reg_lcd_reset: regulator-lcd-reset {
0168 compatible = "regulator-fixed";
0169 regulator-name = "nLCD_RESET";
0170 regulator-min-microvolt = <3300000>;
0171 regulator-max-microvolt = <3300000>;
0172 gpio = <&gpio5 3 GPIO_ACTIVE_HIGH>;
0173 enable-active-high;
0174 vin-supply = <®_lcd>;
0175 };
0176
0177 reg_cam0: regulator-cam0 {
0178 compatible = "regulator-fixed";
0179 regulator-name = "reg_cam0";
0180 regulator-min-microvolt = <1800000>;
0181 regulator-max-microvolt = <1800000>;
0182 gpio = <&gpio_exp2 2 GPIO_ACTIVE_HIGH>;
0183 enable-active-high;
0184 };
0185
0186 reg_cam1: regulator-cam1 {
0187 compatible = "regulator-fixed";
0188 regulator-name = "reg_cam1";
0189 regulator-min-microvolt = <1800000>;
0190 regulator-max-microvolt = <1800000>;
0191 gpio = <&gpio_exp2 5 GPIO_ACTIVE_HIGH>;
0192 enable-active-high;
0193 startup-delay-us = <100000>;
0194 };
0195
0196 sound_card {
0197 compatible = "audio-graph-card";
0198 label = "rcar-sound";
0199 dais = <&rsnd_port0>, <&rsnd_port1>;
0200 widgets = "Microphone", "Mic Jack",
0201 "Line", "Line In Jack",
0202 "Headphone", "Headphone Jack";
0203 mic-det-gpio = <&gpio0 2 GPIO_ACTIVE_LOW>;
0204 routing = "Headphone Jack", "HPOUTL",
0205 "Headphone Jack", "HPOUTR",
0206 "IN3R", "MICBIAS",
0207 "Mic Jack", "IN3R";
0208 };
0209
0210 vccq_sdhi0: regulator-vccq-sdhi0 {
0211 compatible = "regulator-gpio";
0212 regulator-name = "SDHI0 VccQ";
0213 regulator-min-microvolt = <1800000>;
0214 regulator-max-microvolt = <3300000>;
0215 gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
0216 gpios-states = <1>;
0217 states = <3300000 1>, <1800000 0>;
0218 };
0219
0220 /* External DU dot clocks */
0221 x302_clk: x302-clock {
0222 compatible = "fixed-clock";
0223 #clock-cells = <0>;
0224 clock-frequency = <33000000>;
0225 };
0226
0227 x304_clk: x304-clock {
0228 compatible = "fixed-clock";
0229 #clock-cells = <0>;
0230 clock-frequency = <25000000>;
0231 };
0232
0233 connector {
0234 compatible = "usb-c-connector";
0235 label = "USB-C";
0236 data-role = "dual";
0237
0238 ports {
0239 #address-cells = <1>;
0240 #size-cells = <0>;
0241 port@0 {
0242 reg = <0>;
0243 hs_ep: endpoint {
0244 remote-endpoint = <&usb3_hs_ep>;
0245 };
0246 };
0247 port@1 {
0248 reg = <1>;
0249 ss_ep: endpoint {
0250 remote-endpoint = <&hd3ss3220_in_ep>;
0251 };
0252 };
0253 };
0254 };
0255 };
0256
0257 &audio_clk_b {
0258 clock-frequency = <22579200>;
0259 };
0260
0261 &can0 {
0262 pinctrl-0 = <&can0_pins>;
0263 pinctrl-names = "default";
0264 renesas,can-clock-select = <0x0>;
0265 status = "okay";
0266 };
0267
0268 &can1 {
0269 pinctrl-0 = <&can1_pins>;
0270 pinctrl-names = "default";
0271 renesas,can-clock-select = <0x0>;
0272 status = "okay";
0273 };
0274
0275 &du {
0276 ports {
0277 port@0 {
0278 du_out_rgb: endpoint {
0279 remote-endpoint = <&rgb_panel>;
0280 };
0281 };
0282 };
0283 };
0284
0285 &ehci0 {
0286 dr_mode = "otg";
0287 status = "okay";
0288 clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
0289 };
0290
0291 &ehci1 {
0292 status = "okay";
0293 clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
0294 };
0295
0296 &hdmi0 {
0297 status = "okay";
0298 ports {
0299 #address-cells = <1>;
0300 #size-cells = <0>;
0301 port@0 {
0302 reg = <0>;
0303 dw_hdmi0_in: endpoint {
0304 remote-endpoint = <&du_out_hdmi0>;
0305 };
0306 };
0307 port@1 {
0308 reg = <1>;
0309 rcar_dw_hdmi0_out: endpoint {
0310 remote-endpoint = <&hdmi0_con>;
0311 };
0312 };
0313 port@2 {
0314 reg = <2>;
0315 dw_hdmi0_snd_in: endpoint {
0316 remote-endpoint = <&rsnd_endpoint1>;
0317 };
0318 };
0319 };
0320 };
0321
0322 &hscif1 {
0323 pinctrl-0 = <&hscif1_pins>;
0324 pinctrl-names = "default";
0325 uart-has-rtscts;
0326 status = "okay";
0327 };
0328
0329 &hsusb {
0330 dr_mode = "otg";
0331 status = "okay";
0332 };
0333
0334 &i2c2 {
0335 status = "okay";
0336 clock-frequency = <400000>;
0337 pinctrl-0 = <&i2c2_pins>;
0338 pinctrl-names = "default";
0339
0340 gpio_exp2: gpio@21 {
0341 compatible = "onnn,pca9654";
0342 reg = <0x21>;
0343 gpio-controller;
0344 #gpio-cells = <2>;
0345 };
0346
0347 gpio_exp3: gpio@22 {
0348 compatible = "onnn,pca9654";
0349 reg = <0x22>;
0350 gpio-controller;
0351 #gpio-cells = <2>;
0352 };
0353
0354 gpio_exp4: gpio@23 {
0355 compatible = "onnn,pca9654";
0356 reg = <0x23>;
0357 gpio-controller;
0358 #gpio-cells = <2>;
0359 };
0360
0361 versaclock6_bb: clock-controller@6a {
0362 compatible = "idt,5p49v6965";
0363 reg = <0x6a>;
0364 #clock-cells = <1>;
0365 clocks = <&x304_clk>;
0366 clock-names = "xin";
0367
0368 assigned-clocks = <&versaclock6_bb 1>, <&versaclock6_bb 2>,
0369 <&versaclock6_bb 3>, <&versaclock6_bb 4>;
0370 assigned-clock-rates = <24000000>, <24000000>, <24000000>,
0371 <24576000>;
0372
0373 OUT1 {
0374 idt,mode = <VC5_CMOS>;
0375 idt,voltage-microvolt = <1800000>;
0376 idt,slew-percent = <100>;
0377 };
0378
0379 OUT2 {
0380 idt,mode = <VC5_CMOS>;
0381 idt,voltage-microvolt = <1800000>;
0382 idt,slew-percent = <100>;
0383 };
0384
0385 OUT3 {
0386 idt,mode = <VC5_CMOS>;
0387 idt,voltage-microvolt = <3300000>;
0388 idt,slew-percent = <100>;
0389 };
0390
0391 OUT4 {
0392 idt,mode = <VC5_CMOS>;
0393 idt,voltage-microvolt = <3300000>;
0394 idt,slew-percent = <100>;
0395 };
0396 };
0397 };
0398
0399 &i2c0 {
0400 status = "okay";
0401 clock-frequency = <400000>;
0402
0403 pinctrl-0 = <&i2c0_pins>;
0404 pinctrl-names = "default";
0405 };
0406
0407 &i2c5 {
0408 status = "okay";
0409 clock-frequency = <400000>;
0410 pinctrl-0 = <&i2c5_pins>;
0411 pinctrl-names = "default";
0412
0413 codec: wm8962@1a {
0414 compatible = "wlf,wm8962";
0415 reg = <0x1a>;
0416 clocks = <&versaclock6_bb 3>;
0417 DCVDD-supply = <®_audio>;
0418 DBVDD-supply = <®_audio>;
0419 AVDD-supply = <®_audio>;
0420 CPVDD-supply = <®_audio>;
0421 MICVDD-supply = <®_audio>;
0422 PLLVDD-supply = <®_audio>;
0423 SPKVDD1-supply = <®_audio>;
0424 SPKVDD2-supply = <®_audio>;
0425 gpio-cfg = <
0426 0x0000 /* 0:Default */
0427 0x0000 /* 1:Default */
0428 0x0000 /* 2:Default */
0429 0x0000 /* 3:Default */
0430 0x0000 /* 4:Default */
0431 0x0000 /* 5:Default */
0432 >;
0433 port {
0434 wm8962_endpoint: endpoint {
0435 remote-endpoint = <&rsnd_endpoint0>;
0436 };
0437 };
0438 };
0439
0440 /* 0 - lcd_reset */
0441 /* 1 - lcd_pwr */
0442 /* 2 - lcd_select */
0443 /* 3 - backlight-enable */
0444 /* 4 - Touch_shdwn */
0445 /* 5 - LCD_H_pol */
0446 /* 6 - lcd_V_pol */
0447 gpio_exp1: gpio@20 {
0448 compatible = "onnn,pca9654";
0449 reg = <0x20>;
0450 gpio-controller;
0451 #gpio-cells = <2>;
0452 };
0453
0454 touchscreen@26 {
0455 compatible = "ilitek,ili2117";
0456 reg = <0x26>;
0457 interrupt-parent = <&gpio5>;
0458 interrupts = <9 IRQ_TYPE_EDGE_RISING>;
0459 wakeup-source;
0460 };
0461
0462 hd3ss3220@47 {
0463 compatible = "ti,hd3ss3220";
0464 reg = <0x47>;
0465 interrupt-parent = <&gpio6>;
0466 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
0467
0468 ports {
0469 #address-cells = <1>;
0470 #size-cells = <0>;
0471 port@0 {
0472 reg = <0>;
0473 hd3ss3220_in_ep: endpoint {
0474 remote-endpoint = <&ss_ep>;
0475 };
0476 };
0477 port@1 {
0478 reg = <1>;
0479 hd3ss3220_out_ep: endpoint {
0480 remote-endpoint = <&usb3_role_switch>;
0481 };
0482 };
0483 };
0484 };
0485 };
0486
0487 &lvds0 {
0488 status = "okay";
0489
0490 ports {
0491 port@1 {
0492 lvds0_out: endpoint {
0493 remote-endpoint = <&panel_in>;
0494 };
0495 };
0496 };
0497 };
0498
0499 &msiof1 {
0500 pinctrl-0 = <&msiof1_pins>;
0501 pinctrl-names = "default";
0502 status = "okay";
0503 cs-gpios = <&gpio3 10 GPIO_ACTIVE_LOW>;
0504 };
0505
0506 &ohci0 {
0507 dr_mode = "otg";
0508 status = "okay";
0509 };
0510
0511 &ohci1 {
0512 status = "okay";
0513 };
0514
0515 &pciec0 {
0516 status = "okay";
0517 };
0518
0519 &pciec1 {
0520 status = "okay";
0521 };
0522
0523 &pcie_bus_clk {
0524 clock-frequency = <100000000>;
0525 };
0526
0527 &pfc {
0528 can0_pins: can0 {
0529 groups = "can0_data_a";
0530 function = "can0";
0531 };
0532
0533 can1_pins: can1 {
0534 groups = "can1_data";
0535 function = "can1";
0536 };
0537
0538 du_pins: du {
0539 groups = "du_rgb888", "du_sync", "du_clk_out_1", "du_disp";
0540 function = "du";
0541 };
0542
0543 i2c2_pins: i2c2 {
0544 groups = "i2c2_a";
0545 function = "i2c2";
0546 };
0547
0548 i2c5_pins: i2c5 {
0549 groups = "i2c5";
0550 function = "i2c5";
0551 };
0552
0553 led_pins: leds {
0554 /* GP_0_4 , AVS1, AVS2, GP_7_3 */
0555 pins = "GP_0_4", "GP_7_0", "GP_7_1", "GP_7_3";
0556 bias-pull-down;
0557 };
0558
0559 msiof1_pins: msiof1 {
0560 groups = "msiof1_clk_g", "msiof1_rxd_g", "msiof1_txd_g";
0561 function = "msiof1";
0562 };
0563
0564 pwm0_pins: pwm0 {
0565 groups = "pwm0";
0566 function = "pwm0";
0567 };
0568
0569 pwm2_pins: pwm2 {
0570 groups = "pwm2_a";
0571 function = "pwm2";
0572 };
0573
0574 sdhi0_pins: sd0 {
0575 groups = "sdhi0_data4", "sdhi0_ctrl";
0576 function = "sdhi0";
0577 power-source = <3300>;
0578 };
0579
0580 sdhi0_pins_uhs: sd0_uhs {
0581 groups = "sdhi0_data4", "sdhi0_ctrl";
0582 function = "sdhi0";
0583 power-source = <1800>;
0584 };
0585
0586 sound_pins: sound {
0587 groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
0588 function = "ssi";
0589 };
0590
0591 sound_clk_pins: sound_clk {
0592 groups = "audio_clk_a_a", "audio_clk_b_a";
0593 function = "audio_clk";
0594 };
0595
0596 usb0_pins: usb0 {
0597 mux {
0598 groups = "usb0";
0599 function = "usb0";
0600 };
0601 };
0602
0603 usb1_pins: usb1 {
0604 mux {
0605 groups = "usb1";
0606 function = "usb1";
0607 };
0608 };
0609
0610 usb30_pins: usb30 {
0611 mux {
0612 groups = "usb30";
0613 function = "usb30";
0614 };
0615 };
0616 };
0617
0618 &pwm0 {
0619 pinctrl-0 = <&pwm0_pins>;
0620 pinctrl-names = "default";
0621 status = "okay";
0622 };
0623
0624 &pwm2 {
0625 pinctrl-0 = <&pwm2_pins>;
0626 pinctrl-names = "default";
0627 status = "okay";
0628 };
0629
0630 &rcar_sound {
0631 pinctrl-0 = <&sound_pins>, <&sound_clk_pins>;
0632 pinctrl-names = "default";
0633
0634 /* Single DAI */
0635 #sound-dai-cells = <0>;
0636
0637 /* audio_clkout0/1/2/3 */
0638 #clock-cells = <1>;
0639 clock-frequency = <11289600>;
0640
0641 status = "okay";
0642
0643 ports {
0644 #address-cells = <1>;
0645 #size-cells = <0>;
0646 rsnd_port0: port@0 {
0647 reg = <0>;
0648 rsnd_endpoint0: endpoint {
0649 remote-endpoint = <&wm8962_endpoint>;
0650
0651 dai-format = "i2s";
0652 bitclock-master = <&rsnd_endpoint0>;
0653 frame-master = <&rsnd_endpoint0>;
0654
0655 playback = <&ssi1>, <&dvc1>, <&src1>;
0656 capture = <&ssi0>;
0657 };
0658 };
0659 rsnd_port1: port@1 {
0660 reg = <0x01>;
0661 rsnd_endpoint1: endpoint {
0662 remote-endpoint = <&dw_hdmi0_snd_in>;
0663
0664 dai-format = "i2s";
0665 bitclock-master = <&rsnd_endpoint1>;
0666 frame-master = <&rsnd_endpoint1>;
0667
0668 playback = <&ssi2>;
0669 };
0670 };
0671 };
0672 };
0673
0674 &rwdt {
0675 status = "okay";
0676 timeout-sec = <60>;
0677 };
0678
0679 &scif0 {
0680 pinctrl-0 = <&scif0_pins>;
0681 pinctrl-names = "default";
0682 status = "okay";
0683 };
0684
0685 &scif5 {
0686 pinctrl-0 = <&scif5_pins>;
0687 pinctrl-names = "default";
0688 status = "okay";
0689 };
0690
0691 &scif_clk {
0692 clock-frequency = <14745600>;
0693 };
0694
0695 &sdhi0 {
0696 pinctrl-0 = <&sdhi0_pins>;
0697 pinctrl-1 = <&sdhi0_pins_uhs>;
0698 pinctrl-names = "default", "state_uhs";
0699 vmmc-supply = <®_3p3v>;
0700 vqmmc-supply = <&vccq_sdhi0>;
0701 cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
0702 bus-width = <4>;
0703 sd-uhs-sdr50;
0704 sd-uhs-sdr104;
0705 status = "okay";
0706 };
0707
0708 &ssi1 {
0709 shared-pin;
0710 };
0711
0712 &tmu0 {
0713 status = "okay";
0714 };
0715
0716 &tmu1 {
0717 status = "okay";
0718 };
0719
0720 &tmu2 {
0721 status = "okay";
0722 };
0723
0724 &tmu3 {
0725 status = "okay";
0726 };
0727
0728 &tmu4 {
0729 status = "okay";
0730 };
0731
0732 &usb2_phy0 {
0733 pinctrl-0 = <&usb0_pins>;
0734 pinctrl-names = "default";
0735 status = "okay";
0736 };
0737
0738 &usb2_phy1 {
0739 pinctrl-0 = <&usb1_pins>;
0740 pinctrl-names = "default";
0741 status = "okay";
0742 };
0743
0744 &usb3_peri0 {
0745 companion = <&xhci0>;
0746 status = "okay";
0747 usb-role-switch;
0748
0749 ports {
0750 #address-cells = <1>;
0751 #size-cells = <0>;
0752 port@0 {
0753 reg = <0>;
0754 usb3_hs_ep: endpoint {
0755 remote-endpoint = <&hs_ep>;
0756 };
0757 };
0758 port@1 {
0759 reg = <1>;
0760 usb3_role_switch: endpoint {
0761 remote-endpoint = <&hd3ss3220_out_ep>;
0762 };
0763 };
0764 };
0765 };
0766
0767 &usb3_phy0 {
0768 status = "okay";
0769 };
0770
0771 &vin0 {
0772 status = "okay";
0773 };
0774 &vin1 {
0775 status = "okay";
0776 };
0777 &vin2 {
0778 status = "okay";
0779 };
0780 &vin3 {
0781 status = "okay";
0782 };
0783 &vin4 {
0784 status = "okay";
0785 };
0786 &vin5 {
0787 status = "okay";
0788 };
0789 &vin6 {
0790 status = "okay";
0791 };
0792 &vin7 {
0793 status = "okay";
0794 };
0795
0796 &xhci0
0797 {
0798 pinctrl-0 = <&usb30_pins>;
0799 pinctrl-names = "default";
0800 status = "okay";
0801 };