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