devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-V2 0/5] bcm2835: add thermal driver
@ 2016-05-13 13:13 kernel-TqfNSX0MhmxHKSADF0wUEw
  2016-05-13 13:13 ` [PATCH-V2 1/5] dt: bindings: add thermal device driver for bcm2835 kernel
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: kernel-TqfNSX0MhmxHKSADF0wUEw @ 2016-05-13 13:13 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Lee Jones, Eric Anholt,
	Russell King, linux-pm-u79uwXL29TY76Z2rM5mHXA, devicetree,
	linux-rpi-kernel,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Martin Sperl

From: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>

Add a thermal driver for the TSENSE device of the bcm2835 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 - reads as 0 currently)

The calibrations are (potentially) different for bcm2835, bcm2836
and bcm2837 and can get selected by the compatiblity 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
* 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)

Changelog:
 V1 -> V2: renamed dt-binding documentation file
       	   added specific settings depending on compatiblity
	   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

Martin Sperl (5):
  dt: bindings: add thermal device driver for bcm2835
  thermal: bcm2835: add thermal driver for bcm2835 soc
  ARM: bcm2835: add thermal node to device-tree of bcm283x
  ARM: bcm2835: add thermal driver to default_config
  ARM: multi_v7_defconfig: bcm2835: add bcm2835-thermal driver

 .../bindings/thermal/brcm,bcm2835-thermal.txt      |  17 ++
 arch/arm/boot/dts/bcm283x.dtsi                     |   6 +
 arch/arm/configs/bcm2835_defconfig                 |   2 +
 arch/arm/configs/multi_v7_defconfig                |   1 +
 drivers/thermal/Kconfig                            |   5 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/bcm/Kconfig                        |   4 +
 drivers/thermal/bcm/Makefile                       |   1 +
 drivers/thermal/bcm/bcm2835_thermal.c              | 326 +++++++++++++++++++++
 9 files changed, 363 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/brcm,bcm2835-thermal.txt
 create mode 100644 drivers/thermal/bcm/Kconfig
 create mode 100644 drivers/thermal/bcm/Makefile
 create mode 100644 drivers/thermal/bcm/bcm2835_thermal.c

--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-05-16 18:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 13:13 [PATCH-V2 0/5] bcm2835: add thermal driver kernel-TqfNSX0MhmxHKSADF0wUEw
2016-05-13 13:13 ` [PATCH-V2 1/5] dt: bindings: add thermal device driver for bcm2835 kernel
2016-05-16 16:32   ` Rob Herring
     [not found] ` <1463145186-12906-1-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2016-05-13 13:13   ` [PATCH-V2 2/5] thermal: bcm2835: add thermal driver for bcm2835 soc kernel-TqfNSX0MhmxHKSADF0wUEw
2016-05-13 13:13   ` [PATCH-V2 3/5] ARM: bcm2835: add thermal node to device-tree of bcm283x kernel-TqfNSX0MhmxHKSADF0wUEw
2016-05-13 13:13 ` [PATCH-V2 4/5] ARM: bcm2835: add thermal driver to default_config kernel
2016-05-13 13:13 ` [PATCH-V2 5/5] ARM: multi_v7_defconfig: bcm2835: add bcm2835-thermal driver kernel
     [not found]   ` <1463145186-12906-6-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2016-05-16 16:43     ` Florian Fainelli
     [not found]       ` <5739F8AC.8080003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-16 18:17         ` kernel-TqfNSX0MhmxHKSADF0wUEw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).