Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: BSD-3-Clause
0002 /*
0003  * Copyright (c) 2020, Konrad Dybcio <konrad.dybcio@somainline.org>
0004  */
0005 
0006 #include "msm8994.dtsi"
0007 #include "pm8994.dtsi"
0008 #include "pmi8994.dtsi"
0009 #include <dt-bindings/gpio/gpio.h>
0010 #include <dt-bindings/input/gpio-keys.h>
0011 
0012 / {
0013         /* required for bootloader to select correct board */
0014 
0015         /*
0016          * We support MSM8994 v2 (0x20000) and v2.1 (0x20001).
0017          * The V1 chip (0x0 and 0x10000) is significantly different
0018          * and requires driver-side changes (including CPR, be warned!!).
0019          * Besides that, it's very rare.
0020          */
0021         qcom,msm-id = <207 0x20000>, <207 0x20001>;
0022         /* We only use pm8994+pmi8994. */
0023         qcom,pmic-id = <0x10009 0x1000a 0x00 0x00>;
0024         /* This property is shared across all kitakami devices. */
0025         qcom,board-id = <8 0>;
0026 
0027         /* Kitakami firmware doesn't support PSCI */
0028         /delete-node/ psci;
0029 
0030         gpio-keys {
0031                 compatible = "gpio-keys";
0032                 autorepeat;
0033 
0034                 button-0 {
0035                         label = "Volume Down";
0036                         gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
0037                         linux,input-type = <1>;
0038                         linux,code = <KEY_VOLUMEDOWN>;
0039                         wakeup-source;
0040                         debounce-interval = <15>;
0041                 };
0042 
0043                 button-1 {
0044                         label = "Volume Up";
0045                         gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
0046                         linux,input-type = <1>;
0047                         linux,code = <KEY_VOLUMEUP>;
0048                         wakeup-source;
0049                         debounce-interval = <15>;
0050                 };
0051 
0052                 button-2 {
0053                         label = "Camera Snapshot";
0054                         gpios = <&pm8994_gpios 4 GPIO_ACTIVE_LOW>;
0055                         linux,input-type = <1>;
0056                         linux,code = <KEY_CAMERA>;
0057                         wakeup-source;
0058                         debounce-interval = <15>;
0059                 };
0060 
0061                 button-3 {
0062                         label = "Camera Focus";
0063                         gpios = <&pm8994_gpios 5 GPIO_ACTIVE_LOW>;
0064                         linux,input-type = <1>;
0065                         linux,code = <KEY_VOLUMEUP>;
0066                         wakeup-source;
0067                         debounce-interval = <15>;
0068                 };
0069         };
0070 
0071         reserved-memory {
0072                 /* This is for getting crash logs using Android downstream kernels */
0073                 ramoops@1fe00000 {
0074                         compatible = "ramoops";
0075                         reg = <0 0x1fe00000 0 0x200000>;
0076                         console-size = <0x100000>;
0077                         record-size = <0x10000>;
0078                         ftrace-size = <0x10000>;
0079                         pmsg-size = <0x80000>;
0080                 };
0081 
0082                 fb_region: fb_region@40000000 {
0083                         reg = <0 0x40000000 0 0x1000000>;
0084                         no-map;
0085                 };
0086 
0087                 tzapp: memory@c7800000 {
0088                         reg = <0 0xc7800000 0 0x1900000>;
0089                         no-map;
0090                 };
0091         };
0092 };
0093 
0094 &blsp1_spi1 {
0095         status = "okay";
0096 
0097         /* FPC fingerprint reader */
0098 };
0099 
0100 /* I2C1 is disabled on this board */
0101 
0102 &blsp1_i2c2 {
0103         status = "okay";
0104         clock-frequency = <355000>;
0105 
0106         /* NXP PN547 NFC */
0107 };
0108 
0109 &blsp1_i2c6 {
0110         status = "okay";
0111         clock-frequency = <355000>;
0112 
0113         touchscreen: rmi4-i2c-dev@2c {
0114                 compatible = "syna,rmi4-i2c";
0115                 reg = <0x2c>;
0116                 #address-cells = <1>;
0117                 #size-cells = <0>;
0118 
0119                 interrupt-parent = <&tlmm>;
0120                 interrupts = <42 IRQ_TYPE_EDGE_FALLING>;
0121 
0122                 pinctrl-names = "default";
0123                 pinctrl-0 = <&ts_int_active &ts_reset_active>;
0124 
0125                 vdd-supply = <&pm8994_l22>;
0126                 vio-supply = <&pm8994_s4>;
0127 
0128                 syna,reset-delay-ms = <220>;
0129                 syna,startup-delay-ms = <220>;
0130 
0131                 rmi4-f01@1 {
0132                         reg = <0x01>;
0133                         syna,nosleep-mode = <1>;
0134                 };
0135 
0136                 rmi4-f11@11 {
0137                         reg = <0x11>;
0138                         syna,sensor-type = <1>;
0139                 };
0140         };
0141 };
0142 
0143 &blsp1_uart2 {
0144         status = "okay";
0145 };
0146 
0147 &blsp2_i2c5 {
0148         status = "okay";
0149         clock-frequency = <355000>;
0150 
0151         /* sii8620 HDMI/MHL bridge */
0152 };
0153 
0154 &blsp2_uart2 {
0155         status = "okay";
0156 };
0157 
0158 /*
0159  * Kitakami bootloader only turns cont_splash on when it detects
0160  * specific downstream MDSS/backlight nodes in the active DTB.
0161  * One way to use that framebuffer is to load a secondary instance of
0162  * LK with the downstream DTB appended and then, only from there, load
0163  * mainline Linux.
0164  */
0165 &cont_splash_mem {
0166         reg = <0 0x3401000 0 0x2200000>;
0167 };
0168 
0169 &pmi8994_spmi_regulators {
0170         /*
0171          * Yeah, this one *is* managed by RPMPD, but also needs
0172          * to be hacked up as a-o due to the GPU device only accepting a single
0173          * power domain.. which still isn't enough and forces us to bind
0174          * OXILI_CX and OXILI_GX together!
0175          */
0176         vdd_gfx: s2@1700 {
0177                 reg = <0x1700 0x100>;
0178                 regulator-name = "VDD_GFX";
0179                 regulator-min-microvolt = <980000>;
0180                 regulator-max-microvolt = <980000>;
0181 
0182                 /* hack until we rig up the gpu consumer */
0183                 regulator-always-on;
0184         };
0185 };
0186 
0187 &rpm_requests {
0188         /* PMI8994 should probe first, because pmi8994_bby supplies some of PM8994's regulators */
0189         pmi8994_regulators: pmi8994-regulators {
0190                 compatible = "qcom,rpm-pmi8994-regulators";
0191 
0192                 vdd_s1-supply = <&vph_pwr>;
0193                 vdd_bst_byp-supply = <&vph_pwr>;
0194 
0195                 pmi8994_s1: s1 {
0196                         regulator-min-microvolt = <1025000>;
0197                         regulator-max-microvolt = <1025000>;
0198                 };
0199 
0200                 /* S2 & S3 - VDD_GFX */
0201 
0202                 pmi8994_bby: boost-bypass {
0203                         regulator-min-microvolt = <3150000>;
0204                         regulator-max-microvolt = <3600000>;
0205                 };
0206         };
0207 
0208         pm8994_regulators: pm8994-regulators {
0209                 compatible = "qcom,rpm-pm8994-regulators";
0210 
0211                 vdd_s3-supply = <&vph_pwr>;
0212                 vdd_s4-supply = <&vph_pwr>;
0213                 vdd_s5-supply = <&vph_pwr>;
0214                 vdd_s6-supply = <&vph_pwr>;
0215                 vdd_s7-supply = <&vph_pwr>;
0216                 vdd_l1-supply = <&pmi8994_s1>;
0217                 vdd_l2_l26_l28-supply = <&pm8994_s3>;
0218                 vdd_l3_l11-supply = <&pm8994_s3>;
0219                 vdd_l4_l27_l31-supply = <&pm8994_s3>;
0220                 vdd_l6_l12_l32-supply = <&pm8994_s5>;
0221                 vdd_l8_l16_l30-supply = <&vph_pwr>;
0222                 vdd_l9_l10_l18_l22-supply = <&pmi8994_bby>;
0223                 vdd_l13_l19_l23_l24-supply = <&pmi8994_bby>;
0224                 vdd_l14_l15-supply = <&pm8994_s5>;
0225                 vdd_l17_l29-supply = <&pmi8994_bby>;
0226                 vdd_l20_l21-supply = <&pmi8994_bby>;
0227                 vdd_l25-supply = <&pm8994_s3>;
0228                 vdd_lvs1_2-supply = <&pm8994_s4>;
0229 
0230                 /* S1, S2, S6 and S12 are managed by RPMPD */
0231 
0232                 pm8994_s3: s3 {
0233                         regulator-min-microvolt = <1300000>;
0234                         regulator-max-microvolt = <1300000>;
0235                 };
0236 
0237                 pm8994_s4: s4 {
0238                         regulator-min-microvolt = <1800000>;
0239                         regulator-max-microvolt = <1800000>;
0240                         regulator-system-load = <325000>;
0241                         regulator-allow-set-load;
0242                         regulator-always-on;
0243                 };
0244 
0245                 pm8994_s5: s5 {
0246                         regulator-min-microvolt = <2150000>;
0247                         regulator-max-microvolt = <2150000>;
0248                 };
0249 
0250                 pm8994_s7: s7 {
0251                         regulator-min-microvolt = <1000000>;
0252                         regulator-max-microvolt = <1000000>;
0253                 };
0254 
0255                 /*
0256                  * S8 - SPMI-managed VDD_APC0
0257                  * S9, S10 and S11 (the main one) - SPMI-managed VDD_APC1
0258                  */
0259 
0260                 pm8994_l1: l1 {
0261                         regulator-min-microvolt = <1000000>;
0262                         regulator-max-microvolt = <1000000>;
0263                 };
0264 
0265                 pm8994_l2: l2 {
0266                         regulator-min-microvolt = <1250000>;
0267                         regulator-max-microvolt = <1250000>;
0268                         regulator-system-load = <10000>;
0269                         regulator-allow-set-load;
0270                 };
0271 
0272                 pm8994_l3: l3 {
0273                         regulator-min-microvolt = <1100000>;
0274                         regulator-max-microvolt = <1100000>;
0275                         regulator-boot-on;
0276                 };
0277 
0278                 pm8994_l4: l4 {
0279                         regulator-min-microvolt = <1225000>;
0280                         regulator-max-microvolt = <1225000>;
0281                 };
0282 
0283                 /* L5 is inaccessible from RPM */
0284 
0285                 pm8994_l6: l6 {
0286                         regulator-min-microvolt = <1800000>;
0287                         regulator-max-microvolt = <1800000>;
0288                 };
0289 
0290                 /* L7 is inaccessible from RPM */
0291 
0292                 pm8994_l8: l8 {
0293                         regulator-min-microvolt = <1800000>;
0294                         regulator-max-microvolt = <1800000>;
0295                 };
0296 
0297                 pm8994_l9: l9 {
0298                         regulator-min-microvolt = <1800000>;
0299                         regulator-max-microvolt = <1800000>;
0300                 };
0301 
0302                 pm8994_l10: l10 {
0303                         regulator-min-microvolt = <1800000>;
0304                         regulator-max-microvolt = <1800000>;
0305                 };
0306 
0307                 pm8994_l11: l11 {
0308                         regulator-min-microvolt = <1200000>;
0309                         regulator-max-microvolt = <1200000>;
0310                 };
0311 
0312                 pm8994_l12: l12 {
0313                         regulator-min-microvolt = <1800000>;
0314                         regulator-max-microvolt = <1800000>;
0315                         regulator-system-load = <10000>;
0316                         regulator-allow-set-load;
0317                 };
0318 
0319                 pm8994_l13: l13 {
0320                         regulator-min-microvolt = <1800000>;
0321                         regulator-max-microvolt = <2950000>;
0322                 };
0323 
0324                 pm8994_l14: l14 {
0325                         regulator-min-microvolt = <1800000>;
0326                         regulator-max-microvolt = <1800000>;
0327                         regulator-system-load = <10000>;
0328                         regulator-allow-set-load;
0329                         regulator-boot-on;
0330                 };
0331 
0332                 pm8994_l15: l15 {
0333                         regulator-min-microvolt = <1800000>;
0334                         regulator-max-microvolt = <1800000>;
0335                 };
0336 
0337                 pm8994_l16: l16 {
0338                         regulator-min-microvolt = <2700000>;
0339                         regulator-max-microvolt = <2700000>;
0340                 };
0341 
0342                 pm8994_l17: l17 {
0343                         regulator-min-microvolt = <2200000>;
0344                         regulator-max-microvolt = <2200000>;
0345                         regulator-boot-on;
0346                 };
0347 
0348                 pm8994_l18: l18 {
0349                         regulator-min-microvolt = <2850000>;
0350                         regulator-max-microvolt = <2850000>;
0351                         regulator-always-on;
0352                         regulator-boot-on;
0353                 };
0354 
0355                 pm8994_l19: l19 {
0356                         regulator-min-microvolt = <2850000>;
0357                         regulator-max-microvolt = <2850000>;
0358                         regulator-boot-on;
0359                 };
0360 
0361                 pm8994_l20: l20 {
0362                         regulator-min-microvolt = <2950000>;
0363                         regulator-max-microvolt = <2950000>;
0364                         regulator-system-load = <570000>;
0365                         regulator-allow-set-load;
0366                 };
0367 
0368                 pm8994_l21: l21 {
0369                         regulator-min-microvolt = <2950000>;
0370                         regulator-max-microvolt = <2950000>;
0371                         regulator-system-load = <800000>;
0372                         regulator-allow-set-load;
0373                 };
0374 
0375                 pm8994_l22: l22 {
0376                         regulator-min-microvolt = <3000000>;
0377                         regulator-max-microvolt = <3000000>;
0378                         regulator-boot-on;
0379                 };
0380 
0381                 pm8994_l23: l23 {
0382                         regulator-min-microvolt = <2800000>;
0383                         regulator-max-microvolt = <2800000>;
0384                         regulator-always-on;
0385                         regulator-boot-on;
0386                 };
0387 
0388                 pm8994_l24: l24 {
0389                         regulator-min-microvolt = <3075000>;
0390                         regulator-max-microvolt = <3150000>;
0391                 };
0392 
0393                 pm8994_l25: l25 {
0394                         regulator-min-microvolt = <1000000>;
0395                         regulator-max-microvolt = <1000000>;
0396                         regulator-boot-on;
0397                 };
0398 
0399                 pm8994_l26: l26 {
0400                         regulator-min-microvolt = <987500>;
0401                         regulator-max-microvolt = <987500>;
0402                 };
0403 
0404                 pm8994_l27: l27 {
0405                         regulator-min-microvolt = <1200000>;
0406                         regulator-max-microvolt = <1200000>;
0407                         regulator-boot-on;
0408                 };
0409 
0410                 pm8994_l28: l28 {
0411                         regulator-min-microvolt = <1000000>;
0412                         regulator-max-microvolt = <1000000>;
0413                         regulator-system-load = <10000>;
0414                         regulator-allow-set-load;
0415                 };
0416 
0417                 pm8994_l29: l29 {
0418                         regulator-min-microvolt = <2700000>;
0419                         regulator-max-microvolt = <2700000>;
0420                         regulator-boot-on;
0421                 };
0422 
0423                 pm8994_l30: l30 {
0424                         regulator-min-microvolt = <1800000>;
0425                         regulator-max-microvolt = <1800000>;
0426                         regulator-boot-on;
0427                 };
0428 
0429                 pm8994_l31: l31 {
0430                         regulator-min-microvolt = <1200000>;
0431                         regulator-max-microvolt = <1200000>;
0432                         regulator-system-load = <10000>;
0433                         regulator-allow-set-load;
0434                 };
0435 
0436                 pm8994_l32: l32 {
0437                         regulator-min-microvolt = <1800000>;
0438                         regulator-max-microvolt = <1800000>;
0439                 };
0440 
0441                 pm8994_lvs1: lvs1 {
0442                         regulator-boot-on;
0443                 };
0444                 pm8994_lvs2: lvs2 {
0445                         regulator-boot-on;
0446                 };
0447         };
0448 };
0449 
0450 &sdhc1 {
0451         /*
0452          * There is an issue with the eMMC causing permanent
0453          * damage to the card if a quirk isn't addressed.
0454          * Until it's fixed, disable the MMC so as not to brick
0455          * devices.
0456          */
0457         status = "disabled";
0458 
0459         /*
0460          * Downstream pushes 2.95V to the sdhci device,
0461          * but upstream driver REALLY wants to make vmmc 1.8v
0462          * cause of the hs400-1_8v mode. MMC works fine without
0463          * that regulator, so let's not use it for now.
0464          * vqmmc is also disabled cause driver stll complains.
0465          *
0466          * vmmc-supply = <&pm8994_l20>;
0467          * vqmmc-supply = <&pm8994_s4>;
0468          */
0469 };
0470 
0471 &sdhc2 {
0472         status = "okay";
0473 
0474         cd-gpios = <&tlmm 100 0>;
0475         vmmc-supply = <&pm8994_l21>;
0476         vqmmc-supply = <&pm8994_l13>;
0477 };
0478 
0479 &tlmm {
0480         ts_int_active: ts-int-active {
0481                 pins = "gpio42";
0482                 drive-strength = <2>;
0483                 bias-disable;
0484                 input-enable;
0485         };
0486 
0487         ts_reset_active: ts-reset-active {
0488                 pins = "gpio109";
0489                 drive-strength = <2>;
0490                 bias-disable;
0491                 output-low;
0492         };
0493 };