Commit df2fbf5b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents 44ebe016 8d485da0
Loading
Loading
Loading
Loading
+116 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0)
# Copyright 2020 Linaro Ltd.
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/thermal-cooling-devices.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Thermal cooling device binding

maintainers:
  - Amit Kucheria <amitk@kernel.org>

description: |
  Thermal management is achieved in devicetree by describing the sensor hardware
  and the software abstraction of cooling devices and thermal zones required to
  take appropriate action to mitigate thermal overload.

  The following node types are used to completely describe a thermal management
  system in devicetree:
   - thermal-sensor: device that measures temperature, has SoC-specific bindings
   - cooling-device: device used to dissipate heat either passively or actively
   - thermal-zones: a container of the following node types used to describe all
     thermal data for the platform

  This binding describes the cooling devices.

  There are essentially two ways to provide control on power dissipation:
    - Passive cooling: by means of regulating device performance. A typical
      passive cooling mechanism is a CPU that has dynamic voltage and frequency
      scaling (DVFS), and uses lower frequencies as cooling states.
    - Active cooling: by means of activating devices in order to remove the
      dissipated heat, e.g. regulating fan speeds.

  Any cooling device has a range of cooling states (i.e. different levels of
  heat dissipation). They also have a way to determine the state of cooling in
  which the device is. For example, a fan's cooling states correspond to the
  different fan speeds possible. Cooling states are referred to by single
  unsigned integers, where larger numbers mean greater heat dissipation. The
  precise set of cooling states associated with a device should be defined in
  a particular device's binding.

select: true

properties:
  "#cooling-cells":
    description:
        Must be 2, in order to specify minimum and maximum cooling state used in
        the cooling-maps reference. The first cell is the minimum cooling state
        and the second cell is the maximum cooling state requested.
    const: 2

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/thermal/thermal.h>

    // Example 1: Cpufreq cooling device on CPU0
    cpus {
            #address-cells = <2>;
            #size-cells = <0>;

            CPU0: cpu@0 {
                    device_type = "cpu";
                    compatible = "qcom,kryo385";
                    reg = <0x0 0x0>;
                    enable-method = "psci";
                    cpu-idle-states = <&LITTLE_CPU_SLEEP_0
                                       &LITTLE_CPU_SLEEP_1
                                       &CLUSTER_SLEEP_0>;
                    capacity-dmips-mhz = <607>;
                    dynamic-power-coefficient = <100>;
                    qcom,freq-domain = <&cpufreq_hw 0>;
                    #cooling-cells = <2>;
                    next-level-cache = <&L2_0>;
                    L2_0: l2-cache {
                            compatible = "cache";
                            next-level-cache = <&L3_0>;
                            L3_0: l3-cache {
                                    compatible = "cache";
                            };
                    };
          };

          /* ... */

    };

    /* ... */

    thermal-zones {
            cpu0-thermal {
                    polling-delay-passive = <250>;
                    polling-delay = <1000>;

                    thermal-sensors = <&tsens0 1>;

                    trips {
                            cpu0_alert0: trip-point0 {
                                    temperature = <90000>;
                                    hysteresis = <2000>;
                                    type = "passive";
                            };
                    };

                    cooling-maps {
                            map0 {
                                    trip = <&cpu0_alert0>;
                                    /* Corresponds to 1000MHz in OPP table */
                                    cooling-device = <&CPU0 5 5>;
                            };
                    };
            };

            /* ... */
    };
...
+145 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2020 Linaro Ltd.
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/thermal-idle.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Thermal idle cooling device binding

maintainers:
  - Daniel Lezcano <daniel.lezcano@linaro.org>

description: |
  The thermal idle cooling device allows the system to passively
  mitigate the temperature on the device by injecting idle cycles,
  forcing it to cool down.

  This binding describes the thermal idle node.

properties:
   $nodename:
     const: thermal-idle
     description: |
        A thermal-idle node describes the idle cooling device properties to
        cool down efficiently the attached thermal zone.

   '#cooling-cells':
      const: 2
      description: |
         Must be 2, in order to specify minimum and maximum cooling state used in
         the cooling-maps reference. The first cell is the minimum cooling state
         and the second cell is the maximum cooling state requested.

   duration-us:
      description: |
         The idle duration in microsecond the device should cool down.

   exit-latency-us:
      description: |
         The exit latency constraint in microsecond for the injected
         idle state for the device. It is the latency constraint to
         apply when selecting an idle state from among all the present
         ones.

required:
  - '#cooling-cells'

examples:
  - |
    #include <dt-bindings/thermal/thermal.h>

    // Example: Combining idle cooling device on big CPUs with cpufreq cooling device
    cpus {
            #address-cells = <2>;
            #size-cells = <0>;

            /* ... */

                 cpu_b0: cpu@100 {
                         device_type = "cpu";
                         compatible = "arm,cortex-a72";
                         reg = <0x0 0x100>;
                         enable-method = "psci";
                         capacity-dmips-mhz = <1024>;
                         dynamic-power-coefficient = <436>;
                         #cooling-cells = <2>; /* min followed by max */
                         cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                         thermal-idle {
                                 #cooling-cells = <2>;
                                 duration-us = <10000>;
                                 exit-latency-us = <500>;
                         };
                };

                cpu_b1: cpu@101 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a72";
                        reg = <0x0 0x101>;
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
                        dynamic-power-coefficient = <436>;
                        #cooling-cells = <2>; /* min followed by max */
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                        thermal-idle {
                                #cooling-cells = <2>;
                                duration-us = <10000>;
                                exit-latency-us = <500>;
                        };
                 };

          /* ... */

    };

    /* ... */

    thermal_zones {
         cpu_thermal: cpu {
                polling-delay-passive = <100>;
                polling-delay = <1000>;

                /* ... */

                trips {
                        cpu_alert0: cpu_alert0 {
                                    temperature = <65000>;
                                    hysteresis = <2000>;
                                    type = "passive";
                        };

                        cpu_alert1: cpu_alert1 {
                                    temperature = <70000>;
                                    hysteresis = <2000>;
                                    type = "passive";
                        };

                        cpu_alert2: cpu_alert2 {
                                    temperature = <75000>;
                                    hysteresis = <2000>;
                                    type = "passive";
                        };

                        cpu_crit: cpu_crit {
                                    temperature = <95000>;
                                    hysteresis = <2000>;
                                    type = "critical";
                        };
                };

                cooling-maps {
                        map0 {
                             trip = <&cpu_alert1>;
                             cooling-device = <&{/cpus/cpu@100/thermal-idle} 0 15 >,
                                              <&{/cpus/cpu@101/thermal-idle} 0 15>;
                        };

                        map1 {
                             trip = <&cpu_alert2>;
                             cooling-device =
                                        <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
                                        <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
                       };
                };
          };
    };
+72 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0)
# Copyright 2020 Linaro Ltd.
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/thermal-sensor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Thermal sensor binding

maintainers:
  - Amit Kucheria <amitk@kernel.org>

description: |
  Thermal management is achieved in devicetree by describing the sensor hardware
  and the software abstraction of thermal zones required to take appropriate
  action to mitigate thermal overloads.

  The following node types are used to completely describe a thermal management
  system in devicetree:
   - thermal-sensor: device that measures temperature, has SoC-specific bindings
   - cooling-device: device used to dissipate heat either passively or actively
   - thermal-zones: a container of the following node types used to describe all
     thermal data for the platform

  This binding describes the thermal-sensor.

  Thermal sensor devices provide temperature sensing capabilities on thermal
  zones. Typical devices are I2C ADC converters and bandgaps. Thermal sensor
  devices may control one or more internal sensors.

properties:
  "#thermal-sensor-cells":
    description:
      Used to uniquely identify a thermal sensor instance within an IC. Will be
      0 on sensor nodes with only a single sensor and at least 1 on nodes
      containing several internal sensors.
    enum: [0, 1]

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    // Example 1: SDM845 TSENS
    soc: soc@0 {
            #address-cells = <2>;
            #size-cells = <2>;

            /* ... */

            tsens0: thermal-sensor@c263000 {
                    compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
                    reg = <0 0x0c263000 0 0x1ff>, /* TM */
                          <0 0x0c222000 0 0x1ff>; /* SROT */
                    #qcom,sensors = <13>;
                    interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>,
                                 <GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
                    interrupt-names = "uplow", "critical";
                    #thermal-sensor-cells = <1>;
            };

            tsens1: thermal-sensor@c265000 {
                    compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
                    reg = <0 0x0c265000 0 0x1ff>, /* TM */
                          <0 0x0c223000 0 0x1ff>; /* SROT */
                    #qcom,sensors = <8>;
                    interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>,
                                 <GIC_SPI 509 IRQ_TYPE_LEVEL_HIGH>;
                    interrupt-names = "uplow", "critical";
                    #thermal-sensor-cells = <1>;
            };
    };
...
+341 −0

File added.

Preview size limit exceeded, changes collapsed.

+56 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/ti,am654-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments AM654 VTM (DTS) binding

maintainers:
  - Keerthy <j-keerthy@ti.com>

properties:
  compatible:
    const: ti,am654-vtm

  reg:
    maxItems: 1

  power-domains:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 1

required:
  - compatible
  - reg
  - power-domains
  - "#thermal-sensor-cells"

additionalProperties: false

examples:
  - |
    #include <dt-bindings/soc/ti,sci_pm_domain.h>
    vtm: thermal@42050000 {
        compatible = "ti,am654-vtm";
        reg = <0x0 0x42050000 0x0 0x25c>;
        power-domains = <&k3_pds 80 TI_SCI_PD_EXCLUSIVE>;
        #thermal-sensor-cells = <1>;
    };

    mpu0_thermal: mpu0_thermal {
        polling-delay-passive = <250>; /* milliseconds */
        polling-delay = <500>; /* milliseconds */
        thermal-sensors = <&vtm0 0>;

        trips {
                mpu0_crit: mpu0_crit {
                        temperature = <125000>; /* milliCelsius */
                        hysteresis = <2000>; /* milliCelsius */
                        type = "critical";
                };
        };
    };
...
Loading