Re: [PATCH] thermal: brcmstb: enable hwmon

From: Florian Fainelli
Date: Thu Oct 31 2019 - 23:02:11 EST


On 10/31/2019 6:08 AM, Stefan Wahren wrote:
> Hi Chen-Yu,
>
> Am 30.10.19 um 17:38 schrieb Chen-Yu Tsai:
>> From: Chen-Yu Tsai <wens@xxxxxxxx>
>>
>> By defaul of-based thermal driver do not have hwmon entries registered.
>>
>> Do this explicitly so users can use standard hwmon interfaces and tools
>> to read the temperature.
>>
>> This is based on similar changes for bcm2835_thermal in commit
>> d56c19d07e0b ("thermal: bcm2835: enable hwmon explicitly").
>>
>> Signed-off-by: Chen-Yu Tsai <wens@xxxxxxxx>
>> ---
>>
>> This patch was only compile tested. A similar patch [1] was submitted to
>> the downstream kernel, which I did build and actually run on a Raspberry
>> Pi 4.
>
> just a note: from my understanding [2] the brcmstb_thermal isn't the
> right driver for BCM2711. Please consider the current downstream
> solution for BCM2711 support as a quick hack to avoid writing a new
> thermal driver. But must confess that i didn't test Florian's recent
> changes yet.

The brcmstb_thermal driver is for chips with an AVS_TMON whereas the
2711 does not have it AFAICT, even if the registers are there, the
hardware is not present (or so have I been told).

The AVS_RO register you are being pointed out may work, although the
data is over 10 bits (not 11) and the valid bit is 10 (not 11). It looks
like you may have to check bit 16 as well for a measurement being done
or not.
--
Florian