1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2022 Rockchip Electronics Co., Ltd. 4 * 5 */ 6 7#include <dt-bindings/input/input.h> 8#include <dt-bindings/pwm/pwm.h> 9#include "rk3399.dtsi" 10#include "rk3399-opp.dtsi" 11 12/ { 13 compatible = "rockchip,rk3399-evb", "rockchip,rk3399"; 14 15 adc_keys: adc-keys { 16 compatible = "adc-keys"; 17 io-channels = <&saradc 1>; 18 io-channel-names = "buttons"; 19 keyup-threshold-microvolt = <1800000>; 20 poll-interval = <100>; 21 22 vol-up-key { 23 label = "volume up"; 24 linux,code = <KEY_VOLUMEUP>; 25 press-threshold-microvolt = <1750>; 26 }; 27 28 vol-down-key { 29 label = "volume down"; 30 linux,code = <KEY_VOLUMEDOWN>; 31 press-threshold-microvolt = <297500>; 32 }; 33 34 menu-key { 35 label = "menu"; 36 linux,code = <KEY_MENU>; 37 press-threshold-microvolt = <1305500>; 38 }; 39 40 home-key { 41 label = "home"; 42 linux,code = <KEY_HOME>; 43 press-threshold-microvolt = <621250>; 44 }; 45 46 back-key { 47 label = "back"; 48 linux,code = <KEY_BACK>; 49 press-threshold-microvolt = <980000>; 50 }; 51 52 camera-key { 53 label = "camera"; 54 linux,code = <KEY_CAMERA>; 55 press-threshold-microvolt = <787500>; 56 }; 57 }; 58 59 vcc3v3_sys: vcc3v3-sys { 60 compatible = "regulator-fixed"; 61 regulator-name = "vcc3v3_sys"; 62 regulator-always-on; 63 regulator-boot-on; 64 regulator-min-microvolt = <3300000>; 65 regulator-max-microvolt = <3300000>; 66 }; 67 68 vcc5v0_host: vcc5v0-host-regulator { 69 compatible = "regulator-fixed"; 70 enable-active-high; 71 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>; 72 pinctrl-names = "default"; 73 pinctrl-0 = <&host_vbus_drv>; 74 regulator-name = "vcc5v0_host"; 75 regulator-always-on; 76 }; 77 78 backlight: backlight { 79 compatible = "pwm-backlight"; 80 pwms = <&pwm0 0 25000 0>; 81 brightness-levels = < 82 0 1 2 3 4 5 6 7 83 8 9 10 11 12 13 14 15 84 16 17 18 19 20 21 22 23 85 24 25 26 27 28 29 30 31 86 32 33 34 35 36 37 38 39 87 40 41 42 43 44 45 46 47 88 48 49 50 51 52 53 54 55 89 56 57 58 59 60 61 62 63 90 64 65 66 67 68 69 70 71 91 72 73 74 75 76 77 78 79 92 80 81 82 83 84 85 86 87 93 88 89 90 91 92 93 94 95 94 96 97 98 99 100 101 102 103 95 104 105 106 107 108 109 110 111 96 112 113 114 115 116 117 118 119 97 120 121 122 123 124 125 126 127 98 128 129 130 131 132 133 134 135 99 136 137 138 139 140 141 142 143 100 144 145 146 147 148 149 150 151 101 152 153 154 155 156 157 158 159 102 160 161 162 163 164 165 166 167 103 168 169 170 171 172 173 174 175 104 176 177 178 179 180 181 182 183 105 184 185 186 187 188 189 190 191 106 192 193 194 195 196 197 198 199 107 200 201 202 203 204 205 206 207 108 208 209 210 211 212 213 214 215 109 216 217 218 219 220 221 222 223 110 224 225 226 227 228 229 230 231 111 232 233 234 235 236 237 238 239 112 240 241 242 243 244 245 246 247 113 248 249 250 251 252 253 254 255>; 114 default-brightness-level = <200>; 115 }; 116 117 clkin_gmac: external-gmac-clock { 118 compatible = "fixed-clock"; 119 clock-frequency = <125000000>; 120 clock-output-names = "clkin_gmac"; 121 #clock-cells = <0>; 122 }; 123 124 vcc_phy: vcc-phy-regulator { 125 compatible = "regulator-fixed"; 126 regulator-name = "vcc_phy"; 127 regulator-always-on; 128 regulator-boot-on; 129 }; 130 131 es8316-sound { 132 compatible = "simple-audio-card"; 133 simple-audio-card,format = "i2s"; 134 simple-audio-card,name = "rockchip,es8316-codec"; 135 simple-audio-card,mclk-fs = <256>; 136 simple-audio-card,widgets = 137 "Microphone", "Mic Jack", 138 "Headphone", "Headphone Jack"; 139 simple-audio-card,routing = 140 "Mic Jack", "MICBIAS1", 141 "IN1P", "Mic Jack", 142 "Headphone Jack", "HPOL", 143 "Headphone Jack", "HPOR"; 144 simple-audio-card,cpu { 145 sound-dai = <&i2s0>; 146 }; 147 simple-audio-card,codec { 148 sound-dai = <&es8316>; 149 }; 150 }; 151 152 hdmi_sound: hdmi-sound { 153 status = "disabled"; 154 compatible = "simple-audio-card"; 155 simple-audio-card,format = "i2s"; 156 simple-audio-card,mclk-fs = <256>; 157 simple-audio-card,name = "rockchip,hdmi"; 158 simple-audio-card,cpu { 159 sound-dai = <&i2s2>; 160 }; 161 simple-audio-card,codec { 162 sound-dai = <&dw_hdmi_audio>; 163 }; 164 }; 165 166 dw_hdmi_audio: dw-hdmi-audio { 167 status = "disabled"; 168 compatible = "rockchip,dw-hdmi-audio"; 169 #sound-dai-cells = <0>; 170 }; 171 172 spdif_sound: spdif-sound { 173 status = "disabled"; 174 compatible = "simple-audio-card"; 175 simple-audio-card,name = "ROCKCHIP,SPDIF"; 176 simple-audio-card,mclk-fs = <128>; 177 simple-audio-card,cpu { 178 sound-dai = <&spdif>; 179 }; 180 simple-audio-card,codec { 181 sound-dai = <&spdif_out>; 182 }; 183 }; 184 185 spdif_out: spdif-out { 186 status = "disabled"; 187 compatible = "linux,spdif-dit"; 188 #sound-dai-cells = <0>; 189 }; 190 191 sdio_pwrseq: sdio-pwrseq { 192 compatible = "mmc-pwrseq-simple"; 193 clocks = <&rk808 1>; 194 clock-names = "ext_clock"; 195 pinctrl-names = "default"; 196 pinctrl-0 = <&wifi_enable_h>; 197 198 /* 199 * On the module itself this is one of these (depending 200 * on the actual card populated): 201 * - SDIO_RESET_L_WL_REG_ON 202 * - PDN (power down when low) 203 */ 204 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */ 205 }; 206 207 wireless-wlan { 208 compatible = "wlan-platdata"; 209 rockchip,grf = <&grf>; 210 wifi_chip_type = "ap6354"; 211 sdio_vref = <1800>; 212 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */ 213 WIFI,poweren_gpio = <&gpio0 10 GPIO_ACTIVE_HIGH>; 214 status = "okay"; 215 }; 216 217 wireless-bluetooth { 218 compatible = "bluetooth-platdata"; 219 clocks = <&rk808 1>; 220 clock-names = "ext_clock"; 221 //wifi-bt-power-toggle; 222 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */ 223 pinctrl-names = "default", "rts_gpio"; 224 pinctrl-0 = <&uart0_rts>; 225 pinctrl-1 = <&uart0_gpios>; 226 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */ 227 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */ 228 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */ 229 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */ 230 status = "okay"; 231 }; 232 233 test-power { 234 status = "okay"; 235 }; 236}; 237 238&cpu_l0 { 239 cpu-supply = <&vdd_cpu_l>; 240}; 241 242&cpu_l1 { 243 cpu-supply = <&vdd_cpu_l>; 244}; 245 246&cpu_l2 { 247 cpu-supply = <&vdd_cpu_l>; 248}; 249 250&cpu_l3 { 251 cpu-supply = <&vdd_cpu_l>; 252}; 253 254&cpu_b0 { 255 cpu-supply = <&vdd_cpu_b>; 256}; 257 258&cpu_b1 { 259 cpu-supply = <&vdd_cpu_b>; 260}; 261 262&gpu { 263 status = "okay"; 264 mali-supply = <&vdd_gpu>; 265}; 266 267&sdmmc { 268 clock-frequency = <150000000>; 269 clock-freq-min-max = <400000 150000000>; 270 no-sdio; 271 no-mmc; 272 bus-width = <4>; 273 cap-mmc-highspeed; 274 cap-sd-highspeed; 275 disable-wp; 276 num-slots = <1>; 277 //sd-uhs-sdr104; 278 vqmmc-supply = <&vcc_sd>; 279 pinctrl-names = "default"; 280 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; 281 status = "okay"; 282}; 283 284&sdio0 { 285 clock-frequency = <150000000>; 286 clock-freq-min-max = <200000 150000000>; 287 no-sd; 288 no-mmc; 289 bus-width = <4>; 290 disable-wp; 291 cap-sd-highspeed; 292 cap-sdio-irq; 293 keep-power-in-suspend; 294 mmc-pwrseq = <&sdio_pwrseq>; 295 non-removable; 296 num-slots = <1>; 297 pinctrl-names = "default"; 298 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; 299 sd-uhs-sdr104; 300 status = "okay"; 301}; 302 303&emmc_phy { 304 status = "okay"; 305}; 306 307&dfi { 308 status = "okay"; 309}; 310 311&dmc { 312 status = "okay"; 313 center-supply = <&vdd_center>; 314 upthreshold = <40>; 315 downdifferential = <20>; 316 system-status-freq = < 317 /*system status freq(KHz)*/ 318 SYS_STATUS_NORMAL 800000 319 SYS_STATUS_REBOOT 528000 320 SYS_STATUS_SUSPEND 200000 321 SYS_STATUS_VIDEO_1080P 200000 322 SYS_STATUS_VIDEO_4K 600000 323 SYS_STATUS_VIDEO_4K_10B 800000 324 SYS_STATUS_PERFORMANCE 800000 325 SYS_STATUS_BOOST 400000 326 SYS_STATUS_DUALVIEW 600000 327 SYS_STATUS_ISP 600000 328 >; 329 vop-bw-dmc-freq = < 330 /* min_bw(MB/s) max_bw(MB/s) freq(KHz) */ 331 0 577 200000 332 578 1701 300000 333 1702 99999 400000 334 >; 335 auto-min-freq = <200000>; 336}; 337 338&sdhci { 339 bus-width = <8>; 340 mmc-hs400-1_8v; 341 no-sdio; 342 no-sd; 343 non-removable; 344 keep-power-in-suspend; 345 mmc-hs400-enhanced-strobe; 346 status = "okay"; 347}; 348 349&i2s0 { 350 status = "okay"; 351 rockchip,i2s-broken-burst-len; 352 rockchip,playback-channels = <8>; 353 rockchip,capture-channels = <8>; 354 #sound-dai-cells = <0>; 355}; 356 357&i2s2 { 358 #sound-dai-cells = <0>; 359}; 360 361&spdif { 362 #sound-dai-cells = <0>; 363}; 364 365&i2c0 { 366 status = "okay"; 367 i2c-scl-rising-time-ns = <450>; 368 i2c-scl-falling-time-ns = <15>; 369}; 370 371&i2c1 { 372 status = "okay"; 373 i2c-scl-rising-time-ns = <300>; 374 i2c-scl-falling-time-ns = <15>; 375 376 es8316: es8316@10 { 377 #sound-dai-cells = <0>; 378 compatible = "everest,es8316"; 379 reg = <0x10>; 380 clocks = <&cru SCLK_I2S_8CH_OUT>; 381 clock-names = "mclk"; 382 pinctrl-names = "default"; 383 pinctrl-0 = <&i2s_8ch_mclk>; 384 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>; 385 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>; 386 }; 387}; 388 389&i2c4 { 390 status = "okay"; 391 i2c-scl-rising-time-ns = <600>; 392 i2c-scl-falling-time-ns = <20>; 393 394 gt9xx: gt9xx@14 { 395 compatible = "goodix,gt9xx"; 396 reg = <0x14>; 397 touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>; 398 reset-gpio = <&gpio4 22 GPIO_ACTIVE_HIGH>; 399 max-x = <1200>; 400 max-y = <1900>; 401 tp-size = <911>; 402 tp-supply = <&vcc3v0_tp>; 403 }; 404 405 gsl3673: gsl3673@40 { 406 compatible = "GSL,GSL3673"; 407 reg = <0x40>; 408 screen_max_x = <1536>; 409 screen_max_y = <2048>; 410 irq_gpio_number = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>; 411 rst_gpio_number = <&gpio4 22 GPIO_ACTIVE_HIGH>; 412 }; 413}; 414 415&io_domains { 416 status = "okay"; 417 418 bt656-supply = <&vcc1v8_dvp>; 419 audio-supply = <&vcca1v8_codec>; 420 sdmmc-supply = <&vcc_sd>; 421 gpio1830-supply = <&vcc_3v0>; 422}; 423 424&pcie_phy { 425 status = "disabled"; 426}; 427 428&pcie0 { 429 ep-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>; 430 num-lanes = <4>; 431 pinctrl-names = "default"; 432 pinctrl-0 = <&pcie_clkreqn_cpm>; 433 status = "disabled"; 434}; 435 436&tcphy0 { 437 extcon = <&fusb0>; 438 status = "okay"; 439}; 440 441&tcphy1 { 442 extcon = <&fusb1>; 443 status = "okay"; 444}; 445 446&tsadc { 447 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */ 448 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */ 449 status = "okay"; 450}; 451 452&u2phy0 { 453 status = "okay"; 454 extcon = <&fusb0>; 455 456 u2phy0_otg: otg-port { 457 status = "okay"; 458 }; 459 460 u2phy0_host: host-port { 461 phy-supply = <&vcc5v0_host>; 462 status = "okay"; 463 }; 464}; 465 466&u2phy1 { 467 status = "okay"; 468 extcon = <&fusb1>; 469 470 u2phy1_otg: otg-port { 471 status = "okay"; 472 }; 473 474 u2phy1_host: host-port { 475 phy-supply = <&vcc5v0_host>; 476 status = "okay"; 477 }; 478}; 479 480&uart0 { 481 pinctrl-names = "default"; 482 pinctrl-0 = <&uart0_xfer &uart0_cts>; 483 status = "okay"; 484}; 485 486&uart2 { 487 status = "okay"; 488}; 489 490&usb_host0_ehci { 491 status = "okay"; 492}; 493 494&usb_host0_ohci { 495 status = "okay"; 496}; 497 498&usb_host1_ehci { 499 status = "okay"; 500}; 501 502&usb_host1_ohci { 503 status = "okay"; 504}; 505 506&usbdrd3_0 { 507 status = "okay"; 508}; 509 510&usbdrd_dwc3_0 { 511 status = "okay"; 512 extcon = <&fusb0>; 513}; 514 515&usbdrd3_1 { 516 status = "okay"; 517}; 518 519&usbdrd_dwc3_1 { 520 status = "okay"; 521 extcon = <&fusb1>; 522}; 523 524&pwm0 { 525 status = "okay"; 526}; 527 528&gmac { 529 phy-supply = <&vcc_phy>; 530 phy-mode = "rgmii"; 531 clock_in_out = "input"; 532 snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>; 533 snps,reset-active-low; 534 snps,reset-delays-us = <0 10000 50000>; 535 assigned-clocks = <&cru SCLK_RMII_SRC>; 536 assigned-clock-parents = <&clkin_gmac>; 537 pinctrl-names = "default"; 538 pinctrl-0 = <&rgmii_pins>; 539 tx_delay = <0x28>; 540 rx_delay = <0x11>; 541 status = "okay"; 542}; 543 544&saradc { 545 status = "okay"; 546 vref-supply = <&vcc_1v8>; 547}; 548 549&pinctrl { 550 sdio-pwrseq { 551 wifi_enable_h: wifi-enable-h { 552 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; 553 }; 554 }; 555 556 wireless-bluetooth { 557 uart0_gpios: uart0-gpios { 558 rockchip,pins = <2 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>; 559 }; 560 }; 561 562 pmic { 563 pmic_int_l: pmic-int-l { 564 rockchip,pins = 565 <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; 566 }; 567 568 pmic_dvs2: pmic-dvs2 { 569 rockchip,pins = 570 <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; 571 }; 572 vsel1_gpio: vsel1-gpio { 573 rockchip,pins = 574 <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; 575 }; 576 vsel2_gpio: vsel2-gpio { 577 rockchip,pins = 578 <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; 579 }; 580 }; 581 582 usb2 { 583 host_vbus_drv: host-vbus-drv { 584 rockchip,pins = 585 <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; 586 }; 587 }; 588 589 fusb30x { 590 fusb0_int: fusb0-int { 591 rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; 592 }; 593 594 fusb1_int: fusb1-int { 595 rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; 596 }; 597 }; 598}; 599 600&pvtm { 601 status = "okay"; 602}; 603 604&pmu_pvtm { 605 status = "okay"; 606}; 607 608&pmu_io_domains { 609 status = "okay"; 610 pmu1830-supply = <&vcc1v8_pmu>; 611}; 612 613