Fan control

I have been running FreeBSD on my HoneyComb and it doesn’t seem to support setting the fan speed yet. Is there a way to set the fans speed from the UEFI firmware? I looked around and didn’t find anything.

Also I read somewhere the additional fan headers aren’t PWM, only the cpu header is PWN. Is that correct? That seemed wrong given its a 4 pin header but I have’t found documents clarifying it.

Currently FreeBSD only supports 2 fan speeds, default and full because there is no Host OS ACPI support for the I2C controllers. I am working on an automatic mode for OS’s that don’t support the I2C bus but haven’t integrated that fully into a release firmware yet.

Yes only the CPU header is connected to the PWM controller.

@jnettlet Can you provide more details on how to control the fan speed?

With the raw OS image I have been using so far the fan keeps running at full speed after boot, which is fine with me (at least once I had replaced the awful fan that came with the board…). However, an interesting side effect of switching from a raw image to a u-boot one is that the fan reduces speed before control is transferred to the OS:

## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   
   Created:      2022-08-03  10:40:09 UTC
   Image Type:   AArch64 Linux Kernel Image (uncompressed)
   Data Size:    16147312 Bytes = 15.4 MiB
   Load Address: 80200000
   Entry Point:  80200800
   Verifying Checksum ... OK
## Flattened Device Tree blob at 80100000
   Booting using the fdt blob at 0x80100000
   Loading Kernel Image
   Loading Device Tree to 000000009fff1000, end 000000009ffff036 ... OK
Releasing fan controller full speed gpio
fsl-mc: DPL not deployed, DPAA2 ethernet not work

While I appreciate the reduced noise, I’m a bit hesitant to do kernel development with the fan not working at full speed (can never tell when something is going to go wrong…).


That is a choose that was made by the BSP team since they can verify that the kernel is built with the appropriate kernel module to manage the PWM controller. Since EDK2 is firmware controlled thermal management I can not guarantee that the host OS knows how to manage the fan so I leave it fully on until the host OS initializes the _TZ ACPI methods. However if you are using Linux rather than BSD then any kernel should have no issues handling the ACPI _TZ methods.

I’m running QNX (the reason I bought this board is to evaluate SMP scalability on a new kernel architecture), so neither BSD nor Linux.
I’m not looking for full control, just a way to keep the fan running at full speed (or restore it to full speed after boot). I’ll gladly RTFM if there is any documentation.


This is all managed by the PWM controller, it is programmable over i2c, or the full fan speed gpio is available. This is all on the schematics and the documentation for the controller is freely available.

I see, thanks. Just to make sure I got it right (sorry, I’m not a hardware person), the fan controller is on I2C address 0x18?


yes that is correct. on i2c@1 off of the i2c expander.

Works now, with full PWM control based on temperature reading.

For those interested, the temperature/fan control registers can be controlled by I2C commands to the chip on address 0x18, as described here:

Note, however, that every command needs to be preceded by selecting channel 1 on the switch first, achieved by writing 0x9 to address 0x77.

You can see how the fan adjusts to a duty cycle of 70%:

elahav@honeycomb:~$ ./honeycomb_fan -d 70
temp=53 speed=2539
temp=53 speed=2214
temp=53 speed=1995
temp=50 speed=1857
temp=53 speed=1837
temp=53 speed=1795
temp=53 speed=1767
temp=53 speed=1733
temp=53 speed=1727