Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * SDM845 OnePlus 6(T) (enchilada / fajita) common device tree source
0004  *
0005  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
0006  */
0007 
0008 /dts-v1/;
0009 
0010 #include <dt-bindings/input/linux-event-codes.h>
0011 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
0012 
0013 #include "sdm845.dtsi"
0014 #include "pm8998.dtsi"
0015 #include "pmi8998.dtsi"
0016 
0017 /delete-node/ &rmtfs_mem;
0018 
0019 / {
0020         aliases {
0021                 serial0 = &uart9;
0022                 hsuart0 = &uart6;
0023         };
0024 
0025         chosen {
0026                 stdout-path = "serial0:115200n8";
0027         };
0028 
0029         gpio-keys {
0030                 compatible = "gpio-keys";
0031                 label = "Volume keys";
0032                 autorepeat;
0033 
0034                 pinctrl-names = "default";
0035                 pinctrl-0 = <&volume_down_gpio &volume_up_gpio>;
0036 
0037                 key-vol-down {
0038                         label = "Volume down";
0039                         linux,code = <KEY_VOLUMEDOWN>;
0040                         gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
0041                         debounce-interval = <15>;
0042                 };
0043 
0044                 key-vol-up {
0045                         label = "Volume up";
0046                         linux,code = <KEY_VOLUMEUP>;
0047                         gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
0048                         debounce-interval = <15>;
0049                 };
0050         };
0051 
0052         reserved-memory {
0053                 /* The rmtfs_mem needs to be guarded due to "XPU limitations"
0054                  * it is otherwise possible for an allocation adjacent to the
0055                  * rmtfs_mem region to trigger an XPU violation, causing a crash.
0056                  */
0057                 rmtfs_lower_guard: rmtfs-lower-guard@f5b00000 {
0058                         no-map;
0059                         reg = <0 0xf5b00000 0 0x1000>;
0060                 };
0061                 /*
0062                  * The rmtfs memory region in downstream is 'dynamically allocated'
0063                  * but given the same address every time. Hard code it as this address is
0064                  * where the modem firmware expects it to be.
0065                  */
0066                 rmtfs_mem: rmtfs-mem@f5b01000 {
0067                         compatible = "qcom,rmtfs-mem";
0068                         reg = <0 0xf5b01000 0 0x200000>;
0069                         no-map;
0070 
0071                         qcom,client-id = <1>;
0072                         qcom,vmid = <15>;
0073                 };
0074                 rmtfs_upper_guard: rmtfs-upper-guard@f5d01000 {
0075                         no-map;
0076                         reg = <0 0xf5d01000 0 0x1000>;
0077                 };
0078 
0079                 /*
0080                  * It seems like reserving the old rmtfs_mem region is also needed to prevent
0081                  * random crashes which are most likely modem related, more testing needed.
0082                  */
0083                 removed_region: removed-region@88f00000 {
0084                         no-map;
0085                         reg = <0 0x88f00000 0 0x1c00000>;
0086                 };
0087 
0088                 ramoops: ramoops@ac300000 {
0089                         compatible = "ramoops";
0090                         reg = <0 0xac300000 0 0x400000>;
0091                         record-size = <0x40000>;
0092                         console-size = <0x40000>;
0093                         ftrace-size = <0x40000>;
0094                         pmsg-size = <0x200000>;
0095                         ecc-size = <16>;
0096                 };
0097         };
0098 
0099         vph_pwr: vph-pwr-regulator {
0100                 compatible = "regulator-fixed";
0101                 regulator-name = "vph_pwr";
0102                 regulator-min-microvolt = <3700000>;
0103                 regulator-max-microvolt = <3700000>;
0104         };
0105 
0106         /*
0107          * Apparently RPMh does not provide support for PM8998 S4 because it
0108          * is always-on; model it as a fixed regulator.
0109          */
0110         vreg_s4a_1p8: pm8998-smps4 {
0111                 compatible = "regulator-fixed";
0112                 regulator-name = "vreg_s4a_1p8";
0113 
0114                 regulator-min-microvolt = <1800000>;
0115                 regulator-max-microvolt = <1800000>;
0116 
0117                 regulator-always-on;
0118                 regulator-boot-on;
0119 
0120                 vin-supply = <&vph_pwr>;
0121         };
0122 
0123         /*
0124          * The touchscreen regulator seems to be controlled somehow by a gpio.
0125          * Model it as a fixed regulator and keep it on. Without schematics we
0126          * don't know how this is actually wired up...
0127          */
0128         ts_1p8_supply: ts-1p8-regulator {
0129                 compatible = "regulator-fixed";
0130                 regulator-name = "ts_1p8_supply";
0131 
0132                 regulator-min-microvolt = <1800000>;
0133                 regulator-max-microvolt = <1800000>;
0134 
0135                 gpio = <&tlmm 88 0>;
0136                 enable-active-high;
0137                 regulator-boot-on;
0138         };
0139 };
0140 
0141 &adsp_pas {
0142         status = "okay";
0143         firmware-name = "qcom/sdm845/oneplus6/adsp.mbn";
0144 };
0145 
0146 &apps_rsc {
0147         pm8998-rpmh-regulators {
0148                 compatible = "qcom,pm8998-rpmh-regulators";
0149                 qcom,pmic-id = "a";
0150 
0151                 vdd-s1-supply = <&vph_pwr>;
0152                 vdd-s2-supply = <&vph_pwr>;
0153                 vdd-s3-supply = <&vph_pwr>;
0154                 vdd-s4-supply = <&vph_pwr>;
0155                 vdd-s5-supply = <&vph_pwr>;
0156                 vdd-s6-supply = <&vph_pwr>;
0157                 vdd-s7-supply = <&vph_pwr>;
0158                 vdd-s8-supply = <&vph_pwr>;
0159                 vdd-s9-supply = <&vph_pwr>;
0160                 vdd-s10-supply = <&vph_pwr>;
0161                 vdd-s11-supply = <&vph_pwr>;
0162                 vdd-s12-supply = <&vph_pwr>;
0163                 vdd-s13-supply = <&vph_pwr>;
0164                 vdd-l1-l27-supply = <&vreg_s7a_1p025>;
0165                 vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
0166                 vdd-l3-l11-supply = <&vreg_s7a_1p025>;
0167                 vdd-l4-l5-supply = <&vreg_s7a_1p025>;
0168                 vdd-l6-supply = <&vph_pwr>;
0169                 vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
0170                 vdd-l9-supply = <&vreg_bob>;
0171                 vdd-l10-l23-l25-supply = <&vreg_bob>;
0172                 vdd-l13-l19-l21-supply = <&vreg_bob>;
0173                 vdd-l16-l28-supply = <&vreg_bob>;
0174                 vdd-l18-l22-supply = <&vreg_bob>;
0175                 vdd-l20-l24-supply = <&vreg_bob>;
0176                 vdd-l26-supply = <&vreg_s3a_1p35>;
0177                 vin-lvs-1-2-supply = <&vreg_s4a_1p8>;
0178 
0179                 vreg_s3a_1p35: smps3 {
0180                         regulator-min-microvolt = <1352000>;
0181                         regulator-max-microvolt = <1352000>;
0182                 };
0183 
0184                 vreg_s5a_2p04: smps5 {
0185                         regulator-min-microvolt = <1904000>;
0186                         regulator-max-microvolt = <2040000>;
0187                 };
0188 
0189                 vreg_s7a_1p025: smps7 {
0190                         regulator-min-microvolt = <900000>;
0191                         regulator-max-microvolt = <1028000>;
0192                 };
0193 
0194                 vdda_mipi_dsi0_pll:
0195                 vdda_qlink_lv:
0196                 vdda_ufs1_core:
0197                 vdda_usb1_ss_core:
0198                 vreg_l1a_0p875: ldo1 {
0199                         regulator-min-microvolt = <880000>;
0200                         regulator-max-microvolt = <880000>;
0201                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0202                 };
0203 
0204                 vreg_l2a_1p2: ldo2 {
0205                         regulator-min-microvolt = <1200000>;
0206                         regulator-max-microvolt = <1200000>;
0207                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0208                         regulator-always-on;
0209                 };
0210 
0211                 vreg_l5a_0p8: ldo5 {
0212                         regulator-min-microvolt = <800000>;
0213                         regulator-max-microvolt = <800000>;
0214                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0215                 };
0216 
0217                 vreg_l7a_1p8: ldo7 {
0218                         regulator-min-microvolt = <1800000>;
0219                         regulator-max-microvolt = <1800000>;
0220                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0221                 };
0222 
0223                 vdda_qusb_hs0_1p8:
0224                 vreg_l12a_1p8: ldo12 {
0225                         regulator-min-microvolt = <1800000>;
0226                         regulator-max-microvolt = <1800000>;
0227                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0228                 };
0229 
0230                 vreg_l14a_1p88: ldo14 {
0231                         regulator-min-microvolt = <1800000>;
0232                         regulator-max-microvolt = <1800000>;
0233                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0234                         regulator-always-on;
0235                 };
0236 
0237                 vreg_l17a_1p3: ldo17 {
0238                         regulator-min-microvolt = <1304000>;
0239                         regulator-max-microvolt = <1304000>;
0240                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0241                 };
0242 
0243                 vreg_l20a_2p95: ldo20 {
0244                         regulator-min-microvolt = <2704000>;
0245                         regulator-max-microvolt = <2960000>;
0246                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0247                 };
0248 
0249                 vreg_l23a_3p3: ldo23 {
0250                         regulator-min-microvolt = <3300000>;
0251                         regulator-max-microvolt = <3312000>;
0252                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0253                 };
0254 
0255                 vdda_qusb_hs0_3p1:
0256                 vreg_l24a_3p075: ldo24 {
0257                         regulator-min-microvolt = <3088000>;
0258                         regulator-max-microvolt = <3088000>;
0259                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0260                 };
0261 
0262                 vreg_l25a_3p3: ldo25 {
0263                         regulator-min-microvolt = <3300000>;
0264                         regulator-max-microvolt = <3312000>;
0265                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0266                 };
0267 
0268                 vdda_mipi_dsi0_1p2:
0269                 vdda_ufs1_1p2:
0270                 vreg_l26a_1p2: ldo26 {
0271                         regulator-min-microvolt = <1200000>;
0272                         regulator-max-microvolt = <1200000>;
0273                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0274                 };
0275 
0276                 vreg_l28a_3p0: ldo28 {
0277                         regulator-min-microvolt = <2856000>;
0278                         regulator-max-microvolt = <3008000>;
0279                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
0280                 };
0281         };
0282 
0283         pmi8998-rpmh-regulators {
0284                 compatible = "qcom,pmi8998-rpmh-regulators";
0285                 qcom,pmic-id = "b";
0286 
0287                 vdd-bob-supply = <&vph_pwr>;
0288 
0289                 vreg_bob: bob {
0290                         regulator-min-microvolt = <3312000>;
0291                         regulator-max-microvolt = <3600000>;
0292                         regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
0293                         regulator-allow-bypass;
0294                 };
0295         };
0296 
0297         pm8005-rpmh-regulators {
0298                 compatible = "qcom,pm8005-rpmh-regulators";
0299                 qcom,pmic-id = "c";
0300 
0301                 vdd-s1-supply = <&vph_pwr>;
0302                 vdd-s2-supply = <&vph_pwr>;
0303                 vdd-s3-supply = <&vph_pwr>;
0304                 vdd-s4-supply = <&vph_pwr>;
0305 
0306                 vreg_s3c_0p6: smps3 {
0307                         regulator-min-microvolt = <600000>;
0308                         regulator-max-microvolt = <600000>;
0309                 };
0310         };
0311 };
0312 
0313 &cdsp_pas {
0314         status = "okay";
0315         firmware-name = "qcom/sdm845/oneplus6/cdsp.mbn";
0316 };
0317 
0318 &dsi0 {
0319         status = "okay";
0320         vdda-supply = <&vdda_mipi_dsi0_1p2>;
0321 
0322         /*
0323          * Both devices use different panels but all other properties
0324          * are common. Compatible line is declared in device dts.
0325          */
0326         display_panel: panel@0 {
0327                 status = "disabled";
0328 
0329                 #address-cells = <1>;
0330                 #size-cells = <0>;
0331                 reg = <0>;
0332 
0333                 vddio-supply = <&vreg_l14a_1p88>;
0334 
0335                 reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
0336 
0337                 pinctrl-names = "default";
0338                 pinctrl-0 = <&panel_reset_pins &panel_te_pin &panel_esd_pin>;
0339 
0340                 port {
0341                         panel_in: endpoint {
0342                                 remote-endpoint = <&dsi0_out>;
0343                         };
0344                 };
0345         };
0346 };
0347 
0348 &dsi0_out {
0349         remote-endpoint = <&panel_in>;
0350         data-lanes = <0 1 2 3>;
0351 };
0352 
0353 &dsi0_phy {
0354         status = "okay";
0355         vdds-supply = <&vdda_mipi_dsi0_pll>;
0356 };
0357 
0358 &gcc {
0359         protected-clocks = <GCC_QSPI_CORE_CLK>,
0360                                 <GCC_QSPI_CORE_CLK_SRC>,
0361                                 <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
0362                                 <GCC_LPASS_Q6_AXI_CLK>,
0363                                 <GCC_LPASS_SWAY_CLK>;
0364 };
0365 
0366 &gmu {
0367         status = "okay";
0368 };
0369 
0370 &gpu {
0371         status = "okay";
0372 
0373         zap-shader {
0374                 memory-region = <&gpu_mem>;
0375                 firmware-name = "qcom/sdm845/oneplus6/a630_zap.mbn";
0376         };
0377 };
0378 
0379 &i2c10 {
0380         status = "okay";
0381         clock-frequency = <100000>;
0382 
0383         bq27441_fg: bq27441-battery@55 {
0384                 compatible = "ti,bq27411";
0385                 status = "okay";
0386                 reg = <0x55>;
0387         };
0388 };
0389 
0390 &i2c12 {
0391         status = "okay";
0392         clock-frequency = <400000>;
0393 
0394         synaptics-rmi4-i2c@20 {
0395                 compatible = "syna,rmi4-i2c";
0396                 reg = <0x20>;
0397                 #address-cells = <1>;
0398                 #size-cells = <0>;
0399                 interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
0400 
0401                 pinctrl-names = "default";
0402                 pinctrl-0 = <&ts_default_pins>;
0403 
0404                 vdd-supply = <&vreg_l28a_3p0>;
0405                 vio-supply = <&ts_1p8_supply>;
0406 
0407                 syna,reset-delay-ms = <200>;
0408                 syna,startup-delay-ms = <200>;
0409 
0410                 rmi4-f01@1 {
0411                         reg = <0x01>;
0412                         syna,nosleep-mode = <1>;
0413                 };
0414 
0415                 rmi4_f12: rmi4-f12@12 {
0416                         reg = <0x12>;
0417                         touchscreen-x-mm = <68>;
0418                         touchscreen-y-mm = <144>;
0419                         syna,sensor-type = <1>;
0420                         syna,rezero-wait-ms = <200>;
0421                 };
0422         };
0423 };
0424 
0425 &ipa {
0426         status = "okay";
0427 
0428         memory-region = <&ipa_fw_mem>;
0429         firmware-name = "qcom/sdm845/oneplus6/ipa_fws.mbn";
0430 };
0431 
0432 &mdss {
0433         status = "okay";
0434 };
0435 
0436 /* Modem/wifi*/
0437 &mss_pil {
0438         status = "okay";
0439         firmware-name = "qcom/sdm845/oneplus6/mba.mbn", "qcom/sdm845/oneplus6/modem.mbn";
0440 };
0441 
0442 &pm8998_gpio {
0443         volume_down_gpio: pm8998-gpio5-state {
0444                 pinconf {
0445                         pins = "gpio5";
0446                         function = "normal";
0447                         input-enable;
0448                         bias-pull-up;
0449                         qcom,drive-strength = <0>;
0450                 };
0451         };
0452 
0453         volume_up_gpio: pm8998-gpio6-state {
0454                 pinconf {
0455                         pins = "gpio6";
0456                         function = "normal";
0457                         input-enable;
0458                         bias-pull-up;
0459                         qcom,drive-strength = <0>;
0460                 };
0461         };
0462 };
0463 
0464 &qupv3_id_1 {
0465         status = "okay";
0466 };
0467 
0468 &qupv3_id_0 {
0469         status = "okay";
0470 };
0471 
0472 &qup_i2c12_default {
0473         mux {
0474                 pins = "gpio49", "gpio50";
0475                 function = "qup12";
0476                 drive-strength = <2>;
0477                 bias-disable;
0478         };
0479 };
0480 
0481 &qup_i2c10_default {
0482         pinconf {
0483                 pins = "gpio55", "gpio56";
0484                 drive-strength = <2>;
0485                 bias-disable;
0486         };
0487 };
0488 
0489 &qup_uart9_default {
0490         pinconf-tx {
0491                 pins = "gpio4";
0492                 drive-strength = <2>;
0493                 bias-disable;
0494         };
0495 
0496         pinconf-rx {
0497                 pins = "gpio5";
0498                 drive-strength = <2>;
0499                 bias-pull-up;
0500         };
0501 };
0502 
0503 /*
0504  * Prevent garbage data on bluetooth UART lines
0505  */
0506 &qup_uart6_default {
0507         pinmux {
0508                 pins = "gpio45", "gpio46", "gpio47", "gpio48";
0509                 function = "qup6";
0510         };
0511 
0512         cts {
0513                 pins = "gpio45";
0514                 bias-pull-down;
0515         };
0516 
0517         rts-tx {
0518                 pins = "gpio46", "gpio47";
0519                 drive-strength = <2>;
0520                 bias-disable;
0521         };
0522 
0523         rx {
0524                 pins = "gpio48";
0525                 bias-pull-up;
0526         };
0527 };
0528 
0529 &uart6 {
0530         status = "okay";
0531 
0532         bluetooth {
0533                 compatible = "qcom,wcn3990-bt";
0534 
0535                 /*
0536                  * This path is relative to the qca/
0537                  * subdir under lib/firmware.
0538                  */
0539                 firmware-name = "oneplus6/crnv21.bin";
0540 
0541                 vddio-supply = <&vreg_s4a_1p8>;
0542                 vddxo-supply = <&vreg_l7a_1p8>;
0543                 vddrf-supply = <&vreg_l17a_1p3>;
0544                 vddch0-supply = <&vreg_l25a_3p3>;
0545                 max-speed = <3200000>;
0546         };
0547 };
0548 
0549 &uart9 {
0550         label = "LS-UART1";
0551         status = "okay";
0552 };
0553 
0554 &ufs_mem_hc {
0555         status = "okay";
0556 
0557         reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
0558 
0559         vcc-supply = <&vreg_l20a_2p95>;
0560         vcc-max-microamp = <600000>;
0561 };
0562 
0563 &ufs_mem_phy {
0564         status = "okay";
0565 
0566         vdda-phy-supply = <&vdda_ufs1_core>;
0567         vdda-pll-supply = <&vdda_ufs1_1p2>;
0568 };
0569 
0570 &usb_1 {
0571         status = "okay";
0572 
0573         /*
0574          * disable USB3 clock requirement as the device only supports
0575          * USB2.
0576          */
0577         qcom,select-utmi-as-pipe-clk;
0578 };
0579 
0580 &usb_1_dwc3 {
0581         /*
0582          * We don't have the capability to switch modes yet.
0583          */
0584         dr_mode = "peripheral";
0585 
0586         /* fastest mode for USB 2 */
0587         maximum-speed = "high-speed";
0588 
0589         /* Remove USB3 phy as it's unused on this device. */
0590         phys = <&usb_1_hsphy>;
0591         phy-names = "usb2-phy";
0592 };
0593 
0594 &usb_1_hsphy {
0595         status = "okay";
0596 
0597         vdd-supply = <&vdda_usb1_ss_core>;
0598         vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
0599         vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
0600 
0601         qcom,imp-res-offset-value = <8>;
0602         qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
0603         qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
0604         qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
0605 };
0606 
0607 &tlmm {
0608         gpio-reserved-ranges = <0 4>, <81 4>;
0609 
0610         tri_state_key_default: tri_state_key_default {
0611                 mux {
0612                         pins = "gpio40", "gpio42", "gpio26";
0613                         function = "gpio";
0614                         drive-strength = <2>;
0615                         bias-disable;
0616                 };
0617         };
0618 
0619         ts_default_pins: ts-int {
0620                 mux {
0621                         pins = "gpio99", "gpio125";
0622                         function = "gpio";
0623                         drive-strength = <16>;
0624                         bias-pull-up;
0625                 };
0626         };
0627 
0628         panel_reset_pins: panel-reset {
0629                 mux {
0630                         pins = "gpio6", "gpio25", "gpio26";
0631                         function = "gpio";
0632                         drive-strength = <8>;
0633                         bias-disable;
0634                 };
0635         };
0636 
0637         panel_te_pin: panel-te {
0638                 mux {
0639                         pins = "gpio10";
0640                         function = "mdp_vsync";
0641                         drive-strength = <2>;
0642                         bias-disable;
0643                         input-enable;
0644                 };
0645         };
0646 
0647         panel_esd_pin: panel-esd {
0648                 mux {
0649                         pins = "gpio30";
0650                         function = "gpio";
0651                         drive-strength = <2>;
0652                         bias-pull-down;
0653                         input-enable;
0654                 };
0655         };
0656 };
0657 
0658 &venus {
0659         status = "okay";
0660         firmware-name = "qcom/sdm845/oneplus6/venus.mbn";
0661 };
0662 
0663 &wifi {
0664         status = "okay";
0665         vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
0666         vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
0667         vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
0668         vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
0669         vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
0670 
0671         qcom,snoc-host-cap-8bit-quirk;
0672 };