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 <dt-bindings/input/input.h>
12 #include <dt-bindings/gpio/gpio.h>
13 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
14 #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
16 /delete-node/ &slpi_region;
17 /delete-node/ &venus_region;
18 /delete-node/ &zap_shader_region;
21 qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
22 qcom,pmic-id = <0x20009 0x2000a 0 0>; /* PM8994 + PMI8994 */
23 qcom,board-id = <8 0>;
27 * Due to an unknown-for-a-few-years regression,
28 * SDHCI only works on MSM8996 in PIO (lame) mode.
30 bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
35 compatible = "ramoops";
36 reg = <0 0xa7f00000 0 0x100000>;
37 record-size = <0x20000>;
38 console-size = <0x40000>;
39 ftrace-size = <0x20000>;
40 pmsg-size = <0x20000>;
44 cont_splash_mem: memory@83401000 {
45 reg = <0 0x83401000 0 0x23ff000>;
49 zap_shader_region: gpu@90400000 {
50 compatible = "shared-dma-pool";
51 reg = <0x0 0x90400000 0x0 0x2000>;
55 slpi_region: memory@90500000 {
56 reg = <0 0x90500000 0 0xa00000>;
60 venus_region: memory@90f00000 {
61 reg = <0 0x90f00000 0 0x500000>;
66 panel_tvdd: tvdd-regulator {
67 compatible = "regulator-fixed";
68 regulator-name = "panel_tvdd";
69 gpio = <&tlmm 50 GPIO_ACTIVE_LOW>;
70 pinctrl-0 = <&tp_vddio_en>;
71 pinctrl-names = "default";
75 compatible = "linux,extcon-usb-gpio";
76 id-gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;
77 pinctrl-names = "default";
78 pinctrl-0 = <&usb_detect>;
81 vph_pwr: vph-pwr-regulator {
82 compatible = "regulator-fixed";
83 regulator-min-microvolt = <3700000>;
84 regulator-max-microvolt = <3700000>;
85 regulator-name = "vph_pwr";
90 wlan_en: wlan-en-1-8v {
91 compatible = "regulator-fixed";
92 regulator-name = "wlan-en-regulator";
93 regulator-min-microvolt = <1800000>;
94 regulator-max-microvolt = <1800000>;
95 gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
96 pinctrl-names = "default";
97 pinctrl-0 = <&wl_reg_on>;
99 /* WLAN card specific delay */
100 startup-delay-us = <70000>;
107 clock-frequency = <355000>;
109 tof_sensor: vl53l0x@29 {
110 compatible = "st,vl53l0x";
121 clock-frequency = <355000>;
123 /* FUSB301 USB-C controller */
128 clock-frequency = <355000>;
131 compatible = "syna,rmi4-i2c";
133 interrupt-parent = <&tlmm>;
134 interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
135 vdd-supply = <&panel_tvdd>;
137 syna,reset-delay-ms = <220>;
138 syna,startup-delay-ms = <220>;
139 #address-cells = <1>;
144 syna,nosleep-mode = <1>;
149 syna,sensor-type = <1>;
159 drive-strength = <2>;
164 drive-strength = <2>;
170 drive-strength = <2>;
175 drive-strength = <2>;
180 drive-strength = <2>;
187 vdda-pll-supply = <&pm8994_l12>;
188 vdda-phy-dpdm-supply = <&pm8994_l24>;
192 vdd-gfx-supply = <&vdd_gfx>;
197 perst-gpio = <&tlmm 35 GPIO_ACTIVE_LOW>;
198 wake-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
199 vddpe-3v3-supply = <&wlan_en>;
200 vdda-supply = <&pm8994_l28>;
206 vdda-phy-supply = <&pm8994_l28>;
207 vdda-pll-supply = <&pm8994_l12>;
211 pinctrl-names = "default";
212 pinctrl-0 = <&pm8994_gpios_defaults>;
238 * We don't yet know for sure which GPIOs are of our interest, but what
239 * we do know is that if a vendor sets the pins to a non-default state, there's
240 * probably a reason for it, and just to be on the safe side, we follow suit.
242 pm8994_gpios_defaults: pm8994-gpios-default-state {
245 function = PMIC_GPIO_FUNC_NORMAL;
252 function = PMIC_GPIO_FUNC_NORMAL;
256 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
257 power-source = <PM8994_GPIO_S4>;
262 function = PMIC_GPIO_FUNC_NORMAL;
266 power-source = <PM8994_GPIO_S4>;
271 function = PMIC_GPIO_FUNC_NORMAL;
275 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
276 power-source = <PM8994_GPIO_S4>;
281 function = PMIC_GPIO_FUNC_NORMAL;
285 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
286 power-source = <PM8994_GPIO_S4>;
291 function = PMIC_GPIO_FUNC_NORMAL;
294 power-source = <PM8994_GPIO_VPH>;
299 function = PMIC_GPIO_FUNC_NORMAL;
303 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
304 power-source = <PM8994_GPIO_S4>;
309 function = PMIC_GPIO_FUNC_NORMAL;
313 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
314 power-source = <PM8994_GPIO_VPH>;
319 function = PMIC_GPIO_FUNC_NORMAL;
323 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
324 power-source = <PM8994_GPIO_VPH>;
329 function = PMIC_GPIO_FUNC_NORMAL;
333 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
334 power-source = <PM8994_GPIO_S4>;
339 function = PMIC_GPIO_FUNC_NORMAL;
342 power-source = <PM8994_GPIO_VPH>;
347 function = PMIC_GPIO_FUNC_NORMAL;
350 power-source = <PM8994_GPIO_VPH>;
355 function = PMIC_GPIO_FUNC_NORMAL;
359 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
360 power-source = <PM8994_GPIO_S4>;
365 function = PMIC_GPIO_FUNC_NORMAL;
369 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
370 power-source = <PM8994_GPIO_VPH>;
379 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
380 power-source = <PM8994_GPIO_VPH>;
385 function = PMIC_GPIO_FUNC_NORMAL;
391 function = PMIC_GPIO_FUNC_NORMAL;
394 power-source = <PM8994_GPIO_VPH>;
399 function = PMIC_GPIO_FUNC_FUNC2;
403 qcom,drive-strength = <PMIC_GPIO_STRENGTH_MED>;
404 power-source = <PM8994_GPIO_S4>;
409 function = PMIC_GPIO_FUNC_NORMAL;
413 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
414 power-source = <PM8994_GPIO_VPH>;
419 function = PMIC_GPIO_FUNC_NORMAL;
422 power-source = <PM8994_GPIO_VPH>;
428 pinctrl-names = "default";
429 pinctrl-0 = <&pm8994_mpps_defaults>;
441 pm8994_mpps_defaults: pm8994-mpps-default-state {
446 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH6>;
451 function = "digital";
453 power-source = <PM8994_GPIO_VPH>;
460 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
465 function = "digital";
473 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH8>;
480 linux,code = <KEY_VOLUMEUP>;
484 pinctrl-names = "default";
485 pinctrl-0 = <&pmi8994_gpios_defaults>;
499 pmi8994_gpios_defaults: pmi8994-gpios-default-state {
502 function = PMIC_GPIO_FUNC_NORMAL;
506 power-source = <PM8994_GPIO_S4>;
511 function = PMIC_GPIO_FUNC_NORMAL;
515 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
516 power-source = <PM8994_GPIO_VPH>;
521 function = PMIC_GPIO_FUNC_NORMAL;
525 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
526 power-source = <PM8994_GPIO_VPH>;
531 function = PMIC_GPIO_FUNC_NORMAL;
534 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
535 power-source = <PM8994_GPIO_S4>;
540 function = PMIC_GPIO_FUNC_NORMAL;
543 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
544 power-source = <PM8994_GPIO_S4>;
549 function = PMIC_GPIO_FUNC_NORMAL;
552 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
553 power-source = <PM8994_GPIO_S4>;
558 function = PMIC_GPIO_FUNC_NORMAL;
561 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
562 power-source = <PM8994_GPIO_S4>;
567 function = PMIC_GPIO_FUNC_NORMAL;
570 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
571 power-source = <PM8994_GPIO_S4>;
576 function = PMIC_GPIO_FUNC_NORMAL;
582 function = PMIC_GPIO_FUNC_NORMAL;
586 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
587 power-source = <PM8994_GPIO_S4>;
592 &pmi8994_spmi_regulators {
593 qcom,saw-reg = <&saw3>;
597 /* Pinned to a high value for now to avoid random crashes. */
598 regulator-min-microvolt = <1015000>;
599 regulator-max-microvolt = <1015000>;
600 regulator-name = "vdd_gfx";
615 regulator-min-microvolt = <470000>;
616 regulator-max-microvolt = <1140000>;
622 default-brightness = <512>;
627 compatible = "qcom,rpm-pm8994-regulators";
629 vdd_s1-supply = <&vph_pwr>;
630 vdd_s2-supply = <&vph_pwr>;
631 vdd_s3-supply = <&vph_pwr>;
632 vdd_s4-supply = <&vph_pwr>;
633 vdd_s5-supply = <&vph_pwr>;
634 vdd_s6-supply = <&vph_pwr>;
635 vdd_s7-supply = <&vph_pwr>;
636 vdd_s8-supply = <&vph_pwr>;
637 vdd_s9-supply = <&vph_pwr>;
638 vdd_s10-supply = <&vph_pwr>;
639 vdd_s11-supply = <&vph_pwr>;
640 vdd_s12-supply = <&vph_pwr>;
641 vdd_l1-supply = <&pm8994_s3>;
642 vdd_l2_l26_l28-supply = <&pm8994_s3>;
643 vdd_l3_l11-supply = <&pm8994_s3>;
644 vdd_l4_l27_l31-supply = <&pm8994_s3>;
645 vdd_l5_l7-supply = <&pm8994_s5>;
646 vdd_l6_l12_l32-supply = <&pm8994_s5>;
647 vdd_l8_l16_l30-supply = <&vph_pwr>;
648 vdd_l14_l15-supply = <&pm8994_s5>;
649 vdd_l20_l21-supply = <&pm8994_s5>;
650 vdd_l25-supply = <&pm8994_s3>;
651 vdd_lvs1_2-supply = <&pm8994_s4>;
654 regulator-min-microvolt = <1300000>;
655 regulator-max-microvolt = <1300000>;
659 regulator-min-microvolt = <1800000>;
660 regulator-max-microvolt = <1800000>;
661 regulator-system-load = <325000>;
666 regulator-min-microvolt = <2150000>;
667 regulator-max-microvolt = <2150000>;
671 regulator-min-microvolt = <800000>;
672 regulator-max-microvolt = <800000>;
676 regulator-min-microvolt = <1000000>;
677 regulator-max-microvolt = <1000000>;
681 regulator-min-microvolt = <1250000>;
682 regulator-max-microvolt = <1250000>;
686 regulator-min-microvolt = <1100000>;
687 regulator-max-microvolt = <1100000>;
691 regulator-min-microvolt = <1225000>;
692 regulator-max-microvolt = <1225000>;
695 /* L6 and L7 seem unused. */
698 regulator-min-microvolt = <1800000>;
699 regulator-max-microvolt = <1800000>;
703 regulator-min-microvolt = <1800000>;
704 regulator-max-microvolt = <1800000>;
708 regulator-min-microvolt = <1800000>;
709 regulator-max-microvolt = <1800000>;
713 regulator-min-microvolt = <1100000>;
714 regulator-max-microvolt = <1100000>;
718 regulator-min-microvolt = <1800000>;
719 regulator-max-microvolt = <1800000>;
720 regulator-allow-set-load;
724 regulator-min-microvolt = <1800000>;
725 regulator-max-microvolt = <2950000>;
726 regulator-system-load = <22000>;
727 regulator-allow-set-load;
731 regulator-min-microvolt = <1700000>;
732 regulator-max-microvolt = <1900000>;
736 regulator-min-microvolt = <1800000>;
737 regulator-max-microvolt = <1800000>;
741 regulator-min-microvolt = <2700000>;
742 regulator-max-microvolt = <2700000>;
746 regulator-min-microvolt = <2200000>;
747 regulator-max-microvolt = <2500000>;
751 regulator-min-microvolt = <1800000>;
752 regulator-max-microvolt = <1800000>;
756 regulator-min-microvolt = <3000000>;
757 regulator-max-microvolt = <3000000>;
761 regulator-min-microvolt = <2950000>;
762 regulator-max-microvolt = <2950000>;
763 regulator-system-load = <570000>;
764 regulator-allow-set-load;
768 regulator-min-microvolt = <2950000>;
769 regulator-max-microvolt = <2950000>;
770 regulator-system-load = <800000>;
771 regulator-allow-set-load;
775 regulator-min-microvolt = <3000000>;
776 regulator-max-microvolt = <3000000>;
780 regulator-min-microvolt = <2700000>;
781 regulator-max-microvolt = <2700000>;
785 regulator-min-microvolt = <3075000>;
786 regulator-max-microvolt = <3075000>;
787 regulator-allow-set-load;
791 regulator-min-microvolt = <1200000>;
792 regulator-max-microvolt = <1200000>;
793 regulator-allow-set-load;
797 regulator-min-microvolt = <1000000>;
798 regulator-max-microvolt = <1200000>;
802 regulator-min-microvolt = <925000>;
803 regulator-max-microvolt = <925000>;
804 regulator-allow-set-load;
808 regulator-min-microvolt = <2700000>;
809 regulator-max-microvolt = <2700000>;
815 regulator-min-microvolt = <1800000>;
816 regulator-max-microvolt = <1800000>;
822 /* eMMC doesn't seem to cooperate even in PIO mode.. */
825 vmmc-supply = <&pm8994_l20>;
826 vqmmc-supply = <&pm8994_s4>;
834 cd-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
835 vmmc-supply = <&pm8994_l21>;
836 vqmmc-supply = <&pm8994_l13>;
840 gpio-reserved-ranges = <0 4>;
841 pinctrl-0 = <&sw_service_gpio>;
842 pinctrl-names = "default";
844 disp_reset_n_gpio: disp-reset-n {
847 drive-strength = <2>;
851 mdp_vsync_p_gpio: mdp-vsync-p {
853 function = "mdp_vsync";
854 drive-strength = <2>;
858 sw_service_gpio: sw-service-gpio {
861 drive-strength = <2>;
865 usb_detect: usb-detect {
868 drive-strength = <2>;
873 uim_detect_en: uim-detect-en {
876 drive-strength = <2>;
881 tray_det_pin: tray-det {
884 drive-strength = <2>;
888 tp_vddio_en: tp-vddio-en {
891 drive-strength = <2>;
896 lcd_vddio_en: lcd-vddio-en {
899 drive-strength = <2>;
904 wl_host_wake: wl-host-wake {
907 drive-strength = <2>;
912 wl_reg_on: wl-reg-on {
915 drive-strength = <2>;
920 ts_reset_n: ts-rst-n {
923 drive-strength = <2>;
926 touch_int_n: touch-int-n {
929 drive-strength = <2>;
933 touch_int_sleep: touch-int-sleep {
936 drive-strength = <2>;
942 * For reasons that are currently unknown (but probably related to fusb301), USB takes about
943 * 6 minutes to wake up (nothing interesting in kernel logs), but then it works as it should.
947 qcom,select-utmi-as-pipe-clk;
952 dr_mode = "peripheral";
953 phys = <&hsusb_phy1>;
954 phy-names = "usb2-phy";
955 snps,hird-threshold = /bits/ 8 <0>;