1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2024 Radxa Computer (Shenzhen) Co., Ltd. 4 */ 5 6/dts-v1/; 7 8#include <dt-bindings/gpio/gpio.h> 9#include <dt-bindings/input/input.h> 10#include <dt-bindings/leds/common.h> 11#include <dt-bindings/pinctrl/rockchip.h> 12#include <dt-bindings/pwm/pwm.h> 13#include "rk3588s.dtsi" 14 15/ { 16 model = "Radxa E52C"; 17 compatible = "radxa,e52c", "rockchip,rk3582", "rockchip,rk3588s"; 18 19 aliases { 20 mmc0 = &sdhci; 21 mmc1 = &sdmmc; 22 }; 23 24 chosen { 25 stdout-path = "serial2:1500000n8"; 26 }; 27 28 keys-0 { 29 compatible = "adc-keys"; 30 io-channels = <&saradc 0>; 31 io-channel-names = "buttons"; 32 keyup-threshold-microvolt = <1800000>; 33 poll-interval = <100>; 34 35 button-0 { 36 label = "Maskrom"; 37 linux,code = <KEY_VENDOR>; 38 press-threshold-microvolt = <0>; 39 }; 40 }; 41 42 keys-1 { 43 compatible = "gpio-keys"; 44 pinctrl-names = "default"; 45 pinctrl-0 = <&pwm15_ir_m1>; 46 47 button-1 { 48 label = "User"; 49 gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_LOW>; 50 linux,code = <BTN_0>; 51 wakeup-source; 52 }; 53 }; 54 55 leds-0 { 56 compatible = "gpio-leds"; 57 pinctrl-names = "default"; 58 pinctrl-0 = <&power_led>; 59 60 led-0 { 61 color = <LED_COLOR_ID_GREEN>; 62 default-state = "on"; 63 function = LED_FUNCTION_STATUS; 64 gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; 65 linux,default-trigger = "heartbeat"; 66 }; 67 }; 68 69 leds-1 { 70 compatible = "pwm-leds"; 71 72 led-1 { 73 color = <LED_COLOR_ID_GREEN>; 74 default-state = "off"; 75 function = LED_FUNCTION_LAN; 76 linux,default-trigger = "netdev"; 77 pwms = <&pwm14 0 1000000 PWM_POLARITY_INVERTED>; 78 max-brightness = <255>; 79 }; 80 81 led-2 { 82 color = <LED_COLOR_ID_GREEN>; 83 default-state = "off"; 84 function = LED_FUNCTION_WAN; 85 linux,default-trigger = "netdev"; 86 pwms = <&pwm11 0 1000000 PWM_POLARITY_INVERTED>; 87 max-brightness = <255>; 88 }; 89 }; 90 91 vcc_1v1_nldo_s3: regulator-1v1 { 92 compatible = "regulator-fixed"; 93 regulator-name = "vcc_1v1_nldo_s3"; 94 regulator-always-on; 95 regulator-boot-on; 96 regulator-min-microvolt = <1100000>; 97 regulator-max-microvolt = <1100000>; 98 vin-supply = <&vcc_sysin>; 99 }; 100 101 vcc_3v3_s0: regulator-3v3-1 { 102 compatible = "regulator-fixed"; 103 regulator-name = "vcc_3v3_s0"; 104 regulator-always-on; 105 regulator-boot-on; 106 regulator-min-microvolt = <3300000>; 107 regulator-max-microvolt = <3300000>; 108 vin-supply = <&vcc_3v3_s3>; 109 }; 110 111 vcca: regulator-4v0 { 112 compatible = "regulator-fixed"; 113 regulator-name = "vcca"; 114 regulator-always-on; 115 regulator-boot-on; 116 regulator-min-microvolt = <4000000>; 117 regulator-max-microvolt = <4000000>; 118 vin-supply = <&vcc_sysin>; 119 }; 120 121 vcc5v0_usb_otg0: regulator-5v0-0 { 122 compatible = "regulator-fixed"; 123 enable-active-high; 124 gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; 125 pinctrl-names = "default"; 126 pinctrl-0 = <&usb_otg_pwren_h>; 127 regulator-name = "vcc5v0_usb_otg0"; 128 regulator-min-microvolt = <5000000>; 129 regulator-max-microvolt = <5000000>; 130 vin-supply = <&vcc_sysin>; 131 }; 132 133 vcc_5v0: regulator-5v0-1 { 134 compatible = "regulator-fixed"; 135 enable-active-high; 136 gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; 137 pinctrl-names = "default"; 138 pinctrl-0 = <&vcc_5v0_pwren_h>; 139 regulator-name = "vcc_5v0"; 140 regulator-min-microvolt = <5000000>; 141 regulator-max-microvolt = <5000000>; 142 vin-supply = <&vcc_sysin>; 143 }; 144 145 vcc_sysin: regulator-5v0-2 { 146 compatible = "regulator-fixed"; 147 regulator-name = "vcc_sysin"; 148 regulator-always-on; 149 regulator-boot-on; 150 regulator-min-microvolt = <5000000>; 151 regulator-max-microvolt = <5000000>; 152 }; 153}; 154 155&combphy0_ps { 156 status = "okay"; 157}; 158 159&combphy2_psu { 160 status = "okay"; 161}; 162 163/* 164 * In the Rockchip RK3582 SoC, some CPU cores end up disabled 165 * and unused because they're marked in the efuses as defective. 166 * The disabling in the DT is performed by the boot loader. 167 */ 168&cpu_b0 { 169 cpu-supply = <&vdd_cpu_big0_s0>; 170}; 171 172&cpu_b1 { 173 cpu-supply = <&vdd_cpu_big0_s0>; 174}; 175 176&cpu_b2 { 177 cpu-supply = <&vdd_cpu_big1_s0>; 178}; 179 180&cpu_b3 { 181 cpu-supply = <&vdd_cpu_big1_s0>; 182}; 183 184&cpu_l0 { 185 cpu-supply = <&vdd_cpu_lit_s0>; 186}; 187 188&cpu_l1 { 189 cpu-supply = <&vdd_cpu_lit_s0>; 190}; 191 192&cpu_l2 { 193 cpu-supply = <&vdd_cpu_lit_s0>; 194}; 195 196&cpu_l3 { 197 cpu-supply = <&vdd_cpu_lit_s0>; 198}; 199 200&i2c0 { 201 pinctrl-names = "default"; 202 pinctrl-0 = <&i2c0m2_xfer>; 203 status = "okay"; 204 205 vdd_cpu_big0_s0: regulator@42 { 206 compatible = "rockchip,rk8602"; 207 reg = <0x42>; 208 fcs,suspend-voltage-selector = <1>; 209 regulator-name = "vdd_cpu_big0_s0"; 210 regulator-always-on; 211 regulator-boot-on; 212 regulator-min-microvolt = <550000>; 213 regulator-max-microvolt = <1050000>; 214 regulator-ramp-delay = <2300>; 215 vin-supply = <&vcc_sysin>; 216 217 regulator-state-mem { 218 regulator-off-in-suspend; 219 }; 220 }; 221 222 vdd_cpu_big1_s0: regulator@43 { 223 compatible = "rockchip,rk8603", "rockchip,rk8602"; 224 reg = <0x43>; 225 fcs,suspend-voltage-selector = <1>; 226 regulator-name = "vdd_cpu_big1_s0"; 227 regulator-always-on; 228 regulator-boot-on; 229 regulator-min-microvolt = <550000>; 230 regulator-max-microvolt = <1050000>; 231 regulator-ramp-delay = <2300>; 232 vin-supply = <&vcc_sysin>; 233 234 regulator-state-mem { 235 regulator-off-in-suspend; 236 }; 237 }; 238 239 eeprom@50 { 240 compatible = "belling,bl24c16a", "atmel,24c16"; 241 reg = <0x50>; 242 pagesize = <16>; 243 read-only; 244 vcc-supply = <&vcc_3v3_pmu>; 245 }; 246}; 247 248&i2c2 { 249 status = "okay"; 250 251 vdd_npu_s0: regulator@42 { 252 compatible = "rockchip,rk8602"; 253 reg = <0x42>; 254 fcs,suspend-voltage-selector = <1>; 255 regulator-name = "vdd_npu_s0"; 256 regulator-min-microvolt = <550000>; 257 regulator-max-microvolt = <950000>; 258 regulator-ramp-delay = <2300>; 259 vin-supply = <&vcc_sysin>; 260 261 regulator-state-mem { 262 regulator-off-in-suspend; 263 }; 264 }; 265}; 266 267&i2c5 { 268 pinctrl-names = "default"; 269 pinctrl-0 = <&i2c5m2_xfer>; 270 status = "okay"; 271 272 rtc@51 { 273 compatible = "haoyu,hym8563"; 274 reg = <0x51>; 275 #clock-cells = <0>; 276 clock-output-names = "rtcic_32kout"; 277 interrupt-parent = <&gpio0>; 278 interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>; 279 pinctrl-names = "default"; 280 pinctrl-0 = <&rtc_int_l>; 281 wakeup-source; 282 }; 283}; 284 285&pcie2x1l1 { 286 pinctrl-names = "default"; 287 pinctrl-0 = <&pcie20x1_1_perstn_m1>; 288 reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>; 289 vpcie3v3-supply = <&vcc_3v3_s3>; 290 status = "okay"; 291}; 292 293&pcie2x1l2 { 294 pinctrl-names = "default"; 295 pinctrl-0 = <&pcie20x1_2_perstn_m0>; 296 reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>; 297 vpcie3v3-supply = <&vcc_3v3_s3>; 298 status = "okay"; 299}; 300 301&pd_npu { 302 domain-supply = <&vdd_npu_s0>; 303}; 304 305&pinctrl { 306 keys { 307 pwm15_ir_m1: pwm15-ir-m1 { 308 rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; 309 }; 310 }; 311 312 leds { 313 power_led: power-led { 314 rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; 315 }; 316 }; 317 318 pcie { 319 pcie20x1_1_perstn_m1: pcie-1 { 320 rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; 321 }; 322 323 pcie20x1_2_perstn_m0: pcie-2 { 324 rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; 325 }; 326 }; 327 328 regulators { 329 vcc_5v0_pwren_h: vcc-5v0-pwren-h { 330 rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; 331 }; 332 }; 333 334 rtc { 335 rtc_int_l: rtc-int-l { 336 rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; 337 }; 338 }; 339 340 usb { 341 usb_otg_pwren_h: usb-otg-pwren-h { 342 rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; 343 }; 344 }; 345}; 346 347&pwm11 { 348 pinctrl-names = "default"; 349 pinctrl-0 = <&pwm11m1_pins>; 350 status = "okay"; 351}; 352 353&pwm14 { 354 pinctrl-names = "default"; 355 pinctrl-0 = <&pwm14m1_pins>; 356 status = "okay"; 357}; 358 359&rknn_core_0 { 360 npu-supply = <&vdd_npu_s0>; 361 sram-supply = <&vdd_npu_s0>; 362 status = "okay"; 363}; 364 365&rknn_core_1 { 366 npu-supply = <&vdd_npu_s0>; 367 sram-supply = <&vdd_npu_s0>; 368 status = "okay"; 369}; 370 371&rknn_core_2 { 372 npu-supply = <&vdd_npu_s0>; 373 sram-supply = <&vdd_npu_s0>; 374 status = "okay"; 375}; 376 377&rknn_mmu_0 { 378 status = "okay"; 379}; 380 381&rknn_mmu_1 { 382 status = "okay"; 383}; 384 385&rknn_mmu_2 { 386 status = "okay"; 387}; 388 389&saradc { 390 vref-supply = <&vcca_1v8_s0>; 391 status = "okay"; 392}; 393 394&sdhci { 395 bus-width = <8>; 396 cap-mmc-highspeed; 397 mmc-hs400-1_8v; 398 mmc-hs400-enhanced-strobe; 399 no-sd; 400 no-sdio; 401 non-removable; 402 vmmc-supply = <&vcc_3v3_s0>; 403 vqmmc-supply = <&vcc_1v8_s3>; 404 status = "okay"; 405}; 406 407&sdmmc { 408 bus-width = <4>; 409 cap-mmc-highspeed; 410 cap-sd-highspeed; 411 cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>; 412 disable-wp; 413 no-sdio; 414 sd-uhs-sdr104; 415 vmmc-supply = <&vcc_3v3_s3>; 416 vqmmc-supply = <&vccio_sd_s0>; 417 status = "okay"; 418}; 419 420&spi2 { 421 status = "okay"; 422 assigned-clocks = <&cru CLK_SPI2>; 423 assigned-clock-rates = <200000000>; 424 num-cs = <1>; 425 pinctrl-names = "default"; 426 pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>; 427 428 pmic@0 { 429 compatible = "rockchip,rk806"; 430 reg = <0>; 431 gpio-controller; 432 #gpio-cells = <2>; 433 interrupt-parent = <&gpio0>; 434 interrupts = <7 IRQ_TYPE_LEVEL_LOW>; 435 pinctrl-names = "default"; 436 pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, 437 <&rk806_dvs2_null>, <&rk806_dvs3_null>; 438 spi-max-frequency = <1000000>; 439 system-power-controller; 440 441 vcc1-supply = <&vcc_sysin>; 442 vcc2-supply = <&vcc_sysin>; 443 vcc3-supply = <&vcc_sysin>; 444 vcc4-supply = <&vcc_sysin>; 445 vcc5-supply = <&vcc_sysin>; 446 vcc6-supply = <&vcc_sysin>; 447 vcc7-supply = <&vcc_sysin>; 448 vcc8-supply = <&vcc_sysin>; 449 vcc9-supply = <&vcc_sysin>; 450 vcc10-supply = <&vcc_sysin>; 451 vcc11-supply = <&vcc_2v0_pldo_s3>; 452 vcc12-supply = <&vcc_sysin>; 453 vcc13-supply = <&vcc_1v1_nldo_s3>; 454 vcc14-supply = <&vcc_1v1_nldo_s3>; 455 vcca-supply = <&vcca>; 456 457 rk806_dvs1_null: dvs1-null-pins { 458 pins = "gpio_pwrctrl1"; 459 function = "pin_fun0"; 460 }; 461 462 rk806_dvs2_null: dvs2-null-pins { 463 pins = "gpio_pwrctrl2"; 464 function = "pin_fun0"; 465 }; 466 467 rk806_dvs3_null: dvs3-null-pins { 468 pins = "gpio_pwrctrl3"; 469 function = "pin_fun0"; 470 }; 471 472 regulators { 473 vdd_gpu_s0: dcdc-reg1 { 474 regulator-name = "vdd_gpu_s0"; 475 regulator-boot-on; 476 regulator-min-microvolt = <550000>; 477 regulator-max-microvolt = <950000>; 478 regulator-ramp-delay = <12500>; 479 regulator-enable-ramp-delay = <400>; 480 481 regulator-state-mem { 482 regulator-off-in-suspend; 483 }; 484 }; 485 486 vdd_cpu_lit_s0: dcdc-reg2 { 487 regulator-name = "vdd_cpu_lit_s0"; 488 regulator-always-on; 489 regulator-boot-on; 490 regulator-min-microvolt = <550000>; 491 regulator-max-microvolt = <950000>; 492 regulator-ramp-delay = <12500>; 493 494 regulator-state-mem { 495 regulator-off-in-suspend; 496 }; 497 }; 498 499 vdd_logic_s0: dcdc-reg3 { 500 regulator-name = "vdd_logic_s0"; 501 regulator-always-on; 502 regulator-boot-on; 503 regulator-min-microvolt = <675000>; 504 regulator-max-microvolt = <750000>; 505 regulator-ramp-delay = <12500>; 506 507 regulator-state-mem { 508 regulator-on-in-suspend; 509 regulator-suspend-microvolt = <750000>; 510 }; 511 }; 512 513 vdd_vdenc_s0: dcdc-reg4 { 514 regulator-name = "vdd_vdenc_s0"; 515 regulator-always-on; 516 regulator-boot-on; 517 regulator-min-microvolt = <550000>; 518 regulator-max-microvolt = <950000>; 519 regulator-ramp-delay = <12500>; 520 521 regulator-state-mem { 522 regulator-off-in-suspend; 523 }; 524 }; 525 526 vdd_ddr_s0: dcdc-reg5 { 527 regulator-name = "vdd_ddr_s0"; 528 regulator-always-on; 529 regulator-boot-on; 530 regulator-min-microvolt = <675000>; 531 regulator-max-microvolt = <900000>; 532 regulator-ramp-delay = <12500>; 533 534 regulator-state-mem { 535 regulator-off-in-suspend; 536 regulator-suspend-microvolt = <850000>; 537 }; 538 }; 539 540 vdd2_ddr_s3: dcdc-reg6 { 541 regulator-name = "vdd2_ddr_s3"; 542 regulator-always-on; 543 regulator-boot-on; 544 545 regulator-state-mem { 546 regulator-on-in-suspend; 547 }; 548 }; 549 550 vcc_2v0_pldo_s3: dcdc-reg7 { 551 regulator-name = "vcc_2v0_pldo_s3"; 552 regulator-always-on; 553 regulator-boot-on; 554 regulator-min-microvolt = <2000000>; 555 regulator-max-microvolt = <2000000>; 556 557 regulator-state-mem { 558 regulator-on-in-suspend; 559 regulator-suspend-microvolt = <2000000>; 560 }; 561 }; 562 563 vcc_3v3_s3: vcc_3v3_pmu: dcdc-reg8 { 564 regulator-name = "vcc_3v3_s3"; 565 regulator-always-on; 566 regulator-boot-on; 567 regulator-min-microvolt = <3300000>; 568 regulator-max-microvolt = <3300000>; 569 570 regulator-state-mem { 571 regulator-on-in-suspend; 572 regulator-suspend-microvolt = <3300000>; 573 }; 574 }; 575 576 vddq_ddr_s0: dcdc-reg9 { 577 regulator-name = "vddq_ddr_s0"; 578 regulator-always-on; 579 regulator-boot-on; 580 581 regulator-state-mem { 582 regulator-off-in-suspend; 583 }; 584 }; 585 586 vcc_1v8_s3: dcdc-reg10 { 587 regulator-name = "vcc_1v8_s3"; 588 regulator-always-on; 589 regulator-boot-on; 590 regulator-min-microvolt = <1800000>; 591 regulator-max-microvolt = <1800000>; 592 593 regulator-state-mem { 594 regulator-on-in-suspend; 595 regulator-suspend-microvolt = <1800000>; 596 }; 597 }; 598 599 vcc_1v8_s0: pldo-reg1 { 600 regulator-name = "vcc_1v8_s0"; 601 regulator-always-on; 602 regulator-boot-on; 603 regulator-min-microvolt = <1800000>; 604 regulator-max-microvolt = <1800000>; 605 606 regulator-state-mem { 607 regulator-on-in-suspend; 608 regulator-suspend-microvolt = <1800000>; 609 }; 610 }; 611 612 vcca_1v8_s0: pldo-reg2 { 613 regulator-name = "vcca_1v8_s0"; 614 regulator-always-on; 615 regulator-boot-on; 616 regulator-min-microvolt = <1800000>; 617 regulator-max-microvolt = <1800000>; 618 619 regulator-state-mem { 620 regulator-on-in-suspend; 621 regulator-suspend-microvolt = <1800000>; 622 }; 623 }; 624 625 vdda_1v2_s0: pldo-reg3 { 626 regulator-name = "vdda_1v2_s0"; 627 regulator-always-on; 628 regulator-boot-on; 629 regulator-min-microvolt = <1200000>; 630 regulator-max-microvolt = <1200000>; 631 632 regulator-state-mem { 633 regulator-off-in-suspend; 634 }; 635 }; 636 637 vcca_3v3_s0: pldo-reg4 { 638 regulator-name = "vcca_3v3_s0"; 639 regulator-always-on; 640 regulator-boot-on; 641 regulator-min-microvolt = <3300000>; 642 regulator-max-microvolt = <3300000>; 643 644 regulator-state-mem { 645 regulator-on-in-suspend; 646 regulator-suspend-microvolt = <3300000>; 647 }; 648 }; 649 650 vccio_sd_s0: pldo-reg5 { 651 regulator-name = "vccio_sd_s0"; 652 regulator-always-on; 653 regulator-boot-on; 654 regulator-min-microvolt = <1800000>; 655 regulator-max-microvolt = <3300000>; 656 657 regulator-state-mem { 658 regulator-off-in-suspend; 659 }; 660 }; 661 662 pldo6_s3: pldo-reg6 { 663 regulator-name = "pldo6_s3"; 664 regulator-always-on; 665 regulator-boot-on; 666 regulator-min-microvolt = <1800000>; 667 regulator-max-microvolt = <1800000>; 668 669 regulator-state-mem { 670 regulator-on-in-suspend; 671 regulator-suspend-microvolt = <1800000>; 672 }; 673 }; 674 675 vdd_0v75_s3: nldo-reg1 { 676 regulator-name = "vdd_0v75_s3"; 677 regulator-always-on; 678 regulator-boot-on; 679 regulator-min-microvolt = <750000>; 680 regulator-max-microvolt = <750000>; 681 682 regulator-state-mem { 683 regulator-on-in-suspend; 684 regulator-suspend-microvolt = <750000>; 685 }; 686 }; 687 688 vdda_ddr_pll_s0: nldo-reg2 { 689 regulator-name = "vdda_ddr_pll_s0"; 690 regulator-always-on; 691 regulator-boot-on; 692 regulator-min-microvolt = <850000>; 693 regulator-max-microvolt = <850000>; 694 695 regulator-state-mem { 696 regulator-on-in-suspend; 697 regulator-suspend-microvolt = <850000>; 698 }; 699 }; 700 701 vdda_0v75_s0: nldo-reg3 { 702 regulator-name = "vdda_0v75_s0"; 703 regulator-always-on; 704 regulator-boot-on; 705 regulator-min-microvolt = <750000>; 706 regulator-max-microvolt = <750000>; 707 708 regulator-state-mem { 709 regulator-on-in-suspend; 710 regulator-suspend-microvolt = <750000>; 711 }; 712 }; 713 714 vdda_0v85_s0: nldo-reg4 { 715 regulator-name = "vdda_0v85_s0"; 716 regulator-always-on; 717 regulator-boot-on; 718 regulator-min-microvolt = <850000>; 719 regulator-max-microvolt = <850000>; 720 721 regulator-state-mem { 722 regulator-off-in-suspend; 723 }; 724 }; 725 726 vdd_0v75_s0: nldo-reg5 { 727 regulator-name = "vdd_0v75_s0"; 728 regulator-always-on; 729 regulator-boot-on; 730 regulator-min-microvolt = <750000>; 731 regulator-max-microvolt = <750000>; 732 733 regulator-state-mem { 734 regulator-off-in-suspend; 735 }; 736 }; 737 }; 738 }; 739}; 740 741&tsadc { 742 status = "okay"; 743}; 744 745&u2phy0 { 746 status = "okay"; 747}; 748 749&u2phy0_otg { 750 phy-supply = <&vcc5v0_usb_otg0>; 751 status = "okay"; 752}; 753 754&uart2 { 755 pinctrl-0 = <&uart2m0_xfer>; 756 status = "okay"; 757}; 758 759&usb_host0_xhci { 760 dr_mode = "host"; 761 status = "okay"; 762}; 763 764&usbdp_phy0 { 765 status = "okay"; 766}; 767