1 // SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2021, AngeloGioacchino Del Regno
4 * <angelogioacchino.delregno@somainline.org>
5 * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
8 #include "msm8996.dtsi"
10 #include "pmi8994.dtsi"
11 #include "pmi8996.dtsi"
12 #include <dt-bindings/input/input.h>
13 #include <dt-bindings/gpio/gpio.h>
14 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
15 #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
17 /delete-node/ &adsp_mem;
18 /delete-node/ &slpi_mem;
19 /delete-node/ &venus_mem;
20 /delete-node/ &gpu_mem;
23 qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
24 qcom,board-id = <8 0>;
28 * Due to an unknown-for-a-few-years regression,
29 * SDHCI only works on MSM8996 in PIO (lame) mode.
31 bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
36 compatible = "ramoops";
37 reg = <0 0xa7f00000 0 0x100000>;
38 record-size = <0x20000>;
39 console-size = <0x40000>;
40 ftrace-size = <0x20000>;
41 pmsg-size = <0x20000>;
45 adsp_mem: adsp@8ea00000 {
46 reg = <0x0 0x8ea00000 0x0 0x1a00000>;
50 gpu_mem: gpu@90400000 {
51 compatible = "shared-dma-pool";
52 reg = <0x0 0x90400000 0x0 0x2000>;
56 slpi_mem: memory@90500000 {
57 reg = <0 0x90500000 0 0xa00000>;
61 venus_mem: memory@90f00000 {
62 reg = <0 0x90f00000 0 0x500000>;
67 panel_tvdd: tvdd-regulator {
68 compatible = "regulator-fixed";
69 regulator-name = "panel_tvdd";
70 gpio = <&tlmm 50 GPIO_ACTIVE_LOW>;
71 pinctrl-0 = <&tp_vddio_en>;
72 pinctrl-names = "default";
76 compatible = "linux,extcon-usb-gpio";
77 id-gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;
78 pinctrl-names = "default";
79 pinctrl-0 = <&usb_detect>;
82 vph_pwr: vph-pwr-regulator {
83 compatible = "regulator-fixed";
84 regulator-min-microvolt = <3700000>;
85 regulator-max-microvolt = <3700000>;
86 regulator-name = "vph_pwr";
91 wlan_en: wlan-en-1-8v {
92 compatible = "regulator-fixed";
93 regulator-name = "wlan-en-regulator";
94 regulator-min-microvolt = <1800000>;
95 regulator-max-microvolt = <1800000>;
96 gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
97 pinctrl-names = "default";
98 pinctrl-0 = <&wl_reg_on>;
100 /* WLAN card specific delay */
101 startup-delay-us = <70000>;
108 clock-frequency = <355000>;
110 tof_sensor: vl53l0x@29 {
111 compatible = "st,vl53l0x";
122 clock-frequency = <355000>;
124 /* FUSB301 USB-C controller */
129 clock-frequency = <355000>;
132 compatible = "syna,rmi4-i2c";
134 interrupt-parent = <&tlmm>;
135 interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
136 vdd-supply = <&panel_tvdd>;
138 syna,reset-delay-ms = <220>;
139 syna,startup-delay-ms = <220>;
140 #address-cells = <1>;
145 syna,nosleep-mode = <1>;
150 syna,sensor-type = <1>;
160 drive-strength = <2>;
165 drive-strength = <2>;
171 drive-strength = <2>;
176 drive-strength = <2>;
181 drive-strength = <2>;
188 vdd-supply = <&pm8994_l28>;
189 vdda-pll-supply = <&pm8994_l12>;
190 vdda-phy-dpdm-supply = <&pm8994_l24>;
194 vdd-gfx-supply = <&vdd_gfx>;
199 perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
200 wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
201 vddpe-3v3-supply = <&wlan_en>;
202 vdda-supply = <&pm8994_l28>;
208 vdda-phy-supply = <&pm8994_l28>;
209 vdda-pll-supply = <&pm8994_l12>;
213 pinctrl-names = "default";
214 pinctrl-0 = <&pm8994_gpios_defaults>;
240 * We don't yet know for sure which GPIOs are of our interest, but what
241 * we do know is that if a vendor sets the pins to a non-default state, there's
242 * probably a reason for it, and just to be on the safe side, we follow suit.
244 pm8994_gpios_defaults: pm8994-gpios-default-state {
245 pm8994-gpio1-nc-pins {
247 function = PMIC_GPIO_FUNC_NORMAL;
254 function = PMIC_GPIO_FUNC_NORMAL;
258 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
259 power-source = <PM8994_GPIO_S4>;
264 function = PMIC_GPIO_FUNC_NORMAL;
268 power-source = <PM8994_GPIO_S4>;
271 camera-snapshot-n-pins {
273 function = PMIC_GPIO_FUNC_NORMAL;
277 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
278 power-source = <PM8994_GPIO_S4>;
281 camera-focus-n-pins {
283 function = PMIC_GPIO_FUNC_NORMAL;
287 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
288 power-source = <PM8994_GPIO_S4>;
291 pm8994-gpio6-nc-pins {
293 function = PMIC_GPIO_FUNC_NORMAL;
296 power-source = <PM8994_GPIO_VPH>;
301 function = PMIC_GPIO_FUNC_NORMAL;
305 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
306 power-source = <PM8994_GPIO_S4>;
309 pm8994-gpio8-nc-pins {
311 function = PMIC_GPIO_FUNC_NORMAL;
315 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
316 power-source = <PM8994_GPIO_VPH>;
319 pm8994-gpio9-nc-pins {
321 function = PMIC_GPIO_FUNC_NORMAL;
325 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
326 power-source = <PM8994_GPIO_VPH>;
331 function = PMIC_GPIO_FUNC_NORMAL;
335 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
336 power-source = <PM8994_GPIO_S4>;
339 pm8994-gpio11-nc-pins {
341 function = PMIC_GPIO_FUNC_NORMAL;
344 power-source = <PM8994_GPIO_VPH>;
347 pm8994-gpio12-nc-pins {
349 function = PMIC_GPIO_FUNC_NORMAL;
352 power-source = <PM8994_GPIO_VPH>;
357 function = PMIC_GPIO_FUNC_NORMAL;
361 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
362 power-source = <PM8994_GPIO_S4>;
365 pm8994-gpio14-nc-pins {
367 function = PMIC_GPIO_FUNC_NORMAL;
371 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
372 power-source = <PM8994_GPIO_VPH>;
375 pm-divclk1-gpio-pins {
381 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
382 power-source = <PM8994_GPIO_VPH>;
387 function = PMIC_GPIO_FUNC_NORMAL;
391 pm8994-gpio17-nc-pins {
393 function = PMIC_GPIO_FUNC_NORMAL;
396 power-source = <PM8994_GPIO_VPH>;
401 function = PMIC_GPIO_FUNC_FUNC2;
405 qcom,drive-strength = <PMIC_GPIO_STRENGTH_MED>;
406 power-source = <PM8994_GPIO_S4>;
409 pm8994-gpio19-nc-pins {
411 function = PMIC_GPIO_FUNC_NORMAL;
415 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
416 power-source = <PM8994_GPIO_VPH>;
419 pm8994-gpio22-nc-pins {
421 function = PMIC_GPIO_FUNC_NORMAL;
424 power-source = <PM8994_GPIO_VPH>;
430 pinctrl-names = "default";
431 pinctrl-0 = <&pm8994_mpps_defaults>;
443 pm8994_mpps_defaults: pm8994-mpps-default-state {
444 lcd-id_adc-mpp-pins {
448 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH6>;
453 function = "digital";
455 power-source = <PM8994_GPIO_VPH>;
458 flash-therm-mpp-pins {
462 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
467 function = "digital";
475 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH8>;
482 linux,code = <KEY_VOLUMEUP>;
486 pinctrl-names = "default";
487 pinctrl-0 = <&pmi8994_gpios_defaults>;
501 pmi8994_gpios_defaults: pmi8994-gpios-default-state {
502 vib-ldo-en-gpio-pins {
504 function = PMIC_GPIO_FUNC_NORMAL;
508 power-source = <PM8994_GPIO_S4>;
513 function = PMIC_GPIO_FUNC_NORMAL;
517 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
518 power-source = <PM8994_GPIO_VPH>;
523 function = PMIC_GPIO_FUNC_NORMAL;
527 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
528 power-source = <PM8994_GPIO_VPH>;
533 function = PMIC_GPIO_FUNC_NORMAL;
536 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
537 power-source = <PM8994_GPIO_S4>;
542 function = PMIC_GPIO_FUNC_NORMAL;
545 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
546 power-source = <PM8994_GPIO_S4>;
551 function = PMIC_GPIO_FUNC_NORMAL;
554 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
555 power-source = <PM8994_GPIO_S4>;
560 function = PMIC_GPIO_FUNC_NORMAL;
563 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
564 power-source = <PM8994_GPIO_S4>;
569 function = PMIC_GPIO_FUNC_NORMAL;
572 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
573 power-source = <PM8994_GPIO_S4>;
576 usb-switch-sel-pins {
578 function = PMIC_GPIO_FUNC_NORMAL;
584 function = PMIC_GPIO_FUNC_NORMAL;
588 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
589 power-source = <PM8994_GPIO_S4>;
594 &pm8994_spmi_regulators {
595 qcom,saw-reg = <&saw3>;
607 regulator-name = "vdd_apcc";
609 regulator-min-microvolt = <470000>;
610 regulator-max-microvolt = <1140000>;
614 &pmi8994_spmi_regulators {
617 /* Pinned to a high value for now to avoid random crashes. */
618 regulator-min-microvolt = <1015000>;
619 regulator-max-microvolt = <1015000>;
620 regulator-name = "vdd_gfx";
627 default-brightness = <512>;
628 qcom,num-strings = <3>;
633 compatible = "qcom,rpm-pm8994-regulators";
635 vdd_s1-supply = <&vph_pwr>;
636 vdd_s2-supply = <&vph_pwr>;
637 vdd_s3-supply = <&vph_pwr>;
638 vdd_s4-supply = <&vph_pwr>;
639 vdd_s5-supply = <&vph_pwr>;
640 vdd_s6-supply = <&vph_pwr>;
641 vdd_s7-supply = <&vph_pwr>;
642 vdd_s8-supply = <&vph_pwr>;
643 vdd_s9-supply = <&vph_pwr>;
644 vdd_s10-supply = <&vph_pwr>;
645 vdd_s11-supply = <&vph_pwr>;
646 vdd_s12-supply = <&vph_pwr>;
647 vdd_l1-supply = <&pm8994_s3>;
648 vdd_l2_l26_l28-supply = <&pm8994_s3>;
649 vdd_l3_l11-supply = <&pm8994_s3>;
650 vdd_l4_l27_l31-supply = <&pm8994_s3>;
651 vdd_l5_l7-supply = <&pm8994_s5>;
652 vdd_l6_l12_l32-supply = <&pm8994_s5>;
653 vdd_l8_l16_l30-supply = <&vph_pwr>;
654 vdd_l14_l15-supply = <&pm8994_s5>;
655 vdd_l20_l21-supply = <&pm8994_s5>;
656 vdd_l25-supply = <&pm8994_s3>;
657 vdd_lvs1_2-supply = <&pm8994_s4>;
660 regulator-min-microvolt = <1300000>;
661 regulator-max-microvolt = <1300000>;
665 regulator-min-microvolt = <1800000>;
666 regulator-max-microvolt = <1800000>;
667 regulator-system-load = <325000>;
672 regulator-min-microvolt = <2150000>;
673 regulator-max-microvolt = <2150000>;
677 regulator-min-microvolt = <800000>;
678 regulator-max-microvolt = <800000>;
682 regulator-min-microvolt = <1000000>;
683 regulator-max-microvolt = <1000000>;
687 regulator-min-microvolt = <1250000>;
688 regulator-max-microvolt = <1250000>;
692 regulator-min-microvolt = <1100000>;
693 regulator-max-microvolt = <1100000>;
697 regulator-min-microvolt = <1225000>;
698 regulator-max-microvolt = <1225000>;
701 /* L6 and L7 seem unused. */
704 regulator-min-microvolt = <1800000>;
705 regulator-max-microvolt = <1800000>;
709 regulator-min-microvolt = <1800000>;
710 regulator-max-microvolt = <1800000>;
714 regulator-min-microvolt = <1800000>;
715 regulator-max-microvolt = <1800000>;
719 regulator-min-microvolt = <1100000>;
720 regulator-max-microvolt = <1100000>;
724 regulator-min-microvolt = <1800000>;
725 regulator-max-microvolt = <1800000>;
726 regulator-allow-set-load;
730 regulator-min-microvolt = <1800000>;
731 regulator-max-microvolt = <2950000>;
732 regulator-system-load = <22000>;
733 regulator-allow-set-load;
737 regulator-min-microvolt = <1700000>;
738 regulator-max-microvolt = <1900000>;
742 regulator-min-microvolt = <1800000>;
743 regulator-max-microvolt = <1800000>;
747 regulator-min-microvolt = <2700000>;
748 regulator-max-microvolt = <2700000>;
752 regulator-min-microvolt = <2200000>;
753 regulator-max-microvolt = <2500000>;
757 regulator-min-microvolt = <1800000>;
758 regulator-max-microvolt = <1800000>;
762 regulator-min-microvolt = <3000000>;
763 regulator-max-microvolt = <3000000>;
767 regulator-min-microvolt = <2950000>;
768 regulator-max-microvolt = <2950000>;
769 regulator-system-load = <570000>;
770 regulator-allow-set-load;
774 regulator-min-microvolt = <2950000>;
775 regulator-max-microvolt = <2950000>;
776 regulator-system-load = <800000>;
777 regulator-allow-set-load;
781 regulator-min-microvolt = <3000000>;
782 regulator-max-microvolt = <3000000>;
786 regulator-min-microvolt = <2700000>;
787 regulator-max-microvolt = <2700000>;
791 regulator-min-microvolt = <3075000>;
792 regulator-max-microvolt = <3075000>;
793 regulator-allow-set-load;
797 regulator-min-microvolt = <1200000>;
798 regulator-max-microvolt = <1200000>;
799 regulator-allow-set-load;
803 regulator-min-microvolt = <1000000>;
804 regulator-max-microvolt = <1200000>;
808 regulator-min-microvolt = <925000>;
809 regulator-max-microvolt = <925000>;
810 regulator-allow-set-load;
814 regulator-min-microvolt = <2700000>;
815 regulator-max-microvolt = <2700000>;
821 regulator-min-microvolt = <1800000>;
822 regulator-max-microvolt = <1800000>;
828 /* eMMC doesn't seem to cooperate even in PIO mode.. */
831 vmmc-supply = <&pm8994_l20>;
832 vqmmc-supply = <&pm8994_s4>;
840 cd-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
841 vmmc-supply = <&pm8994_l21>;
842 vqmmc-supply = <&pm8994_l13>;
846 gpio-reserved-ranges = <0 4>;
847 pinctrl-0 = <&sw_service_gpio>;
848 pinctrl-names = "default";
850 disp_reset_n_gpio: disp-reset-n {
853 drive-strength = <2>;
857 mdp_vsync_p_gpio: mdp-vsync-p {
859 function = "mdp_vsync";
860 drive-strength = <2>;
864 sw_service_gpio: sw-service-gpio {
867 drive-strength = <2>;
871 usb_detect: usb-detect {
874 drive-strength = <2>;
879 uim_detect_en: uim-detect-en {
882 drive-strength = <2>;
887 tray_det_pin: tray-det {
890 drive-strength = <2>;
894 tp_vddio_en: tp-vddio-en {
897 drive-strength = <2>;
902 lcd_vddio_en: lcd-vddio-en {
905 drive-strength = <2>;
910 wl_host_wake: wl-host-wake {
913 drive-strength = <2>;
918 wl_reg_on: wl-reg-on {
921 drive-strength = <2>;
926 ts_reset_n: ts-rst-n {
929 drive-strength = <2>;
932 touch_int_n: touch-int-n {
935 drive-strength = <2>;
939 touch_int_sleep: touch-int-sleep {
942 drive-strength = <2>;
949 qcom,select-utmi-as-pipe-clk;
954 dr_mode = "peripheral";
955 maximum-speed = "high-speed";
956 phys = <&hsusb_phy1>;
957 phy-names = "usb2-phy";
958 snps,hird-threshold = /bits/ 8 <0>;