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