Libre Computer Tritium - ALL-H3-CC-H5v1.1a - PWM Fan Control issue

Hello,

I require some assistance please.

I have a Libre Computer Tritium - ALL-H3-CC-H5v1.1a. I received it yesterday (Feb 7 2024). I am running debian 12 (bookworm) for arm64 systems downloaded from the libre computer website.

I have my PWM fan wired to the 3-PIN UART for ground, tach, and pwm, the power is coming from GPIO.

As per the pinout header guide- UART pin1 is ground, UART pin2 (PA4) is tach, and UART pin3 (PA5) is pwm0. I am getting power from GPIO pin2, which is a 5V rail.
Here is a link to the site with the pinout header guides:

This device only seems to have one controllable PWM–pwm0 which I have enabled using the ldto command.

I configured the fan according to 2 other threads I found on these forums.

As such:
sudo ldto enable pwm0
sudo echo 0 > /sys/class/pwm/pwmchip0/export
sudo echo 1000000 > /sys/class/pwm/pwmchip0/pwm0/period
sudo echo 500000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
sudo echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable

I then executed:
sudo ldto merge pwm0

When I reboot I no longer have to execute the ldto enable pwm0 schema/overlay however the system does not save the /sys/class/pwm/pwmchip0/pwm0 values. As a side note, after rebooting if I execute sudo ldto status it shows no active overlays, although the fan slows down once I set the pwmchip0 values–I do not need to re-execute the sudo ldto enable pwm0.

Is there some way I can make the OS save these values or at the very least is there a recommended place in /etc I should store the values?

If there isn’t a consensus I will just add it to the system startup scripts.

FYI as per Libre Computer Board BIOS/Firmware Update Images my board does not have firmware.

Thank you for taking the time to read my thread.
-grendel

You need to create a DTBO for the fan and link the fan->cpu temperature. Below are examples for AML-S905X-CC. Feel free to submit a pull request. If you have difficulty, let us know and we can help you.

Thank you for the rapid response. This will be my first time creating a DTBO. I will try to do it on my own and should I come to a place where I cannot continue I will post reply with my progress.

I read through the dts files linked and I believe I understand what I need to do and what I will need to change. Right now, before starting, the only lingering thought I have is how do I compile this and install it. Which I will research once I have actually done a pull request.

-grendel

It would appear that I would need to do a lot more work then just changing the variables from the aml-s905x-cc dts files.

The pin layout, chip configuration/SoC package is different enough that I would also have to write custom header files for the clocks (for tach) and whatnot that it is just not worth it for me because I am not a programmer and I need to deploy the four units I purchased on Tuesday Feb 13 2024.

So I switched the fan’s power to the 3.3V rail (GPIO pin 1) to reduce the power draw so the fan isn’t running full bore all the time.

I ran some tests using a ton of yes > /dev/null 2&>1 and sysbench. With the fan on the 3.3v rail the SoC package never went above 42°C. Based on the anticipated workload I have determined that this will be within specification for the deployment.

Thank you for your assistance on this matter.