Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0)
0002 # Copyright 2020 Linaro Ltd.
0003 %YAML 1.2
0004 ---
0005 $id: http://devicetree.org/schemas/thermal/thermal-cooling-devices.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007 
0008 title: Thermal cooling device binding
0009 
0010 maintainers:
0011   - Amit Kucheria <amitk@kernel.org>
0012 
0013 description: |
0014   Thermal management is achieved in devicetree by describing the sensor hardware
0015   and the software abstraction of cooling devices and thermal zones required to
0016   take appropriate action to mitigate thermal overload.
0017 
0018   The following node types are used to completely describe a thermal management
0019   system in devicetree:
0020    - thermal-sensor: device that measures temperature, has SoC-specific bindings
0021    - cooling-device: device used to dissipate heat either passively or actively
0022    - thermal-zones: a container of the following node types used to describe all
0023      thermal data for the platform
0024 
0025   This binding describes the cooling devices.
0026 
0027   There are essentially two ways to provide control on power dissipation:
0028     - Passive cooling: by means of regulating device performance. A typical
0029       passive cooling mechanism is a CPU that has dynamic voltage and frequency
0030       scaling (DVFS), and uses lower frequencies as cooling states.
0031     - Active cooling: by means of activating devices in order to remove the
0032       dissipated heat, e.g. regulating fan speeds.
0033 
0034   Any cooling device has a range of cooling states (i.e. different levels of
0035   heat dissipation). They also have a way to determine the state of cooling in
0036   which the device is. For example, a fan's cooling states correspond to the
0037   different fan speeds possible. Cooling states are referred to by single
0038   unsigned integers, where larger numbers mean greater heat dissipation. The
0039   precise set of cooling states associated with a device should be defined in
0040   a particular device's binding.
0041 
0042 select: true
0043 
0044 properties:
0045   "#cooling-cells":
0046     description:
0047       Must be 2, in order to specify minimum and maximum cooling state used in
0048       the cooling-maps reference. The first cell is the minimum cooling state
0049       and the second cell is the maximum cooling state requested.
0050     const: 2
0051 
0052 additionalProperties: true
0053 
0054 examples:
0055   - |
0056     #include <dt-bindings/interrupt-controller/arm-gic.h>
0057     #include <dt-bindings/thermal/thermal.h>
0058 
0059     // Example 1: Cpufreq cooling device on CPU0
0060     cpus {
0061             #address-cells = <2>;
0062             #size-cells = <0>;
0063 
0064             CPU0: cpu@0 {
0065                     device_type = "cpu";
0066                     compatible = "qcom,kryo385";
0067                     reg = <0x0 0x0>;
0068                     enable-method = "psci";
0069                     cpu-idle-states = <&LITTLE_CPU_SLEEP_0>,
0070                                       <&LITTLE_CPU_SLEEP_1>,
0071                                       <&CLUSTER_SLEEP_0>;
0072                     capacity-dmips-mhz = <607>;
0073                     dynamic-power-coefficient = <100>;
0074                     qcom,freq-domain = <&cpufreq_hw 0>;
0075                     #cooling-cells = <2>;
0076                     next-level-cache = <&L2_0>;
0077                     L2_0: l2-cache {
0078                             compatible = "cache";
0079                             next-level-cache = <&L3_0>;
0080                             L3_0: l3-cache {
0081                                     compatible = "cache";
0082                             };
0083                     };
0084           };
0085 
0086           /* ... */
0087 
0088     };
0089 
0090     /* ... */
0091 
0092     thermal-zones {
0093             cpu0-thermal {
0094                     polling-delay-passive = <250>;
0095                     polling-delay = <1000>;
0096 
0097                     thermal-sensors = <&tsens0 1>;
0098 
0099                     trips {
0100                             cpu0_alert0: trip-point0 {
0101                                     temperature = <90000>;
0102                                     hysteresis = <2000>;
0103                                     type = "passive";
0104                             };
0105                     };
0106 
0107                     cooling-maps {
0108                             map0 {
0109                                     trip = <&cpu0_alert0>;
0110                                     /* Corresponds to 1000MHz in OPP table */
0111                                     cooling-device = <&CPU0 5 5>;
0112                             };
0113                     };
0114             };
0115 
0116             /* ... */
0117     };
0118 ...