diff mbox series

[3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones

Message ID 20181123121839.18573-3-thierry.reding@gmail.com
State Accepted
Headers show
Series [1/3] dt-bindings: thermal: tegra-bpmp: Add Tegra194 support | expand

Commit Message

Thierry Reding Nov. 23, 2018, 12:18 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

Enable these thermal zones to be able to monitor their temperatures and
control the fan to cool down the system if necessary.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../boot/dts/nvidia/tegra194-p2972-0000.dts   | 91 ++++++++++++++++++-
 1 file changed, 90 insertions(+), 1 deletion(-)

Comments

Eduardo Valentin Dec. 15, 2018, 5:28 p.m. UTC | #1
On Fri, Nov 23, 2018 at 01:18:39PM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Enable these thermal zones to be able to monitor their temperatures and
> control the fan to cool down the system if necessary.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Acked-by: Eduardo Valentin <edubezval@gmail.com>

As mentioned, I already added patch 1.

> ---
>  .../boot/dts/nvidia/tegra194-p2972-0000.dts   | 91 ++++++++++++++++++-
>  1 file changed, 90 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
> index cbae8e8b1281..e29f8f6117c8 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
> +++ b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
> @@ -43,8 +43,97 @@
>  		};
>  	};
>  
> -	fan {
> +	fan: fan {
>  		compatible = "pwm-fan";
>  		pwms = <&pwm4 0 45334>;
> +
> +		cooling-levels = <0 64 128 255>;
> +		cooling-min-state = <0>;
> +		cooling-max-state = <3>;
> +		#cooling-cells = <2>;
> +	};
> +
> +	thermal-zones {
> +		cpu {
> +			polling-delay = <0>;
> +			polling-delay-passive = <500>;
> +			status = "okay";
> +
> +			trips {
> +				cpu_trip_critical: critical {
> +					temperature = <96500>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +
> +				cpu_trip_hot: hot {
> +					temperature = <70000>;
> +					hysteresis = <2000>;
> +					type = "hot";
> +				};
> +
> +				cpu_trip_active: active {
> +					temperature = <50000>;
> +					hysteresis = <2000>;
> +					type = "active";
> +				};
> +
> +				cpu_trip_passive: passive {
> +					temperature = <30000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +			};
> +
> +			cooling-maps {
> +				cpu-critical {
> +					cooling-device = <&fan 3 3>;
> +					trip = <&cpu_trip_critical>;
> +				};
> +
> +				cpu-hot {
> +					cooling-device = <&fan 2 2>;
> +					trip = <&cpu_trip_hot>;
> +				};
> +
> +				cpu-active {
> +					cooling-device = <&fan 1 1>;
> +					trip = <&cpu_trip_active>;
> +				};
> +
> +				cpu-passive {
> +					cooling-device = <&fan 0 0>;
> +					trip = <&cpu_trip_passive>;
> +				};
> +			};
> +		};
> +
> +		gpu {
> +			polling-delay = <0>;
> +			polling-delay-passive = <500>;
> +			status = "okay";
> +
> +			trips {
> +				gpu_alert0: critical {
> +					temperature = <99000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		aux {
> +			polling-delay = <0>;
> +			polling-delay-passive = <500>;
> +			status = "okay";
> +
> +			trips {
> +				aux_alert0: critical {
> +					temperature = <90000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
>  	};
>  };
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
index cbae8e8b1281..e29f8f6117c8 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
@@ -43,8 +43,97 @@ 
 		};
 	};
 
-	fan {
+	fan: fan {
 		compatible = "pwm-fan";
 		pwms = <&pwm4 0 45334>;
+
+		cooling-levels = <0 64 128 255>;
+		cooling-min-state = <0>;
+		cooling-max-state = <3>;
+		#cooling-cells = <2>;
+	};
+
+	thermal-zones {
+		cpu {
+			polling-delay = <0>;
+			polling-delay-passive = <500>;
+			status = "okay";
+
+			trips {
+				cpu_trip_critical: critical {
+					temperature = <96500>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+
+				cpu_trip_hot: hot {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+
+				cpu_trip_active: active {
+					temperature = <50000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+
+				cpu_trip_passive: passive {
+					temperature = <30000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+			};
+
+			cooling-maps {
+				cpu-critical {
+					cooling-device = <&fan 3 3>;
+					trip = <&cpu_trip_critical>;
+				};
+
+				cpu-hot {
+					cooling-device = <&fan 2 2>;
+					trip = <&cpu_trip_hot>;
+				};
+
+				cpu-active {
+					cooling-device = <&fan 1 1>;
+					trip = <&cpu_trip_active>;
+				};
+
+				cpu-passive {
+					cooling-device = <&fan 0 0>;
+					trip = <&cpu_trip_passive>;
+				};
+			};
+		};
+
+		gpu {
+			polling-delay = <0>;
+			polling-delay-passive = <500>;
+			status = "okay";
+
+			trips {
+				gpu_alert0: critical {
+					temperature = <99000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+
+		aux {
+			polling-delay = <0>;
+			polling-delay-passive = <500>;
+			status = "okay";
+
+			trips {
+				aux_alert0: critical {
+					temperature = <90000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
 	};
 };