t234: overlay: Enable thermal slowdown features

As slower clock frequency generates less heat, this change enables
thermal slowdown features which throttles CPU clock and GPU clock
when the passive trip points are crossed.

It's worth mentioning that all the CPU cores within the same cluster
are designed to operate at same clock frequency for Tegra234 platforms.
For AGX Orin series and Orin NX 16GB, there are 12 CPU cores which are
split into 3 clusters with 4 cores in each. So only one CPU core per
cluster needs to be registered as a cooling device.

But for Jetson Orin NX 8GB, Jetson Orin Nano 8GB, and Jetson Orin Nano
4GB platforms, there are only 6 CPU cores, 4 of which are in a cluster,
and the remaining 2 are in pairs in another cluster. Since it's
unpredictable at build-time which CPU cores will be disabled for a given
unit, there should be one CPU core registerd as cooling device per CPU
core pair to ensure the all the CPU clocks can be throttled.

So, this change adds tegra234-soc-thermal-slowdown-cluster.dtsi and
tegra234-soc-thermal-slowdown-corepair.dtsi to handle both of the cases.

The passive trip point temperatures are derived from
//hw/ar/doc/t23x/sysarch/power/global_functions/thermal_management/
T234_Thermal_Settings.xlsx#21.

Bug 4035713

Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>
Change-Id: I5e0bea5ce6e2370710c303a057773b3d7352d168
Reviewed-on: https://git-master.nvidia.com/r/c/device/hardware/nvidia/t23x-public-dts/+/2952086
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Yi-Wei Wang
2023-07-08 00:20:42 +08:00
committed by mobile promotions
parent 2f4bb5bc45
commit 74f3a2846e
8 changed files with 527 additions and 1 deletions

View File

@@ -164,6 +164,10 @@
thermal-zones {
cpu-thermal {
trips {
cpu-sw-slowdown {
temperature = <112000>;
};
cpu-sw-shutdown {
temperature = <117500>;
};
@@ -172,6 +176,10 @@
cv0-thermal {
trips {
cv0-sw-slowdown {
temperature = <112000>;
};
cv0-sw-shutdown {
temperature = <117500>;
};
@@ -180,6 +188,10 @@
cv1-thermal {
trips {
cv1-sw-slowdown {
temperature = <112000>;
};
cv1-sw-shutdown {
temperature = <117500>;
};
@@ -188,6 +200,10 @@
cv2-thermal {
trips {
cv2-sw-slowdown {
temperature = <112000>;
};
cv2-sw-shutdown {
temperature = <117500>;
};
@@ -196,6 +212,10 @@
gpu-thermal {
trips {
gpu-sw-slowdown {
temperature = <112000>;
};
gpu-sw-shutdown {
temperature = <117500>;
};
@@ -204,6 +224,10 @@
soc0-thermal {
trips {
soc0-sw-slowdown {
temperature = <112000>;
};
soc0-sw-shutdown {
temperature = <117500>;
};
@@ -212,6 +236,10 @@
soc1-thermal {
trips {
soc1-sw-slowdown {
temperature = <112000>;
};
soc1-sw-shutdown {
temperature = <117500>;
};
@@ -220,6 +248,10 @@
soc2-thermal {
trips {
soc2-sw-slowdown {
temperature = <112000>;
};
soc2-sw-shutdown {
temperature = <117500>;
};

View File

@@ -7,6 +7,7 @@
#include "tegra234-overlay.dtsi"
#include "tegra234-soc-thermal.dtsi"
#include "tegra234-soc-thermal-slowdown-cluster.dtsi"
#include "tegra234-soc-thermal-shutdown.dtsi"
#include "tegra234-soc-audio-dai-links.dtsi"
#include "tegra234-soc-camera.dtsi"

View File

@@ -6,6 +6,7 @@
#include "tegra234-overlay.dtsi"
#include "tegra234-soc-thermal.dtsi"
#include "tegra234-soc-thermal-slowdown-cluster.dtsi"
#include "tegra234-soc-thermal-shutdown.dtsi"
#include "tegra234-soc-camera.dtsi"
#include "tegra234-p3740-0002.dtsi"

View File

@@ -6,6 +6,7 @@
#include "tegra234-overlay.dtsi"
#include "tegra234-soc-thermal.dtsi"
#include "tegra234-soc-thermal-slowdown-cluster.dtsi"
#include "tegra234-soc-thermal-shutdown.dtsi"
#include "tegra234-p3767-0000.dtsi"

View File

@@ -6,6 +6,7 @@
#include "tegra234-overlay.dtsi"
#include "tegra234-soc-thermal.dtsi"
#include "tegra234-soc-thermal-slowdown-corepair.dtsi"
#include "tegra234-soc-thermal-shutdown.dtsi"
#include "tegra234-p3767-0000.dtsi"

View File

@@ -295,7 +295,7 @@
status = "disabled";
};
gpu@17000000 {
ga10b: gpu@17000000 {
compatible = "nvidia,ga10b";
reg = <0x0 0x17000000 0x0 0x01000000>,
<0x0 0x18000000 0x0 0x01000000>,

View File

@@ -0,0 +1,227 @@
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <dt-bindings/thermal/thermal.h>
#define TEGRA234_THERMAL_SLOWDOWN_TEMP 99000
/ {
fragment-t234-thermal-slowdown-cluster@0 {
target-path = "/";
__overlay__ {
bus@0 {
gpu@17000000 {
#cooling-cells = <2>;
};
};
cpus{
cpu@0 {
#cooling-cells = <2>;
};
cpu@10000 {
#cooling-cells = <2>;
};
cpu@20000 {
#cooling-cells = <2>;
};
};
thermal-zones {
cpu-thermal {
trips {
cpu_sw_slowdown: cpu-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cpu_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cpu_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
gpu-thermal {
trips {
gpu_sw_slowdown: gpu-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&gpu_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&gpu_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
cv0-thermal {
trips {
cv0_sw_slowdown: cv0-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cv0_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cv0_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
cv1-thermal {
trips {
cv1_sw_slowdown: cv1-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cv1_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cv1_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
cv2-thermal {
trips {
cv2_sw_slowdown: cv2-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cv2_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cv2_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
soc0-thermal {
trips {
soc0_sw_slowdown: soc0-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&soc0_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&soc0_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
soc1-thermal {
trips {
soc1_sw_slowdown: soc1-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&soc1_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&soc1_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
soc2-thermal {
trips {
soc2_sw_slowdown: soc2-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&soc2_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&soc2_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
};
};
};
};

View File

@@ -0,0 +1,263 @@
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <dt-bindings/thermal/thermal.h>
#define TEGRA234_THERMAL_SLOWDOWN_TEMP 99000
/ {
fragment-t234-thermal-slowdown-corepair@0 {
target-path = "/";
__overlay__ {
bus@0 {
gpu@17000000 {
#cooling-cells = <2>;
};
};
cpus{
cpu@0 {
#cooling-cells = <2>;
};
cpu@200 {
#cooling-cells = <2>;
};
cpu@10000 {
#cooling-cells = <2>;
};
cpu@10200 {
#cooling-cells = <2>;
};
cpu@20000 {
#cooling-cells = <2>;
};
cpu@20200 {
#cooling-cells = <2>;
};
};
thermal-zones {
cpu-thermal {
trips {
cpu_sw_slowdown: cpu-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cpu_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cpu_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
gpu-thermal {
trips {
gpu_sw_slowdown: gpu-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&gpu_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&gpu_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
cv0-thermal {
trips {
cv0_sw_slowdown: cv0-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cv0_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cv0_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
cv1-thermal {
trips {
cv1_sw_slowdown: cv1-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cv1_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cv1_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
cv2-thermal {
trips {
cv2_sw_slowdown: cv2-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&cv2_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&cv2_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
soc0-thermal {
trips {
soc0_sw_slowdown: soc0-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&soc0_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&soc0_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
soc1-thermal {
trips {
soc1_sw_slowdown: soc1-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&soc1_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&soc1_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
soc2-thermal {
trips {
soc2_sw_slowdown: soc2-sw-slowdown {
temperature = <TEGRA234_THERMAL_SLOWDOWN_TEMP>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
map-cpufreq {
trip = <&soc2_sw_slowdown>;
cooling-device = <&cpu0_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu0_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
map-devfreq {
trip = <&soc2_sw_slowdown>;
cooling-device = <&ga10b THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
};
};
};
};