The fan supplied with Ten64 is running at full speed. I am unable to change its speed.
root@OpenWrt:~# ls /sys/devices/platform/soc/2000000.i2c/i2c-0/0-002f/hwmon/
hwmon2
root@OpenWrt:~# cat /sys/class/hwmon/hwmon2/fan1_input
5453
root@OpenWrt:~# echo 3500 > /sys/class/hwmon/hwmon2/fan1_target
# my ears do not notice any change, and after few minutes still:
root@OpenWrt:~# cat /sys/class/hwmon/hwmon2/fan1_input
5453
root@OpenWrt:~# uname -a
Linux OpenWrt 5.4.61 #0 SMP PREEMPT Mon Dec 21 00:08:33 2020 aarch64 GNU/Linux
root@OpenWrt:~# cat /etc/banner
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r0-6efa060
-----------------------------------------------------
The OpenWrt version on the NAND (with kernel 5.4) has an older version of the fan driver which does not enable fan speed control without external intervention.
The two solutions at the moment are:
Install OpenWrt on a block device (SSD/USB/etc.) which will use the 5.10x kernel.
You should notice the fan will spin down to a lower speed once the fan driver is loaded on bootup.
(The fan speed will be governed by the Linux thermal subsystem to ensure you don’t cook your CPU)
Enable PWM manually in U-Boot before booting
The command to do this in U-Boot is:
=> fan enable_pwm emc2301@2f 0 1
enable_pwm argc: 5
Found controller emc2301@2f
Updating the NAND OpenWrt to the 5.10 kernel is on the TODO list, it’s lagging behind at the moment as 5.10 involved a “new” hardware target.
Unfortunately, after upgrading with the image above via UI, the router is not back. I will connect to it via serial console in few hours to see what’s going on.
The machine was dead. It seems it hang on upgrade. I have repeated installation of the above image via UI, but with serial console attached - no error, upgrade went without any hiccups.
Next time will have serial console attached as well, maybe then I will spot the issue.