1// SPDX-License-Identifier: BSD-3-Clause 2/* 3 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2020-2023, Linaro Limited 5 */ 6 7/dts-v1/; 8 9#include <dt-bindings/firmware/qcom,scm.h> 10#include <dt-bindings/gpio/gpio.h> 11#include <dt-bindings/input/gpio-keys.h> 12#include <dt-bindings/input/input.h> 13#include <dt-bindings/regulator/qcom,rpmh-regulator.h> 14#include "sc8180x.dtsi" 15#include "sc8180x-pmics.dtsi" 16 17/ { 18 model = "Lenovo Flex 5G"; 19 compatible = "lenovo,flex-5g", "qcom,sc8180x"; 20 21 aliases { 22 serial0 = &uart13; 23 }; 24 25 backlight: backlight { 26 compatible = "pwm-backlight"; 27 pwms = <&pmc8180c_lpg 4 1000000>; 28 enable-gpios = <&pmc8180c_gpios 8 GPIO_ACTIVE_HIGH>; 29 30 pinctrl-0 = <&bl_pwm_default>; 31 pinctrl-names = "default"; 32 }; 33 34 gpio-keys { 35 compatible = "gpio-keys"; 36 37 pinctrl-0 = <&hall_int_active_state>; 38 pinctrl-names = "default"; 39 40 lid-switch { 41 gpios = <&tlmm 121 GPIO_ACTIVE_LOW>; 42 linux,input-type = <EV_SW>; 43 linux,code = <SW_LID>; 44 wakeup-source; 45 wakeup-event-action = <EV_ACT_DEASSERTED>; 46 }; 47 }; 48 49 pmic-glink { 50 compatible = "qcom,sc8180x-pmic-glink", "qcom,pmic-glink"; 51 52 #address-cells = <1>; 53 #size-cells = <0>; 54 orientation-gpios = <&tlmm 38 GPIO_ACTIVE_HIGH>, 55 <&tlmm 58 GPIO_ACTIVE_HIGH>; 56 57 connector@0 { 58 compatible = "usb-c-connector"; 59 reg = <0>; 60 power-role = "dual"; 61 data-role = "dual"; 62 63 ports { 64 #address-cells = <1>; 65 #size-cells = <0>; 66 67 port@0 { 68 reg = <0>; 69 70 pmic_glink_con0_hs: endpoint { 71 remote-endpoint = <&usb_prim_dwc3_hs>; 72 }; 73 }; 74 75 port@1 { 76 reg = <1>; 77 78 pmic_glink_con0_ss: endpoint { 79 remote-endpoint = <&usb_prim_qmpphy_out>; 80 }; 81 }; 82 83 port@2 { 84 reg = <2>; 85 86 pmic_glink_con0_sbu: endpoint { 87 remote-endpoint = <&usbprim_sbu_mux>; 88 }; 89 }; 90 }; 91 }; 92 93 connector@1 { 94 compatible = "usb-c-connector"; 95 reg = <1>; 96 power-role = "dual"; 97 data-role = "dual"; 98 99 ports { 100 #address-cells = <1>; 101 #size-cells = <0>; 102 port@0 { 103 reg = <0>; 104 105 pmic_glink_con1_hs: endpoint { 106 remote-endpoint = <&usb_sec_dwc3_hs>; 107 }; 108 }; 109 110 port@1 { 111 reg = <1>; 112 113 pmic_glink_con1_ss: endpoint { 114 remote-endpoint = <&usb_sec_qmpphy_out>; 115 }; 116 }; 117 118 port@2 { 119 reg = <2>; 120 121 pmic_glink_con1_sbu: endpoint { 122 remote-endpoint = <&usbsec_sbu_mux>; 123 }; 124 }; 125 }; 126 }; 127 }; 128 129 reserved-memory { 130 rmtfs_mem: rmtfs-region@85500000 { 131 compatible = "qcom,rmtfs-mem"; 132 reg = <0x0 0x85500000 0x0 0x200000>; 133 no-map; 134 135 qcom,client-id = <1>; 136 qcom,vmid = <QCOM_SCM_VMID_MSS_MSA>; 137 }; 138 139 wlan_mem: wlan-region@8bc00000 { 140 reg = <0x0 0x8bc00000 0x0 0x180000>; 141 no-map; 142 }; 143 144 mpss_mem: mpss-region@8d800000 { 145 reg = <0x0 0x8d800000 0x0 0x3000000>; 146 no-map; 147 }; 148 149 adsp_mem: adsp-region@90800000 { 150 reg = <0x0 0x90800000 0x0 0x1c00000>; 151 no-map; 152 }; 153 154 gpu_mem: gpu-region@98715000 { 155 reg = <0x0 0x98715000 0x0 0x2000>; 156 no-map; 157 }; 158 159 cdsp_mem: cdsp-region@98900000 { 160 reg = <0x0 0x98900000 0x0 0x1400000>; 161 no-map; 162 }; 163 }; 164 165 vph_pwr: vph-pwr-regulator { 166 compatible = "regulator-fixed"; 167 regulator-name = "vph_pwr"; 168 regulator-min-microvolt = <3700000>; 169 regulator-max-microvolt = <3700000>; 170 }; 171 172 vreg_s4a_1p8: pm8150-s4-regulator { 173 compatible = "regulator-fixed"; 174 regulator-name = "vreg_s4a_1p8"; 175 176 regulator-min-microvolt = <1800000>; 177 regulator-max-microvolt = <1800000>; 178 179 regulator-always-on; 180 regulator-boot-on; 181 182 vin-supply = <&vph_pwr>; 183 }; 184 185 usbprim-sbu-mux { 186 compatible = "pericom,pi3usb102", "gpio-sbu-mux"; 187 188 enable-gpios = <&tlmm 152 GPIO_ACTIVE_LOW>; 189 select-gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>; 190 191 pinctrl-names = "default"; 192 pinctrl-0 = <&usbprim_sbu_default>; 193 194 mode-switch; 195 orientation-switch; 196 197 port { 198 usbprim_sbu_mux: endpoint { 199 remote-endpoint = <&pmic_glink_con0_sbu>; 200 }; 201 }; 202 }; 203 204 usbsec-sbu-mux { 205 compatible = "pericom,pi3usb102", "gpio-sbu-mux"; 206 207 enable-gpios = <&tlmm 188 GPIO_ACTIVE_LOW>; 208 select-gpios = <&tlmm 187 GPIO_ACTIVE_HIGH>; 209 210 pinctrl-names = "default"; 211 pinctrl-0 = <&usbsec_sbu_default>; 212 213 mode-switch; 214 orientation-switch; 215 216 port { 217 usbsec_sbu_mux: endpoint { 218 remote-endpoint = <&pmic_glink_con1_sbu>; 219 }; 220 }; 221 }; 222}; 223 224&apps_rsc { 225 regulators-0 { 226 compatible = "qcom,pmc8180-rpmh-regulators"; 227 qcom,pmic-id = "a"; 228 229 vdd-s5-supply = <&vph_pwr>; 230 vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p0>; 231 232 vreg_s5a_2p0: smps5 { 233 regulator-min-microvolt = <2040000>; 234 regulator-max-microvolt = <2100000>; 235 }; 236 237 vreg_l7a_1p8: ldo7 { 238 regulator-min-microvolt = <1800000>; 239 regulator-max-microvolt = <1800000>; 240 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 241 }; 242 243 vreg_l9a_1p3: ldo9 { 244 regulator-min-microvolt = <1296000>; 245 regulator-max-microvolt = <1304000>; 246 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 247 }; 248 249 vreg_l12a_1p8: ldo12 { 250 regulator-min-microvolt = <1800000>; 251 regulator-max-microvolt = <1800000>; 252 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 253 }; 254 }; 255 256 regulators-1 { 257 compatible = "qcom,pmc8180c-rpmh-regulators"; 258 qcom,pmic-id = "c"; 259 260 vdd-s6-supply = <&vph_pwr>; 261 vdd-l2-l3-supply = <&vreg_s6c_1p35>; 262 vdd-bob-supply = <&vph_pwr>; 263 264 vreg_s6c_1p35: smps6 { 265 regulator-min-microvolt = <1350000>; 266 regulator-max-microvolt = <1372000>; 267 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 268 }; 269 270 vreg_l3c_1p2: ldo3 { 271 regulator-min-microvolt = <1200000>; 272 regulator-max-microvolt = <1200000>; 273 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 274 }; 275 276 vreg_l10c_3p3: ldo10 { 277 regulator-min-microvolt = <3000000>; 278 regulator-max-microvolt = <3312000>; 279 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 280 }; 281 282 vreg_l11c_3p3: ldo11 { 283 regulator-min-microvolt = <3296000>; 284 regulator-max-microvolt = <3304000>; 285 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 286 }; 287 288 vreg_bob: bob { 289 regulator-min-microvolt = <3296000>; 290 regulator-max-microvolt = <3350000>; 291 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 292 }; 293 }; 294 295 regulators-2 { 296 compatible = "qcom,pmc8180-rpmh-regulators"; 297 qcom,pmic-id = "e"; 298 299 vdd-s4-supply = <&vph_pwr>; 300 vdd-s5-supply = <&vph_pwr>; 301 vdd-l2-l10-supply = <&vreg_bob>; 302 vdd-l3-l4-l5-l18-supply = <&vreg_s4e_0p98>; 303 vdd-l7-l12-l14-l15-supply = <&vreg_s5e_2p05>; 304 vdd-l13-l16-l17-supply = <&vreg_bob>; 305 306 vreg_s4e_0p98: smps4 { 307 regulator-min-microvolt = <992000>; 308 regulator-max-microvolt = <992000>; 309 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 310 }; 311 312 vreg_s5e_2p05: smps5 { 313 regulator-min-microvolt = <2040000>; 314 regulator-max-microvolt = <2040000>; 315 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 316 }; 317 318 vreg_l1e_0p75: ldo1 { 319 regulator-min-microvolt = <752000>; 320 regulator-max-microvolt = <752000>; 321 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 322 }; 323 324 vreg_l5e_0p88: ldo5 { 325 regulator-min-microvolt = <880000>; 326 regulator-max-microvolt = <880000>; 327 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 328 }; 329 330 vreg_l7e_1p8: ldo7 { 331 regulator-min-microvolt = <1800000>; 332 regulator-max-microvolt = <1800000>; 333 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 334 regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM 335 RPMH_REGULATOR_MODE_HPM>; 336 regulator-allow-set-load; 337 }; 338 339 vreg_l10e_2p9: ldo10 { 340 regulator-min-microvolt = <2904000>; 341 regulator-max-microvolt = <2904000>; 342 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 343 regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM 344 RPMH_REGULATOR_MODE_HPM>; 345 regulator-allow-set-load; 346 }; 347 348 vreg_l16e_3p0: ldo16 { 349 regulator-min-microvolt = <3072000>; 350 regulator-max-microvolt = <3072000>; 351 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 352 }; 353 }; 354}; 355 356&gpu { 357 status = "okay"; 358 359 zap-shader { 360 memory-region = <&gpu_mem>; 361 firmware-name = "qcom/sc8180x/LENOVO/82AK/qcdxkmsuc8180.mbn"; 362 }; 363}; 364 365&i2c1 { 366 clock-frequency = <100000>; 367 368 pinctrl-0 = <&i2c1_active>; 369 pinctrl-names = "default"; 370 371 status = "okay"; 372 373 touchscreen@10 { 374 compatible = "hid-over-i2c"; 375 reg = <0x10>; 376 hid-descr-addr = <0x1>; 377 378 interrupts-extended = <&tlmm 122 IRQ_TYPE_LEVEL_LOW>; 379 380 pinctrl-0 = <&ts_int_default>; 381 pinctrl-names = "default"; 382 }; 383}; 384 385&i2c7 { 386 clock-frequency = <1000000>; 387 388 pinctrl-0 = <&i2c7_active>; 389 pinctrl-names = "default"; 390 391 status = "okay"; 392 393 keyboard@5 { 394 compatible = "hid-over-i2c"; 395 reg = <0x5>; 396 hid-descr-addr = <0x20>; 397 398 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_LOW>; 399 400 pinctrl-0 = <&kb_int_default>; 401 pinctrl-names = "default"; 402 }; 403 404 touchpad@2c { 405 compatible = "hid-over-i2c"; 406 reg = <0x2c>; 407 hid-descr-addr = <0x20>; 408 409 interrupts-extended = <&tlmm 24 IRQ_TYPE_LEVEL_LOW>; 410 411 pinctrl-0 = <&tp_int_default>; 412 pinctrl-names = "default"; 413 }; 414}; 415 416&mdss { 417 status = "okay"; 418}; 419 420&mdss_dp0 { 421 status = "okay"; 422}; 423 424&mdss_dp0_out { 425 data-lanes = <0 1>; 426 remote-endpoint = <&usb_prim_qmpphy_dp_in>; 427}; 428 429&mdss_dp1 { 430 status = "okay"; 431}; 432 433&mdss_dp1_out { 434 data-lanes = <0 1>; 435 remote-endpoint = <&usb_sec_qmpphy_dp_in>; 436}; 437 438&mdss_edp { 439 data-lanes = <0 1 2 3>; 440 441 pinctrl-0 = <&edp_hpd_active>; 442 pinctrl-names = "default"; 443 444 status = "okay"; 445 446 aux-bus { 447 panel { 448 compatible = "edp-panel"; 449 no-hpd; 450 451 backlight = <&backlight>; 452 453 port { 454 auo_b140han06_in: endpoint { 455 remote-endpoint = <&mdss_edp_out>; 456 }; 457 }; 458 }; 459 }; 460 461 ports { 462 port@1 { 463 reg = <1>; 464 mdss_edp_out: endpoint { 465 remote-endpoint = <&auo_b140han06_in>; 466 }; 467 }; 468 }; 469}; 470 471&pcie3 { 472 perst-gpios = <&tlmm 178 GPIO_ACTIVE_LOW>; 473 wake-gpios = <&tlmm 180 GPIO_ACTIVE_HIGH>; 474 pinctrl-0 = <&pcie3_default_state>; 475 pinctrl-names = "default"; 476 477 status = "okay"; 478}; 479 480&pcie3_phy { 481 vdda-phy-supply = <&vreg_l5e_0p88>; 482 vdda-pll-supply = <&vreg_l3c_1p2>; 483 484 status = "okay"; 485}; 486 487&pmc8180c_lpg { 488 status = "okay"; 489}; 490 491&qupv3_id_0 { 492 status = "okay"; 493}; 494 495&qupv3_id_1 { 496 status = "okay"; 497}; 498 499&qupv3_id_2 { 500 status = "okay"; 501}; 502 503&remoteproc_adsp { 504 memory-region = <&adsp_mem>; 505 firmware-name = "qcom/sc8180x/LENOVO/82AK/qcadsp8180.mbn"; 506 507 status = "okay"; 508}; 509 510&remoteproc_cdsp { 511 memory-region = <&cdsp_mem>; 512 firmware-name = "qcom/sc8180x/LENOVO/82AK/qccdsp8180.mbn"; 513 514 status = "okay"; 515}; 516 517&remoteproc_mpss { 518 memory-region = <&mpss_mem>; 519 firmware-name = "qcom/sc8180x/LENOVO/82AK/qcmpss8180_nm.mbn"; 520 521 status = "okay"; 522}; 523 524&uart13 { 525 pinctrl-0 = <&uart13_state>; 526 pinctrl-names = "default"; 527 528 status = "okay"; 529 530 bluetooth { 531 compatible = "qcom,wcn3998-bt"; 532 533 vddio-supply = <&vreg_s4a_1p8>; 534 vddxo-supply = <&vreg_l7a_1p8>; 535 vddrf-supply = <&vreg_l9a_1p3>; 536 vddch0-supply = <&vreg_l11c_3p3>; 537 max-speed = <3200000>; 538 }; 539}; 540 541&ufs_mem_hc { 542 reset-gpios = <&tlmm 190 GPIO_ACTIVE_LOW>; 543 544 vcc-supply = <&vreg_l10e_2p9>; 545 vcc-max-microamp = <155000>; 546 547 vccq2-supply = <&vreg_l7e_1p8>; 548 vccq2-max-microamp = <425000>; 549 550 status = "okay"; 551}; 552 553&ufs_mem_phy { 554 vdda-phy-supply = <&vreg_l5e_0p88>; 555 vdda-pll-supply = <&vreg_l3c_1p2>; 556 557 status = "okay"; 558}; 559 560&usb_prim_hsphy { 561 vdda-pll-supply = <&vreg_l5e_0p88>; 562 vdda18-supply = <&vreg_l12a_1p8>; 563 vdda33-supply = <&vreg_l16e_3p0>; 564 565 status = "okay"; 566}; 567 568&usb_prim_qmpphy { 569 vdda-phy-supply = <&vreg_l3c_1p2>; 570 vdda-pll-supply = <&vreg_l5e_0p88>; 571 572 orientation-switch; 573 574 status = "okay"; 575}; 576 577&usb_prim { 578 status = "okay"; 579}; 580 581&usb_prim_dwc3 { 582 dr_mode = "host"; 583}; 584 585&usb_prim_dwc3_hs { 586 remote-endpoint = <&pmic_glink_con0_hs>; 587}; 588 589&usb_prim_qmpphy_dp_in { 590 remote-endpoint = <&mdss_dp0_out>; 591}; 592 593&usb_prim_qmpphy_out { 594 remote-endpoint = <&pmic_glink_con0_ss>; 595}; 596 597&usb_sec_dwc3_hs { 598 remote-endpoint = <&pmic_glink_con1_hs>; 599}; 600 601&usb_sec_hsphy { 602 vdda-pll-supply = <&vreg_l5e_0p88>; 603 vdda18-supply = <&vreg_l12a_1p8>; 604 vdda33-supply = <&vreg_l16e_3p0>; 605 606 status = "okay"; 607}; 608 609&usb_sec_qmpphy { 610 vdda-phy-supply = <&vreg_l3c_1p2>; 611 vdda-pll-supply = <&vreg_l5e_0p88>; 612 613 orientation-switch; 614 615 status = "okay"; 616}; 617 618&usb_sec_qmpphy_dp_in { 619 remote-endpoint = <&mdss_dp1_out>; 620}; 621 622&usb_sec_qmpphy_out { 623 remote-endpoint = <&pmic_glink_con1_ss>; 624}; 625 626&usb_sec { 627 status = "okay"; 628}; 629 630&usb_sec_dwc3 { 631 dr_mode = "host"; 632}; 633 634&wifi { 635 memory-region = <&wlan_mem>; 636 637 vdd-0.8-cx-mx-supply = <&vreg_l1e_0p75>; 638 vdd-1.8-xo-supply = <&vreg_l7a_1p8>; 639 vdd-1.3-rfa-supply = <&vreg_l9a_1p3>; 640 vdd-3.3-ch0-supply = <&vreg_l11c_3p3>; 641 vdd-3.3-ch1-supply = <&vreg_l10c_3p3>; 642 643 status = "okay"; 644}; 645 646&xo_board_clk { 647 clock-frequency = <38400000>; 648}; 649 650/* PINCTRL */ 651 652&pmc8180c_gpios { 653 bl_pwm_default: bl-pwm-default-state { 654 en-pins { 655 pins = "gpio8"; 656 function = "normal"; 657 }; 658 659 pwm-pins { 660 pins = "gpio10"; 661 function = "func1"; 662 }; 663 }; 664}; 665 666&tlmm { 667 gpio-reserved-ranges = <0 4>, <47 4>, <126 4>; 668 669 edp_hpd_active: epd-hpd-active-state { 670 pins = "gpio10"; 671 function = "edp_hot"; 672 }; 673 674 hall_int_active_state: hall-int-active-state { 675 pins = "gpio121"; 676 function = "gpio"; 677 678 bias-disable; 679 }; 680 681 i2c1_active: i2c1-active-state { 682 pins = "gpio114", "gpio115"; 683 function = "qup1"; 684 685 bias-pull-up = <1>; 686 drive-strength = <2>; 687 }; 688 689 i2c7_active: i2c7-active-state { 690 pins = "gpio98", "gpio99"; 691 function = "qup7"; 692 693 bias-pull-up; 694 drive-strength = <2>; 695 }; 696 697 kb_int_default: kb-int-default-state { 698 pins = "gpio37"; 699 function = "gpio"; 700 701 bias-pull-up; 702 drive-strength = <2>; 703 }; 704 705 pcie3_default_state: pcie3-default-state { 706 clkreq-pins { 707 pins = "gpio179"; 708 function = "pci_e3"; 709 bias-pull-up; 710 }; 711 712 reset-n-pins { 713 pins = "gpio178"; 714 function = "gpio"; 715 716 drive-strength = <2>; 717 output-low; 718 bias-pull-down; 719 }; 720 721 wake-n-pins { 722 pins = "gpio180"; 723 function = "gpio"; 724 725 drive-strength = <2>; 726 bias-pull-up; 727 }; 728 }; 729 730 tp_int_default: tp-int-default-state { 731 pins = "gpio24"; 732 function = "gpio"; 733 734 bias-pull-up; 735 drive-strength = <2>; 736 }; 737 738 ts_int_default: ts-int-default-state { 739 pins = "gpio122"; 740 function = "gpio"; 741 742 bias-pull-up; 743 drive-strength = <2>; 744 }; 745 746 usbprim_sbu_default: usbprim-sbu-state { 747 oe-n-pins { 748 pins = "gpio152"; 749 function = "gpio"; 750 bias-disable; 751 drive-strength = <16>; 752 output-high; 753 }; 754 755 sel-pins { 756 pins = "gpio100"; 757 function = "gpio"; 758 bias-disable; 759 drive-strength = <16>; 760 }; 761 }; 762 763 usbsec_sbu_default: usbsec-sbu-state { 764 oe-n-pins { 765 pins = "gpio188"; 766 function = "gpio"; 767 bias-disable; 768 drive-strength = <16>; 769 output-high; 770 }; 771 772 sel-pins { 773 pins = "gpio187"; 774 function = "gpio"; 775 bias-disable; 776 drive-strength = <16>; 777 }; 778 }; 779 780 uart13_state: uart13-state { 781 cts-pins { 782 pins = "gpio43"; 783 function = "qup13"; 784 bias-pull-down; 785 }; 786 787 rts-tx-pins { 788 pins = "gpio44", "gpio45"; 789 function = "qup13"; 790 drive-strength = <2>; 791 bias-disable; 792 }; 793 794 rx-pins { 795 pins = "gpio46"; 796 function = "qup13"; 797 bias-pull-up; 798 }; 799 }; 800}; 801