Skip to content

Commit df2fbf5

Browse files
committed
Merge tag 'thermal-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal updates from Daniel Lezcano: - Add the hwmon support on the i.MX SC (Anson Huang) - Thermal framework cleanups (self-encapsulation, pointless stubs, private structures) (Daniel Lezcano) - Use the PM QoS frequency changes for the devfreq cooling device (Matthias Kaehlcke) - Remove duplicate error messages from platform_get_irq() error handling (Markus Elfring) - Add support for the bandgap sensors (Keerthy) - Statically initialize .get_mode/.set_mode ops (Andrzej Pietrasiewicz) - Add Renesas R-Car maintainer entry (Niklas Söderlund) - Fix error checking after calling ti_bandgap_get_sensor_data() for the TI SoC thermal (Sudip Mukherjee) - Add latency constraint for the idle injection, the DT binding and the change the registering function (Daniel Lezcano) - Convert the thermal framework binding to the Yaml schema (Amit Kucheria) - Replace zero-length array with flexible-array on i.MX 8MM (Gustavo A. R. Silva) - Thermal framework cleanups (alphabetic order for heads, replace module.h by export.h, make file naming consistent) (Amit Kucheria) - Merge tsens-common into the tsens driver (Amit Kucheria) - Fix platform dependency for the Qoriq driver (Geert Uytterhoeven) - Clean up the rcar_thermal_update_temp() function in the rcar thermal driver (Niklas Söderlund) - Fix the TMSAR register for the TMUv2 on the Qoriq platform (Yuantian Tang) - Export GDDV, OEM vendor variables, and don't require IDSP for the int340x thermal driver - trivial conflicts fixed (Matthew Garrett) * tag 'thermal-v5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (48 commits) thermal/int340x_thermal: Don't require IDSP to exist thermal/int340x_thermal: Export OEM vendor variables thermal/int340x_thermal: Export GDDV thermal: qoriq: Update the settings for TMUv2 thermal: rcar_thermal: Clean up rcar_thermal_update_temp() thermal: qoriq: Add platform dependencies drivers: thermal: tsens: Merge tsens-common.c into tsens.c thermal/of: Rename of-thermal.c thermal/governors: Prefix all source files with gov_ thermal/drivers/user_space: Sort headers alphabetically thermal/drivers/of-thermal: Sort headers alphabetically thermal/drivers/cpufreq_cooling: Replace module.h with export.h thermal/drivers/cpufreq_cooling: Sort headers alphabetically thermal/drivers/clock_cooling: Include export.h thermal/drivers/clock_cooling: Sort headers alphabetically thermal/drivers/thermal_hwmon: Include export.h thermal/drivers/thermal_hwmon: Sort headers alphabetically thermal/drivers/thermal_helpers: Include export.h thermal/drivers/thermal_helpers: Sort headers alphabetically thermal/core: Replace module.h with export.h ...
2 parents 44ebe01 + 8d485da commit df2fbf5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2303
-1068
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# SPDX-License-Identifier: (GPL-2.0)
2+
# Copyright 2020 Linaro Ltd.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/thermal/thermal-cooling-devices.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Thermal cooling device binding
9+
10+
maintainers:
11+
- Amit Kucheria <[email protected]>
12+
13+
description: |
14+
Thermal management is achieved in devicetree by describing the sensor hardware
15+
and the software abstraction of cooling devices and thermal zones required to
16+
take appropriate action to mitigate thermal overload.
17+
18+
The following node types are used to completely describe a thermal management
19+
system in devicetree:
20+
- thermal-sensor: device that measures temperature, has SoC-specific bindings
21+
- cooling-device: device used to dissipate heat either passively or actively
22+
- thermal-zones: a container of the following node types used to describe all
23+
thermal data for the platform
24+
25+
This binding describes the cooling devices.
26+
27+
There are essentially two ways to provide control on power dissipation:
28+
- Passive cooling: by means of regulating device performance. A typical
29+
passive cooling mechanism is a CPU that has dynamic voltage and frequency
30+
scaling (DVFS), and uses lower frequencies as cooling states.
31+
- Active cooling: by means of activating devices in order to remove the
32+
dissipated heat, e.g. regulating fan speeds.
33+
34+
Any cooling device has a range of cooling states (i.e. different levels of
35+
heat dissipation). They also have a way to determine the state of cooling in
36+
which the device is. For example, a fan's cooling states correspond to the
37+
different fan speeds possible. Cooling states are referred to by single
38+
unsigned integers, where larger numbers mean greater heat dissipation. The
39+
precise set of cooling states associated with a device should be defined in
40+
a particular device's binding.
41+
42+
select: true
43+
44+
properties:
45+
"#cooling-cells":
46+
description:
47+
Must be 2, in order to specify minimum and maximum cooling state used in
48+
the cooling-maps reference. The first cell is the minimum cooling state
49+
and the second cell is the maximum cooling state requested.
50+
const: 2
51+
52+
examples:
53+
- |
54+
#include <dt-bindings/interrupt-controller/arm-gic.h>
55+
#include <dt-bindings/thermal/thermal.h>
56+
57+
// Example 1: Cpufreq cooling device on CPU0
58+
cpus {
59+
#address-cells = <2>;
60+
#size-cells = <0>;
61+
62+
CPU0: cpu@0 {
63+
device_type = "cpu";
64+
compatible = "qcom,kryo385";
65+
reg = <0x0 0x0>;
66+
enable-method = "psci";
67+
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
68+
&LITTLE_CPU_SLEEP_1
69+
&CLUSTER_SLEEP_0>;
70+
capacity-dmips-mhz = <607>;
71+
dynamic-power-coefficient = <100>;
72+
qcom,freq-domain = <&cpufreq_hw 0>;
73+
#cooling-cells = <2>;
74+
next-level-cache = <&L2_0>;
75+
L2_0: l2-cache {
76+
compatible = "cache";
77+
next-level-cache = <&L3_0>;
78+
L3_0: l3-cache {
79+
compatible = "cache";
80+
};
81+
};
82+
};
83+
84+
/* ... */
85+
86+
};
87+
88+
/* ... */
89+
90+
thermal-zones {
91+
cpu0-thermal {
92+
polling-delay-passive = <250>;
93+
polling-delay = <1000>;
94+
95+
thermal-sensors = <&tsens0 1>;
96+
97+
trips {
98+
cpu0_alert0: trip-point0 {
99+
temperature = <90000>;
100+
hysteresis = <2000>;
101+
type = "passive";
102+
};
103+
};
104+
105+
cooling-maps {
106+
map0 {
107+
trip = <&cpu0_alert0>;
108+
/* Corresponds to 1000MHz in OPP table */
109+
cooling-device = <&CPU0 5 5>;
110+
};
111+
};
112+
};
113+
114+
/* ... */
115+
};
116+
...
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright 2020 Linaro Ltd.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/thermal/thermal-idle.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Thermal idle cooling device binding
9+
10+
maintainers:
11+
- Daniel Lezcano <[email protected]>
12+
13+
description: |
14+
The thermal idle cooling device allows the system to passively
15+
mitigate the temperature on the device by injecting idle cycles,
16+
forcing it to cool down.
17+
18+
This binding describes the thermal idle node.
19+
20+
properties:
21+
$nodename:
22+
const: thermal-idle
23+
description: |
24+
A thermal-idle node describes the idle cooling device properties to
25+
cool down efficiently the attached thermal zone.
26+
27+
'#cooling-cells':
28+
const: 2
29+
description: |
30+
Must be 2, in order to specify minimum and maximum cooling state used in
31+
the cooling-maps reference. The first cell is the minimum cooling state
32+
and the second cell is the maximum cooling state requested.
33+
34+
duration-us:
35+
description: |
36+
The idle duration in microsecond the device should cool down.
37+
38+
exit-latency-us:
39+
description: |
40+
The exit latency constraint in microsecond for the injected
41+
idle state for the device. It is the latency constraint to
42+
apply when selecting an idle state from among all the present
43+
ones.
44+
45+
required:
46+
- '#cooling-cells'
47+
48+
examples:
49+
- |
50+
#include <dt-bindings/thermal/thermal.h>
51+
52+
// Example: Combining idle cooling device on big CPUs with cpufreq cooling device
53+
cpus {
54+
#address-cells = <2>;
55+
#size-cells = <0>;
56+
57+
/* ... */
58+
59+
cpu_b0: cpu@100 {
60+
device_type = "cpu";
61+
compatible = "arm,cortex-a72";
62+
reg = <0x0 0x100>;
63+
enable-method = "psci";
64+
capacity-dmips-mhz = <1024>;
65+
dynamic-power-coefficient = <436>;
66+
#cooling-cells = <2>; /* min followed by max */
67+
cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
68+
thermal-idle {
69+
#cooling-cells = <2>;
70+
duration-us = <10000>;
71+
exit-latency-us = <500>;
72+
};
73+
};
74+
75+
cpu_b1: cpu@101 {
76+
device_type = "cpu";
77+
compatible = "arm,cortex-a72";
78+
reg = <0x0 0x101>;
79+
enable-method = "psci";
80+
capacity-dmips-mhz = <1024>;
81+
dynamic-power-coefficient = <436>;
82+
#cooling-cells = <2>; /* min followed by max */
83+
cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
84+
thermal-idle {
85+
#cooling-cells = <2>;
86+
duration-us = <10000>;
87+
exit-latency-us = <500>;
88+
};
89+
};
90+
91+
/* ... */
92+
93+
};
94+
95+
/* ... */
96+
97+
thermal_zones {
98+
cpu_thermal: cpu {
99+
polling-delay-passive = <100>;
100+
polling-delay = <1000>;
101+
102+
/* ... */
103+
104+
trips {
105+
cpu_alert0: cpu_alert0 {
106+
temperature = <65000>;
107+
hysteresis = <2000>;
108+
type = "passive";
109+
};
110+
111+
cpu_alert1: cpu_alert1 {
112+
temperature = <70000>;
113+
hysteresis = <2000>;
114+
type = "passive";
115+
};
116+
117+
cpu_alert2: cpu_alert2 {
118+
temperature = <75000>;
119+
hysteresis = <2000>;
120+
type = "passive";
121+
};
122+
123+
cpu_crit: cpu_crit {
124+
temperature = <95000>;
125+
hysteresis = <2000>;
126+
type = "critical";
127+
};
128+
};
129+
130+
cooling-maps {
131+
map0 {
132+
trip = <&cpu_alert1>;
133+
cooling-device = <&{/cpus/cpu@100/thermal-idle} 0 15 >,
134+
<&{/cpus/cpu@101/thermal-idle} 0 15>;
135+
};
136+
137+
map1 {
138+
trip = <&cpu_alert2>;
139+
cooling-device =
140+
<&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
141+
<&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
142+
};
143+
};
144+
};
145+
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SPDX-License-Identifier: (GPL-2.0)
2+
# Copyright 2020 Linaro Ltd.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/thermal/thermal-sensor.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Thermal sensor binding
9+
10+
maintainers:
11+
- Amit Kucheria <[email protected]>
12+
13+
description: |
14+
Thermal management is achieved in devicetree by describing the sensor hardware
15+
and the software abstraction of thermal zones required to take appropriate
16+
action to mitigate thermal overloads.
17+
18+
The following node types are used to completely describe a thermal management
19+
system in devicetree:
20+
- thermal-sensor: device that measures temperature, has SoC-specific bindings
21+
- cooling-device: device used to dissipate heat either passively or actively
22+
- thermal-zones: a container of the following node types used to describe all
23+
thermal data for the platform
24+
25+
This binding describes the thermal-sensor.
26+
27+
Thermal sensor devices provide temperature sensing capabilities on thermal
28+
zones. Typical devices are I2C ADC converters and bandgaps. Thermal sensor
29+
devices may control one or more internal sensors.
30+
31+
properties:
32+
"#thermal-sensor-cells":
33+
description:
34+
Used to uniquely identify a thermal sensor instance within an IC. Will be
35+
0 on sensor nodes with only a single sensor and at least 1 on nodes
36+
containing several internal sensors.
37+
enum: [0, 1]
38+
39+
examples:
40+
- |
41+
#include <dt-bindings/interrupt-controller/arm-gic.h>
42+
43+
// Example 1: SDM845 TSENS
44+
soc: soc@0 {
45+
#address-cells = <2>;
46+
#size-cells = <2>;
47+
48+
/* ... */
49+
50+
tsens0: thermal-sensor@c263000 {
51+
compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
52+
reg = <0 0x0c263000 0 0x1ff>, /* TM */
53+
<0 0x0c222000 0 0x1ff>; /* SROT */
54+
#qcom,sensors = <13>;
55+
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>,
56+
<GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
57+
interrupt-names = "uplow", "critical";
58+
#thermal-sensor-cells = <1>;
59+
};
60+
61+
tsens1: thermal-sensor@c265000 {
62+
compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
63+
reg = <0 0x0c265000 0 0x1ff>, /* TM */
64+
<0 0x0c223000 0 0x1ff>; /* SROT */
65+
#qcom,sensors = <8>;
66+
interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>,
67+
<GIC_SPI 509 IRQ_TYPE_LEVEL_HIGH>;
68+
interrupt-names = "uplow", "critical";
69+
#thermal-sensor-cells = <1>;
70+
};
71+
};
72+
...

0 commit comments

Comments
 (0)