projects/linux·commit abb22e44

Merge tag 'thermal-v5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux

abb22e44 · Linus Torvalds <[email protected]> · 2020-01-28 16:31:08 -08:00

Pull thermal updates from Daniel Lezcano:

 - Depromote debug print on the db8500 platform (Linus Walleij)

 - Fix compilation warning when compiling with make W=1 (Amit Kucheria)

 - Code cleanup and refactoring, regmap conversion and add hwmon support
   on Qoriq (Andrey Smirnov)

 - Add an idle injection cpu cooling device and its documentation,
   rename the cpu_cooling device to cpufreq_cooling device (Daniel
   Lezcano)

 - Convert unexported functions to static, add the __init annotation in
   the thermal-of code and remove the pointless wrapper functions
   (Daniel Lezcano)

 - Fix register offset for Armada XP and register reset bit
   initialization (Zak Hays)

 - Enable hwmon on the rockchip (Stefan Schaeckeler)

 - Add the thermal sensor for the H6/H5/H3/A64/A83T/R40 sun8i platform
   and their device tree bindings, followed by a fix for the ths number
   and the sparse warnings (Yangtao Li)

 - Code cleansup for the sun8i and hwmon support (Yangtao Li)

 - Silent some messages which are misleading given the changes made in
   the previous version on generic-adc (Martin Blumenstingl)

 - Rename exynos to Exynos (Krzysztof Kozlowski)

 - Add the bcm2711 thermal driver with the device tree bindings (Stefan
   Wahren)

 - Use usleep_range() instead of udelay() as the call is always done in
   a sleep-able context (Geert Uytterhoeven)

 - Do code cleanup and re-organization to set the scene for a new
   process for the brcmstb (Florian Fainelli)

 - Fix bindings check issues on brcm (Stefan Wahren)

 - Add Jasper Lake support on int340x (Nivedita Swaminathan)

 - Add Comet Lake support on intel pch (Gayatri Kammela)

 - Fix unmatched pci_release_region() on x86 (Chuhong Yuan)

 - Remove temperature boundaries for rcar and rcar3 (Niklas Söderlund)

 - Fix return value to -ENODEV when thermal_zone_of_sensor_register() is
   called with the of-node is missing (Peter Mamonov)

 - Code cleanup, interrupt bouncing, and better support on stm32 (Pascal
   Paillet)

* tag 'thermal-v5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (66 commits)
  thermal: stm32: Fix low threshold interrupt flood
  thermal: stm32: Improve temperature computing
  thermal: stm32: Handle multiple trip points
  thermal: stm32: Disable interrupts at probe
  thermal: stm32: Rework sensor mode management
  thermal: stm32: Fix icifr register name
  thermal: of: Make thermal_zone_of_sensor_register return -ENODEV if a sensor OF node is missing
  thermal: rcar_gen3_thermal: Remove temperature bound
  thermal: rcar_thermal: Remove temperature bound
  thermal: intel: intel_pch_thermal: Add Comet Lake (CML) platform support
  thermal: intel: Fix unmatched pci_release_region
  thermal: int340x: processor_thermal: Add Jasper Lake support
  dt-bindings: brcm,avs-ro-thermal: Fix binding check issues
  thermal: brcmstb_thermal: Register different ops per process
  thermal: brcmstb_thermal: Restructure interrupt registration
  thermal: brcmstb_thermal: Add 16nm process thermal parameters
  dt-bindings: thermal: Define BCM7216 thermal sensor compatible
  thermal: brcmstb_thermal: Prepare to support a different process
  thermal: brcmstb_thermal: Do not use DT coefficients
  thermal: rcar_thermal: Use usleep_range() instead of udelay()
  ...
Commit
abb22e44cff3f11d9e087bdd46c04bb32ff57678
Parents
fb95aae6 · 2f23e319

Merge commit. Changes below are compared with the first parent: fb95aae6.

Changes

48 files changed · +2012 −590

FileStatusAddDelContent
Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yamladded+160−0View file
Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yamladded+48−0View file
Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txtmodified+6−2View file
Documentation/driver-api/thermal/cpu-idle-cooling.rstadded+189−0View file
Documentation/driver-api/thermal/exynos_thermal.rstmodified+4−4View file
MAINTAINERSmodified+12−1View file
arch/arm/boot/dts/bcm2711.dtsimodified+12−0View file
arch/arm/configs/multi_v7_defconfigmodified+1−0View file
arch/arm64/configs/defconfigmodified+1−0View file
drivers/thermal/Kconfigmodified+33−2View file
drivers/thermal/Makefilemodified+3−1View file
drivers/thermal/amlogic_thermal.cmodified+5−1View file
drivers/thermal/armada_thermal.cmodified+4−1View file
drivers/thermal/broadcom/Kconfigmodified+7−0View file
drivers/thermal/broadcom/Makefilemodified+1−0View file
drivers/thermal/broadcom/bcm2711_thermal.cadded+123−0View file
drivers/thermal/broadcom/brcmstb_thermal.cmodified+58−38View file
drivers/thermal/clock_cooling.cmodified+1−1View file
drivers/thermal/cpu_cooling.c → drivers/thermal/cpufreq_cooling.crenamed+4−3View file
drivers/thermal/cpuidle_cooling.cadded+232−0View file
drivers/thermal/db8500_thermal.cmodified+2−2View file
drivers/thermal/devfreq_cooling.cmodified+2−1View file
drivers/thermal/fair_share.cmodified+2−2View file
drivers/thermal/gov_bang_bang.cmodified+2−2View file
drivers/thermal/intel/int340x_thermal/processor_thermal_device.cmodified+4−0View file
drivers/thermal/intel/intel_pch_thermal.cmodified+9−1View file
drivers/thermal/max77620_thermal.cmodified+1−1View file
drivers/thermal/mtk_thermal.cmodified+6−6View file
drivers/thermal/of-thermal.cmodified+35−35View file
drivers/thermal/qoriq_thermal.cmodified+161−176View file
drivers/thermal/rcar_gen3_thermal.cmodified+1−3View file
drivers/thermal/rcar_thermal.cmodified+2−7View file
drivers/thermal/rockchip_thermal.cmodified+27−7View file
drivers/thermal/samsung/Kconfigmodified+1−1View file
drivers/thermal/samsung/exynos_tmu.cmodified+6−3View file
drivers/thermal/st/stm_thermal.cmodified+120−268View file
drivers/thermal/step_wise.cmodified+2−2View file
drivers/thermal/sun8i_thermal.cadded+639−0View file
drivers/thermal/tegra/soctherm.cmodified+13−2View file
drivers/thermal/thermal-generic-adc.cmodified+12−8View file
drivers/thermal/thermal_core.hmodified+0−2View file
drivers/thermal/thermal_hwmon.cmodified+28−0View file
drivers/thermal/thermal_hwmon.hmodified+7−0View file
drivers/thermal/user_space.cmodified+2−2View file
drivers/thermal/zx2967_thermal.cmodified+1−0View file
include/dt-bindings/thermal/thermal_exynos.hmodified+1−1View file
include/linux/clock_cooling.hmodified+1−1View file
include/linux/cpu_cooling.hmodified+21−3View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml

View file
diff --git a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml
new file mode 100644
index 0000000..8736926
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml
@@ -0,0 +1,160 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/allwinner,sun8i-a83t-ths.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner SUN8I Thermal Controller Device Tree Bindings
+
+maintainers:
+ - Vasily Khoruzhick <[email protected]>
+ - Yangtao Li <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - allwinner,sun8i-a83t-ths
+ - allwinner,sun8i-h3-ths
+ - allwinner,sun8i-r40-ths
+ - allwinner,sun50i-a64-ths
+ - allwinner,sun50i-h5-ths
+ - allwinner,sun50i-h6-ths
+
+ clocks:
+ minItems: 1
+ maxItems: 2
+ items:
+ - description: Bus Clock
+ - description: Module Clock
+
+ clock-names:
+ minItems: 1
+ maxItems: 2
+ items:
+ - const: bus
+ - const: mod
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ nvmem-cells:
+ maxItems: 1
+ description: Calibration data for thermal sensors
+
+ nvmem-cell-names:
+ const: calibration
+
+ # See ./thermal.txt for details
+ "#thermal-sensor-cells":
+ enum:
+ - 0
+ - 1
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: allwinner,sun50i-h6-ths
+
+ then:
+ properties:
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ maxItems: 1
+
+ else:
+ properties:
+ clocks:
+ minItems: 2
+
+ clock-names:
+ minItems: 2
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: allwinner,sun8i-h3-ths
+
+ then:
+ properties:
+ "#thermal-sensor-cells":
+ const: 0
+
+ else:
+ properties:
+ "#thermal-sensor-cells":
+ const: 1
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - const: allwinner,sun8i-h3-ths
+ - const: allwinner,sun8i-r40-ths
+ - const: allwinner,sun50i-a64-ths
+ - const: allwinner,sun50i-h5-ths
+ - const: allwinner,sun50i-h6-ths
+
+ then:
+ required:
+ - clocks
+ - clock-names
+ - resets
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - '#thermal-sensor-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ thermal-sensor@1f04000 {
+ compatible = "allwinner,sun8i-a83t-ths";
+ reg = <0x01f04000 0x100>;
+ interrupts = <0 31 0>;
+ nvmem-cells = <&ths_calibration>;
+ nvmem-cell-names = "calibration";
+ #thermal-sensor-cells = <1>;
+ };
+
+ - |
+ thermal-sensor@1c25000 {
+ compatible = "allwinner,sun8i-h3-ths";
+ reg = <0x01c25000 0x400>;
+ clocks = <&ccu 0>, <&ccu 1>;
+ clock-names = "bus", "mod";
+ resets = <&ccu 2>;
+ interrupts = <0 31 0>;
+ nvmem-cells = <&ths_calibration>;
+ nvmem-cell-names = "calibration";
+ #thermal-sensor-cells = <0>;
+ };
+
+ - |
+ thermal-sensor@5070400 {
+ compatible = "allwinner,sun50i-h6-ths";
+ reg = <0x05070400 0x100>;
+ clocks = <&ccu 0>;
+ clock-names = "bus";
+ resets = <&ccu 2>;
+ interrupts = <0 15 0>;
+ nvmem-cells = <&ths_calibration>;
+ nvmem-cell-names = "calibration";
+ #thermal-sensor-cells = <1>;
+ };
+
+...

Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml

View file
diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
new file mode 100644
index 0000000..d9fdf48
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom AVS ring oscillator thermal
+
+maintainers:
+ - Stefan Wahren <[email protected]>
+
+description: |+
+ The thermal node should be the child of a syscon node with the
+ required property:
+
+ - compatible: Should be one of the following:
+ "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
+
+ Refer to the the bindings described in
+ Documentation/devicetree/bindings/mfd/syscon.txt
+
+properties:
+ compatible:
+ const: brcm,bcm2711-thermal
+
+ # See ./thermal.txt for details
+ "#thermal-sensor-cells":
+ const: 0
+
+required:
+ - compatible
+ - '#thermal-sensor-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ avs-monitor@7d5d2000 {
+ compatible = "brcm,bcm2711-avs-monitor",
+ "syscon", "simple-mfd";
+ reg = <0x7d5d2000 0xf00>;
+
+ thermal: thermal {
+ compatible = "brcm,bcm2711-thermal";
+ #thermal-sensor-cells = <0>;
+ };
+ };
+...

Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt

View file
diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt b/Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt
index 43a9ed5..74a9ef0 100644
--- a/Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt
+++ b/Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt
@@ -3,9 +3,13 @@
Thermal management core, provided by the AVS TMON hardware block.
Required properties:
-- compatible: must be "brcm,avs-tmon" and/or "brcm,avs-tmon-bcm7445"
+- compatible: must be one of:
+ "brcm,avs-tmon-bcm7216"
+ "brcm,avs-tmon-bcm7445"
+ "brcm,avs-tmon"
- reg: address range for the AVS TMON registers
-- interrupts: temperature monitor interrupt, for high/low threshold triggers
+- interrupts: temperature monitor interrupt, for high/low threshold triggers,
+ required except for "brcm,avs-tmon-bcm7216"
- interrupt-names: should be "tmon"
Example:

Documentation/driver-api/thermal/cpu-idle-cooling.rst

View file
diff --git a/Documentation/driver-api/thermal/cpu-idle-cooling.rst b/Documentation/driver-api/thermal/cpu-idle-cooling.rst
new file mode 100644
index 0000000..e4f0859
--- /dev/null
+++ b/Documentation/driver-api/thermal/cpu-idle-cooling.rst
@@ -0,0 +1,189 @@
+
+Situation:
+----------
+
+Under certain circumstances a SoC can reach a critical temperature
+limit and is unable to stabilize the temperature around a temperature
+control. When the SoC has to stabilize the temperature, the kernel can
+act on a cooling device to mitigate the dissipated power. When the
+critical temperature is reached, a decision must be taken to reduce
+the temperature, that, in turn impacts performance.
+
+Another situation is when the silicon temperature continues to
+increase even after the dynamic leakage is reduced to its minimum by
+clock gating the component. This runaway phenomenon can continue due
+to the static leakage. The only solution is to power down the
+component, thus dropping the dynamic and static leakage that will
+allow the component to cool down.
+
+Last but not least, the system can ask for a specific power budget but
+because of the OPP density, we can only choose an OPP with a power
+budget lower than the requested one and under-utilize the CPU, thus
+losing performance. In other words, one OPP under-utilizes the CPU
+with a power less than the requested power budget and the next OPP
+exceeds the power budget. An intermediate OPP could have been used if
+it were present.
+
+Solutions:
+----------
+
+If we can remove the static and the dynamic leakage for a specific
+duration in a controlled period, the SoC temperature will
+decrease. Acting on the idle state duration or the idle cycle
+injection period, we can mitigate the temperature by modulating the
+power budget.
+
+The Operating Performance Point (OPP) density has a great influence on
+the control precision of cpufreq, however different vendors have a
+plethora of OPP density, and some have large power gap between OPPs,
+that will result in loss of performance during thermal control and
+loss of power in other scenarios.
+
+At a specific OPP, we can assume that injecting idle cycle on all CPUs
+belong to the same cluster, with a duration greater than the cluster
+idle state target residency, we lead to dropping the static and the
+dynamic leakage for this period (modulo the energy needed to enter
+this state). So the sustainable power with idle cycles has a linear
+relation with the OPP’s sustainable power and can be computed with a
+coefficient similar to:
+
+ Power(IdleCycle) = Coef x Power(OPP)
+
+Idle Injection:
+---------------
+
+The base concept of the idle injection is to force the CPU to go to an
+idle state for a specified time each control cycle, it provides
+another way to control CPU power and heat in addition to
+cpufreq. Ideally, if all CPUs belonging to the same cluster, inject
+their idle cycles synchronously, the cluster can reach its power down
+state with a minimum power consumption and reduce the static leakage
+to almost zero. However, these idle cycles injection will add extra
+latencies as the CPUs will have to wakeup from a deep sleep state.
+
+We use a fixed duration of idle injection that gives an acceptable
+performance penalty and a fixed latency. Mitigation can be increased
+or decreased by modulating the duty cycle of the idle injection.
+
+ ^
+ |
+ |
+ |------- -------
+ |_______|_______________________|_______|___________
+
+ <------>
+ idle <---------------------->
+ running
+
+ <----------------------------->
+ duty cycle 25%
+
+
+The implementation of the cooling device bases the number of states on
+the duty cycle percentage. When no mitigation is happening the cooling
+device state is zero, meaning the duty cycle is 0%.
+
+When the mitigation begins, depending on the governor's policy, a
+starting state is selected. With a fixed idle duration and the duty
+cycle (aka the cooling device state), the running duration can be
+computed.
+
+The governor will change the cooling device state thus the duty cycle
+and this variation will modulate the cooling effect.
+
+ ^
+ |
+ |
+ |------- -------
+ |_______|_______________|_______|___________
+
+ <------>
+ idle <-------------->
+ running
+
+ <----------------------------->
+ duty cycle 33%
+
+
+ ^
+ |
+ |
+ |------- -------
+ |_______|_______|_______|___________
+
+ <------>
+ idle <------>
+ running
+
+ <------------->
+ duty cycle 50%
+
+The idle injection duration value must comply with the constraints:
+
+- It is less than or equal to the latency we tolerate when the
+ mitigation begins. It is platform dependent and will depend on the
+ user experience, reactivity vs performance trade off we want. This
+ value should be specified.
+
+- It is greater than the idle state’s target residency we want to go
+ for thermal mitigation, otherwise we end up consuming more energy.
+
+Power considerations
+--------------------
+
+When we reach the thermal trip point, we have to sustain a specified
+power for a specific temperature but at this time we consume:
+
+ Power = Capacitance x Voltage^2 x Frequency x Utilisation
+
+... which is more than the sustainable power (or there is something
+wrong in the system setup). The ‘Capacitance’ and ‘Utilisation’ are a
+fixed value, ‘Voltage’ and the ‘Frequency’ are fixed artificially
+because we don’t want to change the OPP. We can group the
+‘Capacitance’ and the ‘Utilisation’ into a single term which is the
+‘Dynamic Power Coefficient (Cdyn)’ Simplifying the above, we have:
+
+ Pdyn = Cdyn x Voltage^2 x Frequency
+
+The power allocator governor will ask us somehow to reduce our power
+in order to target the sustainable power defined in the device
+tree. So with the idle injection mechanism, we want an average power
+(Ptarget) resulting in an amount of time running at full power on a
+specific OPP and idle another amount of time. That could be put in a
+equation:
+
+ P(opp)target = ((Trunning x (P(opp)running) + (Tidle x P(opp)idle)) /
+ (Trunning + Tidle)
+ ...
+
+ Tidle = Trunning x ((P(opp)running / P(opp)target) - 1)
+
+At this point if we know the running period for the CPU, that gives us
+the idle injection we need. Alternatively if we have the idle
+injection duration, we can compute the running duration with:
+
+ Trunning = Tidle / ((P(opp)running / P(opp)target) - 1)
+
+Practically, if the running power is less than the targeted power, we
+end up with a negative time value, so obviously the equation usage is
+bound to a power reduction, hence a higher OPP is needed to have the
+running power greater than the targeted power.
+
+However, in this demonstration we ignore three aspects:
+
+ * The static leakage is not defined here, we can introduce it in the
+ equation but assuming it will be zero most of the time as it is
+ difficult to get the values from the SoC vendors
+
+ * The idle state wake up latency (or entry + exit latency) is not
+ taken into account, it must be added in the equation in order to
+ rigorously compute the idle injection
+
+ * The injected idle duration must be greater than the idle state
+ target residency, otherwise we end up consuming more energy and
+ potentially invert the mitigation effect
+
+So the final equation is:
+
+ Trunning = (Tidle - Twakeup ) x
+ (((P(opp)dyn + P(opp)static ) - P(opp)target) / P(opp)target )

Documentation/driver-api/thermal/exynos_thermal.rst

View file
diff --git a/Documentation/driver-api/thermal/exynos_thermal.rst b/Documentation/driver-api/thermal/exynos_thermal.rst
index 5bd5565..764df4a 100644
--- a/Documentation/driver-api/thermal/exynos_thermal.rst
+++ b/Documentation/driver-api/thermal/exynos_thermal.rst
@@ -4,7 +4,7 @@ Kernel driver exynos_tmu
Supported chips:
-* ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
+* ARM Samsung Exynos4, Exynos5 series of SoC
Datasheet: Not publicly available
@@ -14,7 +14,7 @@ Authors: Amit Daniel <[email protected]>
TMU controller Description:
---------------------------
-This driver allows to read temperature inside SAMSUNG EXYNOS4/5 series of SoC.
+This driver allows to read temperature inside Samsung Exynos4/5 series of SoC.
The chip only exposes the measured 8-bit temperature code value
through a register.
@@ -43,7 +43,7 @@ The three equations are:
Trimming info for 85 degree Celsius (stored at TRIMINFO register)
Temperature code measured at 85 degree Celsius which is unchanged
-TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
+TMU(Thermal Management Unit) in Exynos4/5 generates interrupt
when temperature exceeds pre-defined levels.
The maximum number of configurable threshold is five.
The threshold levels are defined as follows::
@@ -67,7 +67,7 @@ TMU driver description:
The exynos thermal driver is structured as::
Kernel Core thermal framework
- (thermal_core.c, step_wise.c, cpu_cooling.c)
+ (thermal_core.c, step_wise.c, cpufreq_cooling.c)
^
|
|

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 3e6fa02..d51ce1a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -694,6 +694,14 @@ L: [email protected]
S: Maintained
F: drivers/crypto/allwinner/
+ALLWINNER THERMAL DRIVER
+M: Vasily Khoruzhick <[email protected]>
+M: Yangtao Li <[email protected]>
+S: Maintained
+F: Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml
+F: drivers/thermal/sun8i_thermal.c
+
ALLWINNER VPU DRIVER
M: Maxime Ripard <[email protected]>
M: Paul Kocialkowski <[email protected]>
@@ -16432,12 +16440,15 @@ F: Documentation/devicetree/bindings/thermal/
THERMAL/CPU_COOLING
M: Amit Daniel Kachhap <[email protected]>
+M: Daniel Lezcano <[email protected]>
M: Viresh Kumar <[email protected]>
M: Javi Merino <[email protected]>
S: Supported
F: Documentation/driver-api/thermal/cpu-cooling-api.rst
-F: drivers/thermal/cpu_cooling.c
+F: Documentation/driver-api/thermal/cpu-idle-cooling.rst
+F: drivers/thermal/cpufreq_cooling.c
+F: drivers/thermal/cpuidle_cooling.c
F: include/linux/cpu_cooling.h
THERMAL DRIVER FOR AMLOGIC SOCS

arch/arm/boot/dts/bcm2711.dtsi

View file
diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index e2f6ffb..8eedd6e 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -66,6 +66,17 @@
IRQ_TYPE_LEVEL_HIGH)>;
};
+ avs_monitor: avs-monitor@7d5d2000 {
+ compatible = "brcm,bcm2711-avs-monitor",
+ "syscon", "simple-mfd";
+ reg = <0x7d5d2000 0xf00>;
+
+ thermal: thermal {
+ compatible = "brcm,bcm2711-thermal";
+ #thermal-sensor-cells = <0>;
+ };
+ };
+
dma: dma@7e007000 {
compatible = "brcm,bcm2835-dma";
reg = <0x7e007000 0xb00>;
@@ -363,6 +374,7 @@
&cpu_thermal {
coefficients = <(-487) 410040>;
+ thermal-sensors = <&thermal>;
};
&dsi0 {

arch/arm/configs/multi_v7_defconfig

View file
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 3f1b96d..f5d19cc 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -496,6 +496,7 @@ CONFIG_IMX_THERMAL=y
CONFIG_ROCKCHIP_THERMAL=y
CONFIG_RCAR_THERMAL=y
CONFIG_ARMADA_THERMAL=y
+CONFIG_BCM2711_THERMAL=m
CONFIG_BCM2835_THERMAL=m
CONFIG_BRCMSTB_THERMAL=m
CONFIG_ST_THERMAL_MEMMAP=y

arch/arm64/configs/defconfig

View file
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 6a83ba2..b2f6673 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -442,6 +442,7 @@ CONFIG_ROCKCHIP_THERMAL=m
CONFIG_RCAR_THERMAL=y
CONFIG_RCAR_GEN3_THERMAL=y
CONFIG_ARMADA_THERMAL=y
+CONFIG_BCM2711_THERMAL=m
CONFIG_BCM2835_THERMAL=m
CONFIG_BRCMSTB_THERMAL=m
CONFIG_EXYNOS_THERMAL=y

drivers/thermal/Kconfig

View file
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 79b2786..5a05db5 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -151,16 +151,33 @@ config THERMAL_GOV_POWER_ALLOCATOR
config CPU_THERMAL
bool "Generic cpu cooling support"
- depends on CPU_FREQ
depends on THERMAL_OF
help
+ Enable the CPU cooling features. If the system has no active
+ cooling device available, this option allows to use the CPU
+ as a cooling device.
+
+if CPU_THERMAL
+
+config CPU_FREQ_THERMAL
+ bool "CPU frequency cooling device"
+ depends on CPU_FREQ
+ default y
+ help
This implements the generic cpu cooling mechanism through frequency
reduction. An ACPI version of this already exists
(drivers/acpi/processor_thermal.c).
This will be useful for platforms using the generic thermal interface
and not the ACPI interface.
- If you want this support, you should say Y here.
+config CPU_IDLE_THERMAL
+ bool "CPU idle cooling device"
+ depends on IDLE_INJECT
+ help
+ This implements the CPU cooling mechanism through
+ idle injection. This will throttle the CPU by injecting

This diff is incomplete. Download the complete patch.

drivers/thermal/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/amlogic_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/armada_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/broadcom/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/broadcom/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/broadcom/bcm2711_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/broadcom/brcmstb_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/clock_cooling.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/cpufreq_cooling.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/cpuidle_cooling.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/db8500_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/devfreq_cooling.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/fair_share.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/gov_bang_bang.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/intel/int340x_thermal/processor_thermal_device.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/intel/intel_pch_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/max77620_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/mtk_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/of-thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/qoriq_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/rcar_gen3_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/rcar_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/rockchip_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/samsung/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/samsung/exynos_tmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/st/stm_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/step_wise.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/sun8i_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/tegra/soctherm.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/thermal-generic-adc.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/thermal_core.h

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/thermal_hwmon.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/thermal_hwmon.h

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/user_space.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/zx2967_thermal.c

View file

This diff is incomplete. Download the complete patch.

include/dt-bindings/thermal/thermal_exynos.h

View file

This diff is incomplete. Download the complete patch.

include/linux/clock_cooling.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cpu_cooling.h

View file

This diff is incomplete. Download the complete patch.