Probably to impatient and excited to get a fully working version of Arch for Helios4, I made a second try to get an updated patch for Linux 4.20.5 myself. And, well, it compiles and seems to work! I sent it to the author of the original patch for review.
So without the patch, here is the list of available devices for hardware monitoring:
$this->bbcode_second_pass_code('', '
$ ls -l /sys/class/hwmon/
total 0
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon1 -> ../../devices/virtual/thermal/thermal_zone0/hwmon1
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon2 -> ../../devices/platform/j10-pwm/hwmon/hwmon2
')
After loading the lm75 kernel module:
$this->bbcode_second_pass_code('', '
$ modprobe lm75
$ ls -l /sys/class/hwmon/
total 0
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon1 -> ../../devices/virtual/thermal/thermal_zone0/hwmon1
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon2 -> ../../devices/platform/j10-pwm/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 Feb 10 16:41 hwmon3 -> ../../devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon3
')
And finally with the lm75 module and the updated patch:
$this->bbcode_second_pass_code('', '
$ ls -l /sys/class/hwmon/
total 0
lrwxrwxrwx 1 root root 0 Feb 10 16:45 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0
lrwxrwxrwx 1 root root 0 Feb 10 16:45 hwmon1 -> ../../devices/virtual/thermal/thermal_zone0/hwmon1
lrwxrwxrwx 1 root root 0 Feb 10 16:45 hwmon2 -> ../../devices/platform/j10-pwm/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 Feb 10 16:45 hwmon3 -> ../../devices/platform/j17-pwm/hwmon/hwmon3
lrwxrwxrwx 1 root root 0 Feb 10 16:45 hwmon4 -> ../../devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon4
')
The second fan is now available.
There is however a difference with the
output shown on the Helios wiki:
$this->bbcode_second_pass_code('', '
ls -l /sys/class/hwmon/
total 0
lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0
lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon1 -> ../../devices/virtual/hwmon/hwmon1
lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon2 -> ../../devices/platform/j10-pwm/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon3 -> ../../devices/platform/j17-pwm/hwmon/hwmon3
lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon4 -> ../../devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon4
')
The hwmon1 symlink does not point to the same device.
Reading the current PWM works:
$this->bbcode_second_pass_code('', '
$ cat /sys/class/hwmon/hwmon2/pwm1
255
$ cat /sys/class/hwmon/hwmon3/pwm1
255
')
Setting PWM works also:
$this->bbcode_second_pass_code('', '
$ echo 128 > /sys/class/hwmon/hwmon2/pwm1
$ echo 128 > /sys/class/hwmon/hwmon3/pwm1
')
It feels so good on the ears!
I then tried to configure the fancontrol service. Following
instructions on the Helios4 wiki, I used the
udev rules provided for Armbian. Here is the result:
$this->bbcode_second_pass_code('', '
$ ls -l /dev/{fan,thermal}-*
lrwxrwxrwx 1 root root 42 Feb 10 16:45 /dev/fan-j10 -> /sys/devices/platform/j10-pwm/hwmon/hwmon2
lrwxrwxrwx 1 root root 42 Feb 10 16:45 /dev/fan-j17 -> /sys/devices/platform/j17-pwm/hwmon/hwmon3
lrwxrwxrwx 1 root root 82 Feb 10 16:45 /dev/thermal-board -> /sys/devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon4
lrwxrwxrwx 1 root root 118 Feb 10 16:45 /dev/thermal-eth -> /sys/devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0
')
All symlinks are created in /dev/ excepted /dev/thermal-cpu for unknown reasons. Is it related to the hwmon1 symlink in /sys/class/hwmon that does not point to the same device as on Armbian?
Any advice from udev experts is welcome