0001 // SPDX-License-Identifier: BSD-3-Clause
0002 /*
0003 * Copyright (c) 2020, Konrad Dybcio <konrad.dybcio@somainline.org>
0004 * Copyright (c) 2020, AngeloGioacchino Del Regno
0005 * <angelogioacchino.delregno@somainline.org>
0006 */
0007
0008 #include "pm660.dtsi"
0009 #include "pm660l.dtsi"
0010 #include <dt-bindings/gpio/gpio.h>
0011 #include <dt-bindings/input/input.h>
0012 #include <dt-bindings/input/gpio-keys.h>
0013 #include <dt-bindings/leds/common.h>
0014
0015 / {
0016 /* required for bootloader to select correct board */
0017 qcom,msm-id = <318 0>;
0018 qcom,board-id = <8 1>;
0019 qcom,pmic-id = <0x1001b 0x101011a 0x00 0x00 0x1001b 0x201011a 0x00 0x00>;
0020
0021 /* This part enables graphical output via bootloader-enabled display */
0022 chosen {
0023 bootargs = "earlycon=tty0 console=tty0";
0024
0025 #address-cells = <2>;
0026 #size-cells = <2>;
0027 ranges;
0028
0029 stdout-path = "framebuffer0";
0030
0031 framebuffer0: framebuffer@9d400000 {
0032 compatible = "simple-framebuffer";
0033 reg = <0 0x9d400000 0 (1920 * 1080 * 4)>;
0034 width = <1080>;
0035 height = <1920>;
0036 stride = <(1080 * 4)>;
0037 format = "a8r8g8b8";
0038 status = "okay";
0039 };
0040 };
0041
0042 board_vbat: vbat-regulator {
0043 compatible = "regulator-fixed";
0044 regulator-name = "VBAT";
0045
0046 regulator-min-microvolt = <4000000>;
0047 regulator-max-microvolt = <4000000>;
0048 regulator-always-on;
0049 regulator-boot-on;
0050 };
0051
0052 vph_pwr: vph-pwr-regulator {
0053 compatible = "regulator-fixed";
0054 regulator-name = "vph_pwr";
0055
0056 regulator-always-on;
0057 regulator-boot-on;
0058 };
0059
0060 cam_vdig_imx300_219_vreg: cam_vdig_imx300_219_vreg {
0061 compatible = "regulator-fixed";
0062 regulator-name = "cam_vdig_imx300_219_vreg";
0063 startup-delay-us = <0>;
0064 enable-active-high;
0065 gpio = <&tlmm 52 GPIO_ACTIVE_HIGH>;
0066 pinctrl-names = "default";
0067 pinctrl-0 = <&cam_vdig_default>;
0068 };
0069
0070 cam_vana_front_vreg: cam_vana_front_vreg {
0071 compatible = "regulator-fixed";
0072 regulator-name = "cam_vana_front_vreg";
0073 startup-delay-us = <0>;
0074 enable-active-high;
0075 gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>;
0076 pinctrl-names = "default";
0077 pinctrl-0 = <&imx219_vana_default>;
0078 };
0079
0080 cam_vana_rear_vreg: cam_vana_rear_vreg {
0081 compatible = "regulator-fixed";
0082 regulator-name = "cam_vana_rear_vreg";
0083 startup-delay-us = <0>;
0084 enable-active-high;
0085 gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>;
0086 regulator-always-on;
0087 pinctrl-names = "default";
0088 pinctrl-0 = <&imx300_vana_default>;
0089 };
0090
0091 gpio-keys {
0092 compatible = "gpio-keys";
0093
0094 key-camera-focus {
0095 label = "Camera Focus";
0096 gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
0097 linux,input-type = <1>;
0098 linux,code = <KEY_CAMERA_FOCUS>;
0099 debounce-interval = <15>;
0100 };
0101
0102 key-camera-snapshot {
0103 label = "Camera Snapshot";
0104 gpios = <&tlmm 113 GPIO_ACTIVE_LOW>;
0105 linux,input-type = <1>;
0106 linux,code = <KEY_CAMERA>;
0107 debounce-interval = <15>;
0108 };
0109
0110 key-vol-down {
0111 label = "Volume Down";
0112 gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
0113 linux,input-type = <1>;
0114 linux,code = <KEY_VOLUMEDOWN>;
0115 gpio-key,wakeup;
0116 debounce-interval = <15>;
0117 };
0118 };
0119
0120 reserved-memory {
0121 #address-cells = <2>;
0122 #size-cells = <2>;
0123 ranges;
0124
0125 ramoops@ffc00000 {
0126 compatible = "ramoops";
0127 reg = <0x0 0xffc00000 0x0 0x100000>;
0128 record-size = <0x10000>;
0129 console-size = <0x60000>;
0130 ftrace-size = <0x10000>;
0131 pmsg-size = <0x20000>;
0132 ecc-size = <16>;
0133 status = "okay";
0134 };
0135
0136 debug_region@ffb00000 {
0137 reg = <0x00 0xffb00000 0x00 0x100000>;
0138 no-map;
0139 };
0140
0141 removed_region@85800000 {
0142 reg = <0x00 0x85800000 0x00 0x3700000>;
0143 no-map;
0144 };
0145 };
0146
0147 /*
0148 * Until we hook up type-c detection, we
0149 * have to stick with this. But it works.
0150 */
0151 extcon_usb: extcon-usb {
0152 compatible = "linux,extcon-usb-gpio";
0153 id-gpio = <&tlmm 58 GPIO_ACTIVE_HIGH>;
0154 };
0155 };
0156
0157 &adsp_pil {
0158 firmware-name = "adsp.mdt";
0159 };
0160
0161 &blsp_i2c1 {
0162 status = "okay";
0163
0164 touchscreen: synaptics-rmi4-i2c@70 {
0165 compatible = "syna,rmi4-i2c";
0166 reg = <0x70>;
0167 #address-cells = <1>;
0168 #size-cells = <0>;
0169 interrupts-extended = <&tlmm 45 0x2008>;
0170
0171 pinctrl-names = "default";
0172 pinctrl-0 = <&ts_int_active &ts_lcd_id_active>;
0173
0174 syna,reset-delay-ms = <200>;
0175 syna,startup-delay-ms = <220>;
0176
0177 rmi4-f01@1 {
0178 reg = <0x01>;
0179 syna,nosleep-mode = <1>;
0180 };
0181
0182 rmi4-f11@11 {
0183 reg = <0x11>;
0184 syna,sensor-type = <1>;
0185 };
0186 };
0187 };
0188
0189 &blsp_i2c2 {
0190 status = "okay";
0191
0192 /* SMB1351 charger */
0193 };
0194
0195 /* I2C3, 4, 5, 7 and 8 are disabled on this board. */
0196
0197 &blsp_i2c6 {
0198 status = "okay";
0199
0200 /* NXP NFC */
0201 };
0202
0203 &blsp1_uart2 {
0204 status = "okay";
0205
0206 /* MSM serial console */
0207 };
0208
0209 &blsp2_uart1 {
0210 status = "okay";
0211
0212 /* HCI Bluetooth */
0213 };
0214
0215 &pm660l_lpg {
0216 qcom,power-source = <1>;
0217
0218 status = "okay";
0219
0220 multi-led {
0221 color = <LED_COLOR_ID_RGB>;
0222 function = LED_FUNCTION_STATUS;
0223
0224 #address-cells = <1>;
0225 #size-cells = <0>;
0226
0227 led@1 {
0228 reg = <1>;
0229 color = <LED_COLOR_ID_BLUE>;
0230 };
0231
0232 led@2 {
0233 reg = <2>;
0234 color = <LED_COLOR_ID_GREEN>;
0235 };
0236
0237 led@3 {
0238 reg = <3>;
0239 color = <LED_COLOR_ID_RED>;
0240 };
0241 };
0242 };
0243
0244 &pon_pwrkey {
0245 status = "okay";
0246 };
0247
0248 &pon_resin {
0249 status = "okay";
0250
0251 linux,code = <KEY_VOLUMEUP>;
0252 };
0253
0254 &qusb2phy0 {
0255 status = "okay";
0256
0257 vdd-supply = <&vreg_l1b_0p925>;
0258 vdda-pll-supply = <&vreg_l10a_1p8>;
0259 vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
0260 };
0261
0262 &rpm_requests {
0263 pm660l-regulators {
0264 compatible = "qcom,rpm-pm660l-regulators";
0265
0266 vdd_s1-supply = <&vph_pwr>;
0267 vdd_s2-supply = <&vph_pwr>;
0268 vdd_s3_s4-supply = <&vph_pwr>;
0269 vdd_s5-supply = <&vph_pwr>;
0270 vdd_s6-supply = <&vph_pwr>;
0271
0272 vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
0273 vdd_l2-supply = <&vreg_bob>;
0274 vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
0275 vdd_l4_l6-supply = <&vreg_bob>;
0276 vdd_bob-supply = <&vph_pwr>;
0277
0278 vreg_s1b_1p125: s1 {
0279 regulator-min-microvolt = <1125000>;
0280 regulator-max-microvolt = <1125000>;
0281 regulator-enable-ramp-delay = <200>;
0282 regulator-ramp-delay = <0>;
0283 };
0284
0285 vreg_s2b_1p05: s2 {
0286 regulator-min-microvolt = <1050000>;
0287 regulator-max-microvolt = <1050000>;
0288 regulator-enable-ramp-delay = <200>;
0289 regulator-ramp-delay = <0>;
0290 };
0291
0292 /*
0293 * At least on Nile's configuration, S3B/S4B (VDD_CX) and
0294 * S5B (VDD_MX) are managed only through RPM Power Domains.
0295 * Trying to set a voltage on the main supply will create
0296 * havoc and freeze the SoC.
0297 * In any case, reference voltages for these regulators are:
0298 * S3B/S4B: 0.870V
0299 * S5B: 0.915V
0300 */
0301
0302 /* LDOs */
0303 vreg_l1b_0p925: l1 {
0304 regulator-min-microvolt = <920000>;
0305 regulator-max-microvolt = <928000>;
0306 regulator-enable-ramp-delay = <250>;
0307 regulator-ramp-delay = <0>;
0308 regulator-allow-set-load;
0309 };
0310
0311 vreg_l2b_2p95: l2 {
0312 /*
0313 * This regulator supports 1.648 - 3.104V on this board
0314 * but we set a max voltage of anything less than 2.7V
0315 * to satisfy a condition in sdhci.c that will disable
0316 * 3.3V SDHCI signaling, which happens to be not really
0317 * supported on the Xperia Nile/Ganges platform.
0318 */
0319 regulator-min-microvolt = <1648000>;
0320 regulator-max-microvolt = <2696000>;
0321 regulator-enable-ramp-delay = <250>;
0322 regulator-ramp-delay = <0>;
0323 regulator-allow-set-load;
0324 };
0325
0326 vreg_l3b_3p0: l3 {
0327 regulator-min-microvolt = <2800000>;
0328 regulator-max-microvolt = <2800000>;
0329 regulator-enable-ramp-delay = <250>;
0330 regulator-ramp-delay = <0>;
0331 regulator-min-microamp = <200>;
0332 regulator-max-microamp = <600000>;
0333 regulator-system-load = <100000>;
0334 regulator-allow-set-load;
0335 };
0336
0337 vreg_l4b_2p95: l4 {
0338 regulator-min-microvolt = <2944000>;
0339 regulator-max-microvolt = <2952000>;
0340 regulator-enable-ramp-delay = <250>;
0341 regulator-ramp-delay = <0>;
0342
0343 regulator-min-microamp = <200>;
0344 regulator-max-microamp = <600000>;
0345 regulator-system-load = <570000>;
0346 regulator-allow-set-load;
0347 };
0348
0349 /*
0350 * Downstream specifies a range of 1721-3600mV,
0351 * but the only assigned consumers are SDHCI2 VMMC
0352 * and Coresight QPDI that both request pinned 2.95V.
0353 * Tighten the range to 1.8-3.328 (closest to 3.3) to
0354 * make the mmc driver happy.
0355 */
0356 vreg_l5b_2p95: l5 {
0357 regulator-min-microvolt = <1800000>;
0358 regulator-max-microvolt = <3328000>;
0359 regulator-enable-ramp-delay = <250>;
0360 regulator-ramp-delay = <0>;
0361 regulator-allow-set-load;
0362 regulator-system-load = <800000>;
0363 };
0364
0365 vreg_l6b_3p3: l6 {
0366 regulator-min-microvolt = <1704000>;
0367 regulator-max-microvolt = <3312000>;
0368 regulator-enable-ramp-delay = <250>;
0369 regulator-ramp-delay = <0>;
0370 };
0371
0372 vreg_l7b_3p125: l7 {
0373 regulator-min-microvolt = <2704000>;
0374 regulator-max-microvolt = <3128000>;
0375 regulator-enable-ramp-delay = <250>;
0376 regulator-ramp-delay = <0>;
0377 };
0378
0379 vreg_l8b_3p3: l8 {
0380 regulator-min-microvolt = <2800000>;
0381 regulator-max-microvolt = <3400000>;
0382 regulator-enable-ramp-delay = <250>;
0383 regulator-ramp-delay = <0>;
0384 };
0385
0386 /* L9B (870mV) is currently unused */
0387 /* L10B (915mV) is currently unused */
0388
0389 vreg_bob: bob {
0390 regulator-min-microvolt = <3304000>;
0391 regulator-max-microvolt = <3624000>;
0392 regulator-enable-ramp-delay = <500>;
0393 regulator-ramp-delay = <0>;
0394 };
0395 };
0396
0397 pm660-regulators {
0398 compatible = "qcom,rpm-pm660-regulators";
0399
0400 vdd_s1-supply = <&vph_pwr>;
0401 vdd_s2-supply = <&vph_pwr>;
0402 vdd_s3-supply = <&vph_pwr>;
0403 vdd_s4-supply = <&vph_pwr>;
0404 vdd_s5-supply = <&vph_pwr>;
0405 vdd_s6-supply = <&vph_pwr>;
0406
0407 vdd_l1_l6_l7-supply = <&vreg_s5a_1p35>;
0408 vdd_l2_l3-supply = <&vreg_s2b_1p05>;
0409 vdd_l5-supply = <&vreg_s2b_1p05>;
0410 vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
0411 vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
0412
0413 /*
0414 * S1A (FTAPC0), S2A (FTAPC1), S3A (HFAPC1) are managed
0415 * by the Core Power Reduction hardened (CPRh) and the
0416 * Operating State Manager (OSM) HW automatically.
0417 */
0418
0419 vreg_s4a_2p04: s4 {
0420 regulator-min-microvolt = <2040000>;
0421 regulator-max-microvolt = <2040000>;
0422 regulator-enable-ramp-delay = <200>;
0423 regulator-ramp-delay = <0>;
0424 regulator-always-on;
0425 };
0426
0427 vreg_s5a_1p35: s5 {
0428 regulator-min-microvolt = <1224000>;
0429 regulator-max-microvolt = <1350000>;
0430 regulator-enable-ramp-delay = <200>;
0431 regulator-ramp-delay = <0>;
0432 };
0433
0434 vreg_s6a_0p87: s6 {
0435 regulator-min-microvolt = <504000>;
0436 regulator-max-microvolt = <992000>;
0437 regulator-enable-ramp-delay = <150>;
0438 regulator-ramp-delay = <0>;
0439 };
0440
0441 /* LDOs */
0442 vreg_l1a_1p225: l1 {
0443 regulator-min-microvolt = <1226000>;
0444 regulator-max-microvolt = <1250000>;
0445 regulator-enable-ramp-delay = <250>;
0446 regulator-ramp-delay = <0>;
0447 regulator-allow-set-load;
0448 };
0449
0450 vreg_l2a_1p0: l2 {
0451 regulator-min-microvolt = <944000>;
0452 regulator-max-microvolt = <1008000>;
0453 regulator-enable-ramp-delay = <250>;
0454 regulator-ramp-delay = <0>;
0455 };
0456
0457 vreg_l3a_1p0: l3 {
0458 regulator-min-microvolt = <944000>;
0459 regulator-max-microvolt = <1008000>;
0460 regulator-enable-ramp-delay = <250>;
0461 regulator-ramp-delay = <0>;
0462 };
0463
0464 vreg_l5a_0p848: l5 {
0465 regulator-min-microvolt = <800000>;
0466 regulator-max-microvolt = <952000>;
0467 regulator-enable-ramp-delay = <250>;
0468 regulator-ramp-delay = <0>;
0469 };
0470
0471 vreg_l6a_1p3: l6 {
0472 regulator-min-microvolt = <1304000>;
0473 regulator-max-microvolt = <1368000>;
0474 regulator-allow-set-load;
0475 regulator-enable-ramp-delay = <250>;
0476 regulator-ramp-delay = <0>;
0477 };
0478
0479 vreg_l7a_1p2: l7 {
0480 regulator-min-microvolt = <1200000>;
0481 regulator-max-microvolt = <1200000>;
0482 regulator-enable-ramp-delay = <250>;
0483 regulator-ramp-delay = <0>;
0484 };
0485
0486 vreg_l8a_1p8: l8 {
0487 regulator-min-microvolt = <1800000>;
0488 regulator-max-microvolt = <1800000>;
0489 regulator-enable-ramp-delay = <250>;
0490 regulator-ramp-delay = <0>;
0491 regulator-system-load = <325000>;
0492 regulator-allow-set-load;
0493 };
0494
0495 vreg_l9a_1p8: l9 {
0496 regulator-min-microvolt = <1804000>;
0497 regulator-max-microvolt = <1896000>;
0498 regulator-enable-ramp-delay = <250>;
0499 regulator-ramp-delay = <0>;
0500 regulator-allow-set-load;
0501 };
0502
0503 vreg_l10a_1p8: l10 {
0504 regulator-min-microvolt = <1800000>;
0505 regulator-max-microvolt = <1944000>;
0506 regulator-enable-ramp-delay = <250>;
0507 regulator-ramp-delay = <0>;
0508 regulator-allow-set-load;
0509 };
0510
0511 vreg_l11a_1p8: l11 {
0512 regulator-min-microvolt = <1784000>;
0513 regulator-max-microvolt = <1944000>;
0514 regulator-enable-ramp-delay = <250>;
0515 regulator-ramp-delay = <0>;
0516 };
0517
0518 vreg_l12a_1p8: l12 {
0519 regulator-min-microvolt = <1800000>;
0520 regulator-max-microvolt = <1944000>;
0521 regulator-enable-ramp-delay = <250>;
0522 regulator-ramp-delay = <0>;
0523 };
0524
0525 /* This gives power to the LPDDR4: never turn it off! */
0526 vreg_l13a_1p8: l13 {
0527 regulator-min-microvolt = <1800000>;
0528 regulator-max-microvolt = <1944000>;
0529 regulator-enable-ramp-delay = <250>;
0530 regulator-ramp-delay = <0>;
0531 regulator-boot-on;
0532 regulator-always-on;
0533 };
0534
0535 vreg_l14a_1p8: l14 {
0536 regulator-min-microvolt = <1710000>;
0537 regulator-max-microvolt = <1904000>;
0538 regulator-enable-ramp-delay = <250>;
0539 regulator-ramp-delay = <0>;
0540 };
0541
0542 vreg_l15a_1p8: l15 {
0543 regulator-min-microvolt = <1648000>;
0544 regulator-max-microvolt = <2952000>;
0545 regulator-enable-ramp-delay = <250>;
0546 regulator-ramp-delay = <0>;
0547 };
0548
0549 /* L16A (2.70V) is unused */
0550
0551 vreg_l17a_1p8: l17 {
0552 regulator-min-microvolt = <1648000>;
0553 regulator-max-microvolt = <2952000>;
0554 regulator-enable-ramp-delay = <250>;
0555 regulator-ramp-delay = <0>;
0556 };
0557
0558 vreg_l18a_1v8: l18 {
0559 regulator-min-microvolt = <1800000>;
0560 regulator-max-microvolt = <1800000>;
0561 regulator-enable-ramp-delay = <250>;
0562 regulator-ramp-delay = <10>;
0563 regulator-min-microamp = <200>;
0564 regulator-max-microamp = <50000>;
0565 regulator-system-load = <10000>;
0566 regulator-allow-set-load;
0567 };
0568
0569 vreg_l19a_3p3: l19 {
0570 regulator-min-microvolt = <3312000>;
0571 regulator-max-microvolt = <3400000>;
0572 regulator-enable-ramp-delay = <250>;
0573 regulator-ramp-delay = <0>;
0574 regulator-allow-set-load;
0575 };
0576 };
0577 };
0578
0579 &sdc2_state_on {
0580 sd-cd {
0581 pins = "gpio54";
0582 bias-pull-up;
0583 drive-strength = <2>;
0584 };
0585 };
0586
0587 &sdc2_state_off {
0588 sd-cd {
0589 pins = "gpio54";
0590 bias-disable;
0591 drive-strength = <2>;
0592 };
0593 };
0594
0595 &sdhc_1 {
0596 status = "okay";
0597 supports-cqe;
0598
0599 /* SoMC Nile platform's eMMC doesn't support HS200 mode */
0600 mmc-ddr-1_8v;
0601 mmc-hs400-1_8v;
0602 mmc-hs400-enhanced-strobe;
0603
0604 vmmc-supply = <&vreg_l4b_2p95>;
0605 vqmmc-supply = <&vreg_l8a_1p8>;
0606 };
0607
0608 &sdhc_2 {
0609 status = "okay";
0610
0611 vmmc-supply = <&vreg_l5b_2p95>;
0612 vqmmc-supply = <&vreg_l2b_2p95>;
0613 };
0614
0615 &tlmm {
0616 gpio-reserved-ranges = <8 4>;
0617
0618 ts_int_active: ts-int-active {
0619 pins = "gpio45";
0620 drive-strength = <8>;
0621 bias-pull-up;
0622 };
0623
0624 ts_lcd_id_active: ts-lcd-id-active {
0625 pins = "gpio56";
0626 drive-strength = <8>;
0627 bias-disable;
0628 };
0629
0630 imx300_vana_default: imx300-vana-default {
0631 pins = "gpio50";
0632 function = "gpio";
0633 bias-disable;
0634 drive-strength = <2>;
0635 };
0636
0637 imx219_vana_default: imx219-vana-default {
0638 pins = "gpio51";
0639 function = "gpio";
0640 bias-disable;
0641 drive-strength = <2>;
0642 };
0643
0644 cam_vdig_default: cam-vdig-default {
0645 pins = "gpio52";
0646 function = "gpio";
0647 bias-disable;
0648 drive-strength = <2>;
0649 };
0650 };
0651
0652 &usb3 {
0653 status = "okay";
0654 };
0655
0656 &usb3_dwc3 {
0657 dr_mode = "peripheral";
0658 extcon = <&extcon_usb>;
0659 };