Intel Dynamic Platform and Thermal Framework is a framework that can be used to help regulate the thermal properties (i.e., temperature) of an Intel-based computer. It does this by allowing the system designer to specify the different components that can generate heat, and/or dissipate heat. Under DPTF, the different components are referred to as participants
. The different types of functionality available in DPTF are specified in terms of different policies
.
The participants that can be involved in the current implementation are:
In the current implementation, there are 3 different policies available:
The purpose of this policy is to monitor participant temperatures and is capable of controlling performance and throttling available on platform devices in order to regulate the temperatures of each participant. The temperature threshold points are defined by a _PSV
ACPI object within each participant.
The Critical Policy is used for gracefully suspending or powering off the system when the temperature of participants exceeds critical threshold temperatures. Suspend is effected by specifying temperatures in a _CRT
object for a participant, and poweroff is effected by specifying a temperature threshold in a _HOT
ACPI object.
This policy monitors the temperature of participants and controls fans to spin at varying speeds. These speeds are defined by the platform, and will be enabled depending on the various temperatures reported by participants.
ACPI uses unusual units for specifying various physical measurements. For example, temperatures are specified in 10ths of a degree K, and time is measured in tenths of a second. Those oddities are abstracted away in the DPTF library, by using degrees C for temperature, milliseconds for time, mW for power, and mA for current.
DPTF relies on an assortment of ACPI tables to provide parameters to the DPTF application. We will discuss the more important ones here.
This table is used when the Passive Policy is enabled, and is used to represent the thermal relationships in the system that can be controlled passively (i.e., by throttling participants). A passive policy is defined by a Source (which generates heat), a Target (typically a temperature sensor), a Sampling Period (how often to check the temperature), an activation temperature threshold (for when to begin throttling), and a relative priority.
This table is used when the Active Policy is enabled, and is used to represent active cooling relationships (i.e., which TSRs the fan can cool). An active policy contains a Target (the device the fan can cool), a Weight to control which participant needs more attention than others, and a list of temperature / fan percentage pairs. The list of pairs defines the fan control percentage that should be applied when the TSR reaches each successive threshold (_AC0 is the highest threshold, and represents the highest fan control percentage).
This table is used to describe parameters for controlling the SoC's Running Average Power Limits (RAPL, see below).
This table describes the various fan speeds available for DPTF to use, along with various informational properties.
This table describes performance states supported by a participant (typically the battery charger).
The Active and Passive policies also provide for short Methods to define different kinds of temperature thresholds.
These Methods can provide up to 10 temperature thresholds. What these do is set temperatures which act as the thresholds to active rows (fan speeds) in the ART. _AC0 is intended to be the highest temperature thresholds, and the lowest one can be any of them; leave the rest defined as 0 and they will be omitted from the output.
These are optional and are enabled by selecting the Active Policy.
_PSV is a temperature threshold that is used to indicate to DPTF that it should begin taking passive measures (i.e., throttling of the Source) in order to reduce the temperature of the Target in question. It will check on the temperature according to the given sampling period.
This is optional and is enabled by selecting the Passive Policy.
When the temperature of the Source reaches the threshold specified in _CRT, then the system is supposed to execute a "graceful suspend". Similarly, when the Source reaches the temperature specified in _HOT, then the system is supposed to execute a "graceful shutdown".
These are optional, and are enabled by selecting the Critical Policy.
The drivers/intel/dptf
chip driver is organized into several sections:
The Policies section (policies.active
, policies.passive
, and policies.critical
) is where the components of each policy are defined.
Each Active Policy is defined in terms of 4 parts:
An example definition in the devicetree:
register "policies.active[0]" = "{ .target=DPTF_CPU, .weight=100, .thresholds={TEMP_PCT(85, 90), TEMP_PCT(80, 69), TEMP_PCT(75, 56), TEMP_PCT(70, 46), TEMP_PCT(65, 36),}}"
This example sets up a policy wherein the CPU temperature sensor can be cooled by the fan. The 'weight' of this policy is 100% (this policy contributes 100% of the CPU's active cooling capability). When the CPU temperature first crosses 65C, the fan is defined to spin at 36% of its duty cycle, and so forth up the rest of the table (note that it must be defined from highest temperature/ percentage on down to the lowest).
Each Passive Policy is defined in terms of 5 parts:
An example definition in the devicetree:
register "policies.passive[0]" = "DPTF_PASSIVE(CHARGER, TEMP_SENSOR_1, 65, 60000)"
This example sets up a policy to begin throttling the charger performance when temperature sensor 1 reaches 65C. The sampling period here is 60000 ms (60 s). The Priority is defaulted to 100 in this case.
Each Critical Policy is defined in terms of 3 parts:
An example definition in the devicetree:
register "policies.critical[1]" = "DPTF_CRITICAL(CPU, 75, SHUTDOWN)"
This example sets up a policy wherein ACPI will cause the system to shutdown (in a "graceful" manner) when the CPU temperature reaches 75C.
Control over the SoC's Running Average Power Limits (RAPL) is one of the tools that DPTF uses to enact Passive policies. DPTF can control both PL1 and PL2, if the PPCC table is provided for the TCPU object. Each power limit is given the following options:
An example:
register "controls.power_limits.pl1" = "{ .min_power = 3000, .max_power = 15000, .time_window_min = 28 * MSECS_PER_SEC, .time_window_max = 32 * MSECS_PER_SEC, .granularity = 200,}"
This example allow DPTF to control the SoC's PL1 level to between 3W and 15W, over a time interval ranging from 28 to 32 seconds, and it can move PL1 in increments of 200 mW.
The battery charger can be a large contributor of unwanted heat in a system that has one. Controlling the rate of charging is another tool that DPTF uses to enact Passive Policies. Each entry in the PPSS table consists of:
TCHG.SPPC
(Set Participant Performance Capability) if applicable, and will pass this opaque control value as its argument.Example:
register "controls.charger_perf[0]" = "{ 255, 1700 }" register "controls.charger_perf[1]" = "{ 24, 1500 }" register "controls.charger_perf[2]" = "{ 16, 1000 }" register "controls.charger_perf[3]" = "{ 8, 500 }"
In this example, when DPTF decides to throttle the charger, it has four different performance states to choose from.
When using DPTF, the system fan (TFN1
) is the device responsible for actively cooling the other temperature sensors on the mainboard. A fan speed table can be provided to DPTF to assist with fan control. Each entry holds the following:
Example:
register "controls.fan_perf[0]" = "{ 90, 6700, 220, 2200, }" register "controls.fan_perf[1]" = "{ 80, 5800, 180, 1800, }" register "controls.fan_perf[2]" = "{ 70, 5000, 145, 1450, }" register "controls.fan_perf[3]" = "{ 60, 4900, 115, 1150, }" register "controls.fan_perf[4]" = "{ 50, 3838, 90, 900, }" register "controls.fan_perf[5]" = "{ 40, 2904, 55, 550, }" register "controls.fan_perf[6]" = "{ 30, 2337, 30, 300, }" register "controls.fan_perf[7]" = "{ 20, 1608, 15, 150, }" register "controls.fan_perf[8]" = "{ 10, 800, 10, 100, }" register "controls.fan_perf[9]" = "{ 0, 0, 0, 50, }"
In this example, the fan has 10 different performance states, each in an even increment of 10 percentage points. This is common when specifying fine-grained control of the fan, wherein DPTF will interpolate between the percentages in the table for a given temperature threshold.
Notify (0x80)
to the fan device if a low fan speed is detected.