From dbac0063ff1dace032732252a1004063bdd6f35a Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Tue, 11 May 2021 21:59:05 +0530 Subject: [PATCH] ARM: dts: qcom: enable pmic alarm sensor and BCL thermal zones for monaco Enable pm5100 pmic alarm thermal zone and BCL thermal zones for monaco. Change-Id: I4585c758c57b0a8b3d34e5d790251194eb8c476c --- qcom/monaco-idp-v1-common.dtsi | 1 + qcom/monaco-thermal-overlay.dtsi | 101 ++++++++++++++++++++++ qcom/pm5100.dtsi | 138 +++++++++++++++++++++++++++++++ 3 files changed, 240 insertions(+) create mode 100644 qcom/monaco-thermal-overlay.dtsi diff --git a/qcom/monaco-idp-v1-common.dtsi b/qcom/monaco-idp-v1-common.dtsi index e69de29bb2d1..0643de7d8f46 100644 --- a/qcom/monaco-idp-v1-common.dtsi +++ b/qcom/monaco-idp-v1-common.dtsi @@ -0,0 +1 @@ +#include "monaco-thermal-overlay.dtsi" diff --git a/qcom/monaco-thermal-overlay.dtsi b/qcom/monaco-thermal-overlay.dtsi new file mode 100644 index 000000000000..13c385a73423 --- /dev/null +++ b/qcom/monaco-thermal-overlay.dtsi @@ -0,0 +1,101 @@ +#include + +&thermal_zones { + pm5100-tz { + cooling-maps { + trip0_cpu0 { + trip = <&pm5100_trip0>; + cooling-device = + <&CPU0 (THERMAL_MAX_LIMIT-2) + (THERMAL_MAX_LIMIT-2)>; + }; + + trip1_cpu2 { + trip = <&pm5100_trip0>; + cooling-device = <&cpu2_isolate 1 1>; + }; + + trip1_cpu3 { + trip = <&pm5100_trip0>; + cooling-device = <&cpu3_isolate 1 1>; + }; + }; + }; + + pm5100-bcl-lvl0 { + cooling-maps { + cpu0_cdev { + trip = <&bcl_lvl0>; + cooling-device = + <&CPU0 (THERMAL_MAX_LIMIT-5) + (THERMAL_MAX_LIMIT-5)>; + }; + + cpu2_cdev { + trip = <&bcl_lvl0>; + cooling-device = <&cpu2_isolate 1 1>; + }; + + cpu3_cdev { + trip = <&bcl_lvl0>; + cooling-device = <&cpu3_isolate 1 1>; + }; + }; + }; + + pm5100-bcl-lvl1 { + cooling-maps { + cpu0_cdev { + trip = <&bcl_lvl1>; + cooling-device = + <&CPU0 (THERMAL_MAX_LIMIT-4) + (THERMAL_MAX_LIMIT-4)>; + }; + + cpu1_cdev { + trip = <&bcl_lvl1>; + cooling-device = <&cpu1_isolate 1 1>; + }; + + modem_cdev { + trip = <&bcl_lvl1>; + cooling-device = <&modem_pa 2 2>; + }; + + modem1_cdev { + trip = <&bcl_lvl1>; + cooling-device = <&modem_tj 1 1>; + }; + }; + }; + + pm5100-bcl-lvl2 { + cooling-maps { + modem_cdev { + trip = <&bcl_lvl2>; + cooling-device = <&modem_tj 3 3>; + }; + }; + }; + + soc { + cooling-maps { + soc_cpu0 { + trip = <&socd_trip>; + cooling-device = + <&CPU0 (THERMAL_MAX_LIMIT-4) + (THERMAL_MAX_LIMIT-4)>; + }; + + soc_cpu2 { + trip = <&socd_trip>; + cooling-device = <&cpu2_isolate 1 1>; + }; + + soc_cpu3 { + trip = <&socd_trip>; + cooling-device = <&cpu3_isolate 1 1>; + }; + }; + }; +}; diff --git a/qcom/pm5100.dtsi b/qcom/pm5100.dtsi index 5fbe48b0fca5..9417b82f743c 100644 --- a/qcom/pm5100.dtsi +++ b/qcom/pm5100.dtsi @@ -154,5 +154,143 @@ pm5100_cdc: qcom,pm5100-cdc { compatible = "qcom,pm5100-spmi"; }; + + pm5100_bcl: bcl@4700 { + compatible = "qcom,bcl-v5"; + reg = <0x4700 0x100>; + interrupts = <0x0 0x47 0x0 IRQ_TYPE_NONE>, + <0x0 0x47 0x1 IRQ_TYPE_NONE>, + <0x0 0x47 0x2 IRQ_TYPE_NONE>; + interrupt-names = "bcl-lvl0", + "bcl-lvl1", + "bcl-lvl2"; + qcom,pmic7-threshold; + qcom,ibat-ccm-hw-support; + #thermal-sensor-cells = <1>; + }; + + bcl_soc:bcl-soc { + compatible = "qcom,msm-bcl-soc"; + #thermal-sensor-cells = <0>; + }; + }; +}; + +&thermal_zones { + pm5100-tz { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm5100_tz>; + + trips { + pm5100_trip0: trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + pm5100_trip1: trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + + pm5100_trip2: trip2 { + temperature = <145000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + pm5100-ibat-lvl0 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm5100_bcl 0>; + + trips { + ibat_lvl0:ibat-lvl0 { + temperature = <1100>; + hysteresis = <200>; + type = "passive"; + }; + }; + }; + + pm5100-ibat-lvl1 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm5100_bcl 1>; + + trips { + ibat_lvl1:ibat-lvl1 { + temperature = <1500>; + hysteresis = <200>; + type = "passive"; + }; + }; + }; + + pm5100-bcl-lvl0 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm5100_bcl 5>; + + trips { + bcl_lvl0: bcl-lvl0 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + pm5100-bcl-lvl1 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm5100_bcl 6>; + + trips { + bcl_lvl1: bcl-lvl1 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + pm5100-bcl-lvl2 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm5100_bcl 7>; + + trips { + bcl_lvl2: bcl-lvl2 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + socd { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&bcl_soc>; + + trips { + socd_trip:socd-trip { + temperature = <90>; + hysteresis = <0>; + type = "passive"; + }; + }; }; };