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
8title: Thermal cooling device binding
9
10maintainers:
11  - Amit Kucheria <amitk@kernel.org>
12
13description: |
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
42select: true
43
44properties:
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
52additionalProperties: true
53
54examples:
55  - |
56    #include <dt-bindings/interrupt-controller/arm-gic.h>
57    #include <dt-bindings/thermal/thermal.h>
58
59    // Example 1: Cpufreq cooling device on CPU0
60    cpus {
61            #address-cells = <2>;
62            #size-cells = <0>;
63
64            CPU0: cpu@0 {
65                    device_type = "cpu";
66                    compatible = "qcom,kryo385";
67                    reg = <0x0 0x0>;
68                    enable-method = "psci";
69                    cpu-idle-states = <&LITTLE_CPU_SLEEP_0>,
70                                      <&LITTLE_CPU_SLEEP_1>,
71                                      <&CLUSTER_SLEEP_0>;
72                    capacity-dmips-mhz = <607>;
73                    dynamic-power-coefficient = <100>;
74                    qcom,freq-domain = <&cpufreq_hw 0>;
75                    #cooling-cells = <2>;
76                    next-level-cache = <&L2_0>;
77                    L2_0: l2-cache {
78                            compatible = "cache";
79                            next-level-cache = <&L3_0>;
80                            L3_0: l3-cache {
81                                    compatible = "cache";
82                            };
83                    };
84          };
85
86          /* ... */
87
88    };
89
90    /* ... */
91
92    thermal-zones {
93            cpu0-thermal {
94                    polling-delay-passive = <250>;
95                    polling-delay = <1000>;
96
97                    thermal-sensors = <&tsens0 1>;
98
99                    trips {
100                            cpu0_alert0: trip-point0 {
101                                    temperature = <90000>;
102                                    hysteresis = <2000>;
103                                    type = "passive";
104                            };
105                    };
106
107                    cooling-maps {
108                            map0 {
109                                    trip = <&cpu0_alert0>;
110                                    /* Corresponds to 1000MHz in OPP table */
111                                    cooling-device = <&CPU0 5 5>;
112                            };
113                    };
114            };
115
116            /* ... */
117    };
118...
119