From 80362f18275fdeefa9bbfbbd64f679bcc06056ca Mon Sep 17 00:00:00 2001 From: Yi-Wei Wang Date: Tue, 14 Nov 2023 17:38:43 +0800 Subject: [PATCH] nv-public: add support for thermal trip event This change binds thermal trip event cooling devices to the following events: - sw throttling event - hot surface event When the bound trip point temperature gets crossed, the associated cooling device will become active, and its state can be learnt from the user space to take the action accordingly. The thermal trip event cooling device is not needed for safety IGX so disable it. Bug 4261645 Bug 1688327 Signed-off-by: Yi-Wei Wang Change-Id: Ifa7f2dfb5c95113e9902e3ea4dfc03197065c5e5 Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/3015753 (cherry picked from commit 9279090408369c891988a2bcaa7b67b9414d3d24) Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/3019214 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- ...ra234-p3737-0000+p3701-xxxx-nv-common.dtsi | 1 + ...ra234-p3740-0002+p3701-0008-nv-common.dtsi | 1 + ...tegra234-p3740-0002+p3701-0008-safety.dtsi | 64 +++++ ...ra234-p3768-0000+p3767-xxxx-nv-common.dtsi | 1 + nv-soc/tegra234-soc-thermal-trip-event.dtsi | 239 ++++++++++++++++++ 5 files changed, 306 insertions(+) create mode 100644 nv-soc/tegra234-soc-thermal-trip-event.dtsi diff --git a/nv-platform/tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi b/nv-platform/tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi index 9edcfe4..3ef29ee 100644 --- a/nv-platform/tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi +++ b/nv-platform/tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi @@ -5,6 +5,7 @@ #include "nv-soc/tegra234-soc-thermal.dtsi" #include "nv-soc/tegra234-soc-thermal-slowdown-cluster.dtsi" #include "nv-soc/tegra234-soc-thermal-shutdown.dtsi" +#include "nv-soc/tegra234-soc-thermal-trip-event.dtsi" #include "nv-soc/tegra234-soc-audio-dai-links.dtsi" #include "nv-soc/tegra234-soc-camera.dtsi" #include "tegra234-p3737-0000.dtsi" diff --git a/nv-platform/tegra234-p3740-0002+p3701-0008-nv-common.dtsi b/nv-platform/tegra234-p3740-0002+p3701-0008-nv-common.dtsi index 4aa4ca9..325ff58 100644 --- a/nv-platform/tegra234-p3740-0002+p3701-0008-nv-common.dtsi +++ b/nv-platform/tegra234-p3740-0002+p3701-0008-nv-common.dtsi @@ -5,6 +5,7 @@ #include "nv-soc/tegra234-soc-thermal.dtsi" #include "nv-soc/tegra234-soc-thermal-slowdown-cluster.dtsi" #include "nv-soc/tegra234-soc-thermal-shutdown.dtsi" +#include "nv-soc/tegra234-soc-thermal-trip-event.dtsi" #include "nv-soc/tegra234-soc-camera.dtsi" #include "tegra234-camera-p3785.dtsi" #include "tegra234-p3740-0002.dtsi" diff --git a/nv-platform/tegra234-p3740-0002+p3701-0008-safety.dtsi b/nv-platform/tegra234-p3740-0002+p3701-0008-safety.dtsi index aae95e4..4fa244b 100644 --- a/nv-platform/tegra234-p3740-0002+p3701-0008-safety.dtsi +++ b/nv-platform/tegra234-p3740-0002+p3701-0008-safety.dtsi @@ -116,6 +116,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&cpu_throttle_alert 0 0>; + }; }; }; @@ -130,6 +138,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&gpu_throttle_alert 0 0>; + }; }; }; @@ -144,6 +160,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&cv0_throttle_alert 0 0>; + }; }; }; @@ -158,6 +182,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&cv1_throttle_alert 0 0>; + }; }; }; @@ -172,6 +204,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&cv2_throttle_alert 0 0>; + }; }; }; @@ -186,6 +226,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&soc0_throttle_alert 0 0>; + }; }; }; @@ -200,6 +248,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&soc1_throttle_alert 0 0>; + }; }; }; @@ -214,6 +270,14 @@ map-devfreq { cooling-device = <&ga10b 0 0>; }; + + map-hot-surface-alert { + cooling-device = <&hot_surface_alert 0 0>; + }; + + map-throttle-alert { + cooling-device = <&soc2_throttle_alert 0 0>; + }; }; }; }; diff --git a/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi b/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi index 97b167f..5a80a06 100644 --- a/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi +++ b/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi @@ -5,6 +5,7 @@ #include "nv-soc/tegra234-soc-thermal.dtsi" #include "nv-soc/tegra234-soc-thermal-slowdown-corepair.dtsi" #include "nv-soc/tegra234-soc-thermal-shutdown.dtsi" +#include "nv-soc/tegra234-soc-thermal-trip-event.dtsi" #include "nv-soc/tegra234-soc-audio-dai-links.dtsi" #include "tegra234-p3768-0000.dtsi" #include "tegra234-p3767-0000.dtsi" diff --git a/nv-soc/tegra234-soc-thermal-trip-event.dtsi b/nv-soc/tegra234-soc-thermal-trip-event.dtsi new file mode 100644 index 0000000..e20f099 --- /dev/null +++ b/nv-soc/tegra234-soc-thermal-trip-event.dtsi @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#define TEGRA234_THERMAL_HOT_SURFACE_TEMP 70000 +#define TEGRA234_THERMAL_HOT_SURFACE_HYST 8000 + +/ { + cpu_throttle_alert: cpu-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "cpu-throttle-alert"; + #cooling-cells = <2>; + }; + + gpu_throttle_alert: gpu-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "gpu-throttle-alert"; + #cooling-cells = <2>; + }; + + cv0_throttle_alert: cv0-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "cv0-throttle-alert"; + #cooling-cells = <2>; + }; + + cv1_throttle_alert: cv1-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "cv1-throttle-alert"; + #cooling-cells = <2>; + }; + + cv2_throttle_alert: cv2-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "cv2-throttle-alert"; + #cooling-cells = <2>; + }; + + soc0_throttle_alert: soc0-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "soc0-throttle-alert"; + #cooling-cells = <2>; + }; + + soc1_throttle_alert: soc1-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "soc1-throttle-alert"; + #cooling-cells = <2>; + }; + + soc2_throttle_alert: soc2-throttle-alert { + compatible = "thermal-trip-event"; + cdev-type = "soc2-throttle-alert"; + #cooling-cells = <2>; + }; + + hot_surface_alert: hot-surface-alert { + compatible = "thermal-trip-event"; + cdev-type = "hot-surface-alert"; + #cooling-cells = <2>; + }; + + thermal-zones { + cpu-thermal { + trips { + cpu_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&cpu_sw_slowdown>; + cooling-device = <&cpu_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&cpu_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + gpu-thermal { + trips { + gpu_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&gpu_sw_slowdown>; + cooling-device = <&gpu_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&gpu_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + cv0-thermal { + trips { + cv0_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&cv0_sw_slowdown>; + cooling-device = <&cv0_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&cv0_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + cv1-thermal { + trips { + cv1_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&cv1_sw_slowdown>; + cooling-device = <&cv1_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&cv1_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + cv2-thermal { + trips { + cv2_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&cv2_sw_slowdown>; + cooling-device = <&cv2_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&cv2_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + soc0-thermal { + trips { + soc0_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&soc0_sw_slowdown>; + cooling-device = <&soc0_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&soc0_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + soc1-thermal { + trips { + soc1_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&soc1_sw_slowdown>; + cooling-device = <&soc1_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&soc1_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + + soc2-thermal { + trips { + soc2_trip_hot_surface: hot-surface { + temperature = ; + hysteresis = ; + type = "passive"; + }; + }; + + cooling-maps { + map-throttle-alert { + trip = <&soc2_sw_slowdown>; + cooling-device = <&soc2_throttle_alert 1 1>; + }; + + map-hot-surface-alert { + trip = <&soc2_trip_hot_surface>; + cooling-device = <&hot_surface_alert 1 1>; + }; + }; + }; + }; +};