1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2019 Akash Gajjar <Akash_Gajjar@mentor.com> 4 * Copyright (c) 2019 Pragnesh Patel <Pragnesh_Patel@mentor.com> 5 */ 6 7/dts-v1/; 8#include <dt-bindings/input/linux-event-codes.h> 9#include <dt-bindings/pwm/pwm.h> 10#include "rk3399.dtsi" 11#include "rk3399-opp.dtsi" 12 13/ { 14 chosen { 15 stdout-path = "serial2:1500000n8"; 16 }; 17 18 clkin_gmac: external-gmac-clock { 19 compatible = "fixed-clock"; 20 clock-frequency = <125000000>; 21 clock-output-names = "clkin_gmac"; 22 #clock-cells = <0>; 23 }; 24 25 sdio_pwrseq: sdio-pwrseq { 26 compatible = "mmc-pwrseq-simple"; 27 clocks = <&rk808 1>; 28 clock-names = "ext_clock"; 29 pinctrl-names = "default"; 30 pinctrl-0 = <&wifi_enable_h>; 31 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; 32 }; 33 34 sound { 35 compatible = "audio-graph-card"; 36 label = "Analog"; 37 dais = <&i2s0_p0>; 38 }; 39 40 sound-dit { 41 compatible = "audio-graph-card"; 42 label = "SPDIF"; 43 dais = <&spdif_p0>; 44 }; 45 46 spdif-dit { 47 compatible = "linux,spdif-dit"; 48 #sound-dai-cells = <0>; 49 50 port { 51 dit_p0_0: endpoint { 52 remote-endpoint = <&spdif_p0_0>; 53 }; 54 }; 55 }; 56 57 vbus_typec: vbus-typec-regulator { 58 compatible = "regulator-fixed"; 59 enable-active-high; 60 gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; 61 pinctrl-names = "default"; 62 pinctrl-0 = <&vcc5v0_typec_en>; 63 regulator-name = "vbus_typec"; 64 regulator-always-on; 65 vin-supply = <&vcc5v0_sys>; 66 }; 67 68 vcc12v_dcin: dc-12v { 69 compatible = "regulator-fixed"; 70 regulator-name = "vcc12v_dcin"; 71 regulator-always-on; 72 regulator-boot-on; 73 regulator-min-microvolt = <12000000>; 74 regulator-max-microvolt = <12000000>; 75 }; 76 77 vcc3v3_lan: vcc3v3-lan-regulator { 78 compatible = "regulator-fixed"; 79 regulator-name = "vcc3v3_lan"; 80 regulator-always-on; 81 regulator-boot-on; 82 regulator-min-microvolt = <3300000>; 83 regulator-max-microvolt = <3300000>; 84 vin-supply = <&vcc3v3_sys>; 85 }; 86 87 vcc3v3_pcie: vcc3v3-pcie-regulator { 88 compatible = "regulator-fixed"; 89 enable-active-high; 90 gpio = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; 91 pinctrl-names = "default"; 92 pinctrl-0 = <&pcie_pwr_en>; 93 regulator-name = "vcc3v3_pcie"; 94 regulator-always-on; 95 regulator-boot-on; 96 vin-supply = <&vcc5v0_sys>; 97 }; 98 99 vcc3v3_sys: vcc3v3-sys { 100 compatible = "regulator-fixed"; 101 regulator-name = "vcc3v3_sys"; 102 regulator-always-on; 103 regulator-boot-on; 104 regulator-min-microvolt = <3300000>; 105 regulator-max-microvolt = <3300000>; 106 vin-supply = <&vcc5v0_sys>; 107 }; 108 109 vcc5v0_host: vcc5v0-host-regulator { 110 compatible = "regulator-fixed"; 111 enable-active-high; 112 gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; 113 pinctrl-names = "default"; 114 pinctrl-0 = <&vcc5v0_host_en>; 115 regulator-name = "vcc5v0_host"; 116 regulator-always-on; 117 vin-supply = <&vcc5v0_sys>; 118 }; 119 120 vcc5v0_sys: vcc-sys { 121 compatible = "regulator-fixed"; 122 regulator-name = "vcc5v0_sys"; 123 regulator-always-on; 124 regulator-boot-on; 125 regulator-min-microvolt = <5000000>; 126 regulator-max-microvolt = <5000000>; 127 vin-supply = <&vcc12v_dcin>; 128 }; 129 130 vcc_0v9: vcc-0v9 { 131 compatible = "regulator-fixed"; 132 regulator-name = "vcc_0v9"; 133 regulator-always-on; 134 regulator-boot-on; 135 regulator-min-microvolt = <900000>; 136 regulator-max-microvolt = <900000>; 137 vin-supply = <&vcc3v3_sys>; 138 }; 139 140 vdd_log: vdd-log { 141 compatible = "pwm-regulator"; 142 pwms = <&pwm2 0 25000 1>; 143 regulator-name = "vdd_log"; 144 regulator-always-on; 145 regulator-boot-on; 146 regulator-min-microvolt = <800000>; 147 regulator-max-microvolt = <1400000>; 148 vin-supply = <&vcc5v0_sys>; 149 }; 150}; 151 152&cpu_l0 { 153 cpu-supply = <&vdd_cpu_l>; 154}; 155 156&cpu_l1 { 157 cpu-supply = <&vdd_cpu_l>; 158}; 159 160&cpu_l2 { 161 cpu-supply = <&vdd_cpu_l>; 162}; 163 164&cpu_l3 { 165 cpu-supply = <&vdd_cpu_l>; 166}; 167 168&cpu_b0 { 169 cpu-supply = <&vdd_cpu_b>; 170}; 171 172&cpu_b1 { 173 cpu-supply = <&vdd_cpu_b>; 174}; 175 176&emmc_phy { 177 status = "okay"; 178}; 179 180&gmac { 181 assigned-clocks = <&cru SCLK_RMII_SRC>; 182 assigned-clock-parents = <&clkin_gmac>; 183 clock_in_out = "input"; 184 phy-supply = <&vcc3v3_lan>; 185 phy-mode = "rgmii"; 186 pinctrl-names = "default"; 187 pinctrl-0 = <&rgmii_pins>; 188 snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; 189 snps,reset-active-low; 190 snps,reset-delays-us = <0 10000 50000>; 191 tx_delay = <0x28>; 192 rx_delay = <0x11>; 193 status = "okay"; 194}; 195 196&gpu { 197 mali-supply = <&vdd_gpu>; 198 status = "okay"; 199}; 200 201&hdmi { 202 ddc-i2c-bus = <&i2c3>; 203 pinctrl-names = "default"; 204 pinctrl-0 = <&hdmi_cec>; 205 status = "okay"; 206}; 207 208&hdmi_sound { 209 status = "okay"; 210}; 211 212&i2c0 { 213 clock-frequency = <400000>; 214 i2c-scl-rising-time-ns = <168>; 215 i2c-scl-falling-time-ns = <4>; 216 status = "okay"; 217 218 rk808: pmic@1b { 219 compatible = "rockchip,rk808"; 220 reg = <0x1b>; 221 interrupt-parent = <&gpio1>; 222 interrupts = <21 IRQ_TYPE_LEVEL_LOW>; 223 #clock-cells = <1>; 224 clock-output-names = "xin32k", "rk808-clkout2"; 225 pinctrl-names = "default"; 226 pinctrl-0 = <&pmic_int_l>; 227 rockchip,system-power-controller; 228 wakeup-source; 229 230 vcc1-supply = <&vcc5v0_sys>; 231 vcc2-supply = <&vcc5v0_sys>; 232 vcc3-supply = <&vcc5v0_sys>; 233 vcc4-supply = <&vcc5v0_sys>; 234 vcc6-supply = <&vcc5v0_sys>; 235 vcc7-supply = <&vcc5v0_sys>; 236 vcc8-supply = <&vcc3v3_sys>; 237 vcc9-supply = <&vcc5v0_sys>; 238 vcc10-supply = <&vcc5v0_sys>; 239 vcc11-supply = <&vcc5v0_sys>; 240 vcc12-supply = <&vcc3v3_sys>; 241 vddio-supply = <&vcc_1v8>; 242 243 regulators { 244 vdd_center: DCDC_REG1 { 245 regulator-name = "vdd_center"; 246 regulator-always-on; 247 regulator-boot-on; 248 regulator-min-microvolt = <750000>; 249 regulator-max-microvolt = <1350000>; 250 regulator-ramp-delay = <6001>; 251 regulator-state-mem { 252 regulator-off-in-suspend; 253 }; 254 }; 255 256 vdd_cpu_l: DCDC_REG2 { 257 regulator-name = "vdd_cpu_l"; 258 regulator-always-on; 259 regulator-boot-on; 260 regulator-min-microvolt = <750000>; 261 regulator-max-microvolt = <1350000>; 262 regulator-ramp-delay = <6001>; 263 regulator-state-mem { 264 regulator-off-in-suspend; 265 }; 266 }; 267 268 vcc_ddr: DCDC_REG3 { 269 regulator-name = "vcc_ddr"; 270 regulator-always-on; 271 regulator-boot-on; 272 regulator-state-mem { 273 regulator-on-in-suspend; 274 }; 275 }; 276 277 vcc_1v8: DCDC_REG4 { 278 regulator-name = "vcc_1v8"; 279 regulator-always-on; 280 regulator-boot-on; 281 regulator-min-microvolt = <1800000>; 282 regulator-max-microvolt = <1800000>; 283 regulator-state-mem { 284 regulator-on-in-suspend; 285 regulator-suspend-microvolt = <1800000>; 286 }; 287 }; 288 289 vcca1v8_codec: LDO_REG1 { 290 regulator-name = "vcca1v8_codec"; 291 regulator-always-on; 292 regulator-boot-on; 293 regulator-min-microvolt = <1800000>; 294 regulator-max-microvolt = <1800000>; 295 regulator-state-mem { 296 regulator-off-in-suspend; 297 }; 298 }; 299 300 vcca1v8_hdmi: LDO_REG2 { 301 regulator-name = "vcca1v8_hdmi"; 302 regulator-always-on; 303 regulator-boot-on; 304 regulator-min-microvolt = <1800000>; 305 regulator-max-microvolt = <1800000>; 306 regulator-state-mem { 307 regulator-off-in-suspend; 308 }; 309 }; 310 311 vcca_1v8: LDO_REG3 { 312 regulator-name = "vcca_1v8"; 313 regulator-always-on; 314 regulator-boot-on; 315 regulator-min-microvolt = <1800000>; 316 regulator-max-microvolt = <1800000>; 317 regulator-state-mem { 318 regulator-on-in-suspend; 319 regulator-suspend-microvolt = <1800000>; 320 }; 321 }; 322 323 vcc_sdio: LDO_REG4 { 324 regulator-name = "vcc_sdio"; 325 regulator-always-on; 326 regulator-boot-on; 327 regulator-min-microvolt = <3000000>; 328 regulator-max-microvolt = <3000000>; 329 regulator-state-mem { 330 regulator-on-in-suspend; 331 regulator-suspend-microvolt = <3000000>; 332 }; 333 }; 334 335 vcca3v0_codec: LDO_REG5 { 336 regulator-name = "vcca3v0_codec"; 337 regulator-always-on; 338 regulator-boot-on; 339 regulator-min-microvolt = <3000000>; 340 regulator-max-microvolt = <3000000>; 341 regulator-state-mem { 342 regulator-off-in-suspend; 343 }; 344 }; 345 346 vcc_1v5: LDO_REG6 { 347 regulator-name = "vcc_1v5"; 348 regulator-always-on; 349 regulator-boot-on; 350 regulator-min-microvolt = <1500000>; 351 regulator-max-microvolt = <1500000>; 352 regulator-state-mem { 353 regulator-on-in-suspend; 354 regulator-suspend-microvolt = <1500000>; 355 }; 356 }; 357 358 vcca0v9_hdmi: LDO_REG7 { 359 regulator-name = "vcca0v9_hdmi"; 360 regulator-always-on; 361 regulator-boot-on; 362 regulator-min-microvolt = <900000>; 363 regulator-max-microvolt = <900000>; 364 regulator-state-mem { 365 regulator-off-in-suspend; 366 }; 367 }; 368 369 vcc_3v0: LDO_REG8 { 370 regulator-name = "vcc_3v0"; 371 regulator-always-on; 372 regulator-boot-on; 373 regulator-min-microvolt = <3000000>; 374 regulator-max-microvolt = <3000000>; 375 regulator-state-mem { 376 regulator-on-in-suspend; 377 regulator-suspend-microvolt = <3000000>; 378 }; 379 }; 380 381 vcc_cam: SWITCH_REG1 { 382 regulator-name = "vcc_cam"; 383 regulator-always-on; 384 regulator-boot-on; 385 regulator-state-mem { 386 regulator-off-in-suspend; 387 }; 388 }; 389 390 vcc_mipi: SWITCH_REG2 { 391 regulator-name = "vcc_mipi"; 392 regulator-always-on; 393 regulator-boot-on; 394 regulator-state-mem { 395 regulator-off-in-suspend; 396 }; 397 }; 398 }; 399 }; 400 401 vdd_cpu_b: regulator@40 { 402 compatible = "silergy,syr827"; 403 reg = <0x40>; 404 fcs,suspend-voltage-selector = <1>; 405 pinctrl-names = "default"; 406 pinctrl-0 = <&vsel1_pin>; 407 regulator-name = "vdd_cpu_b"; 408 regulator-min-microvolt = <712500>; 409 regulator-max-microvolt = <1500000>; 410 regulator-ramp-delay = <1000>; 411 regulator-always-on; 412 regulator-boot-on; 413 vin-supply = <&vcc5v0_sys>; 414 415 regulator-state-mem { 416 regulator-off-in-suspend; 417 }; 418 }; 419 420 vdd_gpu: regulator@41 { 421 compatible = "silergy,syr828"; 422 reg = <0x41>; 423 fcs,suspend-voltage-selector = <1>; 424 pinctrl-names = "default"; 425 pinctrl-0 = <&vsel2_pin>; 426 regulator-name = "vdd_gpu"; 427 regulator-min-microvolt = <712500>; 428 regulator-max-microvolt = <1500000>; 429 regulator-ramp-delay = <1000>; 430 regulator-always-on; 431 regulator-boot-on; 432 vin-supply = <&vcc5v0_sys>; 433 434 regulator-state-mem { 435 regulator-off-in-suspend; 436 }; 437 }; 438}; 439 440&i2c1 { 441 i2c-scl-rising-time-ns = <300>; 442 i2c-scl-falling-time-ns = <15>; 443 status = "okay"; 444 445 es8316: codec@11 { 446 compatible = "everest,es8316"; 447 reg = <0x11>; 448 clocks = <&cru SCLK_I2S_8CH_OUT>; 449 clock-names = "mclk"; 450 #sound-dai-cells = <0>; 451 452 port { 453 es8316_p0_0: endpoint { 454 remote-endpoint = <&i2s0_p0_0>; 455 }; 456 }; 457 }; 458}; 459 460&i2c3 { 461 i2c-scl-rising-time-ns = <450>; 462 i2c-scl-falling-time-ns = <15>; 463 status = "okay"; 464}; 465 466&i2c4 { 467 i2c-scl-rising-time-ns = <600>; 468 i2c-scl-falling-time-ns = <20>; 469 status = "okay"; 470}; 471 472&i2s0 { 473 rockchip,playback-channels = <8>; 474 rockchip,capture-channels = <8>; 475 status = "okay"; 476 477 i2s0_p0: port { 478 i2s0_p0_0: endpoint { 479 dai-format = "i2s"; 480 mclk-fs = <256>; 481 remote-endpoint = <&es8316_p0_0>; 482 }; 483 }; 484}; 485 486&i2s1 { 487 rockchip,playback-channels = <2>; 488 rockchip,capture-channels = <2>; 489}; 490 491&i2s2 { 492 status = "okay"; 493}; 494 495&io_domains { 496 audio-supply = <&vcca1v8_codec>; 497 bt656-supply = <&vcc_3v0>; 498 gpio1830-supply = <&vcc_3v0>; 499 sdmmc-supply = <&vcc_sdio>; 500 status = "okay"; 501}; 502 503&pcie0 { 504 ep-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>; 505 max-link-speed = <2>; 506 num-lanes = <4>; 507 pinctrl-0 = <&pcie_clkreqnb_cpm>; 508 pinctrl-names = "default"; 509 vpcie0v9-supply = <&vcc_0v9>; 510 vpcie1v8-supply = <&vcc_1v8>; 511 vpcie3v3-supply = <&vcc3v3_pcie>; 512 status = "okay"; 513}; 514 515&pcie_phy { 516 status = "okay"; 517}; 518 519&pinctrl { 520 bt { 521 bt_enable_h: bt-enable-h { 522 rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; 523 }; 524 525 bt_host_wake_l: bt-host-wake-l { 526 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; 527 }; 528 529 bt_wake_l: bt-wake-l { 530 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; 531 }; 532 }; 533 534 pcie { 535 pcie_pwr_en: pcie-pwr-en { 536 rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 537 }; 538 }; 539 540 pmic { 541 pmic_int_l: pmic-int-l { 542 rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; 543 }; 544 545 vsel1_pin: vsel1-pin { 546 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; 547 }; 548 549 vsel2_pin: vsel2-pin { 550 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; 551 }; 552 }; 553 554 sdio0 { 555 sdio0_bus4: sdio0-bus4 { 556 rockchip,pins = <2 RK_PC4 1 &pcfg_pull_up_20ma>, 557 <2 RK_PC5 1 &pcfg_pull_up_20ma>, 558 <2 RK_PC6 1 &pcfg_pull_up_20ma>, 559 <2 RK_PC7 1 &pcfg_pull_up_20ma>; 560 }; 561 562 sdio0_cmd: sdio0-cmd { 563 rockchip,pins = <2 RK_PD0 1 &pcfg_pull_up_20ma>; 564 }; 565 566 sdio0_clk: sdio0-clk { 567 rockchip,pins = <2 RK_PD1 1 &pcfg_pull_none_20ma>; 568 }; 569 }; 570 571 usb-typec { 572 vcc5v0_typec_en: vcc5v0-typec-en { 573 rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; 574 }; 575 }; 576 577 usb2 { 578 vcc5v0_host_en: vcc5v0-host-en { 579 rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; 580 }; 581 }; 582 583 wifi { 584 wifi_enable_h: wifi-enable-h { 585 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; 586 }; 587 588 wifi_host_wake_l: wifi-host-wake-l { 589 rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; 590 }; 591 }; 592}; 593 594&pmu_io_domains { 595 pmu1830-supply = <&vcc_3v0>; 596 status = "okay"; 597}; 598 599&pwm2 { 600 status = "okay"; 601}; 602 603&saradc { 604 status = "okay"; 605 606 vref-supply = <&vcc_1v8>; 607}; 608 609&sdhci { 610 max-frequency = <150000000>; 611 bus-width = <8>; 612 mmc-hs200-1_8v; 613 non-removable; 614 status = "okay"; 615}; 616 617&sdio0 { 618 #address-cells = <1>; 619 #size-cells = <0>; 620 bus-width = <4>; 621 clock-frequency = <50000000>; 622 cap-sdio-irq; 623 cap-sd-highspeed; 624 keep-power-in-suspend; 625 mmc-pwrseq = <&sdio_pwrseq>; 626 non-removable; 627 pinctrl-names = "default"; 628 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; 629 sd-uhs-sdr104; 630}; 631 632&sdmmc { 633 bus-width = <4>; 634 cap-mmc-highspeed; 635 cap-sd-highspeed; 636 cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; 637 disable-wp; 638 max-frequency = <150000000>; 639 pinctrl-names = "default"; 640 pinctrl-0 = <&sdmmc_clk &sdmmc_cd &sdmmc_cmd &sdmmc_bus4>; 641 status = "okay"; 642}; 643 644&spdif { 645 646 spdif_p0: port { 647 spdif_p0_0: endpoint { 648 remote-endpoint = <&dit_p0_0>; 649 }; 650 }; 651}; 652 653&tcphy0 { 654 status = "okay"; 655}; 656 657&tcphy1 { 658 status = "okay"; 659}; 660 661&tsadc { 662 status = "okay"; 663 664 /* tshut mode 0:CRU 1:GPIO */ 665 rockchip,hw-tshut-mode = <1>; 666 /* tshut polarity 0:LOW 1:HIGH */ 667 rockchip,hw-tshut-polarity = <1>; 668}; 669 670&u2phy0 { 671 status = "okay"; 672 673 u2phy0_otg: otg-port { 674 status = "okay"; 675 }; 676 677 u2phy0_host: host-port { 678 phy-supply = <&vcc5v0_host>; 679 status = "okay"; 680 }; 681}; 682 683&u2phy1 { 684 status = "okay"; 685 686 u2phy1_otg: otg-port { 687 status = "okay"; 688 }; 689 690 u2phy1_host: host-port { 691 phy-supply = <&vcc5v0_host>; 692 status = "okay"; 693 }; 694}; 695 696&uart0 { 697 pinctrl-names = "default"; 698 pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; 699}; 700 701&uart2 { 702 status = "okay"; 703}; 704 705&usb_host0_ehci { 706 status = "okay"; 707}; 708 709&usb_host0_ohci { 710 status = "okay"; 711}; 712 713&usb_host1_ehci { 714 status = "okay"; 715}; 716 717&usb_host1_ohci { 718 status = "okay"; 719}; 720 721&usbdrd3_0 { 722 status = "okay"; 723}; 724 725&usbdrd3_1 { 726 status = "okay"; 727}; 728 729&usbdrd_dwc3_0 { 730 status = "okay"; 731 dr_mode = "host"; 732}; 733 734&usbdrd_dwc3_1 { 735 status = "okay"; 736 dr_mode = "host"; 737}; 738 739&vopb { 740 status = "okay"; 741}; 742 743&vopb_mmu { 744 status = "okay"; 745}; 746 747&vopl { 748 status = "okay"; 749}; 750 751&vopl_mmu { 752 status = "okay"; 753}; 754