Issue #601 has been updated by Walter Sonius.

Build and tried the following coreboot branches 4.22, 4.20, 4.15, 4.11 which 
goes back to november 2019. All of these behave the same as in there is a 
default acceptable FAN speed active on the Compaq Elite 8200 SFF when using the 
code, but it won't change to a altered speed based on a specific nvram 
parameter set (tried all 7). Going back from coreboot branch 4.15 to 4.11 even 
breaks adjusting the PWM values (stays same) although altered nvram values are 
still saved in nvram. Earlier releases I'm no longer to compile without errors, 
specifically I would like to build and test the first commit the FAN speed was 
added: 9bd601584350f51f112b15a7369f9aa82f1d0919.

```
#OBJCOPY    cbfs/fallback/romstage.elf
#make: *** No rule to make target '".car.data"', needed by 
'build/coreboot.pre'.  Stop.
```

For compiling older coreboot branches on ubuntu 24.04, it was neseccary to 
downgrade `gnat` and probably `gcc` package, replace broken `acpica` url with 
altered version and checksum, edit some `binutils/gold` and `gcc/ada` code and 
even allow coreboot to build with distribution toolchain `ANY_TOOLCHAIN`. Along 
the way back in the codebase it is also needed to adjust the port its BOARD 
name! 

See following steps to reproduce:


```
#reproduced on kde neon which uses ubuntu noble 24.04 lts 

sudo apt install gnat-9 #removes gnat gnat-13 gnat-13-x86-64-linux-gnu
sudo apt install gcc-11 #was probably downgraded from 14 or 13 all using apt no 
hacks 

git fetch
git branch -v -a
#before switching branches
make distclean
make clean

git switch 4.11_branch #4.15_branch, 4.20_branch, 4.22_branch or even latest 
master
make crossgcc-i386 CPUS=$(nproc)

#4.22
# needs gcc 11

#4.20
# needs gcc 11 and gnat 9

#4.15
# needs gcc 11 and gnat 9
# additionally needs to alter acpica-unix2 version, url, checksum plus 
ANY_TOOLCHAIN
#https://ftp.mirrorservice.org/sites/ftp.gnu.org/gnu/gnuboot/mirrors/acpica.org
nano util/crossgcc/buildgcc #IASL/ACPICA BASE URL / VERSION
cp acpica-unix2-20190703.tar.gz.cksum.calc acpica-unix2-20190703.tar.gz.cksum
./util/scripts/config --enable ANY_TOOLCHAIN

#4.11
# plus all the earlier above needed changes...
# additionally edit binutils/gold and gcc/ada code
#https://sourceware.org/pipermail/binutils/2019-June/107194.html
nano util/crossgcc/binutils-2.32/gold/errors.h #~line25 + include <string>
#https://lists.gnu.org/archive/html/gnuboot-patches/2024-09/msg00006.html
nano util/crossgcc/gcc-8.3.0/gcc/ada/init.c #~line 570 see URL
nano util/crossgcc/gcc-8.3.0/gcc/ada/libgnarl/s-osinte__linux.ads #~line 328 
edit 16>32
#./util/scripts/config --enable 
BOARD_HEWLETT_PACKARD_HP_COMPAQ_8200_ELITE_SFF_PC

make distclean
touch .config
./util/scripts/config --enable VENDOR_HP
./util/scripts/config --enable BOARD_HP_COMPAQ_8200_ELITE_SFF_PC #add 
"HEWLETT_PACKARD_" <= 4.11
./util/scripts/config --enable USE_OPTION_TABLE

#full/stripped?
./util/scripts/config --enable HAVE_IFD_BIN
./util/scripts/config --set-str IFD_BIN_PATH "/home/neon/Desktop/8200/fd0.bin"
./util/scripts/config --enable HAVE_ME_BIN
./util/scripts/config --set-str ME_BIN_PATH "/home/neon/Desktop/8200/me2.bin"
./util/scripts/config --enable HAVE_GBE_BIN
./util/scripts/config --set-str GBE_BIN_PATH "/home/neon/Desktop/8200/gbe3.bin"

make olddefconfig
make

#flash the image on the target and set nvram values and reboot/shutdown to see 
if fan speed changes?
```

----------------------------------------
Bug #601: superio/nuvoton/npcd378:379 FAN issue sandy/ivy-bridge & haswell on HP
https://ticket.coreboot.org/issues/601#change-2177

* Author: Walter Sonius
* Status: New
* Priority: Normal
* Assignee: Patrick Rudolph
* Category: board support
* Target version: main
* Start date: 2025-07-05
* Affected versions: 25.03
* Affected hardware: compaq_8200_elite_sff, compaq_8300_elite_sff, 
compaq_pro_6300_sff, 260_g1_dm, prodesk_600_g1_sff
----------------------------------------
The NPCD378 HWM FAN control is limited to the PSU FAN only but should work for 
the "compaq_8200_elite_sff" according to its [commit and 
instruction](https://review.coreboot.org/c/coreboot/+/26050), which states "... 
the SuperIO has to be notified that a write is ongoing. After clearing the 
write-lock bit all changes are applied...".

Is there a special command that I missed that "clears the write-lock" or is 
there a bug and is its current implementation broken?

Since adjusting the nvram parameter `sudo nvramtool -w psu_fan_lvl=1-7`and 
doing a reboot or cold powerup does show that the nvram parameter changes (can 
be confirmed by coreboot log or reading the nvram parameter after boot again) 
it never changes the actual PSU FAN speed! Tried multiple coreboot/seabios/edk2 
versions the last 3 months on 5 different HP machines and came to the following 
conclusion.

The following nvramtool `psu_fan_lvl=values` reflect the following PWM feedback 
from the coreboot log:
```
=1
[INFO ]  NPCD378: PSU fan PWM 0x37
=2
[INFO ]  NPCD378: PSU fan PWM 0x57
=3
[INFO ]  NPCD378: PSU fan PWM 0x77
=4
[INFO ]  NPCD378: PSU fan PWM 0x97
=5
[INFO ]  NPCD378: PSU fan PWM 0xb7
=6
[INFO ]  NPCD378: PSU fan PWM 0xd7
=7
[INFO ]  NPCD378: PSU fan PWM 0xf8
```
The following 3 supported sandy/ivy bridge HP variants share the same issue 
that nvram parameters and coreboot log show the requested manual `psu_fan_lvl` 
values but its PSU FAN speed won't change according to these values, atleast 
its FANs keep spinning after post/boot on these machines:
```
                                    VALUE       FAN SPEED
compaq_8200_elite_sff   NPCD378     adjusts     remains same
compaq_8300_elite_sff   NPCD379     adjusts     remains same
compaq_pro_6300_sff     NPCD379     adjusts     remains same
```
The following 2 yet uncommited HP Haswell coreboot variants, "HP 260 G1 DM 
(Desktop Mini) Business PC" and "HP Prodesk 600 G1 SFF" both come with a 
NPCD379 and both share the same issue with the former 3 variants that the 
`psu_fan_lvl` value's can be adjusted by nvramtool(if cmos backend is added to 
the code) and verified during boot or nvramtool that these values have changed 
with affecting the PSU FAN speed in a undesired way:
```
                                    VALUE       FAN SPEED
260_g1_dm               NPCD379     adjusts     stops spinning
prodesk_600_g1_sff      NPCD379     adjusts     stops spinning
```

These 2 Haswell machines will halt "and stop spinning" the PSU FAN as soon as 
during post the "PSU fan PWM" value kicks in!!! A side note is needed for the 
HP 260 G1 DM since it only has a single FAN, so I'm not sure if its CPU or its 
PSU FAN technically and its OEM BIOS misses a option the adjust FAN speed 
compared to the other 4 HP models! Another side note for the Prodesk 600 G1 SFF 
is that I'm forced to use a aftermarket non HP CPU FAN(old Intel CPU FAN), but 
it keeps spinning after coreboot post.
Removing the FAN/HWM code from the superio NPCD378 source, leads to the 
opposite it will force the PSU FAN to its MAXIMUM speed after poweron but 
atleast keeps the FAN spinning. This maximum forced full speed FAN behaviour 
can also be replicated by removing one of the 4 FAN wires, red or white cable 
not sure anymore.

Interesting FAN notes:
In case of the "Prodesk 600 G1", swapping its PSU with the PSU from the 
"compaq_8300_elite_sff" keeps the PSU fan spinning during and after coreboot 
post but it will still not adjust its PSU FAN speed to its requested values! 
Also the other way around, putting the PSU of the "Prodesk 600 G1" inside the 
"compaq_8300_elite_sff" stops the PSU FAN during coreboot post, but running the 
OEM firmware, keeps the fan spinning and let it adjust to all requested values 
on its donor FAN. So it seems there is a certain PWM compatibility to control 
these FAN's in similar ways between these boards. It seems the the newer PSU 
FAN from the Haswell generation can actually disable / stop spinning on a 
certain PWM value while older FAN keep spinning on these lower/ same PWM values.

Compared to the [initial support 
commit](https://review.coreboot.org/c/coreboot/+/26050) by Patrick Rudolph, 
around April 2021 there were some 
[code](https://review.coreboot.org/c/coreboot/+/52511) 
[fixes](https://review.coreboot.org/c/coreboot/+/52671) but after that the last 
time this `psu_fan_lvl` code was verified functional was between 2023-05-02 and 
2023-07-03 noted in the [boardsupport 
commit](https://review.coreboot.org/c/coreboot/+/74906) of the variant 
`compaq_8300_elite_sff_usdt` by Riku Viitanen.

History for "coreboot/src/superio/nuvoton/npcd378" shows [6 
patches](https://github.com/coreboot/coreboot/commits/main/src/superio/nuvoton/npcd378)
 from november 2023 till today.

Any tips hints welcome.

---Files--------------------------------
compaq_8200_elite_sff.config (10.9 KB)
cblogs-psu_fan_lvl-PWM-compaq_8200_elite_sff.txt (350 KB)


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
https://ticket.coreboot.org/my/account
_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to