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