Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: BSD-3-Clause
0002 /*
0003  * Copyright (c) 2020, Konrad Dybcio
0004  */
0005 
0006 /dts-v1/;
0007 
0008 #include "msm8992.dtsi"
0009 #include "pm8994.dtsi"
0010 #include "pmi8994.dtsi"
0011 #include <dt-bindings/gpio/gpio.h>
0012 #include <dt-bindings/input/gpio-keys.h>
0013 
0014 / {
0015         model = "Xiaomi Mi 4C";
0016         compatible = "xiaomi,libra", "qcom,msm8992";
0017         chassis-type = "handset";
0018 
0019         /* required for bootloader to select correct board */
0020         qcom,msm-id = <251 0 252 0>;
0021         qcom,pmic-id = <65545 65546 0 0>;
0022         qcom,board-id = <12 0>;
0023 
0024         /* This enables graphical output via bootloader-enabled display */
0025         chosen {
0026                 bootargs = "earlycon=tty0 console=tty0 maxcpus=1";
0027 
0028                 #address-cells = <2>;
0029                 #size-cells = <2>;
0030                 ranges;
0031 
0032                 framebuffer0: framebuffer@3400000 {
0033                         compatible = "simple-framebuffer";
0034                         reg = <0 0x3400000 0 (1080 * 1920 * 3)>;
0035                         width = <1080>;
0036                         height = <1920>;
0037                         stride = <(1080 * 3)>;
0038                         format = "r8g8b8";
0039                         /*
0040                          * That's a lot of clocks, but it's necessary due
0041                          * to unused clk cleanup & no panel driver yet..
0042                          */
0043                         clocks = <&mmcc MDSS_AHB_CLK>,
0044                                  <&mmcc MDSS_AXI_CLK>,
0045                                  <&mmcc MDSS_VSYNC_CLK>,
0046                                  <&mmcc MDSS_MDP_CLK>,
0047                                  <&mmcc MDSS_BYTE0_CLK>,
0048                                  <&mmcc MDSS_PCLK0_CLK>,
0049                                  <&mmcc MDSS_ESC0_CLK>;
0050                         power-domains = <&mmcc MDSS_GDSC>;
0051                 };
0052         };
0053 
0054         gpio-keys {
0055                 compatible = "gpio-keys";
0056                 autorepeat;
0057 
0058                 button {
0059                         label = "Volume Up";
0060                         gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
0061                         linux,input-type = <1>;
0062                         linux,code = <KEY_VOLUMEUP>;
0063                         wakeup-source;
0064                         debounce-interval = <15>;
0065                 };
0066         };
0067 
0068         reserved-memory {
0069                 #address-cells = <2>;
0070                 #size-cells = <2>;
0071                 ranges;
0072 
0073                 /* This is for getting crash logs using Android downstream kernels */
0074                 ramoops@dfc00000 {
0075                         compatible = "ramoops";
0076                         reg = <0x0 0xdfc00000 0x0 0x40000>;
0077                         console-size = <0x10000>;
0078                         record-size = <0x10000>;
0079                         ftrace-size = <0x10000>;
0080                         pmsg-size = <0x20000>;
0081                 };
0082 
0083                 modem_region: modem_region@9000000 {
0084                         reg = <0x0 0x9000000 0x0 0x5a00000>;
0085                         no-map;
0086                 };
0087 
0088                 tzapp: modem_region@ea00000 {
0089                         reg = <0x0 0xea00000 0x0 0x1900000>;
0090                         no-map;
0091                 };
0092         };
0093 };
0094 
0095 &blsp1_i2c2 {
0096         status = "okay";
0097 
0098         /* Atmel or Synaptics touchscreen */
0099 };
0100 
0101 &blsp1_i2c5 {
0102         status = "okay";
0103 
0104         /* ST lsm6db0 gyro/accelerometer */
0105 };
0106 
0107 &blsp1_i2c6 {
0108         status = "okay";
0109 
0110         /*
0111          * NXP NCI NFC,
0112          * TI USB320 Type-C controller,
0113          * Pericom 30216a USB (de)mux switch
0114          */
0115 };
0116 
0117 &blsp2_i2c1 {
0118         status = "okay";
0119 
0120         /* cm36686 proximity and ambient light sensor */
0121 };
0122 
0123 &blsp2_i2c5 {
0124         status = "okay";
0125 
0126         /* Silabs si4705 FM transmitter */
0127 };
0128 
0129 &blsp2_uart2 {
0130         status = "okay";
0131 };
0132 
0133 &peripheral_region {
0134         reg = <0x0 0x7400000 0x0 0x1c00000>;
0135         no-map;
0136 };
0137 
0138 &pm8994_spmi_regulators {
0139         VDD_APC0: s8 {
0140                 regulator-min-microvolt = <680000>;
0141                 regulator-max-microvolt = <1180000>;
0142                 regulator-always-on;
0143                 regulator-boot-on;
0144         };
0145 
0146         /* APC1 is 3-phase, but quoting downstream, s11 is "the gang leader" */
0147         VDD_APC1: s11 {
0148                 regulator-min-microvolt = <700000>;
0149                 regulator-max-microvolt = <1225000>;
0150                 regulator-always-on;
0151                 regulator-boot-on;
0152         };
0153 };
0154 
0155 &rpm_requests {
0156         pm8994-regulators {
0157                 compatible = "qcom,rpm-pm8994-regulators";
0158 
0159                 vdd_l1-supply = <&pm8994_s7>;
0160                 vdd_l2_26_28-supply = <&pm8994_s3>;
0161                 vdd_l3_11-supply = <&pm8994_s3>;
0162                 vdd_l4_27_31-supply = <&pm8994_s3>;
0163                 vdd_l5_7-supply = <&pm8994_s3>;
0164                 vdd_l6_12_32-supply = <&pm8994_s5>;
0165                 vdd_l8_16_30-supply = <&vph_pwr>;
0166                 vdd_l9_10_18_22-supply = <&vph_pwr>;
0167                 vdd_l13_19_23_24-supply = <&vph_pwr>;
0168                 vdd_l14_15-supply = <&pm8994_s5>;
0169                 vdd_l17_29-supply = <&vph_pwr>;
0170                 vdd_l20_21-supply = <&vph_pwr>;
0171                 vdd_l25-supply = <&pm8994_s5>;
0172                 vdd_lvs1_2-supply = <&pm8994_s4>;
0173 
0174                 /* S1, S2, S6 and S12 are managed by RPMPD */
0175 
0176                 pm8994_s3: s3 {
0177                         regulator-min-microvolt = <1300000>;
0178                         regulator-max-microvolt = <1300000>;
0179                 };
0180 
0181                 pm8994_s4: s4 {
0182                         regulator-min-microvolt = <1800000>;
0183                         regulator-max-microvolt = <1800000>;
0184                         regulator-allow-set-load;
0185                         regulator-always-on;
0186                         regulator-system-load = <325000>;
0187                 };
0188 
0189                 pm8994_s5: s5 {
0190                         regulator-min-microvolt = <2150000>;
0191                         regulator-max-microvolt = <2150000>;
0192                 };
0193 
0194                 pm8994_s7: s7 {
0195                         regulator-min-microvolt = <1000000>;
0196                         regulator-max-microvolt = <1000000>;
0197                 };
0198 
0199                 /* S8, S9, S10 and S11 - SPMI-managed VDD_APC */
0200 
0201                 pm8994_l1: l1 {
0202                         regulator-min-microvolt = <1000000>;
0203                         regulator-max-microvolt = <1000000>;
0204                 };
0205 
0206                 pm8994_l2: l2 {
0207                         regulator-min-microvolt = <1250000>;
0208                         regulator-max-microvolt = <1250000>;
0209                 };
0210 
0211                 pm8994_l3: l3 {
0212                         regulator-min-microvolt = <1200000>;
0213                         regulator-max-microvolt = <1200000>;
0214                 };
0215 
0216                 pm8994_l4: l4 {
0217                         regulator-min-microvolt = <1225000>;
0218                         regulator-max-microvolt = <1225000>;
0219                 };
0220 
0221                 /* L5 is inaccessible from RPM */
0222 
0223                 pm8994_l6: l6 {
0224                         regulator-min-microvolt = <1800000>;
0225                         regulator-max-microvolt = <1800000>;
0226                 };
0227 
0228                 /* L7 is inaccessible from RPM */
0229 
0230                 pm8994_l8: l8 {
0231                         regulator-min-microvolt = <1800000>;
0232                         regulator-max-microvolt = <1800000>;
0233                 };
0234 
0235                 pm8994_l9: l9 {
0236                         regulator-min-microvolt = <1800000>;
0237                         regulator-max-microvolt = <1800000>;
0238                 };
0239 
0240                 pm8994_l10: l10 {
0241                         regulator-min-microvolt = <1800000>;
0242                         regulator-max-microvolt = <1800000>;
0243                 };
0244 
0245                 pm8994_l11: l11 {
0246                         regulator-min-microvolt = <1200000>;
0247                         regulator-max-microvolt = <1200000>;
0248                 };
0249 
0250                 pm8994_l12: l12 {
0251                         regulator-min-microvolt = <1800000>;
0252                         regulator-max-microvolt = <1800000>;
0253                 };
0254 
0255                 pm8994_l13: l13 {
0256                         regulator-min-microvolt = <1800000>;
0257                         regulator-max-microvolt = <2950000>;
0258                 };
0259 
0260                 pm8994_l14: l14 {
0261                         regulator-min-microvolt = <1800000>;
0262                         regulator-max-microvolt = <1800000>;
0263                 };
0264 
0265                 pm8994_l15: l15 {
0266                         regulator-min-microvolt = <1800000>;
0267                         regulator-max-microvolt = <1800000>;
0268                 };
0269 
0270                 pm8994_l16: l16 {
0271                         regulator-min-microvolt = <2700000>;
0272                         regulator-max-microvolt = <2700000>;
0273                 };
0274 
0275                 pm8994_l17: l17 {
0276                         regulator-min-microvolt = <2700000>;
0277                         regulator-max-microvolt = <2700000>;
0278                 };
0279 
0280                 pm8994_l18: l18 {
0281                         regulator-min-microvolt = <2850000>;
0282                         regulator-max-microvolt = <2850000>;
0283                         regulator-always-on;
0284                 };
0285 
0286                 pm8994_l19: l19 {
0287                         regulator-min-microvolt = <2800000>;
0288                         regulator-max-microvolt = <2800000>;
0289                 };
0290 
0291                 pm8994_l20: l20 {
0292                         regulator-min-microvolt = <2950000>;
0293                         regulator-max-microvolt = <2950000>;
0294                         regulator-always-on;
0295                         regulator-boot-on;
0296                         regulator-allow-set-load;
0297                         regulator-system-load = <570000>;
0298                 };
0299 
0300                 pm8994_l21: l21 {
0301                         regulator-min-microvolt = <2950000>;
0302                         regulator-max-microvolt = <2950000>;
0303                         regulator-always-on;
0304                 };
0305 
0306                 pm8994_l22: l22 {
0307                         regulator-min-microvolt = <3000000>;
0308                         regulator-max-microvolt = <3000000>;
0309                 };
0310 
0311                 pm8994_l23: l23 {
0312                         regulator-min-microvolt = <2800000>;
0313                         regulator-max-microvolt = <2800000>;
0314                 };
0315 
0316                 pm8994_l24: l24 {
0317                         regulator-min-microvolt = <3075000>;
0318                         regulator-max-microvolt = <3150000>;
0319                 };
0320 
0321                 pm8994_l25: l25 {
0322                         regulator-min-microvolt = <1000000>;
0323                         regulator-max-microvolt = <1000000>;
0324                 };
0325 
0326                 pm8994_l26: l26 {
0327                         regulator-min-microvolt = <987500>;
0328                         regulator-max-microvolt = <987500>;
0329 
0330                 };
0331 
0332                 pm8994_l27: l27 {
0333                         regulator-min-microvolt = <1050000>;
0334                         regulator-max-microvolt = <1050000>;
0335                 };
0336 
0337                 pm8994_l28: l28 {
0338                         regulator-min-microvolt = <1000000>;
0339                         regulator-max-microvolt = <1000000>;
0340                 };
0341 
0342                 pm8994_l29: l29 {
0343                         regulator-min-microvolt = <2800000>;
0344                         regulator-max-microvolt = <2800000>;
0345                 };
0346 
0347                 pm8994_l30: l30 {
0348                         regulator-min-microvolt = <1800000>;
0349                         regulator-max-microvolt = <1800000>;
0350                 };
0351 
0352                 pm8994_l31: l31 {
0353                         regulator-min-microvolt = <1262500>;
0354                         regulator-max-microvolt = <1262500>;
0355                 };
0356 
0357                 pm8994_l32: l32 {
0358                         regulator-min-microvolt = <1800000>;
0359                         regulator-max-microvolt = <1800000>;
0360                 };
0361 
0362                 pm8994_lvs1: lvs1 {};
0363                 pm8994_lvs2: lvs2 {};
0364         };
0365 
0366         pmi8994_regulators: pmi8994-regulators {
0367                 compatible = "qcom,rpm-pmi8994-regulators";
0368                 vdd_s1-supply = <&vph_pwr>;
0369                 vdd_bst_byp-supply = <&vph_pwr>;
0370 
0371                 pmi8994_s1: s1 {
0372                         regulator-min-microvolt = <1025000>;
0373                         regulator-max-microvolt = <1025000>;
0374                 };
0375 
0376                 /* S2 & S3 - VDD_GFX */
0377 
0378                 pmi8994_bby: boost-bypass {
0379                         regulator-min-microvolt = <3150000>;
0380                         regulator-max-microvolt = <3600000>;
0381                 };
0382         };
0383 };
0384 
0385 &sdhc1 {
0386         status = "okay";
0387 
0388         mmc-hs400-1_8v;
0389         vmmc-supply = <&pm8994_l20>;
0390         vqmmc-supply = <&pm8994_s4>;
0391 };