NVIDIA Tegra
DRIVE 5.0 Linux Open Source Software

Development Guide
5.0.10.3 Release


 
External Thermal Sensor
 
Remote Temperature Offset
Shutdown Limits
NVIDIA DRIVE™ includes support for an external thermal sensor device that measures the Tegra and ambient temperatures. This sensor is outside the NVIDIA® Tegra® chip, connected over an I2C bus.
The Tegra processor core and ambient temperatures are measured as follows:
Remote temperature is the temperature on the hotspot of Tegra chip.
Local temperature is the temperature on the external tmon.
This sensor provides the following modes of operation:
Normal mode: Values or limits written to/read from the temperature registers or temperature limit registers are encoded/decoded as is. The temperature range in which the sensor works in Normal mode is 0 degrees Celsius to 127 degrees Celsius.
Extended mode: Values are encoded/decoded with an offset of 64 degrees Celsius. The temperature range in which the sensor works in Extended mode is -64 degrees Celsius to 191 degrees Celsius.
The temperature and limit registers are 8-bits wide, which normally covers the values from 0 to 255. However, using an offset of 64 enables them to cover the values from -64 to 191, which is the temperature range for Extended mode. Therefore, NVIDIA DRIVE™ software adds an offset of 64 to the values to be written when writing limits in extended mode. Similarly, an offset of 64 is subtracted from the values read, when reading temperatures or limits in extended mode by NVIDIA DRIVE™ software.
The operation mode of the sensor in NVIDIA DRIVE™ software is set to Extended.
Remote Temperature Offset
The remote temperature offset is the offset value applied as a correction to the remote temperature reading from the sensor, to get the real temperature value of Tegra hotspot. This value is obtained after appropriate qualification of the hardware platform.
This offset is set to -11 degrees Celsius for Drive CX2 platform and -3degC for Drive PX2 platform.
This offset is configured in both the bootloader (MB1 stage) and kernel. For MB1, offset is provided via the following MB1 BCT configuration file:
<TOP>/drive-t186ref-foundation/platform-config/bct/t186/pmic/tegra186-mb1-bct-pmic-*.cfg
 
Search for “THERMAL” in above file to find “external thermal sensor configuration settings”.
For kernel, offset setting is provided via kernel DTS file. Kernel DTS files can be found in:
hardware/nvidia/platform/t18x/vcm/kernel-dts/
 
or
arch/arm64/boot/dts/
 
For example, the following DT node and property are used to configure the offset:
 
onsemi,nct72@4c {
compatible = "onsemi,nct72";
offset = <(-44)>; /* Actual offset will be this value/4 */
};
 
Here offset is provided at 0.25 degC resolution.
Actual offset value used by the kernel driver shall be “DT provided value/4”. For example:
If need to set offset value -11 degC, then need to provide offset = <(-44)>
If need to set offset value -11.5 degC, then need provide offset = <(-46)>
Shutdown Limits
The external thermal sensor is wired to shutdown the target after reaching a particular remote temperature limit. This thermal sensor is armed with a shutdown limit.
When the Tegra die temperature reaches or exceeds the thermal shutdown limit, the sensor triggers an immediate shutdown, by asserting it’s own THERM_SHUTDOWN signal. THERM_SHUTDOWN signal is an active low signal, which is connected to the PMIC chip EN0 signal.
External Thermal Sensor shutdown is pre-enabled on power on reset. But in Bootloader(MB1 stage) and in kernel, shutdown limit is updated as per the qualified values.
For MB1, shutdown setting is provided via the following MB1 BCT configuration file:
<TOP>/drive-t186ref-foundation/platform-config/bct/t186/pmic/tegra186-mb1-bct-pmic-*.cfg
 
Search for “THERMAL” in above file to find “external thermal sensor shutdown configuration.
To find the shutdown limit value configured for your platform, refer to the command below in MB1 BCT configuration file of your platform.
#Program the remote shutdown limit
pmic.thermal.7.block[0].commands[1].0x19.0xFF = 0xB1; # 113 + 64
As the thermal sensor is configured in extended mode, the value programmed is the shutdown limit (in milli degC) + 64.
For kernel, shutdown setting is provided via kernel dtsi file. For Kernel, DTS files can be found in the following location:
hardware/nvidia/platform/t18x/vcm/kernel-dts/
 
or
arch/arm64/boot/dts/
 
For example, the following DT nodes and property are used to configure the shutdown values.
 
onsemi,nct72@4c {
compatible = "onsemi,nct72";
ext {
shutdown-limit = <109>; /* in DegC */
};
};
 
Refer the DT node above in your platform of kernel DT to find the shutdown limit value configured.
sysfs interfaces to read temperature
Execute the following commands.
root@nvidia:~# cat /sys/bus/i2c/devices/<device>/temperature
34 50.75
The output displays two temperatures (in DegC), the first one is the local temperature and second one is the remote temperature in degrees Celsius.
Execute the following commands to read remote temperature (in DegC):
 
root@nvidia:~# cat /sys/bus/i2c/devices/<device>/ext_temperature
51.0
 
The output displays remote temperature in DegC.
The output displays remote temperature (in DegC)
In the above commands, for DrivePX2 Autocruise platform, the <device> need to be substituted with “1-004c” and for others the <device> to be substituted with “0-004c”
Alternative sysfs for reading remote temperature
 
root@nvidia:~# cat /sys/class/thermal/thermal_zone*/type
 
In above command output, pick the zone, which has “Tdiode_tegra“ as type. In other words, find the zone number to the matching type “Tdiode_tegra”.
If that zone is 1, then executing following command will display remote temperature in milliDegC:
root@nvidia:~# cat /sys/class/thermal/thermal_zone1/temp
45000
 
 
Note:
The remote temperature reading is after applying the remote offset value correction.