0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003 * Copyright (c) 2020, Alexey Minnekhanov <alexey.min@gmail.com>
0004 * Copyright (c) 2021, Dang Huynh <danct12@riseup.net>
0005 */
0006
0007 /dts-v1/;
0008
0009 #include "sdm660.dtsi"
0010 #include "pm660.dtsi"
0011 #include "pm660l.dtsi"
0012 #include <dt-bindings/input/input.h>
0013 #include <dt-bindings/input/gpio-keys.h>
0014
0015 / {
0016 model = "Xiaomi Redmi Note 7";
0017 compatible = "xiaomi,lavender", "qcom,sdm660";
0018 chassis-type = "handset";
0019
0020 aliases {
0021 serial0 = &blsp1_uart2;
0022 };
0023
0024 chosen {
0025 #address-cells = <2>;
0026 #size-cells = <2>;
0027 ranges;
0028
0029 stdout-path = "serial0:115200n8";
0030
0031 framebuffer0: framebuffer@9d400000 {
0032 compatible = "simple-framebuffer";
0033 reg = <0 0x9d400000 0 (1080 * 2340 * 4)>;
0034 width = <1080>;
0035 height = <2340>;
0036 stride = <(1080 * 4)>;
0037 format = "a8r8g8b8";
0038 };
0039 };
0040
0041 vph_pwr: vph-pwr-regulator {
0042 compatible = "regulator-fixed";
0043 regulator-name = "vph_pwr";
0044 regulator-min-microvolt = <3700000>;
0045 regulator-max-microvolt = <3700000>;
0046
0047 regulator-always-on;
0048 regulator-boot-on;
0049 };
0050
0051 gpio-keys {
0052 compatible = "gpio-keys";
0053
0054 key-volup {
0055 label = "Volume Up";
0056 gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
0057 linux,code = <KEY_VOLUMEUP>;
0058 debounce-interval = <15>;
0059 };
0060 };
0061
0062 reserved-memory {
0063 #address-cells = <2>;
0064 #size-cells = <2>;
0065 ranges;
0066
0067 ramoops@a0000000 {
0068 compatible = "ramoops";
0069 reg = <0x0 0xa0000000 0x0 0x400000>;
0070 console-size = <0x20000>;
0071 record-size = <0x20000>;
0072 ftrace-size = <0x0>;
0073 pmsg-size = <0x20000>;
0074 };
0075
0076 framebuffer_mem: memory@9d400000 {
0077 reg = <0x0 0x9d400000 0x0 0x23ff000>;
0078 no-map;
0079 };
0080 };
0081
0082 /*
0083 * Until we hook up type-c detection, we
0084 * have to stick with this. But it works.
0085 */
0086 extcon_usb: extcon-usb {
0087 compatible = "linux,extcon-usb-gpio";
0088 id-gpio = <&tlmm 58 GPIO_ACTIVE_HIGH>;
0089 };
0090 };
0091
0092 &blsp1_uart2 {
0093 status = "okay";
0094 };
0095
0096 &pon_pwrkey {
0097 status = "okay";
0098 };
0099
0100 &pon_resin {
0101 status = "okay";
0102
0103 linux,code = <KEY_VOLUMEDOWN>;
0104 };
0105
0106 &qusb2phy0 {
0107 status = "okay";
0108
0109 vdd-supply = <&vreg_l1b_0p925>;
0110 vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
0111 };
0112
0113 &rpm_requests {
0114 pm660l-regulators {
0115 compatible = "qcom,rpm-pm660l-regulators";
0116
0117 vdd_s1-supply = <&vph_pwr>;
0118 vdd_s2-supply = <&vph_pwr>;
0119 vdd_s3_s4-supply = <&vph_pwr>;
0120 vdd_s5-supply = <&vph_pwr>;
0121 vdd_s6-supply = <&vph_pwr>;
0122
0123 vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
0124 vdd_l2-supply = <&vreg_bob>;
0125 vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
0126 vdd_l4_l6-supply = <&vreg_bob>;
0127 vdd_bob-supply = <&vph_pwr>;
0128
0129 vreg_s1b_1p125: s1 {
0130 regulator-min-microvolt = <1125000>;
0131 regulator-max-microvolt = <1125000>;
0132 regulator-enable-ramp-delay = <200>;
0133 };
0134
0135 vreg_s2b_1p05: s2 {
0136 regulator-min-microvolt = <1050000>;
0137 regulator-max-microvolt = <1050000>;
0138 regulator-enable-ramp-delay = <200>;
0139 };
0140
0141 /* LDOs */
0142 vreg_l1b_0p925: l1 {
0143 regulator-min-microvolt = <800000>;
0144 regulator-max-microvolt = <925000>;
0145 regulator-enable-ramp-delay = <250>;
0146 regulator-allow-set-load;
0147 };
0148
0149 /* SDHCI 3.3V signal doesn't seem to be supported. */
0150 vreg_l2b_2p95: l2 {
0151 regulator-min-microvolt = <1648000>;
0152 regulator-max-microvolt = <2696000>;
0153 regulator-enable-ramp-delay = <250>;
0154 regulator-allow-set-load;
0155 };
0156
0157 vreg_l3b_3p3: l3 {
0158 regulator-min-microvolt = <1700000>;
0159 regulator-max-microvolt = <3300000>;
0160 regulator-enable-ramp-delay = <250>;
0161 regulator-allow-set-load;
0162 };
0163
0164 vreg_l4b_2p95: l4 {
0165 regulator-min-microvolt = <2944000>;
0166 regulator-max-microvolt = <2952000>;
0167 regulator-enable-ramp-delay = <250>;
0168
0169 regulator-min-microamp = <200>;
0170 regulator-max-microamp = <600000>;
0171 regulator-system-load = <570000>;
0172 regulator-allow-set-load;
0173 };
0174
0175 /*
0176 * Downstream specifies a range of 1721-3600mV,
0177 * but the only assigned consumers are SDHCI2 VMMC
0178 * and Coresight QPDI that both request pinned 2.95V.
0179 * Tighten the range to 1.8-3.328 (closest to 3.3) to
0180 * make the mmc driver happy.
0181 */
0182 vreg_l5b_2p95: l5 {
0183 regulator-min-microvolt = <1800000>;
0184 regulator-max-microvolt = <3328000>;
0185 regulator-enable-ramp-delay = <250>;
0186 regulator-allow-set-load;
0187 regulator-system-load = <800000>;
0188 };
0189
0190 vreg_l7b_3p125: l7 {
0191 regulator-min-microvolt = <2700000>;
0192 regulator-max-microvolt = <3125000>;
0193 regulator-enable-ramp-delay = <250>;
0194 };
0195
0196 vreg_l8b_3p3: l8 {
0197 regulator-min-microvolt = <3200000>;
0198 regulator-max-microvolt = <3400000>;
0199 regulator-enable-ramp-delay = <250>;
0200 };
0201
0202 vreg_bob: bob {
0203 regulator-min-microvolt = <3300000>;
0204 regulator-max-microvolt = <3600000>;
0205 regulator-enable-ramp-delay = <500>;
0206 };
0207 };
0208
0209 pm660-regulators {
0210 compatible = "qcom,rpm-pm660-regulators";
0211
0212 vdd_s1-supply = <&vph_pwr>;
0213 vdd_s2-supply = <&vph_pwr>;
0214 vdd_s3-supply = <&vph_pwr>;
0215 vdd_s4-supply = <&vph_pwr>;
0216 vdd_s5-supply = <&vph_pwr>;
0217 vdd_s6-supply = <&vph_pwr>;
0218
0219 vdd_l1_l6_l7-supply = <&vreg_s5a_1p35>;
0220 vdd_l2_l3-supply = <&vreg_s2b_1p05>;
0221 vdd_l5-supply = <&vreg_s2b_1p05>;
0222 vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
0223 vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
0224
0225 /*
0226 * S1A (FTAPC0), S2A (FTAPC1), S3A (HFAPC1) are managed
0227 * by the Core Power Reduction hardened (CPRh) and the
0228 * Operating State Manager (OSM) HW automatically.
0229 */
0230
0231 vreg_s4a_2p04: s4 {
0232 regulator-min-microvolt = <1805000>;
0233 regulator-max-microvolt = <2040000>;
0234 regulator-enable-ramp-delay = <200>;
0235 regulator-always-on;
0236 };
0237
0238 vreg_s5a_1p35: s5 {
0239 regulator-min-microvolt = <1224000>;
0240 regulator-max-microvolt = <1350000>;
0241 regulator-enable-ramp-delay = <200>;
0242 };
0243
0244 vreg_s6a_0p87: s6 {
0245 regulator-min-microvolt = <504000>;
0246 regulator-max-microvolt = <992000>;
0247 regulator-enable-ramp-delay = <150>;
0248 };
0249
0250 /* LDOs */
0251 vreg_l1a_1p225: l1 {
0252 regulator-min-microvolt = <1150000>;
0253 regulator-max-microvolt = <1250000>;
0254 regulator-enable-ramp-delay = <250>;
0255 regulator-allow-set-load;
0256 };
0257
0258 vreg_l2a_1p0: l2 {
0259 regulator-min-microvolt = <950000>;
0260 regulator-max-microvolt = <1010000>;
0261 regulator-enable-ramp-delay = <250>;
0262 };
0263
0264 vreg_l3a_1p0: l3 {
0265 regulator-min-microvolt = <950000>;
0266 regulator-max-microvolt = <1010000>;
0267 regulator-enable-ramp-delay = <250>;
0268 };
0269
0270 vreg_l5a_0p848: l5 {
0271 regulator-min-microvolt = <525000>;
0272 regulator-max-microvolt = <950000>;
0273 regulator-enable-ramp-delay = <250>;
0274 };
0275
0276 vreg_l6a_1p3: l6 {
0277 regulator-min-microvolt = <1200000>;
0278 regulator-max-microvolt = <1370000>;
0279 regulator-allow-set-load;
0280 regulator-enable-ramp-delay = <250>;
0281 };
0282
0283 vreg_l7a_1p2: l7 {
0284 regulator-min-microvolt = <1200000>;
0285 regulator-max-microvolt = <1200000>;
0286 regulator-enable-ramp-delay = <250>;
0287 };
0288
0289 vreg_l8a_1p8: l8 {
0290 regulator-min-microvolt = <1750000>;
0291 regulator-max-microvolt = <1800000>;
0292 regulator-enable-ramp-delay = <250>;
0293 regulator-system-load = <325000>;
0294 regulator-allow-set-load;
0295 };
0296
0297 vreg_l9a_1p8: l9 {
0298 regulator-min-microvolt = <1750000>;
0299 regulator-max-microvolt = <1900000>;
0300 regulator-enable-ramp-delay = <250>;
0301 regulator-allow-set-load;
0302 };
0303
0304 vreg_l10a_1p8: l10 {
0305 regulator-min-microvolt = <1780000>;
0306 regulator-max-microvolt = <1950000>;
0307 regulator-enable-ramp-delay = <250>;
0308 regulator-allow-set-load;
0309 };
0310
0311 vreg_l11a_1p8: l11 {
0312 regulator-min-microvolt = <1780000>;
0313 regulator-max-microvolt = <1950000>;
0314 regulator-enable-ramp-delay = <250>;
0315 };
0316
0317 vreg_l12a_1p8: l12 {
0318 regulator-min-microvolt = <1780000>;
0319 regulator-max-microvolt = <1950000>;
0320 regulator-enable-ramp-delay = <250>;
0321 };
0322
0323 /* This gives power to the LPDDR4: never turn it off! */
0324 vreg_l13a_1p8: l13 {
0325 regulator-min-microvolt = <1780000>;
0326 regulator-max-microvolt = <1950000>;
0327 regulator-enable-ramp-delay = <250>;
0328 regulator-boot-on;
0329 regulator-always-on;
0330 };
0331
0332 vreg_l14a_1p8: l14 {
0333 regulator-min-microvolt = <1710000>;
0334 regulator-max-microvolt = <1900000>;
0335 regulator-enable-ramp-delay = <250>;
0336 };
0337
0338 vreg_l15a_1p8: l15 {
0339 regulator-min-microvolt = <1650000>;
0340 regulator-max-microvolt = <2950000>;
0341 regulator-enable-ramp-delay = <250>;
0342 };
0343
0344 vreg_l16a_2p7: l16 {
0345 regulator-min-microvolt = <2800000>;
0346 regulator-max-microvolt = <2800000>;
0347 regulator-enable-ramp-delay = <250>;
0348 regulator-always-on;
0349 };
0350
0351 vreg_l17a_1p8: l17 {
0352 regulator-min-microvolt = <1648000>;
0353 regulator-max-microvolt = <2952000>;
0354 regulator-enable-ramp-delay = <250>;
0355 };
0356
0357 vreg_l19a_3p3: l19 {
0358 regulator-min-microvolt = <3312000>;
0359 regulator-max-microvolt = <3400000>;
0360 regulator-enable-ramp-delay = <250>;
0361 regulator-allow-set-load;
0362 };
0363 };
0364 };
0365
0366 &pm660l_wled {
0367 status = "okay";
0368
0369 qcom,switching-freq = <800>;
0370 qcom,current-limit-microamp = <20000>;
0371 qcom,num-strings = <2>;
0372 };
0373
0374 &sdc2_state_on {
0375 sd-cd {
0376 pins = "gpio54";
0377 bias-pull-up;
0378 drive-strength = <2>;
0379 };
0380 };
0381
0382 &sdc2_state_off {
0383 sd-cd {
0384 pins = "gpio54";
0385 bias-disable;
0386 drive-strength = <2>;
0387 };
0388 };
0389
0390 &sdhc_1 {
0391 status = "okay";
0392 supports-cqe;
0393
0394 mmc-hs200-1_8v;
0395 mmc-hs400-1_8v;
0396 mmc-hs400-enhanced-strobe;
0397
0398 vmmc-supply = <&vreg_l4b_2p95>;
0399 vqmmc-supply = <&vreg_l8a_1p8>;
0400 };
0401
0402 &sdhc_2 {
0403 status = "okay";
0404
0405 vmmc-supply = <&vreg_l5b_2p95>;
0406 vqmmc-supply = <&vreg_l2b_2p95>;
0407 };
0408
0409 &tlmm {
0410 gpio-reserved-ranges = <8 4>;
0411 };
0412
0413 &usb3 {
0414 status = "okay";
0415 };
0416
0417 &usb3_dwc3 {
0418 dr_mode = "peripheral";
0419 extcon = <&extcon_usb>;
0420 };