[PATCH 0/3] thermal/drivers/sun8i: Add support for the Allwinner A80 thermal sensor
"Sören Hantel" <[email protected]>
| Newsgroups | dev.linux.lists.linux-sunxi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <[email protected]> |
From: FuginInsanE <[email protected]> This series adds support for the thermal sensor of the Allwinner A80 (sun9i), the last SoC of the family with an in-tree DT but no THS support. The A80 THS is an early relative of the A83T/H3-era sensor generation: same register semantics, but the block, bus gate, module clock and reset line are shared with the GPADC, the THS registers start at offset 0x40, and there are four sensors (big cluster, DRAM, GPU, little cluster). Philipp Rossak posted a driver for this hardware back in 2018 as part of a larger THS rework which never landed for the A80; Armbian has been carrying his DT patches ever since. This series takes the mainline sun8i_thermal driver as the base instead: patch 2 adds a chip description derived from the vendor BSP (register init values, protection thresholds and the temperature formula), and patch 3 revives Philipp's DT patch with a fixed interrupt number (SPI 115 as in the vendor BSP - verified on hardware, the original SPI 31 never fires) and critical trip points. Two A80 particularities are worth calling out: the data-ready interrupt fires at the conversion rate on this SoC, so it stays disabled and the sensors are polled, with the interrupt line serving the alarm/shutdown events only (as in the vendor BSP). And the A80 SID is not yet supported by the sunxi nvmem driver, so calibration data is unavailable for now and the driver falls back to defaults, which produce plausible values on real hardware. Tested on a Cubietech Cubieboard4: all four zones report load-reactive temperatures (idle ~40 degC, ~54 degC under sustained full load) tracking the BSP formula across the range we could provoke. Philipp Rossak (1): ARM: dts: sun9i-a80: Add thermal sensor and thermal zones Sören Hantel (2): dt-bindings: thermal: sun8i: Add binding for the A80 THS controller thermal/drivers/sun8i: Add support for the A80 THS .../thermal/allwinner,sun8i-a83t-ths.yaml | 1 + arch/arm/boot/dts/allwinner/sun9i-a80.dtsi | 68 ++++++++++++++ drivers/thermal/sun8i_thermal.c | 93 ++++++++++++++++++- 3 files changed, 161 insertions(+), 1 deletion(-) -- 2.43.0