1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2020 Martijn Braam <martijn@brixit.nl> 4 * Copyright (c) 2021 Kamil Trzciński <ayufan@ayufan.eu> 5 */ 6 7/* 8 * PinePhone Pro datasheet: 9 * https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf 10 */ 11 12/dts-v1/; 13#include <dt-bindings/input/gpio-keys.h> 14#include <dt-bindings/input/linux-event-codes.h> 15#include "rk3399.dtsi" 16#include "rk3399-opp.dtsi" 17 18/ { 19 model = "Pine64 PinePhonePro"; 20 compatible = "pine64,pinephone-pro", "rockchip,rk3399"; 21 chassis-type = "handset"; 22 23 aliases { 24 mmc0 = &sdio0; 25 mmc1 = &sdmmc; 26 mmc2 = &sdhci; 27 }; 28 29 chosen { 30 stdout-path = "serial2:115200n8"; 31 }; 32 33 adc-keys { 34 compatible = "adc-keys"; 35 io-channels = <&saradc 1>; 36 io-channel-names = "buttons"; 37 keyup-threshold-microvolt = <1600000>; 38 poll-interval = <100>; 39 40 button-up { 41 label = "Volume Up"; 42 linux,code = <KEY_VOLUMEUP>; 43 press-threshold-microvolt = <100000>; 44 }; 45 46 button-down { 47 label = "Volume Down"; 48 linux,code = <KEY_VOLUMEDOWN>; 49 press-threshold-microvolt = <600000>; 50 }; 51 }; 52 53 backlight: backlight { 54 compatible = "pwm-backlight"; 55 pwms = <&pwm0 0 50000 0>; 56 }; 57 58 gpio-keys { 59 compatible = "gpio-keys"; 60 pinctrl-names = "default"; 61 pinctrl-0 = <&pwrbtn_pin>; 62 63 key-power { 64 debounce-interval = <20>; 65 gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; 66 label = "Power"; 67 linux,code = <KEY_POWER>; 68 wakeup-source; 69 }; 70 }; 71 72 vcc_sys: vcc-sys-regulator { 73 compatible = "regulator-fixed"; 74 regulator-name = "vcc_sys"; 75 regulator-always-on; 76 regulator-boot-on; 77 }; 78 79 vcc3v3_sys: vcc3v3-sys-regulator { 80 compatible = "regulator-fixed"; 81 regulator-name = "vcc3v3_sys"; 82 regulator-always-on; 83 regulator-boot-on; 84 regulator-min-microvolt = <3300000>; 85 regulator-max-microvolt = <3300000>; 86 vin-supply = <&vcc_sys>; 87 }; 88 89 vcca1v8_s3: vcc1v8-s3-regulator { 90 compatible = "regulator-fixed"; 91 regulator-name = "vcca1v8_s3"; 92 regulator-min-microvolt = <1800000>; 93 regulator-max-microvolt = <1800000>; 94 vin-supply = <&vcc3v3_sys>; 95 regulator-always-on; 96 regulator-boot-on; 97 }; 98 99 vcc1v8_codec: vcc1v8-codec-regulator { 100 compatible = "regulator-fixed"; 101 enable-active-high; 102 gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; 103 pinctrl-names = "default"; 104 pinctrl-0 = <&vcc1v8_codec_en>; 105 regulator-name = "vcc1v8_codec"; 106 regulator-min-microvolt = <1800000>; 107 regulator-max-microvolt = <1800000>; 108 vin-supply = <&vcc3v3_sys>; 109 }; 110 111 wifi_pwrseq: sdio-wifi-pwrseq { 112 compatible = "mmc-pwrseq-simple"; 113 clocks = <&rk818 1>; 114 clock-names = "ext_clock"; 115 pinctrl-names = "default"; 116 pinctrl-0 = <&wifi_enable_h_pin>; 117 /* 118 * Wait between power-on and SDIO access for CYP43455 119 * POR circuit. 120 */ 121 post-power-on-delay-ms = <110>; 122 /* 123 * Wait between consecutive toggles for CYP43455 CBUCK 124 * regulator discharge. 125 */ 126 power-off-delay-us = <10000>; 127 128 /* WL_REG_ON on module */ 129 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; 130 }; 131 132 /* MIPI DSI panel 1.8v supply */ 133 vcc1v8_lcd: vcc1v8-lcd { 134 compatible = "regulator-fixed"; 135 enable-active-high; 136 regulator-name = "vcc1v8_lcd"; 137 regulator-min-microvolt = <1800000>; 138 regulator-max-microvolt = <1800000>; 139 vin-supply = <&vcc3v3_sys>; 140 gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; 141 }; 142 143 /* MIPI DSI panel 2.8v supply */ 144 vcc2v8_lcd: vcc2v8-lcd { 145 compatible = "regulator-fixed"; 146 enable-active-high; 147 regulator-name = "vcc2v8_lcd"; 148 regulator-min-microvolt = <2800000>; 149 regulator-max-microvolt = <2800000>; 150 vin-supply = <&vcc3v3_sys>; 151 gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; 152 }; 153}; 154 155&cpu_alert0 { 156 temperature = <65000>; 157}; 158&cpu_alert1 { 159 temperature = <68000>; 160}; 161 162&cpu_l0 { 163 cpu-supply = <&vdd_cpu_l>; 164}; 165 166&cpu_l1 { 167 cpu-supply = <&vdd_cpu_l>; 168}; 169 170&cpu_l2 { 171 cpu-supply = <&vdd_cpu_l>; 172}; 173 174&cpu_l3 { 175 cpu-supply = <&vdd_cpu_l>; 176}; 177 178&cpu_b0 { 179 cpu-supply = <&vdd_cpu_b>; 180}; 181 182&cpu_b1 { 183 cpu-supply = <&vdd_cpu_b>; 184}; 185 186&emmc_phy { 187 status = "okay"; 188}; 189 190&gpu { 191 mali-supply = <&vdd_gpu>; 192 status = "okay"; 193}; 194 195&i2c0 { 196 clock-frequency = <400000>; 197 i2c-scl-rising-time-ns = <168>; 198 i2c-scl-falling-time-ns = <4>; 199 status = "okay"; 200 201 rk818: pmic@1c { 202 compatible = "rockchip,rk818"; 203 reg = <0x1c>; 204 interrupt-parent = <&gpio1>; 205 interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>; 206 #clock-cells = <1>; 207 clock-output-names = "xin32k", "rk808-clkout2"; 208 pinctrl-names = "default"; 209 pinctrl-0 = <&pmic_int_l>; 210 rockchip,system-power-controller; 211 wakeup-source; 212 213 vcc1-supply = <&vcc_sys>; 214 vcc2-supply = <&vcc_sys>; 215 vcc3-supply = <&vcc_sys>; 216 vcc4-supply = <&vcc_sys>; 217 vcc6-supply = <&vcc_sys>; 218 vcc7-supply = <&vcc3v3_sys>; 219 vcc8-supply = <&vcc_sys>; 220 vcc9-supply = <&vcc3v3_sys>; 221 222 regulators { 223 vdd_cpu_l: DCDC_REG1 { 224 regulator-name = "vdd_cpu_l"; 225 regulator-always-on; 226 regulator-boot-on; 227 regulator-min-microvolt = <875000>; 228 regulator-max-microvolt = <975000>; 229 regulator-ramp-delay = <6001>; 230 regulator-state-mem { 231 regulator-off-in-suspend; 232 }; 233 }; 234 235 vdd_center: DCDC_REG2 { 236 regulator-name = "vdd_center"; 237 regulator-always-on; 238 regulator-boot-on; 239 regulator-min-microvolt = <800000>; 240 regulator-max-microvolt = <1000000>; 241 regulator-ramp-delay = <6001>; 242 regulator-state-mem { 243 regulator-off-in-suspend; 244 }; 245 }; 246 247 vcc_ddr: DCDC_REG3 { 248 regulator-name = "vcc_ddr"; 249 regulator-always-on; 250 regulator-boot-on; 251 regulator-state-mem { 252 regulator-on-in-suspend; 253 }; 254 }; 255 256 vcc_1v8: DCDC_REG4 { 257 regulator-name = "vcc_1v8"; 258 regulator-always-on; 259 regulator-boot-on; 260 regulator-min-microvolt = <1800000>; 261 regulator-max-microvolt = <1800000>; 262 regulator-state-mem { 263 regulator-on-in-suspend; 264 }; 265 }; 266 267 vcca3v0_codec: LDO_REG1 { 268 regulator-name = "vcca3v0_codec"; 269 regulator-min-microvolt = <3000000>; 270 regulator-max-microvolt = <3000000>; 271 }; 272 273 vcc3v0_touch: LDO_REG2 { 274 regulator-name = "vcc3v0_touch"; 275 regulator-min-microvolt = <3000000>; 276 regulator-max-microvolt = <3000000>; 277 }; 278 279 vcca1v8_codec: LDO_REG3 { 280 regulator-name = "vcca1v8_codec"; 281 regulator-min-microvolt = <1800000>; 282 regulator-max-microvolt = <1800000>; 283 }; 284 285 rk818_pwr_on: LDO_REG4 { 286 regulator-name = "rk818_pwr_on"; 287 regulator-always-on; 288 regulator-boot-on; 289 regulator-min-microvolt = <3300000>; 290 regulator-max-microvolt = <3300000>; 291 regulator-state-mem { 292 regulator-on-in-suspend; 293 }; 294 }; 295 296 vcc_3v0: LDO_REG5 { 297 regulator-name = "vcc_3v0"; 298 regulator-always-on; 299 regulator-boot-on; 300 regulator-min-microvolt = <3000000>; 301 regulator-max-microvolt = <3000000>; 302 regulator-state-mem { 303 regulator-on-in-suspend; 304 }; 305 }; 306 307 vcc_1v5: LDO_REG6 { 308 regulator-name = "vcc_1v5"; 309 regulator-always-on; 310 regulator-boot-on; 311 regulator-min-microvolt = <1500000>; 312 regulator-max-microvolt = <1500000>; 313 regulator-state-mem { 314 regulator-on-in-suspend; 315 }; 316 }; 317 318 vcc1v8_dvp: LDO_REG7 { 319 regulator-name = "vcc1v8_dvp"; 320 regulator-min-microvolt = <1800000>; 321 regulator-max-microvolt = <1800000>; 322 }; 323 324 vcc3v3_s3: LDO_REG8 { 325 regulator-name = "vcc3v3_s3"; 326 regulator-always-on; 327 regulator-boot-on; 328 regulator-min-microvolt = <3300000>; 329 regulator-max-microvolt = <3300000>; 330 regulator-state-mem { 331 regulator-off-in-suspend; 332 }; 333 }; 334 335 vccio_sd: LDO_REG9 { 336 regulator-name = "vccio_sd"; 337 regulator-min-microvolt = <1800000>; 338 regulator-max-microvolt = <3300000>; 339 }; 340 341 vcc3v3_s0: SWITCH_REG { 342 regulator-name = "vcc3v3_s0"; 343 regulator-always-on; 344 regulator-boot-on; 345 regulator-state-mem { 346 regulator-on-in-suspend; 347 }; 348 }; 349 }; 350 }; 351 352 vdd_cpu_b: regulator@40 { 353 compatible = "silergy,syr827"; 354 reg = <0x40>; 355 fcs,suspend-voltage-selector = <1>; 356 pinctrl-names = "default"; 357 pinctrl-0 = <&vsel1_pin>; 358 regulator-name = "vdd_cpu_b"; 359 regulator-min-microvolt = <875000>; 360 regulator-max-microvolt = <1150000>; 361 regulator-ramp-delay = <1000>; 362 regulator-always-on; 363 regulator-boot-on; 364 365 regulator-state-mem { 366 regulator-off-in-suspend; 367 }; 368 }; 369 370 vdd_gpu: regulator@41 { 371 compatible = "silergy,syr828"; 372 reg = <0x41>; 373 fcs,suspend-voltage-selector = <1>; 374 pinctrl-names = "default"; 375 pinctrl-0 = <&vsel2_pin>; 376 regulator-name = "vdd_gpu"; 377 regulator-min-microvolt = <875000>; 378 regulator-max-microvolt = <975000>; 379 regulator-ramp-delay = <1000>; 380 regulator-always-on; 381 regulator-boot-on; 382 383 regulator-state-mem { 384 regulator-off-in-suspend; 385 }; 386 }; 387}; 388 389&i2c3 { 390 i2c-scl-rising-time-ns = <450>; 391 i2c-scl-falling-time-ns = <15>; 392 status = "okay"; 393 394 touchscreen@14 { 395 compatible = "goodix,gt1158"; 396 reg = <0x14>; 397 interrupt-parent = <&gpio3>; 398 interrupts = <RK_PB5 IRQ_TYPE_EDGE_RISING>; 399 irq-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; 400 reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>; 401 AVDD28-supply = <&vcc3v0_touch>; 402 VDDIO-supply = <&vcc3v0_touch>; 403 touchscreen-size-x = <720>; 404 touchscreen-size-y = <1440>; 405 }; 406}; 407 408&cluster0_opp { 409 opp04 { 410 status = "disabled"; 411 }; 412 413 opp05 { 414 status = "disabled"; 415 }; 416}; 417 418&cluster1_opp { 419 opp06 { 420 opp-hz = /bits/ 64 <1500000000>; 421 opp-microvolt = <1100000 1100000 1150000>; 422 }; 423 424 opp07 { 425 status = "disabled"; 426 }; 427}; 428 429&io_domains { 430 bt656-supply = <&vcc1v8_dvp>; 431 audio-supply = <&vcca1v8_codec>; 432 sdmmc-supply = <&vccio_sd>; 433 gpio1830-supply = <&vcc_3v0>; 434 status = "okay"; 435}; 436 437&mipi_dsi { 438 status = "okay"; 439 clock-master; 440 441 ports { 442 mipi_out: port@1 { 443 #address-cells = <0>; 444 #size-cells = <0>; 445 reg = <1>; 446 447 mipi_out_panel: endpoint { 448 remote-endpoint = <&mipi_in_panel>; 449 }; 450 }; 451 }; 452 453 panel@0 { 454 compatible = "hannstar,hsd060bhw4"; 455 reg = <0>; 456 backlight = <&backlight>; 457 reset-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>; 458 vcc-supply = <&vcc2v8_lcd>; 459 iovcc-supply = <&vcc1v8_lcd>; 460 pinctrl-names = "default"; 461 462 port { 463 mipi_in_panel: endpoint { 464 remote-endpoint = <&mipi_out_panel>; 465 }; 466 }; 467 }; 468}; 469 470&pmu_io_domains { 471 pmu1830-supply = <&vcc_1v8>; 472 status = "okay"; 473}; 474 475&pinctrl { 476 buttons { 477 pwrbtn_pin: pwrbtn-pin { 478 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; 479 }; 480 }; 481 482 pmic { 483 pmic_int_l: pmic-int-l { 484 rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; 485 }; 486 487 vsel1_pin: vsel1-pin { 488 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; 489 }; 490 491 vsel2_pin: vsel2-pin { 492 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; 493 }; 494 }; 495 496 sdio-pwrseq { 497 wifi_enable_h_pin: wifi-enable-h-pin { 498 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; 499 }; 500 }; 501 502 sound { 503 vcc1v8_codec_en: vcc1v8-codec-en { 504 rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; 505 }; 506 }; 507 508 wireless-bluetooth { 509 bt_wake_pin: bt-wake-pin { 510 rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 511 }; 512 513 bt_host_wake_pin: bt-host-wake-pin { 514 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; 515 }; 516 517 bt_reset_pin: bt-reset-pin { 518 rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; 519 }; 520 }; 521}; 522 523&sdio0 { 524 bus-width = <4>; 525 cap-sd-highspeed; 526 cap-sdio-irq; 527 disable-wp; 528 keep-power-in-suspend; 529 mmc-pwrseq = <&wifi_pwrseq>; 530 non-removable; 531 pinctrl-names = "default"; 532 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; 533 sd-uhs-sdr104; 534 status = "okay"; 535}; 536 537&pwm0 { 538 status = "okay"; 539}; 540 541&saradc { 542 vref-supply = <&vcca1v8_s3>; 543 status = "okay"; 544}; 545 546&sdmmc { 547 bus-width = <4>; 548 cap-sd-highspeed; 549 cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; 550 disable-wp; 551 max-frequency = <150000000>; 552 pinctrl-names = "default"; 553 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; 554 vmmc-supply = <&vcc3v3_sys>; 555 vqmmc-supply = <&vccio_sd>; 556 status = "okay"; 557}; 558 559&sdhci { 560 bus-width = <8>; 561 mmc-hs200-1_8v; 562 non-removable; 563 status = "okay"; 564}; 565 566&tsadc { 567 rockchip,hw-tshut-mode = <1>; 568 rockchip,hw-tshut-polarity = <1>; 569 status = "okay"; 570}; 571 572&uart0 { 573 pinctrl-names = "default"; 574 pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; 575 uart-has-rtscts; 576 status = "okay"; 577 578 bluetooth { 579 compatible = "brcm,bcm4345c5"; 580 clocks = <&rk818 1>; 581 clock-names = "lpo"; 582 device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; 583 host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; 584 max-speed = <1500000>; 585 pinctrl-names = "default"; 586 pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>; 587 shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; 588 vbat-supply = <&vcc3v3_sys>; 589 vddio-supply = <&vcc_1v8>; 590 }; 591}; 592 593&uart2 { 594 status = "okay"; 595}; 596 597&vopb { 598 status = "okay"; 599 assigned-clocks = <&cru DCLK_VOP0_DIV>, <&cru DCLK_VOP0>, 600 <&cru ACLK_VOP0>, <&cru HCLK_VOP0>; 601 assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; 602 assigned-clock-parents = <&cru PLL_GPLL>, <&cru DCLK_VOP0_DIV>; 603}; 604 605&vopb_mmu { 606 status = "okay"; 607}; 608 609&vopl { 610 status = "okay"; 611 assigned-clocks = <&cru DCLK_VOP1_DIV>, <&cru DCLK_VOP1>, 612 <&cru ACLK_VOP1>, <&cru HCLK_VOP1>; 613 assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; 614 assigned-clock-parents = <&cru PLL_GPLL>, <&cru DCLK_VOP1_DIV>; 615}; 616 617&vopl_mmu { 618 status = "okay"; 619}; 620