Re: [PATCH v14 7/7] riscv: dts: thead: Add PWM fan and thermal control

From: Michal Wilczynski
Date: Sat Aug 23 2025 - 06:18:42 EST




On 8/23/25 12:13, Michal Wilczynski wrote:
>
>
> On 8/22/25 22:49, Drew Fustini wrote:
>> On Wed, Aug 20, 2025 at 10:35:42AM +0200, Michal Wilczynski wrote:
>>> Add Device Tree nodes to enable a PWM controlled fan and it's associated
>>> thermal management for the Lichee Pi 4A board.
>>>
>>> This enables temperature-controlled active cooling for the Lichee Pi 4A
>>> board based on SoC temperature.
>>>
>>> Reviewed-by: Drew Fustini <fustini@xxxxxxxxxx>
>>> Tested-by: Drew Fustini <fustini@xxxxxxxxxx>
>>> Signed-off-by: Michal Wilczynski <m.wilczynski@xxxxxxxxxxx>
>>> ---
>>> arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 67 +++++++++++++++++++++++
>>> 1 file changed, 67 insertions(+)
>>
>> Do you think it makes sense to coordinate this with the "Initial thermal
>> management for Lichee Pi 4A board" series [1] from Icenowy?
>
> Hi,
> It seems to me like using the HW PWM is just a better solution for
> driving the fans. However as pointed in the discussion currently Rust
> requires LLVM, so people compiling with gcc will not be able to compile
> the driver for some time until the gcc support becomes better.
>
> I think there is a way to express in Device Tree the fallback logic -

Sorry I meant 'there is NO way to express this in Device tree'

> if Rust not available then use SW PWM. So I guess the pragmatic way to
> go is to merge SW PWM temporary fix first, and later when gcc becomes
> better at compiling Rust patch it up to use HW PWM instead.
>
>>
>> Thanks,
>> Drew
>>
>> [1] https://lore.kernel.org/linux-riscv/20250816093209.2600355-1-uwu@xxxxxxxxxx/
>>
>
> Best regards,

Best regards,
--
Michal Wilczynski <m.wilczynski@xxxxxxxxxxx>