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 = <®_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 = <®_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 = <®_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 = <®_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 = <®_lcd>; 175 }; 176 177 reg_cam0: regulator-cam0 { 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-cam1 { 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 widgets = "Microphone", "Mic Jack", 201 "Line", "Line In Jack", 202 "Headphone", "Headphone Jack"; 203 mic-det-gpio = <&gpio0 2 GPIO_ACTIVE_LOW>; 204 routing = "Headphone Jack", "HPOUTL", 205 "Headphone Jack", "HPOUTR", 206 "IN3R", "MICBIAS", 207 "Mic Jack", "IN3R"; 208 }; 209 210 vccq_sdhi0: regulator-vccq-sdhi0 { 211 compatible = "regulator-gpio"; 212 regulator-name = "SDHI0 VccQ"; 213 regulator-min-microvolt = <1800000>; 214 regulator-max-microvolt = <3300000>; 215 gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>; 216 gpios-states = <1>; 217 states = <3300000 1>, <1800000 0>; 218 }; 219 220 /* External DU dot clocks */ 221 x302_clk: x302-clock { 222 compatible = "fixed-clock"; 223 #clock-cells = <0>; 224 clock-frequency = <33000000>; 225 }; 226 227 x304_clk: x304-clock { 228 compatible = "fixed-clock"; 229 #clock-cells = <0>; 230 clock-frequency = <25000000>; 231 }; 232 233 connector { 234 compatible = "usb-c-connector"; 235 label = "USB-C"; 236 data-role = "dual"; 237 238 ports { 239 #address-cells = <1>; 240 #size-cells = <0>; 241 port@0 { 242 reg = <0>; 243 hs_ep: endpoint { 244 remote-endpoint = <&usb3_hs_ep>; 245 }; 246 }; 247 port@1 { 248 reg = <1>; 249 ss_ep: endpoint { 250 remote-endpoint = <&hd3ss3220_in_ep>; 251 }; 252 }; 253 }; 254 }; 255}; 256 257&audio_clk_b { 258 clock-frequency = <22579200>; 259}; 260 261&can0 { 262 pinctrl-0 = <&can0_pins>; 263 pinctrl-names = "default"; 264 renesas,can-clock-select = <0x0>; 265 status = "okay"; 266}; 267 268&can1 { 269 pinctrl-0 = <&can1_pins>; 270 pinctrl-names = "default"; 271 renesas,can-clock-select = <0x0>; 272 status = "okay"; 273}; 274 275&du_out_rgb { 276 remote-endpoint = <&rgb_panel>; 277}; 278 279&ehci0 { 280 dr_mode = "otg"; 281 status = "okay"; 282 clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>; 283}; 284 285&ehci1 { 286 status = "okay"; 287 clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>; 288}; 289 290&hdmi0 { 291 status = "okay"; 292 ports { 293 #address-cells = <1>; 294 #size-cells = <0>; 295 port@0 { 296 reg = <0>; 297 dw_hdmi0_in: endpoint { 298 remote-endpoint = <&du_out_hdmi0>; 299 }; 300 }; 301 port@1 { 302 reg = <1>; 303 rcar_dw_hdmi0_out: endpoint { 304 remote-endpoint = <&hdmi0_con>; 305 }; 306 }; 307 port@2 { 308 reg = <2>; 309 dw_hdmi0_snd_in: endpoint { 310 remote-endpoint = <&rsnd_endpoint1>; 311 }; 312 }; 313 }; 314}; 315 316&hscif1 { 317 pinctrl-0 = <&hscif1_pins>; 318 pinctrl-names = "default"; 319 uart-has-rtscts; 320 status = "okay"; 321}; 322 323&hsusb { 324 dr_mode = "otg"; 325 status = "okay"; 326}; 327 328&i2c2 { 329 status = "okay"; 330 clock-frequency = <400000>; 331 pinctrl-0 = <&i2c2_pins>; 332 pinctrl-names = "default"; 333 334 gpio_exp2: gpio@21 { 335 compatible = "onnn,pca9654"; 336 reg = <0x21>; 337 gpio-controller; 338 #gpio-cells = <2>; 339 }; 340 341 gpio_exp3: gpio@22 { 342 compatible = "onnn,pca9654"; 343 reg = <0x22>; 344 gpio-controller; 345 #gpio-cells = <2>; 346 }; 347 348 gpio_exp4: gpio@23 { 349 compatible = "onnn,pca9654"; 350 reg = <0x23>; 351 gpio-controller; 352 #gpio-cells = <2>; 353 }; 354 355 versaclock6_bb: clock-controller@6a { 356 compatible = "idt,5p49v6965"; 357 reg = <0x6a>; 358 #clock-cells = <1>; 359 clocks = <&x304_clk>; 360 clock-names = "xin"; 361 362 assigned-clocks = <&versaclock6_bb 1>, 363 <&versaclock6_bb 2>, 364 <&versaclock6_bb 3>, 365 <&versaclock6_bb 4>; 366 assigned-clock-rates = <24000000>, <24000000>, <24000000>, <24576000>; 367 368 OUT1 { 369 idt,mode = <VC5_CMOS>; 370 idt,voltage-microvolt = <1800000>; 371 idt,slew-percent = <100>; 372 }; 373 374 OUT2 { 375 idt,mode = <VC5_CMOS>; 376 idt,voltage-microvolt = <1800000>; 377 idt,slew-percent = <100>; 378 }; 379 380 OUT3 { 381 idt,mode = <VC5_CMOS>; 382 idt,voltage-microvolt = <3300000>; 383 idt,slew-percent = <100>; 384 }; 385 386 OUT4 { 387 idt,mode = <VC5_CMOS>; 388 idt,voltage-microvolt = <3300000>; 389 idt,slew-percent = <100>; 390 }; 391 }; 392}; 393 394&i2c0 { 395 status = "okay"; 396 clock-frequency = <400000>; 397 398 pinctrl-0 = <&i2c0_pins>; 399 pinctrl-names = "default"; 400}; 401 402&i2c5 { 403 status = "okay"; 404 clock-frequency = <400000>; 405 pinctrl-0 = <&i2c5_pins>; 406 pinctrl-names = "default"; 407 408 codec: wm8962@1a { 409 compatible = "wlf,wm8962"; 410 reg = <0x1a>; 411 clocks = <&versaclock6_bb 3>; 412 DCVDD-supply = <®_audio>; 413 DBVDD-supply = <®_audio>; 414 AVDD-supply = <®_audio>; 415 CPVDD-supply = <®_audio>; 416 MICVDD-supply = <®_audio>; 417 PLLVDD-supply = <®_audio>; 418 SPKVDD1-supply = <®_audio>; 419 SPKVDD2-supply = <®_audio>; 420 gpio-cfg = < 421 0x0000 /* 0:Default */ 422 0x0000 /* 1:Default */ 423 0x0000 /* 2:Default */ 424 0x0000 /* 3:Default */ 425 0x0000 /* 4:Default */ 426 0x0000 /* 5:Default */ 427 >; 428 port { 429 wm8962_endpoint: endpoint { 430 remote-endpoint = <&rsnd_endpoint0>; 431 }; 432 }; 433 }; 434 435 touchscreen@26 { 436 compatible = "ilitek,ili2117"; 437 reg = <0x26>; 438 interrupt-parent = <&gpio5>; 439 interrupts = <9 IRQ_TYPE_EDGE_RISING>; 440 wakeup-source; 441 }; 442 443 hd3ss3220@47 { 444 compatible = "ti,hd3ss3220"; 445 reg = <0x47>; 446 interrupt-parent = <&gpio6>; 447 interrupts = <4 IRQ_TYPE_LEVEL_LOW>; 448 449 ports { 450 #address-cells = <1>; 451 #size-cells = <0>; 452 port@0 { 453 reg = <0>; 454 hd3ss3220_in_ep: endpoint { 455 remote-endpoint = <&ss_ep>; 456 }; 457 }; 458 port@1 { 459 reg = <1>; 460 hd3ss3220_out_ep: endpoint { 461 remote-endpoint = <&usb3_role_switch>; 462 }; 463 }; 464 }; 465 }; 466 467 gpio_exp1: gpio@70 { 468 compatible = "nxp,pca9538"; 469 reg = <0x70>; 470 gpio-controller; 471 #gpio-cells = <2>; 472 gpio-line-names = "lcd_reset", "lcd_pwr", "lcd_select", 473 "backlight-enable", "Touch_shdwn", 474 "LCD_H_pol", "lcd_V_pol"; 475 }; 476}; 477 478&lvds0 { 479 status = "okay"; 480 481 ports { 482 port@1 { 483 lvds0_out: endpoint { 484 remote-endpoint = <&panel_in>; 485 }; 486 }; 487 }; 488}; 489 490&msiof1 { 491 pinctrl-0 = <&msiof1_pins>; 492 pinctrl-names = "default"; 493 status = "okay"; 494 cs-gpios = <&gpio3 10 GPIO_ACTIVE_LOW>; 495}; 496 497&ohci0 { 498 dr_mode = "otg"; 499 status = "okay"; 500}; 501 502&ohci1 { 503 status = "okay"; 504}; 505 506&pciec0 { 507 status = "okay"; 508}; 509 510&pciec1 { 511 status = "okay"; 512}; 513 514&pcie_bus_clk { 515 clock-frequency = <100000000>; 516}; 517 518&pfc { 519 can0_pins: can0 { 520 groups = "can0_data_a"; 521 function = "can0"; 522 }; 523 524 can1_pins: can1 { 525 groups = "can1_data"; 526 function = "can1"; 527 }; 528 529 du_pins: du { 530 groups = "du_rgb888", "du_sync", "du_clk_out_1", "du_disp"; 531 function = "du"; 532 }; 533 534 i2c2_pins: i2c2 { 535 groups = "i2c2_a"; 536 function = "i2c2"; 537 }; 538 539 i2c5_pins: i2c5 { 540 groups = "i2c5"; 541 function = "i2c5"; 542 }; 543 544 led_pins: leds { 545 /* GP_0_4 , AVS1, AVS2, GP_7_3 */ 546 pins = "GP_0_4", "GP_7_0", "GP_7_1", "GP_7_3"; 547 bias-pull-down; 548 }; 549 550 msiof1_pins: msiof1 { 551 groups = "msiof1_clk_g", "msiof1_rxd_g", "msiof1_txd_g"; 552 function = "msiof1"; 553 }; 554 555 pwm0_pins: pwm0 { 556 groups = "pwm0"; 557 function = "pwm0"; 558 }; 559 560 pwm2_pins: pwm2 { 561 groups = "pwm2_a"; 562 function = "pwm2"; 563 }; 564 565 sdhi0_pins: sd0 { 566 groups = "sdhi0_data4", "sdhi0_ctrl"; 567 function = "sdhi0"; 568 power-source = <3300>; 569 }; 570 571 sdhi0_pins_uhs: sd0_uhs { 572 groups = "sdhi0_data4", "sdhi0_ctrl"; 573 function = "sdhi0"; 574 power-source = <1800>; 575 }; 576 577 sound_pins: sound { 578 groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a"; 579 function = "ssi"; 580 }; 581 582 sound_clk_pins: sound_clk { 583 groups = "audio_clk_a_a", "audio_clk_b_a"; 584 function = "audio_clk"; 585 }; 586 587 usb0_pins: usb0 { 588 mux { 589 groups = "usb0"; 590 function = "usb0"; 591 }; 592 }; 593 594 usb1_pins: usb1 { 595 mux { 596 groups = "usb1"; 597 function = "usb1"; 598 }; 599 }; 600 601 usb30_pins: usb30 { 602 mux { 603 groups = "usb30"; 604 function = "usb30"; 605 }; 606 }; 607}; 608 609&pwm0 { 610 pinctrl-0 = <&pwm0_pins>; 611 pinctrl-names = "default"; 612 status = "okay"; 613}; 614 615&pwm2 { 616 pinctrl-0 = <&pwm2_pins>; 617 pinctrl-names = "default"; 618 status = "okay"; 619}; 620 621&rcar_sound { 622 pinctrl-0 = <&sound_pins>, <&sound_clk_pins>; 623 pinctrl-names = "default"; 624 625 /* Single DAI */ 626 #sound-dai-cells = <0>; 627 628 /* audio_clkout0/1/2/3 */ 629 #clock-cells = <1>; 630 clock-frequency = <11289600>; 631 632 status = "okay"; 633 634 ports { 635 #address-cells = <1>; 636 #size-cells = <0>; 637 rsnd_port0: port@0 { 638 reg = <0>; 639 rsnd_endpoint0: endpoint { 640 remote-endpoint = <&wm8962_endpoint>; 641 642 dai-format = "i2s"; 643 bitclock-master = <&rsnd_endpoint0>; 644 frame-master = <&rsnd_endpoint0>; 645 646 playback = <&ssi1>, <&dvc1>, <&src1>; 647 capture = <&ssi0>; 648 }; 649 }; 650 rsnd_port1: port@1 { 651 reg = <0x01>; 652 rsnd_endpoint1: endpoint { 653 remote-endpoint = <&dw_hdmi0_snd_in>; 654 655 dai-format = "i2s"; 656 bitclock-master = <&rsnd_endpoint1>; 657 frame-master = <&rsnd_endpoint1>; 658 659 playback = <&ssi2>; 660 }; 661 }; 662 }; 663}; 664 665&rwdt { 666 status = "okay"; 667 timeout-sec = <60>; 668}; 669 670&scif0 { 671 pinctrl-0 = <&scif0_pins>; 672 pinctrl-names = "default"; 673 status = "okay"; 674}; 675 676&scif5 { 677 pinctrl-0 = <&scif5_pins>; 678 pinctrl-names = "default"; 679 status = "okay"; 680}; 681 682&scif_clk { 683 clock-frequency = <14745600>; 684}; 685 686&sdhi0 { 687 pinctrl-0 = <&sdhi0_pins>; 688 pinctrl-1 = <&sdhi0_pins_uhs>; 689 pinctrl-names = "default", "state_uhs"; 690 vmmc-supply = <®_3p3v>; 691 vqmmc-supply = <&vccq_sdhi0>; 692 cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>; 693 bus-width = <4>; 694 sd-uhs-sdr50; 695 sd-uhs-sdr104; 696 status = "okay"; 697}; 698 699&ssi1 { 700 shared-pin; 701}; 702 703&tmu0 { 704 status = "okay"; 705}; 706 707&tmu1 { 708 status = "okay"; 709}; 710 711&tmu2 { 712 status = "okay"; 713}; 714 715&tmu3 { 716 status = "okay"; 717}; 718 719&tmu4 { 720 status = "okay"; 721}; 722 723&usb2_phy0 { 724 pinctrl-0 = <&usb0_pins>; 725 pinctrl-names = "default"; 726 status = "okay"; 727}; 728 729&usb2_phy1 { 730 pinctrl-0 = <&usb1_pins>; 731 pinctrl-names = "default"; 732 status = "okay"; 733}; 734 735&usb3_peri0 { 736 companion = <&xhci0>; 737 status = "okay"; 738 usb-role-switch; 739 740 ports { 741 #address-cells = <1>; 742 #size-cells = <0>; 743 port@0 { 744 reg = <0>; 745 usb3_hs_ep: endpoint { 746 remote-endpoint = <&hs_ep>; 747 }; 748 }; 749 port@1 { 750 reg = <1>; 751 usb3_role_switch: endpoint { 752 remote-endpoint = <&hd3ss3220_out_ep>; 753 }; 754 }; 755 }; 756}; 757 758&usb3_phy0 { 759 status = "okay"; 760}; 761 762&vin0 { 763 status = "okay"; 764}; 765&vin1 { 766 status = "okay"; 767}; 768&vin2 { 769 status = "okay"; 770}; 771&vin3 { 772 status = "okay"; 773}; 774&vin4 { 775 status = "okay"; 776}; 777&vin5 { 778 status = "okay"; 779}; 780&vin6 { 781 status = "okay"; 782}; 783&vin7 { 784 status = "okay"; 785}; 786 787&xhci0 788{ 789 pinctrl-0 = <&usb30_pins>; 790 pinctrl-names = "default"; 791 status = "okay"; 792}; 793