thermal: add brcmstb AVS TMON driver
Subsystems (5)
v3 cover thermal: add brcmstb AVS TMON driver
From: Markus Mayer <[email protected]>
This series adds the brcmstb AVS TMON driver.
The driver was originally written by Brian Norris.
This series is also available at
https://github.com/mmayer/linux/tree/brcmstb-thermal-4.13-v4.
v1 of this series can be found at https://lkml.org/lkml/2017/6/5/921
v2 of this series can be found at https://lkml.org/lkml/2017/7/21/585
v3 of this series can be found at https://lkml.org/lkml/2017/7/31/710
Changes since v3:
- Rebased on v4.13-rc3 to resolve conflicts in the MAINTAINERS file
Changes since v2:
- replaced calls to pr_debug() with calls to dev_dbg() [PATCH 2/4 only]
- all other patches are unchanged from v2
Changes since v1:
- Fixed wording in binding document
- Fixed lincensing to consistently mention GPL v2
- Use thermal_zone_get_slope() and thermal_zone_get_offset()
- Some minor clean-ups
Brian Norris (2):
Documentation: devicetree: add binding for Broadcom STB AVS TMON
thermal: add brcmstb AVS TMON driver
Markus Mayer (2):
ARM: multi_v7_defconfig: add CONFIG_BRCMSTB_THERMAL
arm64: defconfig: add CONFIG_BRCMSTB_THERMAL
.../devicetree/bindings/thermal/brcm,avs-tmon.txt | 20 ++ MAINTAINERS | 8 + arch/arm/configs/multi_v7_defconfig | 1 + arch/arm64/configs/defconfig | 1 + drivers/thermal/Kconfig | 2 +- drivers/thermal/broadcom/Kconfig | 7 + drivers/thermal/broadcom/Makefile | 1 + drivers/thermal/broadcom/brcmstb_thermal.c | 386 +++++++++++++++++++++ 8 files changed, 425 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt create mode 100644 drivers/thermal/broadcom/brcmstb_thermal.c
Signature · 1 line
2.7.4
PATCH v3 1/4 Documentation: devicetree: add binding for Broadcom STB AVS TMON
From: Brian Norris <[email protected]>
Add binding for Broadcom STB thermal.
--- .../devicetree/bindings/thermal/brcm,avs-tmon.txt | 20 ++++++++++++++++++++ MAINTAINERS | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt
Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt new file +20 -0
@@ -0,0 +1,20 @@ +* Broadcom STB thermal management + +Thermal management core, provided by the AVS TMON hardware block. + +Required properties: +- compatible: must be "brcm,avs-tmon" and/or "brcm,avs-tmon-bcm7445" +- reg: address range for the AVS TMON registers +- interrupts: temperature monitor interrupt, for high/low threshold triggers +- interrupt-names: should be "tmon" +- interrupt-parent: the parent interrupt controller + +Example: + + thermal at f04d1500 { + compatible = "brcm,avs-tmon-bcm7445", "brcm,avs-tmon"; + reg = <0xf04d1500 0x28>; + interrupts = <0x6>; + interrupt-names = "tmon"; + interrupt-parent = <&avs_host_l2_intc>; + };
MAINTAINERS +8 -0
@@ -2903,6 +2903,14 @@ S: Maintained F: Documentation/devicetree/bindings/cpufreq/brcm,stb-avs-cpu-freq.txt F: drivers/cpufreq/brcmstb* +BROADCOM STB AVS TMON DRIVER +M: Markus Mayer <[email protected]> +M: bcm-kernel-feedback-list at broadcom.com +L: linux-pm at vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/thermal/brcm,avs-tmon.txt +F: drivers/thermal/broadcom/brcmstb* + BROADCOM STB NAND FLASH DRIVER M: Brian Norris <[email protected]> M: Kamal Dasu <[email protected]>
Signature · 1 line
2.7.4
PATCH v3 2/4 thermal: add brcmstb AVS TMON driver
In reply to Markus MayerFrom: Brian Norris <[email protected]>
The AVS TMON core provides temperature readings, a pair of configurable high- and low-temperature threshold interrupts, and an emergency over-temperature chip reset. The driver utilizes the first two to provide temperature readings and high-temperature notifications to applications. The over-temperature reset is not exposed to applications; this reset threshold is critical to the system and should be set with care within the bootloader.
Applications may choose to utilize the notification mechanism, the temperature reading mechanism (e.g., through polling), or both.
--- drivers/thermal/Kconfig | 2 +- drivers/thermal/broadcom/Kconfig | 7 + drivers/thermal/broadcom/Makefile | 1 + drivers/thermal/broadcom/brcmstb_thermal.c | 386 +++++++++++++++++++++++++++++ 4 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 drivers/thermal/broadcom/brcmstb_thermal.c
drivers/thermal/Kconfig +1 -1
@@ -408,7 +408,7 @@ config MTK_THERMAL controller present in Mediatek SoCs menu "Broadcom thermal drivers" -depends on ARCH_BCM || COMPILE_TEST +depends on ARCH_BCM || ARCH_BRCMSTB || COMPILE_TEST source "drivers/thermal/broadcom/Kconfig" endmenu
drivers/thermal/broadcom/Kconfig +7 -0
@@ -6,6 +6,13 @@ config BCM2835_THERMAL help Support for thermal sensors on Broadcom bcm2835 SoCs. +config BRCMSTB_THERMAL + tristate "Broadcom STB AVS TMON thermal driver" + depends on ARCH_BRCMSTB || COMPILE_TEST + help + Enable this driver if you have a Broadcom STB SoC and would like + thermal framework support. + config BCM_NS_THERMAL tristate "Northstar thermal driver" depends on ARCH_BCM_IPROC || COMPILE_TEST
drivers/thermal/broadcom/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_BCM2835_THERMAL) += bcm2835_thermal.o +obj-$(CONFIG_BRCMSTB_THERMAL) += brcmstb_thermal.o obj-$(CONFIG_BCM_NS_THERMAL) += ns-thermal.o
drivers/thermal/broadcom/brcmstb_thermal.c new file +386 -0
386 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v3 3/4 ARM: multi_v7_defconfig: add CONFIG_BRCMSTB_THERMAL
In reply to Markus MayerFrom: Markus Mayer <[email protected]>
Turn on CONFIG_BRCMSTB_THERMAL as module.
--- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
@@ -455,6 +455,7 @@ CONFIG_SENSORS_NTC_THERMISTOR=m CONFIG_SENSORS_PWM_FAN=m CONFIG_SENSORS_INA2XX=m CONFIG_CPU_THERMAL=y +CONFIG_BRCMSTB_THERMAL=m CONFIG_ROCKCHIP_THERMAL=y CONFIG_RCAR_THERMAL=y CONFIG_ARMADA_THERMAL=y
Signature · 1 line
2.7.4
PATCH v3 4/4 arm64: defconfig: add CONFIG_BRCMSTB_THERMAL
In reply to Markus MayerFrom: Markus Mayer <[email protected]>
Turn on CONFIG_BRCMSTB_THERMAL as module.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -304,6 +304,7 @@ CONFIG_SENSORS_INA2XX=m CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_CPU_THERMAL=y CONFIG_THERMAL_EMULATION=y +CONFIG_BRCMSTB_THERMAL=m CONFIG_EXYNOS_THERMAL=y CONFIG_ROCKCHIP_THERMAL=m CONFIG_WATCHDOG=y
Signature · 1 line
2.7.4