Unlike the CPU, the CDSP/Modem does not throttle its speed automatically
when it reaches high temperatures in kodiak.

Set up CDSP cooling by throttling the cdsp when it reaches 100°C and
for modem when it reaches to 95°C.

Remove inherited mdmss cooling-map nodes for Non Modem kodiak variant.

Signed-off-by: Gaurav Kohli <[email protected]>
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi               | 127 ++++++++++++++++++++-
 .../boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts     |  17 +++
 .../dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts  |  17 +++
 .../boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts |  17 +++
 .../boot/dts/qcom/sc7280-herobrine-lte-sku.dtsi    |  18 +++
 .../boot/dts/qcom/sc7280-herobrine-wifi-sku.dtsi   |  16 +++
 6 files changed, 208 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi 
b/arch/arm64/boot/dts/qcom/kodiak.dtsi
index fa540d8c2615..d345add2d8c8 100644
--- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
+++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
@@ -3427,6 +3427,9 @@ remoteproc_mpss: remoteproc@4080000 {
                        qcom,smem-states = <&modem_smp2p_out 0>;
                        qcom,smem-state-names = "stop";
 
+                       #cooling-cells = <3>;
+                       tmd-names = "pa", "modem";
+
                        status = "disabled";
 
                        glink-edge {
@@ -4787,6 +4790,9 @@ remoteproc_cdsp: remoteproc@a300000 {
                        qcom,smem-states = <&cdsp_smp2p_out 0>;
                        qcom,smem-state-names = "stop";
 
+                       #cooling-cells = <2>;
+                       tmd-names = "cdsp_sw";
+
                        status = "disabled";
 
                        glink-edge {
@@ -4906,6 +4912,7 @@ compute-cb@14 {
                                        };
                                };
                        };
+
                };
 
                usb_1: usb@a600000 {
@@ -7716,6 +7723,8 @@ map0 {
                };
 
                nspss0-thermal {
+                       polling-delay-passive = <200>;
+
                        thermal-sensors = <&tsens1 3>;
 
                        trips {
@@ -7725,15 +7734,31 @@ nspss0_alert0: trip-point0 {
                                        type = "hot";
                                };
 
+                               nspss0_alert1: trip-point1 {
+                                       temperature = <100000>;
+                                       hysteresis = <5000>;
+                                       type = "passive";
+                               };
+
                                nspss0_crit: nspss0-crit {
                                        temperature = <110000>;
                                        hysteresis = <0>;
                                        type = "critical";
                                };
                        };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&nspss0_alert1>;
+                                       cooling-device = <&remoteproc_cdsp 
THERMAL_NO_LIMIT
+                                                        THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
 
                nspss1-thermal {
+                       polling-delay-passive = <200>;
+
                        thermal-sensors = <&tsens1 4>;
 
                        trips {
@@ -7743,12 +7768,26 @@ nspss1_alert0: trip-point0 {
                                        type = "hot";
                                };
 
+                               nspss1_alert1: trip-point1 {
+                                       temperature = <100000>;
+                                       hysteresis = <5000>;
+                                       type = "passive";
+                               };
+
                                nspss1_crit: nspss1-crit {
                                        temperature = <110000>;
                                        hysteresis = <0>;
                                        type = "critical";
                                };
                        };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&nspss1_alert1>;
+                                       cooling-device = <&remoteproc_cdsp 
THERMAL_NO_LIMIT
+                                                        THERMAL_NO_LIMIT>;
+                               };
+                       };
                };
 
                video-thermal {
@@ -7787,7 +7826,9 @@ ddr_crit: ddr-crit {
                        };
                };
 
-               mdmss0-thermal {
+               mdmss0_thermal: mdmss0-thermal {
+                       polling-delay-passive = <200>;
+
                        thermal-sensors = <&tsens1 7>;
 
                        trips {
@@ -7797,15 +7838,35 @@ mdmss0_alert0: trip-point0 {
                                        type = "hot";
                                };
 
+                               mdmss0_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
                                mdmss0_crit: mdmss0-crit {
                                        temperature = <110000>;
                                        hysteresis = <0>;
                                        type = "critical";
                                };
                        };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&mdmss0_alert1>;
+                                       cooling-device = <&remoteproc_mpss 0 0 
2>;
+                               };
+
+                               map1 {
+                                       trip = <&mdmss0_alert1>;
+                                       cooling-device = <&remoteproc_mpss 1 0 
2>;
+                               };
+                       };
                };
 
-               mdmss1-thermal {
+               mdmss1_thermal: mdmss1-thermal {
+                       polling-delay-passive = <200>;
+
                        thermal-sensors = <&tsens1 8>;
 
                        trips {
@@ -7815,15 +7876,35 @@ mdmss1_alert0: trip-point0 {
                                        type = "hot";
                                };
 
+                               mdmss1_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
                                mdmss1_crit: mdmss1-crit {
                                        temperature = <110000>;
                                        hysteresis = <0>;
                                        type = "critical";
                                };
                        };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&mdmss1_alert1>;
+                                       cooling-device = <&remoteproc_mpss 0 0 
2>;
+                               };
+
+                               map1 {
+                                       trip = <&mdmss1_alert1>;
+                                       cooling-device = <&remoteproc_mpss 1 0 
2>;
+                               };
+                       };
                };
 
-               mdmss2-thermal {
+               mdmss2_thermal: mdmss2-thermal {
+                       polling-delay-passive = <200>;
+
                        thermal-sensors = <&tsens1 9>;
 
                        trips {
@@ -7833,15 +7914,35 @@ mdmss2_alert0: trip-point0 {
                                        type = "hot";
                                };
 
+                               mdmss2_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
                                mdmss2_crit: mdmss2-crit {
                                        temperature = <110000>;
                                        hysteresis = <0>;
                                        type = "critical";
                                };
                        };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&mdmss2_alert1>;
+                                       cooling-device = <&remoteproc_mpss 0 0 
2>;
+                               };
+
+                               map1 {
+                                       trip = <&mdmss2_alert1>;
+                                       cooling-device = <&remoteproc_mpss 1 0 
2>;
+                               };
+                       };
                };
 
-               mdmss3-thermal {
+               mdmss3_thermal: mdmss3-thermal {
+                       polling-delay-passive = <200>;
+
                        thermal-sensors = <&tsens1 10>;
 
                        trips {
@@ -7851,12 +7952,30 @@ mdmss3_alert0: trip-point0 {
                                        type = "hot";
                                };
 
+                               mdmss3_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
                                mdmss3_crit: mdmss3-crit {
                                        temperature = <110000>;
                                        hysteresis = <0>;
                                        type = "critical";
                                };
                        };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&mdmss3_alert1>;
+                                       cooling-device = <&remoteproc_mpss 0 0 
2>;
+                               };
+
+                               map1 {
+                                       trip = <&mdmss3_alert1>;
+                                       cooling-device = <&remoteproc_mpss 1 0 
2>;
+                               };
+                       };
                };
 
                camera0-thermal {
diff --git a/arch/arm64/boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts 
b/arch/arm64/boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts
index bb5a42b038f1..400d128132fc 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-radxa-dragon-q6a.dts
@@ -24,6 +24,23 @@
 /delete-node/ &adsp_mem;
 /delete-node/ &cdsp_mem;
 /delete-node/ &ipa_fw_mem;
+
+&mdmss0_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss1_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss2_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss3_thermal {
+       /delete-node/ cooling-maps;
+};
+
 /delete-node/ &mpss_mem;
 /delete-node/ &remoteproc_mpss;
 /delete-node/ &remoteproc_wpss;
diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts 
b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts
index a5ad796cb65d..1e190ed18ae5 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts
@@ -22,6 +22,23 @@
 /delete-node/ &cdsp_mem;
 /delete-node/ &ipa_fw_mem;
 /delete-node/ &mpss_mem;
+
+&mdmss0_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss1_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss2_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss3_thermal {
+       /delete-node/ cooling-maps;
+};
+
 /delete-node/ &remoteproc_mpss;
 /delete-node/ &remoteproc_wpss;
 /delete-node/ &rmtfs_mem;
diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts 
b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
index f47efca42d48..8e8dd4efd8c0 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
@@ -23,6 +23,23 @@
 /delete-node/ &adsp_mem;
 /delete-node/ &cdsp_mem;
 /delete-node/ &ipa_fw_mem;
+
+&mdmss0_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss1_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss2_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss3_thermal {
+       /delete-node/ cooling-maps;
+};
+
 /delete-node/ &mpss_mem;
 /delete-node/ &remoteproc_mpss;
 /delete-node/ &remoteproc_wpss;
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-lte-sku.dtsi 
b/arch/arm64/boot/dts/qcom/sc7280-herobrine-lte-sku.dtsi
index b721a8546800..e2c0a317ecb8 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-lte-sku.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-lte-sku.dtsi
@@ -26,8 +26,26 @@ &ipa {
        status = "okay";
 };
 
+&mdmss0_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss1_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss2_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss3_thermal {
+       /delete-node/ cooling-maps;
+};
+
 &remoteproc_mpss {
        compatible = "qcom,sc7280-mss-pil";
+       /delete-property/ tmd-names;
+       /delete-property/ #cooling-cells;
        reg = <0 0x04080000 0 0x10000>, <0 0x04180000 0 0x48>;
        reg-names = "qdsp6", "rmb";
 
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-wifi-sku.dtsi 
b/arch/arm64/boot/dts/qcom/sc7280-herobrine-wifi-sku.dtsi
index 3ebc915f0dc2..6642076f62c4 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-wifi-sku.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-wifi-sku.dtsi
@@ -7,6 +7,22 @@
 
 /* WIFI SKUs save 256M by not having modem/mba/rmtfs memory regions defined. */
 
+&mdmss0_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss1_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss2_thermal {
+       /delete-node/ cooling-maps;
+};
+
+&mdmss3_thermal {
+       /delete-node/ cooling-maps;
+};
+
 /delete-node/ &mpss_mem;
 /delete-node/ &remoteproc_mpss;
 /delete-node/ &rmtfs_mem;

-- 
2.34.1


Reply via email to