From 44ffc5f62be365d527b662f0858071bd12e92358 Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Thu, 19 Nov 2020 01:25:24 +0530 Subject: [PATCH] ARM: dts: qcom: Enable TSENS and thermal zone changes for sdxnightjar Enable TSENS driver, default userspace thermal zone rules for each TSENS, enable QMI cooling device, regulator cooling device and enable modem junction temperature mitigation thermal zone rule for sdxnightjar. Change-Id: I67efdb252e3fb59a6d6256b03613b14e8a5e2c56 --- qcom/sdxnightjar-regulator.dtsi | 8 ++ qcom/sdxnightjar-thermal.dtsi | 177 ++++++++++++++++++++++++++++++++ qcom/sdxnightjar.dtsi | 3 + 3 files changed, 188 insertions(+) create mode 100644 qcom/sdxnightjar-thermal.dtsi diff --git a/qcom/sdxnightjar-regulator.dtsi b/qcom/sdxnightjar-regulator.dtsi index d381a0a2996a..074adccb73c6 100644 --- a/qcom/sdxnightjar-regulator.dtsi +++ b/qcom/sdxnightjar-regulator.dtsi @@ -92,6 +92,14 @@ ; qcom,use-voltage-floor-level; }; + + cx_cdev: cx-cdev { + compatible = "qcom,regulator-cooling-device"; + regulator-cdev-supply = <&pmd9650_s5_floor_level>; + regulator-levels = ; + #cooling-cells = <2>; + }; }; rpm-regulator-ldoa1 { diff --git a/qcom/sdxnightjar-thermal.dtsi b/qcom/sdxnightjar-thermal.dtsi new file mode 100644 index 000000000000..657530c6180b --- /dev/null +++ b/qcom/sdxnightjar-thermal.dtsi @@ -0,0 +1,177 @@ +#include + +&soc { + tsens0: tsens@4a8000 { + compatible = "qcom,msm8996-tsens"; + reg = <0x4a8000 0x152>, + <0x4a9000 0x1ff>; + reg-names = "tsens_srot_physical", + "tsens_tm_physical"; + interrupts-extended = <&intc GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tsens-upper-lower", "tsens-critical"; + #thermal-sensor-cells = <1>; + }; + + qmi-tmd-devices { + compatible = "qcom,qmi-cooling-devices"; + + modem { + qcom,instance-id = ; + + modem_pa: modem_pa { + qcom,qmi-dev-name = "pa"; + #cooling-cells = <2>; + }; + + modem_proc: modem_proc { + qcom,qmi-dev-name = "modem"; + #cooling-cells = <2>; + }; + + modem_vdd: modem_vdd { + qcom,qmi-dev-name = "cpuv_restriction_cold"; + #cooling-cells = <2>; + }; + + modem_cpr_cold: modem_cpr_cold { + qcom,qmi-dev-name = "cpr_cold"; + #cooling-cells = <2>; + }; + }; + }; +}; + +&thermal_zones { + aoss-0-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 0>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + q6-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 1>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + ipa-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 2>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + cpuss-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 3>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + mdm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 6>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + mdm-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 6>; + thermal-governor = "step_wise"; + trips { + tj_config0: active-config0 { + temperature = <95000>; + hysteresis = <5000>; + type = "passive"; + }; + + tj_config1: active-config1 { + temperature = <105000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + + cooling-maps { + modem_proc_cdev1 { + trip = <&tj_config0>; + cooling-device = <&modem_proc 1 1>; + }; + + modem_proc_cdev2 { + trip = <&tj_config1>; + cooling-device = <&modem_proc 3 3>; + }; + }; + }; +}; diff --git a/qcom/sdxnightjar.dtsi b/qcom/sdxnightjar.dtsi index 95eeafc47ad1..40213acab1b6 100644 --- a/qcom/sdxnightjar.dtsi +++ b/qcom/sdxnightjar.dtsi @@ -897,6 +897,8 @@ }; }; + thermal_zones: thermal-zones {}; + spmi_bus: qcom,spmi@200f000 { compatible = "qcom,spmi-pmic-arb"; reg = <0x200f000 0x1000>, @@ -1032,6 +1034,7 @@ #include "sdxnightjar-pcie.dtsi" #include "sdxnightjar-audio.dtsi" #include "sdxnightjar-audio-overlay.dtsi" +#include "sdxnightjar-thermal.dtsi" &i2c_3 { status = "ok";