All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V8 0/6] thermal: bcm2835: add thermal driver
@ 2016-11-02 10:18 ` kernel at martin.sperl.org
  0 siblings, 0 replies; 46+ messages in thread
From: kernel @ 2016-11-02 10:18 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Lee Jones, Eric Anholt,
	Russell King, Florian Fainelli, Catalin Marinas, Will Deacon,
	linux-pm, devicetree, linux-rpi-kernel, linux-arm-kernel
  Cc: Martin Sperl

From: Martin Sperl <kernel@martin.sperl.org>

Add a thermal driver for the TSENSE device of the bcm2835/6/7 SOC.

If the firmware enables the HW, then the configuration is not touched.
In case the firmware has not enabled the device, then we try to set
it up correctly (which unfortunately can not get tested).

It exposes temperature and a critical trip point
(using a hardcoded default of 80C or the temperature configured
in the control register by the firmware, which reads as
407C currently)

The calibrations are (potentially) different for bcm2835, bcm2836
and bcm2837 and can get selected by the compatible property
in the device tree.

The driver also exposes the registers via debugfs.

Possible future enhancements:
* the device has the ability to trigger interrupts on reaching
  the programmed critical temperature.
  I have no knowledge which interrupt could be responsible
  for this on the ARM side, so if we get to know which irq
  it is we can implement that.
  Instead the driver right now implements polling in 1 second intervals
* the device can also reset the HW after the trip point
  has been reached (also with some delay, so that corrective
  actions can get taken) - this is currently not enabled by the
  firmware, but could.
* we could define more trip points for THERMAL_TRIP_HOT
* make the trip point limits modifiable (ops.set_trip_temp)

Note:
  No support for 32-bit arm bcm2837, as there is no
  arch/arm/boot/dts/bcm2836.dtsi upstream as of now.
  64-bit arm support is not tested

Changelog:
 V1 -> V2: renamed dt-binding documentation file
       	   added specific settings depending on compatible
	   added trip point based on register
	   setting up ctrl-register if HW is not enabled by firmware
	     as per recommendation of Eric (untested)
	   check that clock frequency is in range
	     (1.9 - 5MHz - as per comment in clk-bcm2835.c)
 	   added driver to multi_v7_defconfig
 V2 -> V3: made a module in multi_v7_defconfig
           fixed typo in dt-binding document
 V3 -> V4: moved driver back to thermal (not using bcm sub-directory)
       	   set polling interval to 1second (was 0ms, so interrupt driven)
 V4 -> V5: use correct compatiblity for different soc versions in dt
       	   support ARM64 for bcm2837 in devicetree and defconfig
 V5 -> V6: incorporated changes recommended by Stefan Wahren
 V6 -> V7: removed depends on ARCH_BCM2836 || ARCH_BCM2837 in Kconfig
 V7 -> V8: rebased

Martin Sperl (6):
  dt: bindings: add thermal device driver for bcm2835
  thermal: bcm2835: add thermal driver for bcm2835 soc
  ARM: bcm2835: dts: add thermal node to device-tree of bcm283x
  ARM64: bcm2835: dts: add thermal node to device-tree of bcm2837
  ARM: bcm2835: add thermal driver to default_config
  ARM64: bcm2835: add thermal driver to default_config

 .../bindings/thermal/brcm,bcm2835-thermal.txt      |  17 ++
 arch/arm/boot/dts/bcm2835.dtsi                     |   6 +
 arch/arm/boot/dts/bcm2836.dtsi                     |   6 +
 arch/arm/boot/dts/bcm283x.dtsi                     |   7 +
 arch/arm/configs/bcm2835_defconfig                 |   2 +
 arch/arm64/boot/dts/broadcom/bcm2837.dtsi          |   6 +
 arch/arm64/configs/defconfig                       |   1 +
 drivers/thermal/Kconfig                            |   8 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/bcm2835_thermal.c                  | 340 +++++++++++++++++++++
 10 files changed, 394 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/brcm,bcm2835-thermal.txt
 create mode 100644 drivers/thermal/bcm2835_thermal.c

--
2.1.4

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2016-11-30  6:39 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02 10:18 [PATCH V8 0/6] thermal: bcm2835: add thermal driver kernel
2016-11-02 10:18 ` kernel at martin.sperl.org
2016-11-02 10:18 ` [PATCH V8 1/6] dt: bindings: add thermal device driver for bcm2835 kernel
2016-11-02 10:18   ` kernel at martin.sperl.org
2016-11-02 10:18 ` [PATCH V8 2/6] thermal: bcm2835: add thermal driver for bcm2835 soc kernel
2016-11-02 10:18   ` kernel at martin.sperl.org
     [not found]   ` <1478081906-12009-3-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2016-11-15 12:29     ` Zhang Rui
2016-11-15 12:29       ` Zhang Rui
2016-11-17  2:11   ` Eduardo Valentin
2016-11-17  2:11     ` Eduardo Valentin
2016-11-17  9:51     ` Martin Sperl
2016-11-17  9:51       ` Martin Sperl
2016-11-17 15:10       ` Eduardo Valentin
2016-11-17 15:10         ` Eduardo Valentin
     [not found]         ` <20161117151019.GA3115-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-11-18  8:32           ` kernel-TqfNSX0MhmxHKSADF0wUEw
2016-11-18  8:32             ` kernel at martin.sperl.org
     [not found]             ` <7957B3CC-0E18-4B27-82EB-EF88B7695E28-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2016-11-19  4:22               ` Eduardo Valentin
2016-11-19  4:22                 ` Eduardo Valentin
     [not found]                 ` <20161119042224.GA25063-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-11-22 14:28                   ` Martin Sperl
2016-11-22 14:28                     ` Martin Sperl
     [not found]                     ` <28F93ABE-8210-4389-AE77-4D5E830E669B-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2016-11-25  5:20                       ` Eduardo Valentin
2016-11-25  5:20                         ` Eduardo Valentin
     [not found]                         ` <20161125052008.GA8342-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-11-28 20:30                           ` Eric Anholt
2016-11-28 20:30                             ` Eric Anholt
2016-11-29  1:34                             ` Eduardo Valentin
2016-11-29  1:34                               ` Eduardo Valentin
2016-11-29 22:12                               ` Eric Anholt
2016-11-29 22:12                                 ` Eric Anholt
2016-11-30  6:39                                 ` Eduardo Valentin
2016-11-30  6:39                                   ` Eduardo Valentin
2016-11-02 10:18 ` [PATCH V8 3/6] ARM: bcm2835: dts: add thermal node to device-tree of bcm283x kernel
2016-11-02 10:18   ` kernel at martin.sperl.org
2016-11-02 10:18 ` [PATCH V8 4/6] ARM64: bcm2835: dts: add thermal node to device-tree of bcm2837 kernel
2016-11-02 10:18   ` kernel at martin.sperl.org
2016-11-02 10:18 ` [PATCH V8 5/6] ARM: bcm2835: add thermal driver to default_config kernel
2016-11-02 10:18   ` kernel at martin.sperl.org
2016-11-02 10:18 ` [PATCH V8 6/6] ARM64: " kernel
2016-11-02 10:18   ` kernel at martin.sperl.org
2016-11-11 17:01 ` [PATCH V8 0/6] thermal: bcm2835: add thermal driver Eric Anholt
2016-11-11 17:01   ` Eric Anholt
2016-11-15 12:50   ` Zhang Rui
2016-11-15 12:50     ` Zhang Rui
     [not found]     ` <1479214212.2224.24.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16 21:57       ` Eric Anholt
2016-11-16 21:57         ` Eric Anholt
2016-11-17  2:21 ` Eduardo Valentin
2016-11-17  2:21   ` Eduardo Valentin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.