I’m rusty on Device Tree. I think the current R4’s DTS is quite wrong about trip points and cooling mapping. The fan won’t work as expected.
Perhaps that’s the reason one user above tried to do it himself in Linux user space ? Akin to run a program on Windows eating CPU cycles to manage fan speed.
If I read the current DTS correctly, here are current fan speed & trip point setup:
fan level: 0 - duty cycle 0%, 1 - 30%, 2 - 50%, 3 100%
Trip points: low - 40C, med - 85C, high - 115C, hot - 120C, critical - 125C
trip point to fan level mapping: low <> 1 1, med <> 2 2, hot <> 3 3
I see four main issues:
- 40C is too low a temperature to start the fan and potentially associated noise. Router chips can tolerate lot higher temperature.
- Once the fan triggered it will never stop, even if temperature drops below 40C.
- No “passive” trip point. Note I think “passive” is not what the author thinks i.e. heat dissipation by heatsink. A “passive” trip point in DTS is cooling by adjusting CPU freq.
- CPU freq won’t throttle when overheat as a “passive” mapping is missing.
I haven’t got R4 yet and no chance to try. My recommended trip points:
Trip points: low - 65C, med - 70C, high - 80C, hot - 95C (define this trip point as “passive”), critical - 125C
And the trip points to fan level mapping should be:
low <> 0 1, med <> 1 2, high <> 2 3, hot <> 3 3
Add the missing mapping for ‘hot’ that linking to CPU OPPs for “passive” cooling
With these changes, the behaviour will be:
- 65C or below: fan not spin
- 70C or below: 0% to 30% duty cycle
- 80C or below: 30% to 50% duty cycle
- 95C or below: 50% to 100% full blast; additionally use CPU throttle to reduce heat
- 125C: system auto reboot (I believe it’s hard wired inside the SoC).
Reference to Device Tree: https://www.kernel.org/doc/Documentation/devicetree/bindings/thermal/thermal.txt