0001 // SPDX-License-Identifier: BSD-3-Clause
0002 /*
0003 * OnePlus 5(T) (cheeseburger / dumpling) common device tree source based on msm8998-mtp.dtsi
0004 *
0005 * Copyright (c) 2021, Jami Kettunen <jamipkettunen@gmail.com>
0006 * Copyright (c) 2016, The Linux Foundation. All rights reserved.
0007 */
0008
0009 /dts-v1/;
0010
0011 #include <dt-bindings/gpio/gpio.h>
0012 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
0013 #include "msm8998.dtsi"
0014 #include "pm8005.dtsi"
0015 #include "pm8998.dtsi"
0016 #include "pmi8998.dtsi"
0017
0018 / {
0019 /* Required for bootloader to select correct board */
0020 qcom,msm-id = <292 0x20001>; /* 8998 v2.1 */
0021
0022 chosen {
0023 #address-cells = <2>;
0024 #size-cells = <2>;
0025 ranges;
0026
0027 /* Use display framebuffer setup by the UEFI XBL bootloader for simplefb */
0028 framebuffer0: framebuffer@9d400000 {
0029 compatible = "simple-framebuffer";
0030 reg = <0x0 0x9d400000 0x0 0x2400000>;
0031 width = <1080>;
0032 height = <1920>;
0033 stride = <(1080 * 4)>;
0034 format = "a8r8g8b8";
0035 /*
0036 * That's a lot of clocks, but it's necessary due
0037 * to unused clk cleanup & no panel driver yet..
0038 */
0039 clocks = <&mmcc MDSS_AHB_CLK>,
0040 <&mmcc MDSS_AXI_CLK>,
0041 <&mmcc MDSS_VSYNC_CLK>,
0042 <&mmcc MDSS_MDP_CLK>,
0043 <&mmcc MDSS_BYTE0_CLK>,
0044 <&mmcc MDSS_BYTE0_INTF_CLK>,
0045 <&mmcc MDSS_PCLK0_CLK>,
0046 <&mmcc MDSS_ESC0_CLK>;
0047 power-domains = <&mmcc MDSS_GDSC>;
0048 };
0049 };
0050
0051 reserved-memory {
0052 /* Bootloader display framebuffer region */
0053 cont_splash_mem: memory@9d400000 {
0054 reg = <0x0 0x9d400000 0x0 0x2400000>;
0055 no-map;
0056 };
0057
0058 /* For getting crash logs using Android downstream kernels */
0059 ramoops@ac000000 {
0060 compatible = "ramoops";
0061 reg = <0x0 0xac000000 0x0 0x200000>;
0062 console-size = <0x80000>;
0063 pmsg-size = <0x40000>;
0064 record-size = <0x8000>;
0065 ftrace-size = <0x20000>;
0066 };
0067
0068 /*
0069 * The following memory regions on downstream are "dynamically allocated"
0070 * but given the same addresses every time. Hard code them as these addresses
0071 * are where the OnePlus signed firmware expects them to be.
0072 */
0073 ipa_fws_region: ipa@f6800000 {
0074 compatible = "shared-dma-pool";
0075 reg = <0x0 0xf6800000 0x0 0x5000>;
0076 no-map;
0077 };
0078 zap_shader_region: gpu@f6900000 {
0079 compatible = "shared-dma-pool";
0080 reg = <0x0 0xf6900000 0x0 0x2000>;
0081 no-map;
0082 };
0083 };
0084
0085 gpio-keys {
0086 compatible = "gpio-keys";
0087 label = "Volume buttons";
0088 autorepeat;
0089
0090 pinctrl-names = "default";
0091 pinctrl-0 = <&vol_keys_default>;
0092
0093 button-vol-down {
0094 label = "Volume down";
0095 gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
0096 linux,code = <KEY_VOLUMEDOWN>;
0097 debounce-interval = <15>;
0098 wakeup-source;
0099 };
0100
0101 button-vol-up {
0102 label = "Volume up";
0103 gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
0104 linux,code = <KEY_VOLUMEUP>;
0105 debounce-interval = <15>;
0106 wakeup-source;
0107 };
0108 };
0109
0110 gpio-hall-sensor {
0111 compatible = "gpio-keys";
0112 label = "Hall effect sensor";
0113
0114 pinctrl-names = "default";
0115 pinctrl-0 = <&hall_sensor_default>;
0116
0117 event-hall-sensor {
0118 label = "Hall Effect Sensor";
0119 gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
0120 linux,input-type = <EV_SW>;
0121 linux,code = <SW_LID>;
0122 linux,can-disable;
0123 wakeup-source;
0124 };
0125 };
0126
0127 vph_pwr: vph-pwr-regulator {
0128 compatible = "regulator-fixed";
0129 regulator-name = "vph_pwr";
0130 regulator-always-on;
0131 regulator-boot-on;
0132 };
0133 };
0134
0135 /*
0136 * OnePlus' ADSP firmware requires 30 MiB in total, so increase the adsp_mem
0137 * region by 4 MiB to account for this while relocating the other now
0138 * conflicting memory nodes accordingly.
0139 */
0140 &adsp_mem {
0141 reg = <0x0 0x8b200000 0x0 0x1e00000>;
0142 };
0143 &mpss_mem {
0144 reg = <0x0 0x8d000000 0x0 0x7000000>;
0145 };
0146 &venus_mem {
0147 reg = <0x0 0x94000000 0x0 0x500000>;
0148 };
0149 &mba_mem {
0150 reg = <0x0 0x94500000 0x0 0x200000>;
0151 };
0152 &slpi_mem {
0153 reg = <0x0 0x94700000 0x0 0xf00000>;
0154 };
0155 &ipa_fw_mem {
0156 reg = <0x0 0x95600000 0x0 0x10000>;
0157 };
0158 &ipa_gsi_mem {
0159 reg = <0x0 0x95610000 0x0 0x5000>;
0160 };
0161 &gpu_mem {
0162 reg = <0x0 0x95615000 0x0 0x100000>;
0163 };
0164 &wlan_msa_mem {
0165 reg = <0x0 0x95715000 0x0 0x100000>;
0166 };
0167
0168 &blsp1_i2c5 {
0169 status = "okay";
0170
0171 touchscreen@20 {
0172 compatible = "syna,rmi4-i2c";
0173 reg = <0x20>;
0174 #address-cells = <1>;
0175 #size-cells = <0>;
0176
0177 interrupt-parent = <&tlmm>;
0178 interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
0179
0180 pinctrl-names = "default";
0181 pinctrl-0 = <&ts_int_active &ts_reset_active>;
0182
0183 vdd-supply = <&vreg_l28_3p0>;
0184 vio-supply = <&vreg_l6a_1p8>;
0185
0186 syna,reset-delay-ms = <20>;
0187 syna,startup-delay-ms = <20>;
0188
0189 rmi4-f01@1 {
0190 reg = <0x01>;
0191 syna,nosleep-mode = <1>;
0192 };
0193
0194 rmi4_f12: rmi4-f12@12 {
0195 reg = <0x12>;
0196 syna,rezero-wait-ms = <20>;
0197 syna,sensor-type = <1>;
0198 touchscreen-x-mm = <68>;
0199 touchscreen-y-mm = <122>;
0200 };
0201 };
0202 };
0203
0204 &blsp1_i2c6 {
0205 status = "okay";
0206
0207 nfc@28 {
0208 compatible = "nxp,nxp-nci-i2c";
0209 reg = <0x28>;
0210
0211 interrupt-parent = <&tlmm>;
0212 interrupts = <92 IRQ_TYPE_LEVEL_HIGH>;
0213
0214 enable-gpios = <&tlmm 116 GPIO_ACTIVE_HIGH>;
0215
0216 pinctrl-names = "default";
0217 pinctrl-0 = <&nfc_int_active &nfc_enable_active>;
0218 };
0219 };
0220
0221 &blsp1_uart3 {
0222 status = "okay";
0223
0224 bluetooth {
0225 compatible = "qcom,wcn3990-bt";
0226
0227 vddio-supply = <&vreg_s4a_1p8>;
0228 vddxo-supply = <&vreg_l7a_1p8>;
0229 vddrf-supply = <&vreg_l17a_1p3>;
0230 vddch0-supply = <&vreg_l25a_3p3>;
0231 max-speed = <3200000>;
0232 };
0233 };
0234
0235 &blsp1_uart3_on {
0236 rx {
0237 /delete-property/ bias-disable;
0238 /*
0239 * Configure a pull-up on 46 (RX). This is needed to
0240 * avoid garbage data when the TX pin of the Bluetooth
0241 * module is in tri-state (module powered off or not
0242 * driving the signal yet).
0243 */
0244 bias-pull-up;
0245 };
0246
0247 cts {
0248 /delete-property/ bias-disable;
0249 /*
0250 * Configure a pull-down on 47 (CTS) to match the pull
0251 * of the Bluetooth module.
0252 */
0253 bias-pull-down;
0254 };
0255 };
0256
0257 &blsp2_uart1 {
0258 status = "okay";
0259 };
0260
0261 &pm8005_regulators {
0262 /* VDD_GFX supply */
0263 pm8005_s1: s1 {
0264 regulator-min-microvolt = <524000>;
0265 regulator-max-microvolt = <1100000>;
0266 regulator-enable-ramp-delay = <500>;
0267 /* Hack until we rig up the gpu consumer */
0268 regulator-always-on;
0269 };
0270 };
0271
0272 &pm8998_gpio {
0273 vol_keys_default: vol-keys-state {
0274 pins = "gpio5", "gpio6";
0275 function = "normal";
0276 bias-pull-up;
0277 input-enable;
0278 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
0279 };
0280 };
0281
0282 &qusb2phy {
0283 status = "okay";
0284
0285 vdd-supply = <&vreg_l1a_0p875>;
0286 vdda-pll-supply = <&vreg_l12a_1p8>;
0287 vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
0288 };
0289
0290 &rpm_requests {
0291 pm8998-regulators {
0292 compatible = "qcom,rpm-pm8998-regulators";
0293
0294 vdd_s1-supply = <&vph_pwr>;
0295 vdd_s2-supply = <&vph_pwr>;
0296 vdd_s3-supply = <&vph_pwr>;
0297 vdd_s4-supply = <&vph_pwr>;
0298 vdd_s5-supply = <&vph_pwr>;
0299 vdd_s6-supply = <&vph_pwr>;
0300 vdd_s7-supply = <&vph_pwr>;
0301 vdd_s8-supply = <&vph_pwr>;
0302 vdd_s9-supply = <&vph_pwr>;
0303 vdd_s10-supply = <&vph_pwr>;
0304 vdd_s11-supply = <&vph_pwr>;
0305 vdd_s12-supply = <&vph_pwr>;
0306 vdd_s13-supply = <&vph_pwr>;
0307 vdd_l1_l27-supply = <&vreg_s7a_1p025>;
0308 vdd_l2_l8_l17-supply = <&vreg_s3a_1p35>;
0309 vdd_l3_l11-supply = <&vreg_s7a_1p025>;
0310 vdd_l4_l5-supply = <&vreg_s7a_1p025>;
0311 vdd_l6-supply = <&vreg_s5a_2p04>;
0312 vdd_l7_l12_l14_l15-supply = <&vreg_s5a_2p04>;
0313 vdd_l9-supply = <&vreg_bob>;
0314 vdd_l10_l23_l25-supply = <&vreg_bob>;
0315 vdd_l13_l19_l21-supply = <&vreg_bob>;
0316 vdd_l16_l28-supply = <&vreg_bob>;
0317 vdd_l18_l22-supply = <&vreg_bob>;
0318 vdd_l20_l24-supply = <&vreg_bob>;
0319 vdd_l26-supply = <&vreg_s3a_1p35>;
0320 vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
0321
0322 vreg_s3a_1p35: s3 {
0323 regulator-min-microvolt = <1352000>;
0324 regulator-max-microvolt = <1352000>;
0325 };
0326
0327 vreg_s4a_1p8: s4 {
0328 regulator-min-microvolt = <1800000>;
0329 regulator-max-microvolt = <1800000>;
0330 regulator-allow-set-load;
0331 };
0332
0333 vreg_s5a_2p04: s5 {
0334 regulator-min-microvolt = <1904000>;
0335 regulator-max-microvolt = <2040000>;
0336 };
0337
0338 vreg_s7a_1p025: s7 {
0339 regulator-min-microvolt = <900000>;
0340 regulator-max-microvolt = <1028000>;
0341 };
0342
0343 vreg_l1a_0p875: l1 {
0344 regulator-min-microvolt = <880000>;
0345 regulator-max-microvolt = <880000>;
0346 };
0347
0348 vreg_l2a_1p2: l2 {
0349 regulator-min-microvolt = <1200000>;
0350 regulator-max-microvolt = <1200000>;
0351 };
0352
0353 vreg_l3a_1p0: l3 {
0354 regulator-min-microvolt = <1000000>;
0355 regulator-max-microvolt = <1000000>;
0356 };
0357
0358 vreg_l5a_0p8: l5 {
0359 regulator-min-microvolt = <800000>;
0360 regulator-max-microvolt = <800000>;
0361 };
0362
0363 vreg_l6a_1p8: l6 {
0364 regulator-min-microvolt = <1808000>;
0365 regulator-max-microvolt = <1808000>;
0366 };
0367
0368 vreg_l7a_1p8: l7 {
0369 regulator-min-microvolt = <1800000>;
0370 regulator-max-microvolt = <1800000>;
0371 };
0372
0373 vreg_l8a_1p2: l8 {
0374 regulator-min-microvolt = <1200000>;
0375 regulator-max-microvolt = <1200000>;
0376 };
0377
0378 vreg_l9a_1p8: l9 {
0379 regulator-min-microvolt = <1808000>;
0380 regulator-max-microvolt = <2960000>;
0381 };
0382
0383 vreg_l10a_1p8: l10 {
0384 regulator-min-microvolt = <1808000>;
0385 regulator-max-microvolt = <2960000>;
0386 };
0387
0388 vreg_l11a_1p0: l11 {
0389 regulator-min-microvolt = <1000000>;
0390 regulator-max-microvolt = <1000000>;
0391 };
0392
0393 vreg_l12a_1p8: l12 {
0394 regulator-min-microvolt = <1800000>;
0395 regulator-max-microvolt = <1800000>;
0396 };
0397
0398 vreg_l13a_2p95: l13 {
0399 regulator-min-microvolt = <1808000>;
0400 regulator-max-microvolt = <2960000>;
0401 };
0402
0403 vreg_l14a_1p88: l14 {
0404 regulator-min-microvolt = <1880000>;
0405 regulator-max-microvolt = <1880000>;
0406 };
0407
0408 vreg_l15a_1p8: l15 {
0409 regulator-min-microvolt = <1800000>;
0410 regulator-max-microvolt = <1800000>;
0411 };
0412
0413 vreg_l16a_2p7: l16 {
0414 regulator-min-microvolt = <2704000>;
0415 regulator-max-microvolt = <2704000>;
0416 };
0417
0418 vreg_l17a_1p3: l17 {
0419 regulator-min-microvolt = <1304000>;
0420 regulator-max-microvolt = <1304000>;
0421 };
0422
0423 vreg_l18a_2p7: l18 {
0424 regulator-min-microvolt = <2704000>;
0425 regulator-max-microvolt = <2704000>;
0426 };
0427
0428 vreg_l19a_3p0: l19 {
0429 regulator-min-microvolt = <3008000>;
0430 regulator-max-microvolt = <3008000>;
0431 };
0432
0433 vreg_l20a_2p95: l20 {
0434 regulator-min-microvolt = <2960000>;
0435 regulator-max-microvolt = <2960000>;
0436 regulator-allow-set-load;
0437 };
0438 vreg_l21a_2p95: l21 {
0439 regulator-min-microvolt = <2960000>;
0440 regulator-max-microvolt = <2960000>;
0441 regulator-system-load = <800000>;
0442 regulator-allow-set-load;
0443 };
0444
0445 vreg_l22a_2p85: l22 {
0446 regulator-min-microvolt = <2864000>;
0447 regulator-max-microvolt = <2864000>;
0448 };
0449
0450 vreg_l23a_3p3: l23 {
0451 regulator-min-microvolt = <3312000>;
0452 regulator-max-microvolt = <3312000>;
0453 };
0454
0455 vreg_l24a_3p075: l24 {
0456 regulator-min-microvolt = <3088000>;
0457 regulator-max-microvolt = <3088000>;
0458 };
0459
0460 vreg_l25a_3p3: l25 {
0461 regulator-min-microvolt = <3104000>;
0462 regulator-max-microvolt = <3312000>;
0463 };
0464
0465 vreg_l26a_1p2: l26 {
0466 regulator-min-microvolt = <1200000>;
0467 regulator-max-microvolt = <1200000>;
0468 regulator-allow-set-load;
0469 };
0470
0471 vreg_l28_3p0: l28 {
0472 regulator-min-microvolt = <3008000>;
0473 regulator-max-microvolt = <3008000>;
0474 };
0475
0476 vreg_lvs1a_1p8: lvs1 { };
0477 vreg_lvs2a_1p8: lvs2 { };
0478 };
0479
0480 pmi8998-regulators {
0481 compatible = "qcom,rpm-pmi8998-regulators";
0482
0483 vdd_bob-supply = <&vph_pwr>;
0484
0485 vreg_bob: bob {
0486 regulator-min-microvolt = <3312000>;
0487 regulator-max-microvolt = <3600000>;
0488 };
0489 };
0490 };
0491
0492 &tlmm {
0493 gpio-reserved-ranges = <0 4>, <81 4>;
0494
0495 hall_sensor_default: hall-sensor-default {
0496 pins = "gpio124";
0497 function = "gpio";
0498 drive-strength = <2>;
0499 bias-disable;
0500 input-enable;
0501 };
0502
0503 ts_int_active: ts-int-active {
0504 pins = "gpio125";
0505 function = "gpio";
0506 drive-strength = <8>;
0507 bias-pull-up;
0508 };
0509
0510 ts_reset_active: ts-reset-active {
0511 pins = "gpio89";
0512 function = "gpio";
0513 drive-strength = <8>;
0514 bias-pull-up;
0515 };
0516
0517 nfc_int_active: nfc-int-active {
0518 pins = "gpio92";
0519 function = "gpio";
0520 drive-strength = <6>;
0521 bias-pull-up;
0522 };
0523
0524 nfc_enable_active: nfc-enable-active {
0525 pins = "gpio12", "gpio116";
0526 function = "gpio";
0527 drive-strength = <6>;
0528 bias-pull-up;
0529 };
0530 };
0531
0532 &ufshc {
0533 status = "okay";
0534
0535 vcc-supply = <&vreg_l20a_2p95>;
0536 vccq-supply = <&vreg_l26a_1p2>;
0537 vccq2-supply = <&vreg_s4a_1p8>;
0538 vcc-max-microamp = <750000>;
0539 vccq-max-microamp = <560000>;
0540 vccq2-max-microamp = <750000>;
0541 };
0542
0543 &ufsphy {
0544 status = "okay";
0545
0546 vdda-phy-supply = <&vreg_l1a_0p875>;
0547 vdda-pll-supply = <&vreg_l2a_1p2>;
0548 vddp-ref-clk-supply = <&vreg_l26a_1p2>;
0549 };
0550
0551 &usb3 {
0552 status = "okay";
0553
0554 /* Disable USB3 clock requirement as the device only supports USB2 */
0555 qcom,select-utmi-as-pipe-clk;
0556 };
0557
0558 &usb3_dwc3 {
0559 /* Drop the unused USB 3 PHY */
0560 phys = <&qusb2phy>;
0561 phy-names = "usb2-phy";
0562
0563 /* Fastest mode for USB 2 */
0564 maximum-speed = "high-speed";
0565
0566 /* Force to peripheral until we can switch modes */
0567 dr_mode = "peripheral";
0568 };
0569
0570 &wifi {
0571 /* Leave disabled until MSS is functional */
0572 vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
0573 vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
0574 vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
0575 vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
0576 };