xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0)
2*4882a593Smuzhiyun# Copyright 2020 Linaro Ltd.
3*4882a593Smuzhiyun%YAML 1.2
4*4882a593Smuzhiyun---
5*4882a593Smuzhiyun$id: http://devicetree.org/schemas/thermal/thermal-cooling-devices.yaml#
6*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
7*4882a593Smuzhiyun
8*4882a593Smuzhiyuntitle: Thermal cooling device binding
9*4882a593Smuzhiyun
10*4882a593Smuzhiyunmaintainers:
11*4882a593Smuzhiyun  - Amit Kucheria <amitk@kernel.org>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription: |
14*4882a593Smuzhiyun  Thermal management is achieved in devicetree by describing the sensor hardware
15*4882a593Smuzhiyun  and the software abstraction of cooling devices and thermal zones required to
16*4882a593Smuzhiyun  take appropriate action to mitigate thermal overload.
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun  The following node types are used to completely describe a thermal management
19*4882a593Smuzhiyun  system in devicetree:
20*4882a593Smuzhiyun   - thermal-sensor: device that measures temperature, has SoC-specific bindings
21*4882a593Smuzhiyun   - cooling-device: device used to dissipate heat either passively or actively
22*4882a593Smuzhiyun   - thermal-zones: a container of the following node types used to describe all
23*4882a593Smuzhiyun     thermal data for the platform
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun  This binding describes the cooling devices.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun  There are essentially two ways to provide control on power dissipation:
28*4882a593Smuzhiyun    - Passive cooling: by means of regulating device performance. A typical
29*4882a593Smuzhiyun      passive cooling mechanism is a CPU that has dynamic voltage and frequency
30*4882a593Smuzhiyun      scaling (DVFS), and uses lower frequencies as cooling states.
31*4882a593Smuzhiyun    - Active cooling: by means of activating devices in order to remove the
32*4882a593Smuzhiyun      dissipated heat, e.g. regulating fan speeds.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun  Any cooling device has a range of cooling states (i.e. different levels of
35*4882a593Smuzhiyun  heat dissipation). They also have a way to determine the state of cooling in
36*4882a593Smuzhiyun  which the device is. For example, a fan's cooling states correspond to the
37*4882a593Smuzhiyun  different fan speeds possible. Cooling states are referred to by single
38*4882a593Smuzhiyun  unsigned integers, where larger numbers mean greater heat dissipation. The
39*4882a593Smuzhiyun  precise set of cooling states associated with a device should be defined in
40*4882a593Smuzhiyun  a particular device's binding.
41*4882a593Smuzhiyun
42*4882a593Smuzhiyunselect: true
43*4882a593Smuzhiyun
44*4882a593Smuzhiyunproperties:
45*4882a593Smuzhiyun  "#cooling-cells":
46*4882a593Smuzhiyun    description:
47*4882a593Smuzhiyun      Must be 2, in order to specify minimum and maximum cooling state used in
48*4882a593Smuzhiyun      the cooling-maps reference. The first cell is the minimum cooling state
49*4882a593Smuzhiyun      and the second cell is the maximum cooling state requested.
50*4882a593Smuzhiyun    const: 2
51*4882a593Smuzhiyun
52*4882a593SmuzhiyunadditionalProperties: true
53*4882a593Smuzhiyun
54*4882a593Smuzhiyunexamples:
55*4882a593Smuzhiyun  - |
56*4882a593Smuzhiyun    #include <dt-bindings/interrupt-controller/arm-gic.h>
57*4882a593Smuzhiyun    #include <dt-bindings/thermal/thermal.h>
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun    // Example 1: Cpufreq cooling device on CPU0
60*4882a593Smuzhiyun    cpus {
61*4882a593Smuzhiyun            #address-cells = <2>;
62*4882a593Smuzhiyun            #size-cells = <0>;
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun            CPU0: cpu@0 {
65*4882a593Smuzhiyun                    device_type = "cpu";
66*4882a593Smuzhiyun                    compatible = "qcom,kryo385";
67*4882a593Smuzhiyun                    reg = <0x0 0x0>;
68*4882a593Smuzhiyun                    enable-method = "psci";
69*4882a593Smuzhiyun                    cpu-idle-states = <&LITTLE_CPU_SLEEP_0
70*4882a593Smuzhiyun                                       &LITTLE_CPU_SLEEP_1
71*4882a593Smuzhiyun                                       &CLUSTER_SLEEP_0>;
72*4882a593Smuzhiyun                    capacity-dmips-mhz = <607>;
73*4882a593Smuzhiyun                    dynamic-power-coefficient = <100>;
74*4882a593Smuzhiyun                    qcom,freq-domain = <&cpufreq_hw 0>;
75*4882a593Smuzhiyun                    #cooling-cells = <2>;
76*4882a593Smuzhiyun                    next-level-cache = <&L2_0>;
77*4882a593Smuzhiyun                    L2_0: l2-cache {
78*4882a593Smuzhiyun                            compatible = "cache";
79*4882a593Smuzhiyun                            next-level-cache = <&L3_0>;
80*4882a593Smuzhiyun                            L3_0: l3-cache {
81*4882a593Smuzhiyun                                    compatible = "cache";
82*4882a593Smuzhiyun                            };
83*4882a593Smuzhiyun                    };
84*4882a593Smuzhiyun          };
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun          /* ... */
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun    };
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun    /* ... */
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun    thermal-zones {
93*4882a593Smuzhiyun            cpu0-thermal {
94*4882a593Smuzhiyun                    polling-delay-passive = <250>;
95*4882a593Smuzhiyun                    polling-delay = <1000>;
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun                    thermal-sensors = <&tsens0 1>;
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun                    trips {
100*4882a593Smuzhiyun                            cpu0_alert0: trip-point0 {
101*4882a593Smuzhiyun                                    temperature = <90000>;
102*4882a593Smuzhiyun                                    hysteresis = <2000>;
103*4882a593Smuzhiyun                                    type = "passive";
104*4882a593Smuzhiyun                            };
105*4882a593Smuzhiyun                    };
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun                    cooling-maps {
108*4882a593Smuzhiyun                            map0 {
109*4882a593Smuzhiyun                                    trip = <&cpu0_alert0>;
110*4882a593Smuzhiyun                                    /* Corresponds to 1000MHz in OPP table */
111*4882a593Smuzhiyun                                    cooling-device = <&CPU0 5 5>;
112*4882a593Smuzhiyun                            };
113*4882a593Smuzhiyun                    };
114*4882a593Smuzhiyun            };
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun            /* ... */
117*4882a593Smuzhiyun    };
118*4882a593Smuzhiyun...
119