1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd 4 */ 5 6#include "rk322x.dtsi" 7#include "rk3229-cpu-opp.dtsi" 8#include "rk322x-android.dtsi" 9#include <dt-bindings/input/input.h> 10 11/ { 12 gpio_keys { 13 compatible = "gpio-keys"; 14 #address-cells = <1>; 15 #size-cells = <0>; 16 autorepeat; 17 18 pinctrl-names = "default"; 19 pinctrl-0 = <&pwr_key>; 20 21 power_key: power-key { 22 label = "GPIO Key Power"; 23 gpios = <&gpio3 23 GPIO_ACTIVE_LOW>; 24 linux,code = <KEY_POWER>; 25 debounce-interval = <100>; 26 wakeup-source; 27 }; 28 }; 29 30 sound { 31 compatible = "simple-audio-card"; 32 simple-audio-card,format = "i2s"; 33 simple-audio-card,mclk-fs = <256>; 34 simple-audio-card,name = "rockchip,rk3229"; 35 simple-audio-card,cpu { 36 sound-dai = <&i2s1>; 37 }; 38 simple-audio-card,codec { 39 sound-dai = <&codec>; 40 }; 41 }; 42 43 hdmi_sound: hdmi-sound { 44 status = "okay"; 45 compatible = "simple-audio-card"; 46 simple-audio-card,format = "i2s"; 47 simple-audio-card,mclk-fs = <128>; 48 simple-audio-card,name = "rockchip,hdmi"; 49 simple-audio-card,cpu { 50 sound-dai = <&i2s0>; 51 }; 52 simple-audio-card,codec { 53 sound-dai = <&hdmi>; 54 }; 55 }; 56 57 regulators { 58 compatible = "simple-bus"; 59 #address-cells = <1>; 60 #size-cells = <0>; 61 62 vccio_1v8_reg: regulator@0 { 63 compatible = "regulator-fixed"; 64 regulator-name = "vccio_1v8"; 65 regulator-min-microvolt = <1800000>; 66 regulator-max-microvolt = <1800000>; 67 regulator-always-on; 68 }; 69 70 vccio_3v3_reg: regulator@1 { 71 compatible = "regulator-fixed"; 72 regulator-name = "vccio_3v3"; 73 regulator-min-microvolt = <3300000>; 74 regulator-max-microvolt = <3300000>; 75 regulator-always-on; 76 }; 77 }; 78 79 sdio_pwrseq: sdio-pwrseq { 80 compatible = "mmc-pwrseq-simple"; 81 clocks = <&hym8563>; 82 clock-names = "ext_clock"; 83 pinctrl-names = "default"; 84 pinctrl-0 = <&wifi_enable_h>; 85 86 /* 87 * On the module itself this is one of these (depending 88 * on the actual card populated): 89 * - SDIO_RESET_L_WL_REG_ON 90 * - PDN (power down when low) 91 */ 92 reset-gpios = <&gpio2 26 GPIO_ACTIVE_LOW>; /* GPIO2_D2 */ 93 }; 94 95 spdif_out: spdif-out { 96 status = "okay"; 97 compatible = "linux,spdif-dit"; 98 #sound-dai-cells = <0>; 99 }; 100 101 spdif-sound { 102 status = "okay"; 103 compatible = "simple-audio-card"; 104 simple-audio-card,name = "ROCKCHIP,SPDIF"; 105 simple-audio-card,mclk-fs = <128>; 106 simple-audio-card,cpu { 107 sound-dai = <&spdif>; 108 }; 109 simple-audio-card,codec { 110 sound-dai = <&spdif_out>; 111 }; 112 }; 113 114 vcc_host: vcc-host-regulator { 115 compatible = "regulator-fixed"; 116 enable-active-high; 117 gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>; 118 pinctrl-names = "default"; 119 pinctrl-0 = <&host_vbus_drv>; 120 regulator-name = "vcc_host"; 121 regulator-always-on; 122 regulator-boot-on; 123 }; 124 125 vcc_otg_vbus: otg-vbus-regulator { 126 compatible = "regulator-fixed"; 127 gpio = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; 128 pinctrl-names = "default"; 129 pinctrl-0 = <&otg_vbus_drv>; 130 regulator-name = "vcc_otg_vbus"; 131 regulator-min-microvolt = <5000000>; 132 regulator-max-microvolt = <5000000>; 133 enable-active-high; 134 }; 135 136 vcc_phy: vcc-phy-regulator { 137 compatible = "regulator-fixed"; 138 enable-active-high; 139 regulator-name = "vcc_phy"; 140 regulator-min-microvolt = <1800000>; 141 regulator-max-microvolt = <1800000>; 142 regulator-always-on; 143 regulator-boot-on; 144 }; 145 146 vdd_arm: vdd-arm-regulator { 147 compatible = "pwm-regulator"; 148 rockchip,pwm_id = <1>; 149 rockchip,pwm_voltage = <1100000>; 150 pwms = <&pwm1 0 5000 1>; 151 regulator-name = "vdd_arm"; 152 regulator-min-microvolt = <950000>; 153 regulator-max-microvolt = <1400000>; 154 regulator-settling-time-up-us = <250>; 155 regulator-always-on; 156 regulator-boot-on; 157 }; 158 159 vdd_log: vdd-log-regulator { 160 compatible = "pwm-regulator"; 161 rockchip,pwm_id = <2>; 162 rockchip,pwm_voltage = <1200000>; 163 pwms = <&pwm2 0 5000 1>; 164 regulator-name = "vdd_log"; 165 regulator-min-microvolt = <1000000>; 166 regulator-max-microvolt = <1300000>; 167 regulator-settling-time-up-us = <250>; 168 regulator-always-on; 169 regulator-boot-on; 170 }; 171 172 wireless-bluetooth { 173 compatible = "bluetooth-platdata"; 174 clocks = <&hym8563>; 175 clock-names = "ext_clock"; 176 uart_rts_gpios = <&gpio3 6 GPIO_ACTIVE_LOW>; 177 pinctrl-names = "default", "rts_gpio"; 178 pinctrl-0 = <&uart11_rts>; 179 pinctrl-1 = <&uart11_rts_gpio>; 180 BT,power_gpio = <&gpio2 29 GPIO_ACTIVE_HIGH>; 181 BT,wake_host_irq = <&gpio3 26 GPIO_ACTIVE_HIGH>; 182 status = "okay"; 183 }; 184 185 wireless-wlan { 186 compatible = "wlan-platdata"; 187 rockchip,grf = <&grf>; 188 wifi_chip_type = "ap6335"; 189 sdio_vref = <1800>; 190 WIFI,host_wake_irq = <&gpio0 28 GPIO_ACTIVE_HIGH>; 191 status = "okay"; 192 }; 193}; 194 195&codec { 196 #sound-dai-cells = <0>; 197 status = "okay"; 198}; 199 200&cpu0 { 201 cpu-supply = <&vdd_arm>; 202}; 203 204&display_subsystem { 205 logo-memory-region = <&drm_logo>; 206 status = "okay"; 207 secure-memory-region = <&secure_memory>; 208 route { 209 route_hdmi: route-hdmi { 210 status = "okay"; 211 logo,uboot = "logo.bmp"; 212 logo,kernel = "logo_kernel.bmp"; 213 logo,mode = "center"; 214 charge_logo,mode = "center"; 215 connect = <&vop_out_hdmi>; 216 }; 217 218 route_tve: route-tve { 219 status = "okay"; 220 logo,uboot = "logo.bmp"; 221 logo,kernel = "logo_kernel.bmp"; 222 logo,mode = "center"; 223 charge_logo,mode = "center"; 224 connect = <&vop_out_tve>; 225 }; 226 }; 227}; 228 229&dmc { 230 center-supply = <&vdd_log>; 231 status = "okay"; 232}; 233 234&gmac { 235 assigned-clocks = <&cru SCLK_MAC_SRC>; 236 assigned-clock-rates = <50000000>; 237 clock_in_out = "output"; 238 phy-supply = <&vcc_phy>; 239 phy-mode = "rmii"; 240 phy-handle = <&phy>; 241 status = "okay"; 242 243 mdio { 244 compatible = "snps,dwmac-mdio"; 245 #address-cells = <1>; 246 #size-cells = <0>; 247 248 phy: phy@0 { 249 compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22"; 250 reg = <0>; 251 clocks = <&cru SCLK_MAC_PHY>; 252 resets = <&cru SRST_MACPHY>; 253 phy-is-integrated; 254 }; 255 }; 256}; 257 258&gpu { 259 status = "okay"; 260 mali-supply = <&vdd_log>; 261}; 262 263&hdmi { 264 status = "okay"; 265 #sound-dai-cells = <0>; 266 ddc-i2c-scl-high-time-ns = <9625>; 267 ddc-i2c-scl-low-time-ns = <10000>; 268}; 269 270&io_domains { 271 status = "okay"; 272 273 vccio1-supply = <&vccio_3v3_reg>; 274 vccio2-supply = <&vccio_1v8_reg>; 275 vccio4-supply = <&vccio_3v3_reg>; 276}; 277 278&secure_memory { 279 /* 280 * enable like this: 281 * reg = <0x80000000 0x10000000>; 282 */ 283 reg = <0x80000000 0x0>; 284}; 285 286&i2c0 { 287 status = "okay"; 288 289 hym8563: hym8563@51 { 290 compatible = "haoyu,hym8563"; 291 reg = <0x51>; 292 #clock-cells = <0>; 293 clock-frequency = <32768>; 294 clock-output-names = "xin32k"; 295 }; 296}; 297 298&i2s0 { 299 status = "okay"; 300 rockchip,bclk-fs = <128>; 301 #sound-dai-cells = <0>; 302}; 303 304&i2s1 { 305 #sound-dai-cells = <0>; 306 status = "okay"; 307}; 308 309&iep { 310 status = "okay"; 311}; 312 313&iep_mmu { 314 status = "okay"; 315}; 316 317&mpp_srv { 318 status = "okay"; 319}; 320 321&nandc { 322 status = "okay"; 323}; 324 325&pinctrl { 326 keys { 327 pwr_key: pwr-key { 328 rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>; 329 }; 330 }; 331 332 sdmmc { 333 sdmmc_pwr: sdmmc-pwr { 334 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; 335 }; 336 }; 337 338 sdio-pwrseq { 339 wifi_enable_h: wifi-enable-h { 340 rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 341 }; 342 }; 343 344 usb { 345 host_vbus_drv: host-vbus-drv { 346 rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; 347 }; 348 349 otg_vbus_drv: otg-vbus-drv { 350 rockchip,pins = <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; 351 }; 352 }; 353}; 354 355&pwm1 { 356 status = "okay"; 357 pinctrl-names = "active"; 358 pinctrl-0 = <&pwm1_pin_pull_down>; 359}; 360 361&pwm2 { 362 status = "okay"; 363 pinctrl-names = "active"; 364 pinctrl-0 = <&pwm2_pin_pull_up>; 365}; 366 367&pwm3 { 368 status = "okay"; 369 pinctrl-names = "default"; 370 pinctrl-0 = <&pwm3_pin>; 371 compatible = "rockchip,remotectl-pwm"; 372 remote_pwm_id = <3>; 373 handle_cpu_id = <1>; 374 remote_support_psci = <1>; 375 376 ir_key1 { 377 rockchip,usercode = <0x4040>; 378 rockchip,key_table = 379 <0xf2 KEY_REPLY>, 380 <0xba KEY_BACK>, 381 <0xf4 KEY_UP>, 382 <0xf1 KEY_DOWN>, 383 <0xef KEY_LEFT>, 384 <0xee KEY_RIGHT>, 385 <0xbd KEY_HOME>, 386 <0xea KEY_VOLUMEUP>, 387 <0xe3 KEY_VOLUMEDOWN>, 388 <0xe2 KEY_SEARCH>, 389 <0xb2 KEY_POWER>, 390 <0xbc KEY_MUTE>, 391 <0xec KEY_MENU>, 392 <0xbf 0x190>, 393 <0xe0 0x191>, 394 <0xe1 0x192>, 395 <0xe9 183>, 396 <0xe6 248>, 397 <0xe8 185>, 398 <0xe7 186>, 399 <0xf0 388>, 400 <0xbe 0x175>; 401 }; 402 403 ir_key2 { 404 rockchip,usercode = <0xff00>; 405 rockchip,key_table = 406 <0xf9 KEY_HOME>, 407 <0xbf KEY_BACK>, 408 <0xfb KEY_MENU>, 409 <0xaa KEY_REPLY>, 410 <0xb9 KEY_UP>, 411 <0xe9 KEY_DOWN>, 412 <0xb8 KEY_LEFT>, 413 <0xea KEY_RIGHT>, 414 <0xeb KEY_VOLUMEDOWN>, 415 <0xef KEY_VOLUMEUP>, 416 <0xf7 KEY_MUTE>, 417 <0xe7 KEY_POWER>, 418 <0xfc KEY_POWER>, 419 <0xa9 KEY_VOLUMEDOWN>, 420 <0xa8 KEY_PLAYPAUSE>, 421 <0xe0 KEY_VOLUMEDOWN>, 422 <0xa5 KEY_VOLUMEDOWN>, 423 <0xab 183>, 424 <0xb7 388>, 425 <0xe8 388>, 426 <0xf8 184>, 427 <0xaf 185>, 428 <0xed KEY_VOLUMEDOWN>, 429 <0xee 186>, 430 <0xb3 KEY_VOLUMEDOWN>, 431 <0xf1 KEY_VOLUMEDOWN>, 432 <0xf2 KEY_VOLUMEDOWN>, 433 <0xf3 KEY_SEARCH>, 434 <0xb4 KEY_VOLUMEDOWN>, 435 <0xa4 KEY_SETUP>, 436 <0xbe KEY_SEARCH>; 437 }; 438 439 ir_key3 { 440 rockchip,usercode = <0x1dcc>; 441 rockchip,key_table = 442 <0xee KEY_REPLY>, 443 <0xf0 KEY_BACK>, 444 <0xf8 KEY_UP>, 445 <0xbb KEY_DOWN>, 446 <0xef KEY_LEFT>, 447 <0xed KEY_RIGHT>, 448 <0xfc KEY_HOME>, 449 <0xf1 KEY_VOLUMEUP>, 450 <0xfd KEY_VOLUMEDOWN>, 451 <0xb7 KEY_SEARCH>, 452 <0xff KEY_POWER>, 453 <0xf3 KEY_MUTE>, 454 <0xbf KEY_MENU>, 455 <0xf9 0x191>, 456 <0xf5 0x192>, 457 <0xb3 388>, 458 <0xbe KEY_1>, 459 <0xba KEY_2>, 460 <0xb2 KEY_3>, 461 <0xbd KEY_4>, 462 <0xf9 KEY_5>, 463 <0xb1 KEY_6>, 464 <0xfc KEY_7>, 465 <0xf8 KEY_8>, 466 <0xb0 KEY_9>, 467 <0xb6 KEY_0>, 468 <0xb5 KEY_BACKSPACE>; 469 }; 470}; 471 472&rockchip_suspend { 473 status = "okay"; 474 rockchip,virtual-poweroff = <1>; 475 rockchip,sleep-mode-config = < 476 (0 477 |RKPM_CTR_GTCLKS 478 |RKPM_CTR_IDLESRAM_MD 479 |RKPM_CTR_PMIC 480 ) 481 >; 482}; 483 484&sdio { 485 status = "okay"; 486 mmc-pwrseq = <&sdio_pwrseq>; 487}; 488 489&sdmmc { 490 status = "okay"; 491 pinctrl-names = "default"; 492 pinctrl-0 = <&sdmmc_pwr &sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; 493}; 494 495&spdif { 496 status = "okay"; 497 #sound-dai-cells = <0>; 498}; 499 500&threshold { 501 temperature = <90000>; /* millicelsius */ 502}; 503 504&target { 505 temperature = <105000>; /* millicelsius */ 506}; 507 508&soc_crit { 509 temperature = <115000>; /* millicelsius */ 510}; 511 512&tsadc { 513 rockchip,hw-tshut-temp = <120000>; 514 status = "okay"; 515}; 516 517&tve { 518 status = "okay"; 519}; 520 521&uart1 { 522 pinctrl-names = "default"; 523 pinctrl-0 = <&uart11_xfer &uart11_cts>; 524 status = "okay"; 525}; 526 527&u2phy0_host { 528 phy-supply = <&vcc_host>; 529}; 530 531&u2phy1_host { 532 phy-supply = <&vcc_host>; 533}; 534 535&u2phy0_otg { 536 vbus-supply = <&vcc_otg_vbus>; 537}; 538 539&usb_host0_ehci { 540 status = "okay"; 541}; 542 543&usb_host0_ohci { 544 status = "okay"; 545}; 546 547&usb_host1_ehci { 548 status = "okay"; 549}; 550 551&usb_host1_ohci { 552 status = "okay"; 553}; 554 555&usb_host2_ehci { 556 status = "okay"; 557}; 558 559&usb_host2_ohci { 560 status = "okay"; 561}; 562 563&vdpu { 564 status = "okay"; 565}; 566 567&vepu { 568 status = "okay"; 569}; 570 571&vpu_mmu { 572 status = "okay"; 573}; 574 575&rkvdec { 576 vcodec-supply = <&vdd_log>; 577 status = "okay"; 578}; 579 580&rkvdec_mmu { 581 status = "okay"; 582}; 583 584&rk_rga { 585 status = "okay"; 586}; 587