1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2022 Rockchip Electronics Co., Ltd. 4 * 5 */ 6 7/dts-v1/; 8#include "rk3368.dtsi" 9#include "rk3368-android.dtsi" 10#include <dt-bindings/input/input.h> 11 12/ { 13 model = "Rockchip R88"; 14 compatible = "rockchip,r88", "rockchip,rk3368"; 15 16 hdmi_sound: hdmi-sound { 17 status = "okay"; 18 compatible = "simple-audio-card"; 19 simple-audio-card,format = "i2s"; 20 simple-audio-card,mclk-fs = <256>; 21 simple-audio-card,name = "rockchip,hdmi"; 22 simple-audio-card,cpu { 23 sound-dai = <&i2s_8ch>; 24 }; 25 simple-audio-card,codec { 26 sound-dai = <&hdmi>; 27 }; 28 }; 29 30 keys: gpio-keys { 31 compatible = "gpio-keys"; 32 #address-cells = <1>; 33 #size-cells = <0>; 34 pinctrl-names = "default"; 35 pinctrl-0 = <&pwr_key>; 36 37 button@0 { 38 gpio-key,wakeup = <1>; 39 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; 40 label = "GPIO Power"; 41 linux,code = <116>; 42 }; 43 }; 44 45 leds: gpio-leds { 46 compatible = "gpio-leds"; 47 48 work { 49 gpios = <&gpio3 29 GPIO_ACTIVE_HIGH>; 50 label = "r88:green:led"; 51 pinctrl-names = "default"; 52 pinctrl-0 = <&led_ctl>; 53 }; 54 }; 55 56 ir: ir-receiver { 57 compatible = "gpio-ir-receiver"; 58 gpios = <&gpio3 30 GPIO_ACTIVE_LOW>; 59 pinctrl-names = "default"; 60 pinctrl-0 = <&ir_int>; 61 }; 62 63 vcc_sys: vcc-sys { 64 compatible = "regulator-fixed"; 65 regulator-name = "vcc_sys"; 66 regulator-always-on; 67 regulator-boot-on; 68 regulator-min-microvolt = <3800000>; 69 regulator-max-microvolt = <3800000>; 70 }; 71 72 vcc_host: vcc-host { 73 compatible = "regulator-fixed"; 74 enable-active-high; 75 gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>; 76 pinctrl-names = "default"; 77 pinctrl-0 = <&host_vbus_drv>; 78 regulator-name = "vcc_host"; 79 regulator-always-on; 80 }; 81 82 vcc_phy: vcc-phy-regulator { 83 compatible = "regulator-fixed"; 84 regulator-name = "vcc_phy"; 85 regulator-always-on; 86 regulator-boot-on; 87 }; 88 89 regulators { 90 compatible = "simple-bus"; 91 #address-cells = <1>; 92 #size-cells = <0>; 93 94 vccio_1v8_reg: regulator@0 { 95 compatible = "regulator-fixed"; 96 regulator-name = "vccio_1v8"; 97 regulator-min-microvolt = <1800000>; 98 regulator-max-microvolt = <1800000>; 99 regulator-always-on; 100 }; 101 102 vccio_3v3_reg: regulator@1 { 103 compatible = "regulator-fixed"; 104 regulator-name = "vccio_3v3"; 105 regulator-min-microvolt = <3300000>; 106 regulator-max-microvolt = <3300000>; 107 regulator-always-on; 108 }; 109 }; 110 111 vdd_gpu: vdd-arm-regulator { 112 compatible = "pwm-regulator"; 113 rockchip,pwm_id = <1>; 114 rockchip,pwm_voltage = <1100000>; 115 pwms = <&pwm1 0 25000 1>; 116 regulator-name = "vdd_gpu"; 117 regulator-min-microvolt = <950000>; 118 regulator-max-microvolt = <1400000>; 119 regulator-always-on; 120 regulator-boot-on; 121 }; 122 123 clkin_gmac: external-gmac-clock { 124 compatible = "fixed-clock"; 125 clock-frequency = <125000000>; 126 clock-output-names = "clkin_gmac"; 127 #clock-cells = <0>; 128 }; 129 130 wireless-wlan { 131 compatible = "wlan-platdata"; 132 rockchip,grf = <&grf>; 133 wifi_chip_type = "rtl8189es"; 134 sdio_vref = <1800>; 135 WIFI,host_wake_irq = <&gpio3 6 GPIO_ACTIVE_HIGH>; 136 status = "okay"; 137 }; 138 139 wireless-bluetooth { 140 compatible = "bluetooth-platdata"; 141 //clocks = <&rk808 1>; 142 //clock-names = "ext_clock"; 143 /* wifi-bt-power-toggle; */ 144 uart_rts_gpios = <&gpio2 27 GPIO_ACTIVE_LOW>; 145 pinctrl-names = "default", "rts_gpio"; 146 pinctrl-0 = <&uart0_rts>; 147 pinctrl-1 = <&uart0_gpios>; 148 /* BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; */ 149 BT,reset_gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; 150 BT,wake_gpio = <&gpio3 2 GPIO_ACTIVE_HIGH>; 151 BT,wake_host_irq = <&gpio3 7 GPIO_ACTIVE_HIGH>; 152 status = "okay"; 153 }; 154}; 155 156&firmware_android { 157 compatible = "android,firmware"; 158 fstab { 159 compatible = "android,fstab"; 160 system { 161 compatible = "android,system"; 162 dev = "/dev/block/by-name/system"; 163 type = "ext4"; 164 mnt_flags = "ro,barrier=1,inode_readahead_blks=8"; 165 fsmgr_flags = "wait,verify"; 166 }; 167 vendor { 168 compatible = "android,vendor"; 169 dev = "/dev/block/by-name/vendor"; 170 type = "ext4"; 171 mnt_flags = "ro,barrier=1,inode_readahead_blks=8"; 172 fsmgr_flags = "wait,verify"; 173 }; 174 }; 175}; 176 177&i2s_8ch { 178 status = "okay"; 179 rockchip,i2s-broken-burst-len; 180 rockchip,playback-channels = <8>; 181 rockchip,capture-channels = <2>; 182 #sound-dai-cells = <0>; 183}; 184 185&emmc { 186 status = "okay"; 187 bus-width = <8>; 188 cap-mmc-highspeed; 189 mmc-hs200-1_8v; 190 no-sdio; 191 no-sd; 192 disable-wp; 193 non-removable; 194 num-slots = <1>; 195 pinctrl-names = "default"; 196 pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; 197}; 198 199&sdmmc { 200 status = "disabled"; 201 clock-frequency = <37500000>; 202 clock-freq-min-max = <400000 37500000>; 203 no-sdio; 204 no-mmc; 205 cap-mmc-highspeed; 206 cap-sd-highspeed; 207 card-detect-delay = <200>; 208 disable-wp; 209 num-slots = <1>; 210 pinctrl-names = "default"; 211 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; 212}; 213 214&gmac { 215 phy-supply = <&vcc_phy>; 216 phy-mode = "rmii"; 217 clock_in_out = "output"; 218 snps,reset-gpio = <&gpio3 12 0>; 219 snps,reset-active-low; 220 snps,reset-delays-us = <0 50000 50000>; 221 //assigned-clocks = <&cru SCLK_RMII_SRC>; 222 //assigned-clock-parents = <&clkin_gmac>; 223 pinctrl-names = "default"; 224 pinctrl-0 = <&rmii_pins>; 225 tx_delay = <0x30>; 226 rx_delay = <0x10>; 227 status = "ok"; 228}; 229 230&pwm1 { 231 status = "okay"; 232 pinctrl-names = "active"; 233 pinctrl-0 = <&pwm1_pin_pull_down>; 234}; 235 236&i2c0 { 237 status = "okay"; 238 clock-frequency = <100000>; 239 240 vdd_cpu: syr827@40 { 241 compatible = "silergy,syr827"; 242 reg = <0x40>; 243 status = "okay"; 244 vin-supply = <&vcc_sys>; 245 regulator-compatible = "fan53555-reg"; 246 pinctrl-names = "default"; 247 pinctrl-0 = <&vsel1_gpio>; 248 vsel-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; 249 regulator-name = "vdd_cpu"; 250 regulator-min-microvolt = <712500>; 251 regulator-max-microvolt = <1500000>; 252 regulator-ramp-delay = <1000>; 253 fcs,suspend-voltage-selector = <1>; 254 regulator-always-on; 255 regulator-boot-on; 256 regulator-initial-state = <3>; 257 regulator-state-mem { 258 regulator-off-in-suspend; 259 }; 260 }; 261 262/* xz3215: xz3215@40 { 263 compatible = "xz3216"; 264 reg = <0x40>; 265 status = "disabled"; 266 pinctrl-names = "default"; 267 pinctrl-0 = <&vsel1_gpio>; 268 vsel-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; 269 regulators { 270 #address-cells = <1>; 271 #size-cells = <0>; 272 vdd_cpu: regulator@0 { 273 reg = <0>; 274 regulator-compatible = "xz_dcdc1"; 275 regulator-name = "vdd_cpu"; 276 regulator-min-microvolt = <603000>; 277 regulator-max-microvolt = <1400000>; 278 regulator-ramp-delay = <1000>; 279 regulator-always-on; 280 regulator-boot-on; 281 fcs,suspend-voltage-selector = <1>; 282 //regulator-initial-mode = <0x1>; 283 regulator-initial-state = <3>; 284 regulator-state-mem { 285 regulator-off-in-suspend; 286 }; 287 }; 288 }; 289 }; 290*/ 291 292 hym8563: hym8563@51 { 293 compatible = "haoyu,hym8563"; 294 reg = <0x51>; 295 #clock-cells = <0>; 296 clock-frequency = <32768>; 297 clock-output-names = "xin32k"; 298 /* rtc_int is not connected */ 299 }; 300}; 301 302&io_domains { 303 status = "ok"; 304 305 dvp-supply = <&vccio_1v8_reg>; /* DVPIO_VDD */ 306 /*flash0-supply = <&vcc18_flash>;*/ /* FLASH0_VDD (emmc) */ 307 sdcard-supply = <&vccio_3v3_reg>; /* SDMMC0_VDD (sdmmc) */ 308 309 audio-supply = <&vccio_3v3_reg>; /* APIO3_VDD */ 310 gpio30-supply = <&vccio_3v3_reg>; /* APIO1_VDD */ 311 gpio1830-supply = <&vccio_3v3_reg>; /* APIO4_VDD (gpujtag) */ 312 wifi-supply = <&vccio_3v3_reg>; /* APIO2_VDD (sdio0) */ 313}; 314 315&sdio0 { 316 bus-width = <4>; 317 cap-sd-highspeed; 318 cap-sdio-irq; 319 keep-power-in-suspend; 320 max-frequency = <100000000>; 321 non-removable; 322 num-slots = <1>; 323 pinctrl-names = "default"; 324 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; 325 sd-uhs-sdr104; 326 no-sd; 327 no-mmc; 328 status = "okay"; 329}; 330 331&pinctrl { 332 pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma { 333 bias-disable; 334 drive-strength = <8>; 335 }; 336 337 pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma { 338 bias-pull-up; 339 drive-strength = <8>; 340 }; 341 342 pmic { 343 pmic_int: pmic-int { 344 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; 345 }; 346 347 vsel1_gpio:vsel1_gpio{ 348 rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>; 349 }; 350 }; 351 352 emmc { 353 emmc_bus8: emmc-bus8 { 354 rockchip,pins = <1 RK_PC2 2 &pcfg_pull_up_drv_8ma>, 355 <1 RK_PC3 2 &pcfg_pull_up_drv_8ma>, 356 <1 RK_PC4 2 &pcfg_pull_up_drv_8ma>, 357 <1 RK_PC5 2 &pcfg_pull_up_drv_8ma>, 358 <1 RK_PC6 2 &pcfg_pull_up_drv_8ma>, 359 <1 RK_PC7 2 &pcfg_pull_up_drv_8ma>, 360 <1 RK_PD0 2 &pcfg_pull_up_drv_8ma>, 361 <1 RK_PD1 2 &pcfg_pull_up_drv_8ma>; 362 }; 363 364 emmc-clk { 365 rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none_drv_8ma>; 366 }; 367 368 emmc-cmd { 369 rockchip,pins = <1 RK_PD2 2 &pcfg_pull_up_drv_8ma>; 370 }; 371 372 emmc_reset: emmc-reset { 373 rockchip,pins = <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; 374 }; 375 }; 376 377 ir { 378 ir_int: ir-int { 379 rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>; 380 }; 381 }; 382 383 keys { 384 pwr_key: pwr-key { 385 rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; 386 }; 387 }; 388 389 leds { 390 stby_pwren: stby-pwren { 391 rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; 392 }; 393 394 led_ctl: led-ctl { 395 rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; 396 }; 397 }; 398 399 sdio-pwrseq { 400 wifi_enable_h: wifi-enable-h { 401 rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; 402 }; 403 }; 404 405 wireless-bluetooth { 406 uart0_gpios: uart0-gpios { 407 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; 408 }; 409 }; 410 411 usb { 412 host_vbus_drv: host-vbus-drv { 413 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; 414 }; 415 }; 416}; 417 418&pmu_io_domains { 419 status = "okay"; 420 421 pmu-supply = <&vccio_3v3_reg>; 422 vop-supply = <&vccio_3v3_reg>; 423}; 424 425&saradc { 426 vref-supply = <&vccio_1v8_reg>; 427 status = "okay"; 428}; 429 430&uart2 { 431 status = "okay"; 432}; 433 434&usb_host0_ehci { 435 status = "okay"; 436}; 437 438&usb_host0_ohci { 439 status = "okay"; 440}; 441 442&usb_otg { 443 dr_mode = "device"; 444 status = "okay"; 445}; 446 447&u2phy { 448 status = "okay"; 449}; 450 451&u2phy_host { 452 status = "okay"; 453}; 454 455&wdt { 456 status = "okay"; 457}; 458 459&route_hdmi { 460 status = "okay"; 461}; 462 463&hdmi { 464 status = "okay"; 465 #sound-dai-cells = <0>; 466}; 467 468&mailbox { 469 status = "okay"; 470}; 471 472&mailbox_scpi { 473 status = "okay"; 474}; 475 476&tsadc { 477 tsadc-supply = <&vdd_cpu>; 478 status = "okay"; 479}; 480 481&cpu_l0 { 482 cpu-supply = <&vdd_cpu>; 483}; 484 485&cpu_l1 { 486 cpu-supply = <&vdd_cpu>; 487}; 488 489&cpu_l2 { 490 cpu-supply = <&vdd_cpu>; 491}; 492 493&cpu_l3 { 494 cpu-supply = <&vdd_cpu>; 495}; 496 497&cpu_b0 { 498 cpu-supply = <&vdd_cpu>; 499}; 500 501&cpu_b1 { 502 cpu-supply = <&vdd_cpu>; 503}; 504 505&cpu_b2 { 506 cpu-supply = <&vdd_cpu>; 507}; 508 509&cpu_b3 { 510 cpu-supply = <&vdd_cpu>; 511}; 512 513&gpu { 514 logic-supply = <&vdd_gpu>; 515}; 516 517&rockchip_suspend { 518 status = "okay"; 519 rockchip,sleep-mode-config = < 520 (0 521 | RKPM_SLP_ARMOFF 522 | RKPM_SLP_PMU_PLLS_PWRDN 523 | RKPM_SLP_PMU_PMUALIVE_32K 524 | RKPM_SLP_SFT_PLLS_DEEP 525 | RKPM_SLP_PMU_DIS_OSC 526 | RKPM_SLP_SFT_PD_NBSCUS 527 ) 528 >; 529 rockchip,wakeup-config = < 530 (0 531 | RKPM_GPIO_WKUP_EN 532 | RKPM_USB_WKUP_EN 533 | RKPM_CLUSTER_L_WKUP_EN 534 ) 535 >; 536}; 537 538&pwm3 { 539 status = "okay"; 540 541 interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; 542 compatible = "rockchip,remotectl-pwm"; 543 remote_pwm_id = <3>; 544 handle_cpu_id = <1>; 545 546 ir_key1 { 547 rockchip,usercode = <0x4040>; 548 rockchip,key_table = 549 <0xf2 KEY_REPLY>, 550 <0xba KEY_BACK>, 551 <0xf4 KEY_UP>, 552 <0xf1 KEY_DOWN>, 553 <0xef KEY_LEFT>, 554 <0xee KEY_RIGHT>, 555 <0xbd KEY_HOME>, 556 <0xea KEY_VOLUMEUP>, 557 <0xe3 KEY_VOLUMEDOWN>, 558 <0xe2 KEY_SEARCH>, 559 <0xb2 KEY_POWER>, 560 <0xbc KEY_MUTE>, 561 <0xec KEY_MENU>, 562 <0xbf 0x190>, 563 <0xe0 0x191>, 564 <0xe1 0x192>, 565 <0xe9 183>, 566 <0xe6 248>, 567 <0xe8 185>, 568 <0xe7 186>, 569 <0xf0 388>, 570 <0xbe 0x175>; 571 }; 572 573 ir_key2 { 574 rockchip,usercode = <0xff00>; 575 rockchip,key_table = 576 <0xf9 KEY_HOME>, 577 <0xbf KEY_BACK>, 578 <0xfb KEY_MENU>, 579 <0xaa KEY_REPLY>, 580 <0xb9 KEY_UP>, 581 <0xe9 KEY_DOWN>, 582 <0xb8 KEY_LEFT>, 583 <0xea KEY_RIGHT>, 584 <0xeb KEY_VOLUMEDOWN>, 585 <0xef KEY_VOLUMEUP>, 586 <0xf7 KEY_MUTE>, 587 <0xe7 KEY_POWER>, 588 <0xfc KEY_POWER>, 589 <0xa9 KEY_VOLUMEDOWN>, 590 <0xa8 KEY_VOLUMEDOWN>, 591 <0xe0 KEY_VOLUMEDOWN>, 592 <0xa5 KEY_VOLUMEDOWN>, 593 <0xab 183>, 594 <0xb7 388>, 595 <0xe8 388>, 596 <0xf8 184>, 597 <0xaf 185>, 598 <0xed KEY_VOLUMEDOWN>, 599 <0xee 186>, 600 <0xb3 KEY_VOLUMEDOWN>, 601 <0xb3 KEY_VOLUMEDOWN>, 602 <0xf1 KEY_VOLUMEDOWN>, 603 <0xf2 KEY_VOLUMEDOWN>, 604 <0xf3 KEY_SEARCH>, 605 <0xb4 KEY_VOLUMEDOWN>, 606 <0xbe KEY_SEARCH>; 607 }; 608 609 ir_key3 { 610 rockchip,usercode = <0x1dcc>; 611 rockchip,key_table = 612 <0xee KEY_REPLY>, 613 <0xf0 KEY_BACK>, 614 <0xf8 KEY_UP>, 615 <0xbb KEY_DOWN>, 616 <0xef KEY_LEFT>, 617 <0xed KEY_RIGHT>, 618 <0xfc KEY_HOME>, 619 <0xf1 KEY_VOLUMEUP>, 620 <0xfd KEY_VOLUMEDOWN>, 621 <0xb7 KEY_SEARCH>, 622 <0xff KEY_POWER>, 623 <0xf3 KEY_MUTE>, 624 <0xbf KEY_MENU>, 625 <0xf9 0x191>, 626 <0xf5 0x192>, 627 <0xb3 388>, 628 <0xbe KEY_1>, 629 <0xba KEY_2>, 630 <0xb2 KEY_3>, 631 <0xbd KEY_4>, 632 <0xf9 KEY_5>, 633 <0xb1 KEY_6>, 634 <0xfc KEY_7>, 635 <0xf8 KEY_8>, 636 <0xb0 KEY_9>, 637 <0xb6 KEY_0>, 638 <0xb5 KEY_BACKSPACE>; 639 }; 640}; 641