1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd 4 * 5 */ 6 7#include "rk3328.dtsi" 8#include "rk3328-android.dtsi" 9#include <dt-bindings/input/input.h> 10 11/ { 12 gmac_clkin: external-gmac-clock { 13 compatible = "fixed-clock"; 14 clock-frequency = <125000000>; 15 clock-output-names = "gmac_clkin"; 16 #clock-cells = <0>; 17 }; 18 19 sdio_pwrseq: sdio-pwrseq { 20 compatible = "mmc-pwrseq-simple"; 21 pinctrl-names = "default"; 22 pinctrl-0 = <&wifi_enable_h>; 23 24 /* 25 * On the module itself this is one of these (depending 26 * on the actual card populated): 27 * - SDIO_RESET_L_WL_REG_ON 28 * - PDN (power down when low) 29 */ 30 reset-gpios = <&gpio1 18 GPIO_ACTIVE_LOW>; 31 }; 32 33 sound { 34 compatible = "simple-audio-card"; 35 simple-audio-card,format = "i2s"; 36 simple-audio-card,mclk-fs = <256>; 37 simple-audio-card,name = "rockchip-rk3328"; 38 simple-audio-card,cpu { 39 sound-dai = <&i2s1>; 40 }; 41 simple-audio-card,codec { 42 sound-dai = <&codec>; 43 }; 44 }; 45 46 hdmi-sound { 47 compatible = "simple-audio-card"; 48 simple-audio-card,format = "i2s"; 49 simple-audio-card,mclk-fs = <128>; 50 simple-audio-card,name = "rockchip-hdmi"; 51 simple-audio-card,cpu { 52 sound-dai = <&i2s0>; 53 }; 54 simple-audio-card,codec { 55 sound-dai = <&hdmi>; 56 }; 57 }; 58 59 spdif-sound { 60 compatible = "simple-audio-card"; 61 simple-audio-card,name = "rockchip-spdif"; 62 simple-audio-card,mclk-fs = <128>; 63 simple-audio-card,cpu { 64 sound-dai = <&spdif>; 65 }; 66 simple-audio-card,codec { 67 sound-dai = <&spdif_out>; 68 }; 69 }; 70 71 spdif_out: spdif-out { 72 compatible = "linux,spdif-dit"; 73 #sound-dai-cells = <0>; 74 }; 75 76 vcc_host_vbus: host-vbus-regulator { 77 compatible = "regulator-fixed"; 78 gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; 79 pinctrl-names = "default"; 80 pinctrl-0 = <&host_vbus_drv>; 81 regulator-name = "vcc_host_vbus"; 82 regulator-min-microvolt = <5000000>; 83 regulator-max-microvolt = <5000000>; 84 enable-active-high; 85 }; 86 87 vcc_otg_vbus: otg-vbus-regulator { 88 compatible = "regulator-fixed"; 89 gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>; 90 pinctrl-names = "default"; 91 pinctrl-0 = <&otg_vbus_drv>; 92 regulator-name = "vcc_otg_vbus"; 93 regulator-min-microvolt = <5000000>; 94 regulator-max-microvolt = <5000000>; 95 enable-active-high; 96 }; 97 98 vcc_phy: vcc-phy-regulator { 99 compatible = "regulator-fixed"; 100 regulator-name = "vcc_phy"; 101 regulator-always-on; 102 regulator-boot-on; 103 }; 104 105 vcc_sd: sdmmc-regulator { 106 compatible = "regulator-fixed"; 107 gpio = <&gpio0 30 GPIO_ACTIVE_LOW>; 108 pinctrl-names = "default"; 109 pinctrl-0 = <&sdmmc0m1_gpio>; 110 regulator-name = "vcc_sd"; 111 regulator-min-microvolt = <3300000>; 112 regulator-max-microvolt = <3300000>; 113 vin-supply = <&vcc_io>; 114 }; 115 116 vcc_sys: vcc-sys { 117 compatible = "regulator-fixed"; 118 regulator-name = "vcc_sys"; 119 regulator-min-microvolt = <5000000>; 120 regulator-max-microvolt = <5000000>; 121 regulator-always-on; 122 }; 123 124 xin32k: xin32k { 125 compatible = "fixed-clock"; 126 clock-frequency = <32768>; 127 clock-output-names = "xin32k"; 128 #clock-cells = <0>; 129 }; 130 131 wireless-bluetooth { 132 compatible = "bluetooth-platdata"; 133 clocks = <&rk805 1>; 134 clock-names = "ext_clock"; 135 uart_rts_gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; 136 pinctrl-names = "default", "rts_gpio"; 137 pinctrl-0 = <&uart0_rts>; 138 pinctrl-1 = <&uart0_gpios>; 139 BT,power_gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>; 140 BT,wake_host_irq = <&gpio1 26 GPIO_ACTIVE_HIGH>; 141 status = "okay"; 142 }; 143 144 wireless-wlan { 145 compatible = "wlan-platdata"; 146 rockchip,grf = <&grf>; 147 wifi_chip_type = "ap6354"; 148 sdio_vref = <1800>; 149 WIFI,host_wake_irq = <&gpio1 19 GPIO_ACTIVE_HIGH>; 150 status = "okay"; 151 }; 152}; 153 154&avsd { 155 status = "okay"; 156}; 157 158&codec { 159 #sound-dai-cells = <0>; 160 status = "okay"; 161}; 162 163&cpu0 { 164 cpu-supply = <&vdd_arm>; 165}; 166 167&dfi { 168 status = "okay"; 169}; 170 171&dmc { 172 center-supply = <&vdd_logic>; 173 status = "okay"; 174}; 175 176&emmc { 177 bus-width = <8>; 178 cap-mmc-highspeed; 179 mmc-hs200-1_8v; 180 no-sdio; 181 no-sd; 182 disable-wp; 183 non-removable; 184 num-slots = <1>; 185 pinctrl-names = "default"; 186 pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; 187 rockchip,default-sample-phase = <90>; 188 status = "okay"; 189}; 190 191&gmac2io { 192 phy-supply = <&vcc_phy>; 193 phy-mode = "rgmii"; 194 clock_in_out = "input"; 195 snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 196 snps,reset-active-low; 197 snps,reset-delays-us = <0 10000 50000>; 198 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; 199 assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>; 200 pinctrl-names = "default"; 201 pinctrl-0 = <&rgmiim1_pins>; 202 tx_delay = <0x26>; 203 rx_delay = <0x11>; 204 status = "disabled"; 205}; 206 207&gmac2phy { 208 phy-supply = <&vcc_phy>; 209 clock_in_out = "output"; 210 assigned-clocks = <&cru SCLK_MAC2PHY_SRC>; 211 assigned-clock-rate = <50000000>; 212 assigned-clocks = <&cru SCLK_MAC2PHY>; 213 assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>; 214 status = "okay"; 215}; 216 217&gpu { 218 status = "okay"; 219 mali-supply = <&vdd_logic>; 220}; 221 222&hdmi { 223 #sound-dai-cells = <0>; 224 ddc-i2c-scl-high-time-ns = <9625>; 225 ddc-i2c-scl-low-time-ns = <10000>; 226 status = "okay"; 227}; 228 229&hdmiphy { 230 rockchip,phy-table = 231 <165000000 0x07 0x0a 0x0a 0x0a 0x00 0x00 0x08 232 0x08 0x08 0x00 0xac 0xcc 0xcc 0xcc>, 233 <340000000 0x0b 0x0d 0x0d 0x0d 0x07 0x15 0x08 234 0x08 0x08 0x3f 0xac 0xcc 0xcd 0xdd>, 235 <594000000 0x10 0x1a 0x1a 0x1a 0x07 0x15 0x08 236 0x08 0x08 0x00 0xac 0xcc 0xcc 0xcc>; 237 status = "okay"; 238}; 239 240&i2c1 { 241 status = "okay"; 242 243 rk805: rk805@18 { 244 compatible = "rockchip,rk805"; 245 status = "okay"; 246 reg = <0x18>; 247 interrupt-parent = <&gpio2>; 248 interrupts = <6 IRQ_TYPE_LEVEL_LOW>; 249 pinctrl-names = "default"; 250 pinctrl-0 = <&pmic_int_l>; 251 wakeup-source; 252 gpio-controller; 253 #gpio-cells = <2>; 254 #clock-cells = <1>; 255 clock-output-names = "rk805-clkout1", "rk805-clkout2"; 256 257 vcc1-supply = <&vcc_sys>; 258 vcc2-supply = <&vcc_sys>; 259 vcc3-supply = <&vcc_sys>; 260 vcc4-supply = <&vcc_sys>; 261 vcc5-supply = <&vcc_io>; 262 vcc6-supply = <&vcc_io>; 263 264 rtc { 265 status = "okay"; 266 }; 267 268 pwrkey { 269 status = "disabled"; 270 }; 271 272 gpio { 273 status = "okay"; 274 }; 275 276 regulators { 277 vdd_logic: DCDC_REG1 { 278 regulator-name = "vdd_logic"; 279 regulator-min-microvolt = <712500>; 280 regulator-max-microvolt = <1450000>; 281 regulator-initial-mode = <0x1>; 282 regulator-ramp-delay = <12500>; 283 regulator-boot-on; 284 regulator-always-on; 285 regulator-state-mem { 286 regulator-mode = <0x2>; 287 regulator-on-in-suspend; 288 regulator-suspend-microvolt = <1000000>; 289 }; 290 }; 291 292 vdd_arm: DCDC_REG2 { 293 regulator-name = "vdd_arm"; 294 regulator-init-microvolt = <1225000>; 295 regulator-min-microvolt = <712500>; 296 regulator-max-microvolt = <1450000>; 297 regulator-initial-mode = <0x1>; 298 regulator-ramp-delay = <12500>; 299 regulator-boot-on; 300 regulator-always-on; 301 regulator-state-mem { 302 regulator-mode = <0x2>; 303 regulator-on-in-suspend; 304 regulator-suspend-microvolt = <950000>; 305 }; 306 }; 307 308 vcc_ddr: DCDC_REG3 { 309 regulator-name = "vcc_ddr"; 310 regulator-initial-mode = <0x1>; 311 regulator-boot-on; 312 regulator-always-on; 313 regulator-state-mem { 314 regulator-mode = <0x2>; 315 regulator-on-in-suspend; 316 }; 317 }; 318 319 vcc_io: DCDC_REG4 { 320 regulator-name = "vcc_io"; 321 regulator-min-microvolt = <3300000>; 322 regulator-max-microvolt = <3300000>; 323 regulator-initial-mode = <0x1>; 324 regulator-boot-on; 325 regulator-always-on; 326 regulator-state-mem { 327 regulator-mode = <0x2>; 328 regulator-on-in-suspend; 329 regulator-suspend-microvolt = <3300000>; 330 }; 331 }; 332 333 vdd_18: LDO_REG1 { 334 regulator-name = "vdd_18"; 335 regulator-min-microvolt = <1800000>; 336 regulator-max-microvolt = <1800000>; 337 regulator-boot-on; 338 regulator-always-on; 339 regulator-state-mem { 340 regulator-on-in-suspend; 341 regulator-suspend-microvolt = <1800000>; 342 }; 343 }; 344 345 vcc_18emmc: LDO_REG2 { 346 regulator-name = "vcc_18emmc"; 347 regulator-min-microvolt = <1800000>; 348 regulator-max-microvolt = <1800000>; 349 regulator-boot-on; 350 regulator-always-on; 351 regulator-state-mem { 352 regulator-on-in-suspend; 353 regulator-suspend-microvolt = <1800000>; 354 }; 355 }; 356 357 vdd_11: LDO_REG3 { 358 regulator-name = "vdd_11"; 359 regulator-min-microvolt = <1100000>; 360 regulator-max-microvolt = <1100000>; 361 regulator-boot-on; 362 regulator-always-on; 363 regulator-state-mem { 364 regulator-on-in-suspend; 365 regulator-suspend-microvolt = <1100000>; 366 }; 367 }; 368 }; 369 }; 370}; 371 372&secure_memory { 373 /* 374 * enable like this: 375 * reg = <0x0 0x20000000 0x0 0x10000000>; 376 */ 377 reg = <0x0 0x20000000 0x0 0x0>; 378}; 379 380&i2s0 { 381 #sound-dai-cells = <0>; 382 rockchip,bclk-fs = <128>; 383 status = "okay"; 384}; 385 386&i2s1 { 387 #sound-dai-cells = <0>; 388 status = "okay"; 389}; 390 391&iep { 392 status = "okay"; 393}; 394 395&iep_mmu { 396 status = "okay"; 397}; 398 399&io_domains { 400 status = "okay"; 401 402 vccio1-supply = <&vcc_io>; 403 vccio2-supply = <&vcc_18emmc>; 404 vccio3-supply = <&vcc_io>; 405 vccio4-supply = <&vdd_18>; 406 vccio5-supply = <&vcc_io>; 407 vccio6-supply = <&vcc_io>; 408 pmuio-supply = <&vcc_io>; 409}; 410 411&mpp_srv { 412 status = "okay"; 413}; 414 415&pinctrl { 416 pmic { 417 pmic_int_l: pmic-int-l { 418 rockchip,pins = 419 <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; /* gpio2_a6 */ 420 }; 421 }; 422 423 sdio-pwrseq { 424 wifi_enable_h: wifi-enable-h { 425 rockchip,pins = 426 <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; 427 }; 428 }; 429 430 usb { 431 host_vbus_drv: host-vbus-drv { 432 rockchip,pins = 433 <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; 434 }; 435 436 otg_vbus_drv: otg-vbus-drv { 437 rockchip,pins = 438 <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; 439 }; 440 }; 441 442 wireless-bluetooth { 443 uart0_gpios: uart0-gpios { 444 rockchip,pins = 445 <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; 446 }; 447 }; 448}; 449 450&pwm3 { 451 status = "okay"; 452 pinctrl-names = "default"; 453 pinctrl-0 = <&pwmir_pin>; 454 compatible = "rockchip,remotectl-pwm"; 455 remote_pwm_id = <3>; 456 handle_cpu_id = <1>; 457 remote_support_psci = <1>; 458 459 ir_key1 { 460 rockchip,usercode = <0x4040>; 461 rockchip,key_table = 462 <0xf2 KEY_REPLY>, 463 <0xba KEY_BACK>, 464 <0xf4 KEY_UP>, 465 <0xf1 KEY_DOWN>, 466 <0xef KEY_LEFT>, 467 <0xee KEY_RIGHT>, 468 <0xbd KEY_HOME>, 469 <0xea KEY_VOLUMEUP>, 470 <0xe3 KEY_VOLUMEDOWN>, 471 <0xe2 KEY_SEARCH>, 472 <0xb2 KEY_POWER>, 473 <0xbc KEY_MUTE>, 474 <0xec KEY_MENU>, 475 <0xbf 0x190>, 476 <0xe0 0x191>, 477 <0xe1 0x192>, 478 <0xe9 183>, 479 <0xe6 248>, 480 <0xe8 185>, 481 <0xe7 186>, 482 <0xf0 388>, 483 <0xbe 0x175>; 484 }; 485 486 ir_key2 { 487 rockchip,usercode = <0xff00>; 488 rockchip,key_table = 489 <0xf9 KEY_HOME>, 490 <0xbf KEY_BACK>, 491 <0xfb KEY_MENU>, 492 <0xaa KEY_REPLY>, 493 <0xb9 KEY_UP>, 494 <0xe9 KEY_DOWN>, 495 <0xb8 KEY_LEFT>, 496 <0xea KEY_RIGHT>, 497 <0xeb KEY_VOLUMEDOWN>, 498 <0xef KEY_VOLUMEUP>, 499 <0xf7 KEY_MUTE>, 500 <0xe7 KEY_POWER>, 501 <0xfc KEY_POWER>, 502 <0xa9 KEY_VOLUMEDOWN>, 503 <0xa8 KEY_PLAYPAUSE>, 504 <0xe0 KEY_VOLUMEDOWN>, 505 <0xa5 KEY_VOLUMEDOWN>, 506 <0xab 183>, 507 <0xb7 388>, 508 <0xe8 388>, 509 <0xf8 184>, 510 <0xaf 185>, 511 <0xed KEY_VOLUMEDOWN>, 512 <0xee 186>, 513 <0xb3 KEY_VOLUMEDOWN>, 514 <0xf1 KEY_VOLUMEDOWN>, 515 <0xf2 KEY_VOLUMEDOWN>, 516 <0xf3 KEY_SEARCH>, 517 <0xb4 KEY_VOLUMEDOWN>, 518 <0xa4 KEY_SETUP>, 519 <0xbe KEY_SEARCH>; 520 }; 521 522 ir_key3 { 523 rockchip,usercode = <0x1dcc>; 524 rockchip,key_table = 525 <0xee KEY_REPLY>, 526 <0xf0 KEY_BACK>, 527 <0xf8 KEY_UP>, 528 <0xbb KEY_DOWN>, 529 <0xef KEY_LEFT>, 530 <0xed KEY_RIGHT>, 531 <0xfc KEY_HOME>, 532 <0xf1 KEY_VOLUMEUP>, 533 <0xfd KEY_VOLUMEDOWN>, 534 <0xb7 KEY_SEARCH>, 535 <0xff KEY_POWER>, 536 <0xf3 KEY_MUTE>, 537 <0xbf KEY_MENU>, 538 <0xf9 0x191>, 539 <0xf5 0x192>, 540 <0xb3 388>, 541 <0xbe KEY_1>, 542 <0xba KEY_2>, 543 <0xb2 KEY_3>, 544 <0xbd KEY_4>, 545 <0xf9 KEY_5>, 546 <0xb1 KEY_6>, 547 <0xfc KEY_7>, 548 <0xf8 KEY_8>, 549 <0xb0 KEY_9>, 550 <0xb6 KEY_0>, 551 <0xb5 KEY_BACKSPACE>; 552 }; 553}; 554 555&rga { 556 status = "okay"; 557}; 558 559&rkvdec { 560 status = "okay"; 561 vcodec-supply = <&vdd_logic>; 562}; 563 564&rkvdec_mmu { 565 status = "okay"; 566}; 567 568&rockchip_suspend { 569 status = "okay"; 570 rockchip,virtual-poweroff = <1>; 571}; 572 573&uart0 { 574 pinctrl-names = "default"; 575 pinctrl-0 = <&uart0_xfer &uart0_cts>; 576 status = "okay"; 577}; 578 579&sdio { 580 bus-width = <4>; 581 cap-sd-highspeed; 582 cap-sdio-irq; 583 disable-wp; 584 keep-power-in-suspend; 585 max-frequency = <125000000>; 586 mmc-pwrseq = <&sdio_pwrseq>; 587 non-removable; 588 num-slots = <1>; 589 pinctrl-names = "default"; 590 pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>; 591 no-sd; 592 no-mmc; 593 sd-uhs-sdr104; 594 status = "okay"; 595}; 596 597&sdmmc { 598 bus-width = <4>; 599 cap-mmc-highspeed; 600 cap-sd-highspeed; 601 disable-wp; 602 max-frequency = <150000000>; 603 num-slots = <1>; 604 pinctrl-names = "default"; 605 pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>; 606 no-sdio; 607 no-mmc; 608 status = "okay"; 609 vmmc-supply = <&vcc_sd>; 610}; 611 612&spdif { 613 #sound-dai-cells = <0>; 614 pinctrl-names = "default"; 615 pinctrl-0 = <&spdifm2_tx>; 616 status = "okay"; 617}; 618 619&threshold { 620 temperature = <90000>; /* millicelsius */ 621}; 622 623&target { 624 temperature = <105000>; /* millicelsius */ 625}; 626 627&soc_crit { 628 temperature = <115000>; /* millicelsius */ 629}; 630 631&tsadc { 632 rockchip,hw-tshut-temp = <120000>; 633 status = "okay"; 634}; 635 636&tve { 637 status = "okay"; 638}; 639 640&u2phy { 641 status = "okay"; 642 643 u2phy_host: host-port { 644 status = "okay"; 645 }; 646 647 u2phy_otg: otg-port { 648 vbus-supply = <&vcc_otg_vbus>; 649 status = "okay"; 650 }; 651}; 652 653&u3phy { 654 vbus-supply = <&vcc_host_vbus>; 655 status = "okay"; 656}; 657 658&u3phy_utmi { 659 status = "okay"; 660}; 661 662&u3phy_pipe { 663 status = "okay"; 664}; 665 666&usb20_otg { 667 status = "okay"; 668}; 669 670&usb_host0_ehci { 671 status = "okay"; 672}; 673 674&usb_host0_ohci { 675 status = "okay"; 676}; 677 678&usbdrd3 { 679 status = "okay"; 680}; 681 682&usbdrd_dwc3 { 683 status = "okay"; 684}; 685 686&vdpu { 687 status = "okay"; 688}; 689 690&vpu_mmu { 691 status = "okay"; 692}; 693 694&vepu { 695 status = "okay"; 696}; 697 698&vepu_mmu { 699 status = "okay"; 700}; 701 702&vepu22 { 703 status = "okay"; 704}; 705 706&vepu22_mmu { 707 status = "okay"; 708}; 709 710&vop { 711 status = "okay"; 712}; 713 714&vop_mmu { 715 status = "okay"; 716}; 717