From 840c913c52a82b3c6ec28c0c0ffdc49122c888dd Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Wed, 4 Mar 2020 10:59:37 -0800 Subject: [PATCH 1/6] dt-bindings: thermal: Add LMH DCVSh devicetree documentation Add LMH DCVSh devicetree documentation. LMH DCVSh driver is used to configure the LMH hardware. Change-Id: Idbdd23dcead6ce8c26bc7754308f742490978cd2 --- bindings/thermal/qti-lmh-dcvs.txt | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 bindings/thermal/qti-lmh-dcvs.txt diff --git a/bindings/thermal/qti-lmh-dcvs.txt b/bindings/thermal/qti-lmh-dcvs.txt new file mode 100644 index 000000000000..07309c14c20f --- /dev/null +++ b/bindings/thermal/qti-lmh-dcvs.txt @@ -0,0 +1,85 @@ +Limits Management Hardware - DCVS + +The LMH-DCVS block is a hardware IP for every CPU cluster, to handle quick +changes in thermal limits. The hardware responds to thermal variation amongst +the CPUs in the cluster by requesting limits on the clock frequency and +voltage on the OSM hardware. + +The LMH DCVS driver exports a virtual sensor that can be used to set the +thermal limits on the hardware. LMH DCVS driver can be a platform CPU Cooling +device, which registers with the CPU cooling device interface. All CPU device +nodes should reference the corresponding LMH DCVS hardware in device tree. +CPUs referencing the same LMH DCVS node will be associated with the +corresponding cooling device as related CPUs. + +Properties: + +- compatible: + Usage: required + Value type: + Definition: shall be "qcom,msm-hw-limits" +- interrupts: + Usage: optional + Value type: + Definition: Should specify interrupt information about the debug + interrupt generated by the LMH DCVSh hardware. LMH + DCVSh hardware will generate this interrupt whenever + it makes a new cpu DCVS decision. +- qcom,affinity: + Usage: optional + Value type: + Definition: Should specify the cluster affinity this hardware + corresponds to. + +- isens_vref_1p8-supply: +- isens_vref_0p8-supply: + Usage: optional + Value type: + Definition: Should specify the phandle of the vref regulator used by + the isens hardware. This active only regulator will be + enabled by LMH DCVSh. Isens hardware needs 1.8v and + 0.8v supply regulators. + +- isens-vref-1p8-settings: +- isens-vref-0p8-settings: + Usage: optional + Value type: + Definition: Should specify the min voltage(uV), max voltage(uV) and + max load(uA) for the isens vref regulator. This + property is valid only if there is valid entry for + isens_vref_1p8-supply and isens_vref_0p8-supply. + +- reg: + Usage: optional + Value type: + Definition: where 'a' is the starting register address of the OSM/LLM + and 'b' is the size of OSM/LLM address space. The + register space in index 0 should be LLM and index 1 + should be OSM. + +- qcom,no-cooling-device-register: + Usage: optional + Value type: + Definition: Should define this property if this driver doesn't need + to register CPU cooling devices with thermal framework. + +Example: + + lmh_dcvs0: qcom,limits-dcvs@18350800 { + compatible = "qcom,msm-hw-limits"; + interrupts = ; + qcom,affinity = <0>; + isens_vref_1p8-supply = <&pm8998_l1_ao>; + isens-vref-1p8-settings = <880000 880000 36000>; + isens_vref_0p8-supply = <&pm8998_l12_ao>; + isens-vref-0p8-settings = <880000 880000 36000>; + reg = <0x18350800 0x1000>, //LLM + <0x18323000 0x1000>; //OSM + }; + + CPU0: cpu@0 { + device_type = "cpu"; + compatible = "arm,armv8"; + reg = <0x0 0x0>; + qcom,lmh-dcvs = <&lmh_dcvs0>;; + }; From 68e82f77665034a15662a659dca13a3e772c0392 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Fri, 28 Feb 2020 13:22:02 -0800 Subject: [PATCH 2/6] ARM: dts: msm: Add modem QMI sensor and cdev configuration for lahaina Add the list of modem QMI sensors and QMI cooling devices available for lahaina. Change-Id: I515aa3279aa0d07a585222c07e19aeb270a9daa7 --- qcom/lahaina-thermal-modem.dtsi | 367 ++++++++++++++++++++++++++++++++ qcom/lahaina-thermal.dtsi | 3 +- 2 files changed, 369 insertions(+), 1 deletion(-) create mode 100644 qcom/lahaina-thermal-modem.dtsi diff --git a/qcom/lahaina-thermal-modem.dtsi b/qcom/lahaina-thermal-modem.dtsi new file mode 100644 index 000000000000..cc9eef0308c3 --- /dev/null +++ b/qcom/lahaina-thermal-modem.dtsi @@ -0,0 +1,367 @@ +&soc { + 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_pa_fr1: modem_pa_fr1 { + qcom,qmi-dev-name = "pa_fr1"; + #cooling-cells = <2>; + }; + + modem_tj: modem_tj { + qcom,qmi-dev-name = "modem"; + #cooling-cells = <2>; + }; + + modem_current: modem_current { + qcom,qmi-dev-name = "modem_current"; + #cooling-cells = <2>; + }; + + modem_skin: modem_skin { + qcom,qmi-dev-name = "modem_skin"; + #cooling-cells = <2>; + }; + + modem_mmw_skin0: modem_mmw_skin0 { + qcom,qmi-dev-name = "mmw_skin0"; + #cooling-cells = <2>; + }; + + modem_mmw_skin1: modem_mmw_skin1 { + qcom,qmi-dev-name = "mmw_skin1"; + #cooling-cells = <2>; + }; + + modem_mmw_skin2: modem_mmw_skin2 { + qcom,qmi-dev-name = "mmw_skin2"; + #cooling-cells = <2>; + }; + + modem_mmw_skin3: modem_mmw_skin3 { + qcom,qmi-dev-name = "mmw_skin3"; + #cooling-cells = <2>; + }; + + modem_mmw0: modem_mmw0 { + qcom,qmi-dev-name = "mmw0"; + #cooling-cells = <2>; + }; + + modem_mmw1: modem_mmw1 { + qcom,qmi-dev-name = "mmw1"; + #cooling-cells = <2>; + }; + + modem_mmw2: modem_mmw2 { + qcom,qmi-dev-name = "mmw2"; + #cooling-cells = <2>; + }; + + modem_mmw3: modem_mmw3 { + qcom,qmi-dev-name = "mmw3"; + #cooling-cells = <2>; + }; + + modem_bcl: modem_bcl { + qcom,qmi-dev-name = "vbatt_low"; + #cooling-cells = <2>; + }; + + modem_charge_state: modem_charge_state { + qcom,qmi-dev-name = "charge_state"; + #cooling-cells = <2>; + }; + + modem_vdd: modem_vdd { + qcom,qmi-dev-name = "cpuv_restriction_cold"; + #cooling-cells = <2>; + }; + + modem_wlan: modem_wlan { + qcom,qmi-dev-name = "wlan"; + #cooling-cells = <2>; + }; + }; + }; + + qmi_sensor: qmi-ts-sensors { + compatible = "qcom,qmi-sensors"; + #thermal-sensor-cells = <1>; + + modem { + qcom,instance-id = ; + qcom,qmi-sensor-names = "pa", + "pa_1", + "qfe_wtr0", + "modem_tsens", + "qfe_mmw0", + "qfe_mmw1", + "qfe_mmw2", + "qfe_mmw3", + "xo_therm", + "qfe_mmw_streamer0", + "qfe_mmw0_mod", + "qfe_mmw1_mod", + "qfe_mmw2_mod", + "qfe_mmw3_mod", + "qfe_ret_pa0", + "qfe_wtr_pa0", + "qfe_wtr_pa1", + "qfe_wtr_pa2", + "qfe_wtr_pa3", + "sys_therm1", + "sys_therm2", + "modem_tsens1"; + }; + }; +}; + +&thermal_zones { + modem-lte-sub6-pa1 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_PA)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-lte-sub6-pa2 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_PA_1)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw0-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_0)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw1-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_1)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw2-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_2)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw3-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_3)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-skin-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_XO_THERM)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-wifi-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_SYS_THERM_1)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-ambient-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_SYS_THERM_2)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-0-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_MODEM_TSENS)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-1-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_MODEM_TSENS_1)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-streamer-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_STREAMER_0)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw0-mod-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_0_MOD)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw1-mod-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_1_MOD)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw2-mod-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_2_MOD)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + modem-mmw3-mod-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&qmi_sensor + (QMI_MODEM_INST_ID+QMI_QFE_MMW_3_MOD)>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; +}; diff --git a/qcom/lahaina-thermal.dtsi b/qcom/lahaina-thermal.dtsi index e879ab3b09a6..4a56ff992f75 100644 --- a/qcom/lahaina-thermal.dtsi +++ b/qcom/lahaina-thermal.dtsi @@ -1,4 +1,5 @@ -#include +#include +#include "lahaina-thermal-modem.dtsi" &thermal_zones { aoss-0-usr { From 017c99cf518a6c33fc547bf481c85bb954422edb Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Fri, 28 Feb 2020 13:40:22 -0800 Subject: [PATCH 3/6] ARM: dts: msm: Add CPU thermal configuration for lahaina Add CPU frequency and CPU isolation cooling device configuration. Add thermal emergency mitigation configuration to mitigate CPU at high temperatures for lahaina. Change-Id: I2a168b279d883d8ee4644d5e1c269c9d76a25937 --- qcom/lahaina-thermal.dtsi | 392 +++++++++++++++++++++++++++++++++++--- 1 file changed, 363 insertions(+), 29 deletions(-) diff --git a/qcom/lahaina-thermal.dtsi b/qcom/lahaina-thermal.dtsi index 4a56ff992f75..ccc49d150210 100644 --- a/qcom/lahaina-thermal.dtsi +++ b/qcom/lahaina-thermal.dtsi @@ -1,13 +1,57 @@ #include #include "lahaina-thermal-modem.dtsi" +&cpufreq_hw { + qcom,cpu-isolation { + compatible = "qcom,cpu-isolate"; + cpu0_isolate: cpu0-isolate { + qcom,cpu = <&CPU0>; + #cooling-cells = <2>; + }; + + cpu1_isolate: cpu1-isolate { + qcom,cpu = <&CPU1>; + #cooling-cells = <2>; + }; + + cpu2_isolate: cpu2-isolate { + qcom,cpu = <&CPU2>; + #cooling-cells = <2>; + }; + + cpu3_isolate: cpu3-isolate { + qcom,cpu = <&CPU3>; + #cooling-cells = <2>; + }; + + cpu4_isolate: cpu4-isolate { + qcom,cpu = <&CPU4>; + #cooling-cells = <2>; + }; + + cpu5_isolate: cpu5-isolate { + qcom,cpu = <&CPU5>; + #cooling-cells = <2>; + }; + + cpu6_isolate: cpu6-isolate { + qcom,cpu = <&CPU6>; + #cooling-cells = <2>; + }; + + cpu7_isolate: cpu7-isolate { + qcom,cpu = <&CPU7>; + #cooling-cells = <2>; + }; + }; +}; + &thermal_zones { aoss-0-usr { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 0>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -28,7 +72,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 1>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -49,7 +92,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 2>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -70,7 +112,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 3>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -91,7 +132,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 4>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -112,7 +152,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 5>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -133,7 +172,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 6>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -154,7 +192,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 7>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -175,7 +212,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 8>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -196,7 +232,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 9>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -217,7 +252,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 10>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -238,7 +272,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 11>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -259,7 +292,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 12>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -280,7 +312,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 13>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -301,7 +332,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens0 14>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -322,7 +352,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 0>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -343,7 +372,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 1>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -364,7 +392,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 2>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -385,7 +412,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 3>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -406,7 +432,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 4>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -427,7 +452,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 5>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -448,7 +472,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 6>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -469,7 +492,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 7>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -490,7 +512,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 8>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -511,7 +532,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 9>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -532,7 +552,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 10>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -553,7 +572,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 11>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -574,7 +592,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 12>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -595,7 +612,6 @@ polling-delay = <0>; thermal-governor = "user_space"; thermal-sensors = <&tsens1 13>; - wake-capable-sensor; trips { active-config0 { temperature = <125000>; @@ -610,5 +626,323 @@ }; }; }; + + pop-mem-step { + polling-delay-passive = <10>; + polling-delay = <0>; + thermal-sensors = <&tsens1 7>; + thermal-governor = "step_wise"; + trips { + pop_trip: pop-trip { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + }; + + cooling-maps { + pop_cdev4 { + trip = <&pop_trip>; + cooling-device = + <&CPU4 THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + }; + + pop_cdev7 { + trip = <&pop_trip>; + cooling-device = + <&CPU7 THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + }; + }; + }; + + cpu-0-0-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 1>; + trips { + cpu00_config: cpu00-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu00_cdev { + trip = <&cpu00_config>; + cooling-device = <&cpu0_isolate 1 1>; + }; + }; + }; + + cpu-0-1-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 2>; + trips { + cpu01_config: cpu01-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu01_cdev { + trip = <&cpu01_config>; + cooling-device = <&cpu1_isolate 1 1>; + }; + }; + }; + + cpu-0-2-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 3>; + trips { + cpu02_config: cpu02-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu02_cdev { + trip = <&cpu02_config>; + cooling-device = <&cpu2_isolate 1 1>; + }; + }; + }; + + cpu-0-3-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 4>; + thermal-governor = "step_wise"; + trips { + cpu03_config: cpu03-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu03_cdev { + trip = <&cpu03_config>; + cooling-device = <&cpu3_isolate 1 1>; + }; + }; + }; + + cpu-1-0-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 7>; + thermal-governor = "step_wise"; + trips { + cpu10_config: cpu10-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu10_cdev { + trip = <&cpu10_config>; + cooling-device = <&cpu4_isolate 1 1>; + }; + + cpu10_cdev1 { + trip = <&cpu10_config>; + cooling-device = <&CPU4 THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + cpu-1-1-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 8>; + thermal-governor = "step_wise"; + trips { + cpu11_config: cpu11-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu11_cdev { + trip = <&cpu11_config>; + cooling-device = <&cpu4_isolate 1 1>; + }; + + cpu11_cdev1 { + trip = <&cpu11_config>; + cooling-device = <&CPU4 THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + cpu-1-2-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 9>; + thermal-governor = "step_wise"; + trips { + cpu12_config: cpu12-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu12_cdev { + trip = <&cpu12_config>; + cooling-device = <&cpu5_isolate 1 1>; + }; + + cpu12_cdev1 { + trip = <&cpu12_config>; + cooling-device = <&CPU4 THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + cpu-1-3-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 10>; + thermal-governor = "step_wise"; + trips { + cpu13_config: cpu13-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu13_cdev { + trip = <&cpu13_config>; + cooling-device = <&cpu5_isolate 1 1>; + }; + + cpu13_cdev1 { + trip = <&cpu13_config>; + cooling-device = <&CPU4 THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + cpu-1-4-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 11>; + thermal-governor = "step_wise"; + trips { + cpu14_config: cpu14-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu14_cdev { + trip = <&cpu14_config>; + cooling-device = <&cpu6_isolate 1 1>; + }; + + cpu14_cdev1 { + trip = <&cpu14_config>; + cooling-device = <&CPU4 THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + cpu-1-5-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 12>; + thermal-governor = "step_wise"; + trips { + cpu15_config: cpu15-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu15_cdev { + trip = <&cpu15_config>; + cooling-device = <&cpu6_isolate 1 1>; + }; + + cpu15_cdev1 { + trip = <&cpu15_config>; + cooling-device = <&CPU4 THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + cpu-1-6-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 13>; + thermal-governor = "step_wise"; + trips { + cpu16_config: cpu16-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu16_cdev { + trip = <&cpu16_config>; + cooling-device = <&cpu7_isolate 1 1>; + }; + }; + }; + + cpu-1-7-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 14>; + thermal-governor = "step_wise"; + trips { + cpu17_config: cpu17-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu17_cdev { + trip = <&cpu17_config>; + cooling-device = <&cpu7_isolate 1 1>; + }; + }; + }; }; From 59f20fa6d1905fc62312ad077c410971e5e68032 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Fri, 28 Feb 2020 13:42:45 -0800 Subject: [PATCH 4/6] ARM: dts: msm: Add BCL configuration for lahaina Add BCL configuration to monitor battery current, level violation and state of charge depletion configuration for lahaina. Change-Id: I548cec77b1f1c64651cd1ecf7b25a4ed114830b0 --- qcom/lahaina-cdp.dtsi | 1 + qcom/lahaina-mtp.dtsi | 1 + qcom/lahaina-qrd.dtsi | 1 + qcom/lahaina-thermal-overlay.dtsi | 131 ++++++++++++++++++++++++++++++ qcom/pm8350b.dtsi | 107 ++++++++++++++++++++++++ qcom/pm8350c.dtsi | 57 +++++++++++++ 6 files changed, 298 insertions(+) create mode 100644 qcom/lahaina-thermal-overlay.dtsi diff --git a/qcom/lahaina-cdp.dtsi b/qcom/lahaina-cdp.dtsi index 735be4e52a9f..e6799c18bdcc 100644 --- a/qcom/lahaina-cdp.dtsi +++ b/qcom/lahaina-cdp.dtsi @@ -4,6 +4,7 @@ #include "lahaina-pmic-overlay.dtsi" #include "lahaina-audio-overlay.dtsi" #include "display/lahaina-sde-display-cdp.dtsi" +#include "lahaina-thermal-overlay.dtsi" &spmi_debug_bus { status = "ok"; diff --git a/qcom/lahaina-mtp.dtsi b/qcom/lahaina-mtp.dtsi index 0755a9157f64..3177135db5f6 100644 --- a/qcom/lahaina-mtp.dtsi +++ b/qcom/lahaina-mtp.dtsi @@ -4,6 +4,7 @@ #include "lahaina-pmic-overlay.dtsi" #include "lahaina-audio-overlay.dtsi" #include "display/lahaina-sde-display-mtp.dtsi" +#include "lahaina-thermal-overlay.dtsi" &spmi_debug_bus { status = "ok"; diff --git a/qcom/lahaina-qrd.dtsi b/qcom/lahaina-qrd.dtsi index 28392c7365b8..ca018b00a504 100644 --- a/qcom/lahaina-qrd.dtsi +++ b/qcom/lahaina-qrd.dtsi @@ -2,6 +2,7 @@ #include "display/lahaina-sde-display-qrd.dtsi" #include "camera/lahaina-camera-sensor-mtp.dtsi" #include "lahaina-audio-overlay.dtsi" +#include "lahaina-thermal-overlay.dtsi" &ufsphy_mem { compatible = "qcom,ufs-phy-qmp-v4-lahaina"; diff --git a/qcom/lahaina-thermal-overlay.dtsi b/qcom/lahaina-thermal-overlay.dtsi new file mode 100644 index 000000000000..69093cf1dfb5 --- /dev/null +++ b/qcom/lahaina-thermal-overlay.dtsi @@ -0,0 +1,131 @@ +#include + +&mdss_mdp { + #cooling-cells = <2>; +}; + +&thermal_zones { + socd { + cooling-maps { + socd_cpu4 { + trip = <&socd_trip>; + cooling-device = <&cpu4_isolate 1 1>; + }; + + socd_cpu5 { + trip = <&socd_trip>; + cooling-device = <&cpu5_isolate 1 1>; + }; + + socd_cpu6 { + trip = <&socd_trip>; + cooling-device = <&cpu6_isolate 1 1>; + }; + + socd_cpu7 { + trip = <&socd_trip>; + cooling-device = <&cpu7_isolate 1 1>; + }; + }; + }; + + + pm8350b-bcl-lvl0 { + cooling-maps { + vbat_cpu4 { + trip = <&b_bcl_lvl0>; + cooling-device = <&cpu4_isolate 1 1>; + }; + + vbat_cpu5 { + trip = <&b_bcl_lvl0>; + cooling-device = <&cpu5_isolate 1 1>; + }; + + vbat_gpu0 { + trip = <&b_bcl_lvl0>; + cooling-device = <&msm_gpu 2 2>; + }; + }; + }; + + pm8350b-bcl-lvl1 { + cooling-maps { + vbat_cpu6 { + trip = <&b_bcl_lvl1>; + cooling-device = <&cpu6_isolate 1 1>; + }; + + vbat_cpu7 { + trip = <&b_bcl_lvl1>; + cooling-device = <&cpu7_isolate 1 1>; + }; + + vbat_gpu1 { + trip = <&b_bcl_lvl1>; + cooling-device = <&msm_gpu 4 4>; + }; + }; + }; + + pm8350b-bcl-lvl2 { + cooling-maps { + vbat_gpu2 { + trip = <&b_bcl_lvl2>; + cooling-device = <&msm_gpu THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; + + pm8350c-bcl-lvl0 { + disable-thermal-zone; + cooling-maps { + vph_cpu4 { + trip = <&c_bcl_lvl0>; + cooling-device = <&cpu4_isolate 1 1>; + }; + + vph_cpu5 { + trip = <&c_bcl_lvl0>; + cooling-device = <&cpu5_isolate 1 1>; + }; + + vph_gpu0 { + trip = <&c_bcl_lvl0>; + cooling-device = <&msm_gpu 2 2>; + }; + }; + }; + + pm8350c-bcl-lvl1 { + disable-thermal-zone; + cooling-maps { + vph_cpu6 { + trip = <&c_bcl_lvl1>; + cooling-device = <&cpu6_isolate 1 1>; + }; + + vph_cpu7 { + trip = <&c_bcl_lvl1>; + cooling-device = <&cpu7_isolate 1 1>; + }; + + vph_gpu1 { + trip = <&c_bcl_lvl1>; + cooling-device = <&msm_gpu 4 4>; + }; + }; + }; + + pm8350c-bcl-lvl2 { + disable-thermal-zone; + cooling-maps { + vph_gpu2 { + trip = <&c_bcl_lvl2>; + cooling-device = <&msm_gpu THERMAL_MAX_LIMIT + THERMAL_MAX_LIMIT>; + }; + }; + }; +}; diff --git a/qcom/pm8350b.dtsi b/qcom/pm8350b.dtsi index e6a21d80e3c8..ad52a160c94f 100644 --- a/qcom/pm8350b.dtsi +++ b/qcom/pm8350b.dtsi @@ -30,6 +30,23 @@ #interrupt-cells = <2>; }; + pm8350b_bcl: bcl@4700 { + compatible = "qcom,bcl-v5"; + reg = <0x4700 0x100>; + interrupts = <0x3 0x47 0x0 IRQ_TYPE_NONE>, + <0x3 0x47 0x1 IRQ_TYPE_NONE>, + <0x3 0x47 0x2 IRQ_TYPE_NONE>; + interrupt-names = "bcl-lvl0", + "bcl-lvl1", + "bcl-lvl2"; + #thermal-sensor-cells = <1>; + }; + + bcl_soc:bcl-soc { + compatible = "qcom,msm-bcl-soc"; + #thermal-sensor-cells = <0>; + }; + pm8350b_haptics: qcom,hv-haptics@f000 { compatible = "qcom,hv-haptics"; reg = <0xf000>, <0xf100>; @@ -176,4 +193,94 @@ }; }; }; + + pm8350b-ibat-lvl0 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350b_bcl 0>; + + trips { + ibat_lvl0:ibat-lvl0 { + temperature = <4500>; + hysteresis = <200>; + type = "passive"; + }; + }; + }; + + pm8350b-ibat-lvl1 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350b_bcl 1>; + + trips { + ibat_lvl1:ibat-lvl1 { + temperature = <5000>; + hysteresis = <200>; + type = "passive"; + }; + }; + }; + + pm8350b-bcl-lvl0 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350b_bcl 5>; + + trips { + b_bcl_lvl0: b-bcl-lvl0 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + pm8350b-bcl-lvl1 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350b_bcl 6>; + + trips { + b_bcl_lvl1: b-bcl-lvl1 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + pm8350b-bcl-lvl2 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350b_bcl 7>; + + trips { + b_bcl_lvl2: b-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"; + }; + }; + }; }; diff --git a/qcom/pm8350c.dtsi b/qcom/pm8350c.dtsi index 14ee3081f065..e04bad7ab114 100644 --- a/qcom/pm8350c.dtsi +++ b/qcom/pm8350c.dtsi @@ -71,6 +71,18 @@ }; }; + pm8350c_bcl: bcl@4700 { + compatible = "qcom,bcl-v5"; + reg = <0x4700 0x100>; + interrupts = <0x2 0x47 0x0 IRQ_TYPE_NONE>, + <0x2 0x47 0x1 IRQ_TYPE_NONE>, + <0x2 0x47 0x2 IRQ_TYPE_NONE>; + interrupt-names = "bcl-lvl0", + "bcl-lvl1", + "bcl-lvl2"; + #thermal-sensor-cells = <1>; + }; + pm8350c_flash: qcom,flash_led@ee00 { compatible = "qcom,pm8350c-flash-led"; reg = <0xee00>; @@ -208,4 +220,49 @@ }; }; }; + + pm8350c-bcl-lvl0 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350c_bcl 5>; + + trips { + c_bcl_lvl0: c-bcl-lvl0 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + pm8350c-bcl-lvl1 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350c_bcl 6>; + + trips { + c_bcl_lvl1: c-bcl-lvl1 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; + + pm8350c-bcl-lvl2 { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&pm8350c_bcl 7>; + + trips { + c_bcl_lvl2: c-bcl-lvl2 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + }; }; From 2369e107db7735302dfe94768dec3918476fec6f Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Tue, 3 Mar 2020 09:42:28 -0800 Subject: [PATCH 5/6] ARM: dts: msm: Add GPU thermal zone configuration for lahaina Add a virtual sensor configuration to monitor the maximum temperature of two GPU sensors and then mitigate GPU cooling device. Change-Id: I14265fb06d453ae56a0dcf00ed37742139f71d68 --- qcom/lahaina-thermal.dtsi | 27 +++++++++++++++++++++++++++ qcom/lahaina.dtsi | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/qcom/lahaina-thermal.dtsi b/qcom/lahaina-thermal.dtsi index ccc49d150210..03839e109937 100644 --- a/qcom/lahaina-thermal.dtsi +++ b/qcom/lahaina-thermal.dtsi @@ -46,6 +46,10 @@ }; }; +&msm_gpu { + #cooling-cells = <2>; +}; + &thermal_zones { aoss-0-usr { polling-delay-passive = <0>; @@ -944,5 +948,28 @@ }; }; }; + + gpuss-max-step { + polling-delay-passive = <10>; + polling-delay = <100>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens1 1>, <&tsens1 2>; + sensor-aggregation = ; + trips { + gpuss_config: active-config0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + }; + + cooling-maps { + gpu_cdev { + trip = <&gpuss_config>; + cooling-device = <&msm_gpu THERMAL_NO_LIMIT + THERMAL_NO_LIMIT>; + }; + }; + }; }; diff --git a/qcom/lahaina.dtsi b/qcom/lahaina.dtsi index 9eb219fcfe9b..5cf784d5ef52 100644 --- a/qcom/lahaina.dtsi +++ b/qcom/lahaina.dtsi @@ -3773,7 +3773,6 @@ }; }; -#include "lahaina-thermal.dtsi" #include "ipcc-test.dtsi" #include "lahaina-regulators.dtsi" #include "lahaina-pinctrl.dtsi" @@ -3813,6 +3812,7 @@ #include "lahaina-gpu.dtsi" #include "display/lahaina-sde.dtsi" +#include "lahaina-thermal.dtsi" &qupv3_se18_4uart { status = "ok"; From 1a15b9ab2a1c47add01c94967db3760c592e62d5 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Tue, 3 Mar 2020 09:45:05 -0800 Subject: [PATCH 6/6] ARM: dts: msm: Add configuration for vref regulator vote for lahaina Add regulator configuration for vref regulators so that LMH driver can place a active only vote for lahaina. Change-Id: Idadf2fbc0cdaa7f47cfd6b3cb23a1ccc0bdf73b9 --- qcom/lahaina-regulators.dtsi | 38 ++++++++++++++++++++++++++++++++++++ qcom/lahaina-thermal.dtsi | 8 ++++++++ 2 files changed, 46 insertions(+) diff --git a/qcom/lahaina-regulators.dtsi b/qcom/lahaina-regulators.dtsi index 5178a1f9e38d..7a90d689a7a0 100644 --- a/qcom/lahaina-regulators.dtsi +++ b/qcom/lahaina-regulators.dtsi @@ -242,6 +242,25 @@ qcom,proxy-consumer-enable; qcom,proxy-consumer-current = <100000>; }; + + L5B_AO: pm8350_l5_ao: regulator-pm8350-l5-ao { + regulator-name = "pm8350_l5_ao"; + qcom,set = ; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + qcom,init-voltage = <880000>; + qcom,init-mode = ; + }; + + regulator-pm8350-l5-so { + regulator-name = "pm8350_l5_so"; + qcom,set = ; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + qcom,init-voltage = <880000>; + qcom,init-mode = ; + qcom,init-enable = <0>; + }; }; rpmh-regulator-ldob6 { @@ -502,6 +521,25 @@ qcom,init-voltage = <1800000>; qcom,init-mode = ; }; + + L1C_AO: pm8350c_l1_ao: regulator-pm8350c-l1-ao { + regulator-name = "pm8350c_l1_ao"; + qcom,set = ; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + qcom,init-voltage = <1800000>; + qcom,init-mode = ; + }; + + regulator-pm8350c-l1-so { + regulator-name = "pm8350c_l1_so"; + qcom,set = ; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + qcom,init-voltage = <1800000>; + qcom,init-mode = ; + qcom,init-enable = <0>; + }; }; rpmh-regulator-ldoc2 { diff --git a/qcom/lahaina-thermal.dtsi b/qcom/lahaina-thermal.dtsi index 03839e109937..44007fbc7d8e 100644 --- a/qcom/lahaina-thermal.dtsi +++ b/qcom/lahaina-thermal.dtsi @@ -44,6 +44,14 @@ #cooling-cells = <2>; }; }; + + qcom,limits-dcvs { + compatible = "qcom,msm-hw-limits"; + isens_vref_0p8-supply = <&pm8350_l5_ao>; + isens-vref-0p8-settings = <880000 880000 30000>; + isens_vref_1p8-supply = <&pm8350c_l1_ao>; + isens-vref-1p8-settings = <1800000 1800000 20000>; + }; }; &msm_gpu {