From ed19b4fcd5dcafa2bd9b1e23e764169a0c97dbaf Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Tue, 11 May 2021 21:58:33 +0530 Subject: [PATCH] ARM: dts: qcom: enable tsens and thermal zone mitigations for monaco Enable different thermal zones for tsens, different cooling devices like regulator cooling devices, lmh vdd cooling devices, qmi cooling devices etc. for monaco. Change-Id: I292c7d34d103c0cfe708eb63903cf21d90b26c51 --- qcom/monaco-regulators.dtsi | 15 ++ qcom/monaco-rumi.dtsi | 4 + qcom/monaco-stub-regulator.dtsi | 18 ++ qcom/monaco-thermal.dtsi | 419 ++++++++++++++++++++++++++++++++ qcom/monaco.dtsi | 8 + 5 files changed, 464 insertions(+) create mode 100644 qcom/monaco-thermal.dtsi diff --git a/qcom/monaco-regulators.dtsi b/qcom/monaco-regulators.dtsi index 99d06dca19eb..026c4df19edd 100644 --- a/qcom/monaco-regulators.dtsi +++ b/qcom/monaco-regulators.dtsi @@ -51,6 +51,14 @@ ; qcom,use-voltage-level; }; + + cx_cdev: cx-cdev-lvl { + compatible = "qcom,regulator-cooling-device"; + regulator-cdev-supply = <&VDD_CX_FLOOR_LEVEL>; + regulator-levels = ; + #cooling-cells = <2>; + }; }; rpm-regulator-smpa3 { @@ -178,6 +186,13 @@ qcom,use-voltage-level; }; + mx_cdev: mx-cdev-lvl { + compatible = "qcom,regulator-cooling-device"; + regulator-cdev-supply = <&VDD_MXA_LEVEL>; + regulator-levels = ; + #cooling-cells = <2>; + }; }; rpm-regulator-ldoa7 { diff --git a/qcom/monaco-rumi.dtsi b/qcom/monaco-rumi.dtsi index 2ca7828f5719..69376a48fb12 100644 --- a/qcom/monaco-rumi.dtsi +++ b/qcom/monaco-rumi.dtsi @@ -58,3 +58,7 @@ qcom,vdd-io-voltage-level = <1800000 1800000>; qcom,vdd-io-current-level = <0 250000>; }; + +&tsens0 { + status = "disabled"; +}; diff --git a/qcom/monaco-stub-regulator.dtsi b/qcom/monaco-stub-regulator.dtsi index 9a5433cc2814..45958a35747a 100644 --- a/qcom/monaco-stub-regulator.dtsi +++ b/qcom/monaco-stub-regulator.dtsi @@ -23,6 +23,15 @@ regulator-max-microvolt = ; }; + cx_cdev: cx-cdev-lvl { + compatible = "qcom,regulator-cooling-device"; + regulator-cdev-supply = <&VDD_CX_LEVEL_AO>; + regulator-levels = ; + #cooling-cells = <2>; + status = "disabled"; + }; + S3A: pm5100_s3: regulator-pm5100-s3 { compatible = "qcom,stub-regulator"; @@ -83,6 +92,15 @@ regulator-max-microvolt = ; }; + mx_cdev: mx-cdev-lvl { + compatible = "qcom,regulator-cooling-device"; + regulator-cdev-supply = <&VDD_MXA_LEVEL>; + regulator-levels = ; + #cooling-cells = <2>; + status = "disabled"; + }; + VDD_LPI_CX_LEVEL: L4A_LEVEL: pm5100_l4_level: regulator-pm5100-l4-level { diff --git a/qcom/monaco-thermal.dtsi b/qcom/monaco-thermal.dtsi new file mode 100644 index 000000000000..a16a2b1bd4dd --- /dev/null +++ b/qcom/monaco-thermal.dtsi @@ -0,0 +1,419 @@ +#include + +&cpufreq_hw { + #address-cells = <1>; + #size-cells = <1>; + lmh_dcvs0: qcom,limits-dcvs@f550800 { + compatible = "qcom,msm-hw-limits"; + interrupts = ; + qcom,affinity = <0>; + reg = <0xf550800 0x1000>, + <0xf521000 0x1000>; + qcom,no-cooling-device-register; + }; + + 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>; + }; + }; +}; + +&soc { + tsens0:tsens@4410000 { + compatible = "qcom,tsens26xx"; + reg = <0x04410000 0x20>, + <0x04411000 0x140>; + reg-names = "tsens_srot_physical", + "tsens_tm_physical"; + interrupts-extended = <&intc 0 275 IRQ_TYPE_LEVEL_HIGH>, + <&intc 0 190 IRQ_TYPE_LEVEL_HIGH>, + <&wakegic 89 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "tsens-upper-lower", + "tsens-critical", + "tsens-0C"; + tsens-reinit-wa; + 0C-sensor-num = <16>; + #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_tj: modem_tj { + qcom,qmi-dev-name = "modem"; + #cooling-cells = <2>; + }; + + modem_skin: modem_skin { + qcom,qmi-dev-name = "modem_skin"; + #cooling-cells = <2>; + }; + + modem_wlan: modem_wlan { + qcom,qmi-dev-name = "wlan"; + #cooling-cells = <2>; + }; + }; + + adsp { + qcom,instance-id = ; + + adsp_vdd: adsp_vdd { + qcom,qmi-dev-name = "cpuv_restriction_cold"; + #cooling-cells = <2>; + }; + }; + }; + + lmh_cpu_vdd: qcom,lmh-cpu-vdd@f550800 { + compatible = "qcom,lmh-cpu-vdd"; + reg = <0xf550800 0x1000>; + #cooling-cells = <2>; + }; +}; + +&thermal_zones { + gpu-step { + polling-delay-passive = <10>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 6>; + trips { + gpu_step_trip: gpu-trip { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + gpu_cx_mon: gpu-cx-mon { + temperature = <100000>; + hysteresis = <5000>; + type = "passive"; + }; + + }; + + cooling-maps { + gpu-cx-cdev1 { + trip = <&gpu_cx_mon>; + cooling-device = <&modem_tj 3 3>; + }; + }; + }; + + cpuss-0-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 2>; + trips { + cpu0_2_config: cpu-0-2-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu0_cdev { + trip = <&cpu0_2_config>; + cooling-device = <&cpu0_isolate 1 1>; + }; + + cpu2_cdev { + trip = <&cpu0_2_config>; + cooling-device = <&cpu2_isolate 1 1>; + }; + }; + }; + + cpuss-1-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 3>; + trips { + cpu1_3_config: cpu-1-3-config { + temperature = <110000>; + hysteresis = <10000>; + type = "passive"; + }; + }; + + cooling-maps { + cpu1_cdev { + trip = <&cpu1_3_config>; + cooling-device = <&cpu1_isolate 1 1>; + }; + + cpu3_cdev { + trip = <&cpu1_3_config>; + cooling-device = <&cpu3_isolate 1 1>; + }; + }; + }; + + mdm-0-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 4>; + trips { + mdm0_cx_mon: mdm0-cx-mon { + temperature = <100000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + + cooling-maps { + mdm0-cx-cdev1 { + trip = <&mdm0_cx_mon>; + cooling-device = <&modem_tj 3 3>; + }; + }; + }; + + mdm-1-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "step_wise"; + thermal-sensors = <&tsens0 5>; + trips { + mdm1_cx_mon: mdm1-cx-mon { + temperature = <100000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + + cooling-maps { + mdm1-cx-cdev1 { + trip = <&mdm1_cx_mon>; + cooling-device = <&modem_tj 3 3>; + }; + }; + }; + + mapss-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"; + }; + }; + }; + + wlan-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"; + }; + }; + }; + + cpuss-0-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-1-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-0-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 4>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + mdm-1-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 5>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + gpu-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"; + }; + }; + }; + + camera-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&tsens0 7>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + + reset-mon-cfg { + temperature = <115000>; + hysteresis = <5000>; + type = "passive"; + }; + }; + }; + + zeroc-0-step { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&tsens0 16>; + thermal-governor = "step_wise"; + trips { + zeroc_0_trip: active-config0 { + temperature = <1>; + hysteresis = <1>; + type = "passive"; + }; + }; + + cooling-maps { + lmh_cpu_cdev { + trip = <&zeroc_0_trip>; + cooling-device = <&lmh_cpu_vdd 1 1>; + }; + + cx_vdd_cdev { + trip = <&zeroc_0_trip>; + cooling-device = <&cx_cdev 1 1>; + }; + + mx_vdd_cdev { + trip = <&zeroc_0_trip>; + cooling-device = <&mx_cdev 1 1>; + }; + + adsp_vdd_cdev { + trip = <&zeroc_0_trip>; + cooling-device = <&adsp_vdd 1 1>; + }; + }; + }; +}; diff --git a/qcom/monaco.dtsi b/qcom/monaco.dtsi index 204fe4039a33..8dd1188cc510 100644 --- a/qcom/monaco.dtsi +++ b/qcom/monaco.dtsi @@ -43,6 +43,8 @@ i-cache-size = <0x8000>; next-level-cache = <&L2_0>; qcom,freq-domain = <&cpufreq_hw 0 4>; + qcom,lmh-dcvs = <&lmh_dcvs0>; + #cooling-cells = <2>; L2_0: l2-cache { compatible = "arm,arch-cache"; cache-size = <0x80000>; @@ -68,6 +70,7 @@ i-cache-size = <0x8000>; qcom,freq-domain = <&cpufreq_hw 0 4>; next-level-cache = <&L2_0>; + qcom,lmh-dcvs = <&lmh_dcvs0>; L1_I_1: l1-icache { compatible = "arm,arch-cache"; @@ -88,6 +91,7 @@ i-cache-size = <0x8000>; qcom,freq-domain = <&cpufreq_hw 0 4>; next-level-cache = <&L2_0>; + qcom,lmh-dcvs = <&lmh_dcvs0>; L1_I_2: l1-icache { compatible = "arm,arch-cache"; @@ -108,6 +112,7 @@ i-cache-size = <0x8000>; qcom,freq-domain = <&cpufreq_hw 0 4>; next-level-cache = <&L2_0>; + qcom,lmh-dcvs = <&lmh_dcvs0>; L1_I_3: l1-icache { compatible = "arm,arch-cache"; @@ -1249,6 +1254,8 @@ }; }; + thermal_zones: thermal-zones { }; + system_pm_rpm { compatible = "qcom,system-pm-rpm"; }; @@ -1282,6 +1289,7 @@ #include "monaco-pm.dtsi" #include "monaco-audio.dtsi" #include "monaco-usb.dtsi" +#include "monaco-thermal.dtsi" &qupv3_se6_2uart { status = "ok";