* [PATCH 1/3] dt-bindings: thermal: tegra-bpmp: Add Tegra194 support
@ 2018-11-23 12:18 Thierry Reding
2018-11-23 12:18 ` [PATCH 2/3] arm64: tegra: Add thermal zones on Tegra194 Thierry Reding
2018-11-23 12:18 ` [PATCH 3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones Thierry Reding
0 siblings, 2 replies; 5+ messages in thread
From: Thierry Reding @ 2018-11-23 12:18 UTC (permalink / raw)
To: Thierry Reding
Cc: Jon Hunter, Mikko Perttunen, Rob Herring, linux-tegra,
devicetree, linux-pm, linux-kernel
From: Thierry Reding <treding@nvidia.com>
The thermal controller implementation on Tegra194 is very similar to the
implementation on Tegra186. Add a compatible string for the new
generation.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
.../thermal/nvidia,tegra186-bpmp-thermal.txt | 3 ++-
.../dt-bindings/thermal/tegra194-bpmp-thermal.h | 15 +++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 include/dt-bindings/thermal/tegra194-bpmp-thermal.h
diff --git a/Documentation/devicetree/bindings/thermal/nvidia,tegra186-bpmp-thermal.txt b/Documentation/devicetree/bindings/thermal/nvidia,tegra186-bpmp-thermal.txt
index 276387dd6815..e17c07be270b 100644
--- a/Documentation/devicetree/bindings/thermal/nvidia,tegra186-bpmp-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/nvidia,tegra186-bpmp-thermal.txt
@@ -15,7 +15,8 @@ Required properties:
- compatible:
Array of strings.
One of:
- - "nvidia,tegra186-bpmp-thermal".
+ - "nvidia,tegra186-bpmp-thermal"
+ - "nvidia,tegra194-bpmp-thermal"
- #thermal-sensor-cells: Cell for sensor index.
Single-cell integer.
Must be <1>.
diff --git a/include/dt-bindings/thermal/tegra194-bpmp-thermal.h b/include/dt-bindings/thermal/tegra194-bpmp-thermal.h
new file mode 100644
index 000000000000..aa7fb08135ca
--- /dev/null
+++ b/include/dt-bindings/thermal/tegra194-bpmp-thermal.h
@@ -0,0 +1,15 @@
+/*
+ * This header provides constants for binding nvidia,tegra194-bpmp-thermal.
+ */
+
+#ifndef _DT_BINDINGS_THERMAL_TEGRA194_BPMP_THERMAL_H
+#define _DT_BINDINGS_THERMAL_TEGRA194_BPMP_THERMAL_H
+
+#define TEGRA194_BPMP_THERMAL_ZONE_CPU 2
+#define TEGRA194_BPMP_THERMAL_ZONE_GPU 3
+#define TEGRA194_BPMP_THERMAL_ZONE_AUX 4
+#define TEGRA194_BPMP_THERMAL_ZONE_PLLX 5
+#define TEGRA194_BPMP_THERMAL_ZONE_AO 6
+#define TEGRA194_BPMP_THERMAL_ZONE_TJ_MAX 7
+
+#endif
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] arm64: tegra: Add thermal zones on Tegra194
2018-11-23 12:18 [PATCH 1/3] dt-bindings: thermal: tegra-bpmp: Add Tegra194 support Thierry Reding
@ 2018-11-23 12:18 ` Thierry Reding
2018-12-15 17:28 ` Eduardo Valentin
2018-11-23 12:18 ` [PATCH 3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones Thierry Reding
1 sibling, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2018-11-23 12:18 UTC (permalink / raw)
To: Thierry Reding
Cc: Jon Hunter, Mikko Perttunen, Rob Herring, linux-tegra,
devicetree, linux-pm, linux-kernel
From: Thierry Reding <treding@nvidia.com>
The NVIDIA Tegra194 SoC defines six thermal zones. Define all of them in
device tree.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm64/boot/dts/nvidia/tegra194.dtsi | 39 ++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
index cbba7395a286..39169f6b6166 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
@@ -5,6 +5,7 @@
#include <dt-bindings/mailbox/tegra186-hsp.h>
#include <dt-bindings/reset/tegra194-reset.h>
#include <dt-bindings/power/tegra194-powergate.h>
+#include <dt-bindings/thermal/tegra194-bpmp-thermal.h>
/ {
compatible = "nvidia,tegra194";
@@ -938,6 +939,44 @@
mbox-names = "rx", "tx";
};
+ thermal-zones {
+ cpu {
+ thermal-sensors = <&{/bpmp/thermal}
+ TEGRA194_BPMP_THERMAL_ZONE_CPU>;
+ status = "disabled";
+ };
+
+ gpu {
+ thermal-sensors = <&{/bpmp/thermal}
+ TEGRA194_BPMP_THERMAL_ZONE_GPU>;
+ status = "disabled";
+ };
+
+ aux {
+ thermal-sensors = <&{/bpmp/thermal}
+ TEGRA194_BPMP_THERMAL_ZONE_AUX>;
+ status = "disabled";
+ };
+
+ pllx {
+ thermal-sensors = <&{/bpmp/thermal}
+ TEGRA194_BPMP_THERMAL_ZONE_PLLX>;
+ status = "disabled";
+ };
+
+ ao {
+ thermal-sensors = <&{/bpmp/thermal}
+ TEGRA194_BPMP_THERMAL_ZONE_AO>;
+ status = "disabled";
+ };
+
+ tj {
+ thermal-sensors = <&{/bpmp/thermal}
+ TEGRA194_BPMP_THERMAL_ZONE_TJ_MAX>;
+ status = "disabled";
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 13
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones
2018-11-23 12:18 [PATCH 1/3] dt-bindings: thermal: tegra-bpmp: Add Tegra194 support Thierry Reding
2018-11-23 12:18 ` [PATCH 2/3] arm64: tegra: Add thermal zones on Tegra194 Thierry Reding
@ 2018-11-23 12:18 ` Thierry Reding
2018-12-15 17:28 ` Eduardo Valentin
1 sibling, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2018-11-23 12:18 UTC (permalink / raw)
To: Thierry Reding
Cc: Jon Hunter, Mikko Perttunen, Rob Herring, linux-tegra,
devicetree, linux-pm, linux-kernel
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(-)
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";
+ };
+ };
+ };
};
};
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] arm64: tegra: Add thermal zones on Tegra194
2018-11-23 12:18 ` [PATCH 2/3] arm64: tegra: Add thermal zones on Tegra194 Thierry Reding
@ 2018-12-15 17:28 ` Eduardo Valentin
0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Valentin @ 2018-12-15 17:28 UTC (permalink / raw)
To: Thierry Reding
Cc: Jon Hunter, Mikko Perttunen, Rob Herring, linux-tegra,
devicetree, linux-pm, linux-kernel
On Fri, Nov 23, 2018 at 01:18:38PM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The NVIDIA Tegra194 SoC defines six thermal zones. Define all of them in
> device tree.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
The patch 1 I added in my -linus branch.
> ---
> arch/arm64/boot/dts/nvidia/tegra194.dtsi | 39 ++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
> index cbba7395a286..39169f6b6166 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
> @@ -5,6 +5,7 @@
> #include <dt-bindings/mailbox/tegra186-hsp.h>
> #include <dt-bindings/reset/tegra194-reset.h>
> #include <dt-bindings/power/tegra194-powergate.h>
> +#include <dt-bindings/thermal/tegra194-bpmp-thermal.h>
>
> / {
> compatible = "nvidia,tegra194";
> @@ -938,6 +939,44 @@
> mbox-names = "rx", "tx";
> };
>
> + thermal-zones {
> + cpu {
> + thermal-sensors = <&{/bpmp/thermal}
> + TEGRA194_BPMP_THERMAL_ZONE_CPU>;
> + status = "disabled";
> + };
> +
> + gpu {
> + thermal-sensors = <&{/bpmp/thermal}
> + TEGRA194_BPMP_THERMAL_ZONE_GPU>;
> + status = "disabled";
> + };
> +
> + aux {
> + thermal-sensors = <&{/bpmp/thermal}
> + TEGRA194_BPMP_THERMAL_ZONE_AUX>;
> + status = "disabled";
> + };
> +
> + pllx {
> + thermal-sensors = <&{/bpmp/thermal}
> + TEGRA194_BPMP_THERMAL_ZONE_PLLX>;
> + status = "disabled";
> + };
> +
> + ao {
> + thermal-sensors = <&{/bpmp/thermal}
> + TEGRA194_BPMP_THERMAL_ZONE_AO>;
> + status = "disabled";
> + };
> +
> + tj {
> + thermal-sensors = <&{/bpmp/thermal}
> + TEGRA194_BPMP_THERMAL_ZONE_TJ_MAX>;
> + status = "disabled";
> + };
> + };
> +
> timer {
> compatible = "arm,armv8-timer";
> interrupts = <GIC_PPI 13
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones
2018-11-23 12:18 ` [PATCH 3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones Thierry Reding
@ 2018-12-15 17:28 ` Eduardo Valentin
0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Valentin @ 2018-12-15 17:28 UTC (permalink / raw)
To: Thierry Reding
Cc: Jon Hunter, Mikko Perttunen, Rob Herring, linux-tegra,
devicetree, linux-pm, linux-kernel
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";
> + };
> + };
> + };
> };
> };
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-12-15 17:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-23 12:18 [PATCH 1/3] dt-bindings: thermal: tegra-bpmp: Add Tegra194 support Thierry Reding
2018-11-23 12:18 ` [PATCH 2/3] arm64: tegra: Add thermal zones on Tegra194 Thierry Reding
2018-12-15 17:28 ` Eduardo Valentin
2018-11-23 12:18 ` [PATCH 3/3] arm64: tegra: p2972: Enable the CPU, GPU and AUX thermal zones Thierry Reding
2018-12-15 17:28 ` Eduardo Valentin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).