Re: [PATCH v2 2/3] thermal/drivers/sun8i: Add support for the A80 THS
Krzysztof Kozlowski <[email protected]> Fri, 24 Jul 2026 09:10:42 +0200
| 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 | <20260724-independent-humble-lion-931e6a@quoll> |
On Wed, Jul 22, 2026 at 11:00:45PM +0200, Sören Hantel wrote: > The Allwinner A80 thermal sensor is an early relative of the THS found > in the A83T and later SoCs. It shares its register block, bus gate, > 4 MHz module clock and reset line with the GPADC; the THS registers > live at offset 0x40 of the shared block, with four data registers for > the four sensors (0: big cluster, 1: DRAM, 2: GPU, 3: little cluster). > > Register layout, initialization values and the temperature formula > (T = 190 - raw * 1000 / 14543, i.e. offset 190000 / scale 688 in this > driver's convention) are taken from the vendor BSP kernel. The init > sequence also programs the hardware alarm (~90 degC) and emergency > shutdown (~105 degC) thresholds the BSP uses, since their reset > defaults are undefined. > > Unlike on later SoCs the data-ready interrupt fires at the conversion > rate (tens of kHz), and the level triggered alarm interrupt would > retrigger for as long as an over-temperature condition persists, so > both stay disabled and the thermal core polls the sensors; only the > emergency shutdown event keeps its interrupt enabled. > > Since the A80 chip description has no calibrate callback, guard the > callback invocation in sun8i_ths_calibrate(); the A80 SID is not yet > supported by the sunxi nvmem driver anyway, so calibration data is > currently unavailable and the driver falls back to the defaults, > which yield plausible results (idle temperatures around 40 degC, > full-load peaks in the mid 50s on a Cubieboard4). > > Tested on a Cubietech Cubieboard4: all four zones report load-reactive > temperatures via polling. > > Co-authored-by: Claude Fable 5 <[email protected]> Same as for binding: nope. Claude is not a person. Best regards, Krzysztof