To create a model configuration file for NBFC-Linux, you will need to analyze
the DSDT of your ACPI firmware to discover the registers and methods for controlling the fan.
This guide walks you through:
Install required programs / modules
Install the following programs / modules
stress
-- to stress the systems so fans spin upacpica
-- for disassembling the DSDTacpicall
-- for invoking ACPI methods (viaec_probe
)
Operating System | Command |
---|---|
Arch Linux | sudo pacman -S acpica acpi_call stress |
Debian (Bookworm) | sudo apt install acpica-tools acpi-call stress |
Fedora 42 (Adams) | sudo dnf install acpica-tools acpi_call stress |
OpenSuse (Tumbleweed) | sudo zypper install acpica acpi_call stress |
Extracting the Firmware
Extract the binary ACPI tables
This will create the file dsdt.dat
sudo cat /sys/firmware/acpi/tables/DSDT > dsdt.datGenerate the DSL file
This will create the file dsdt.dsl
. You can view it with your favourite text editor.
iasl -d dsdt.dat
Analyzing the firmware
Get a list of ACPI methods
acpiexec -b Methods dsdt.datExample Output
[...] \_SB.PC00.LPCB.EC0._REG Method 0x5e8056d96f60 001 Args 2 Len 002D Aml 0x7564f4170c19 \_SB.PC00.LPCB.EC0.CMDW Method 0x5e8056d97050 001 Args 2 Len 004E Aml 0x7564f4170c4e \_SB.PC00.LPCB.EC0.FANG Method 0x5e8056da2610 001 Args 1 Len 0009 Aml 0x7564f4171377 \_SB.PC00.LPCB.EC0.FANW Method 0x5e8056da2780 001 Args 2 Len 0008 Aml 0x7564f4171387 \_SB.PC00.LPCB.EC0.TUVR Method 0x5e8056da9940 001 Args 1 Len 0003 Aml 0x7564f4171396 \_SB.PC00.LPCB.EC0.THRO Method 0x5e8056da9a30 001 Args 1 Len 0005 Aml 0x7564f41713a0 \_SB.PC00.LPCB.EC0.CLCK Method 0x5e8056da9b20 001 Args 1 Len 0024 Aml 0x7564f41713ac \_SB.PC00.LPCB.EC0.PCLK Method 0x5e8056da9c10 001 Args 0 Len 0004 Aml 0x7564f41713d7 \_SB.PC00.LPCB.EC0.ITHR Method 0x5e8056da9d00 001 Args 1 Len 0026 Aml 0x7564f41713e2 \_SB.PC00.LPCB.EC0.IPCL Method 0x5e8056da9df0 001 Args 0 Len 0010 Aml 0x7564f417140f [...]
Get a list of registers
acpiexec -b 'Objects RegionField' dsdt.datExample Output
[...] \_SB.PC00.LPCB.EC0.ERIB RegionField 0x60093e6470b0 001 Rgn [ECMM] Off 2E8 Len 10 Acc 01 \_SB.PC00.LPCB.EC0.SMST RegionField 0x60093e647120 001 Rgn [ECMM] Off 308 Len 08 Acc 01 \_SB.PC00.LPCB.EC0.SMAD RegionField 0x60093e647190 001 Rgn [ECMM] Off 310 Len 08 Acc 01 \_SB.PC00.LPCB.EC0.SMCM RegionField 0x60093e647200 001 Rgn [ECMM] Off 318 Len 08 Acc 01 \_SB.PC00.LPCB.EC0.SMD0 RegionField 0x60093e647270 001 Rgn [ECMM] Off 320 Len 100 Acc 01 \_SB.PC00.LPCB.EC0.BCNT RegionField 0x60093e6472e0 001 Rgn [ECMM] Off 420 Len 08 Acc 01 \_SB.PC00.LPCB.EC0.SMAA RegionField 0x60093e647350 001 Rgn [ECMM] Off 428 Len 18 Acc 01 [...]
Finding Methods And Registers
When reading your DSDT, try to identify registers and methods with names like:
Registers:
CFAN
,
PFAN
,
FAN1
,
FSW1
Methods:
FANG
,
FANW
,
GFSD
,
SFSD
Probing Registers And Methods
You can access EC registers and invoke ACPI methods using the ec_probe
tool:
Reading a register
sudo ec_probe read 0xD6
For a two-byte register:
sudo ec_probe read -w 0xD6
Writing to a register
sudo ec_probe write 0xD7 0x0
For a two-byte register:
sudo ec_probe write -w 0xD7 0xDEAD
Calling ACPI methods
You can also invoke ACPI methods:
sudo ec_probe acpi_call '\_SB.PCI0.LPCB.EC0.GFSD'
With arguments:
sudo ec_probe acpi_call '\_SB.PCI0.LPCB.EC0.SFSD' 100
Examples
Below are real-world examples, along with a detailed explanation of how the configuration files were created.
Model | Registers | Methods |
---|---|---|
HP Laptop 17-bs0xx | FAN1 (read), FSW1 (write), FSH1 (misc) | |
HP 620 | CFAN (read), PFAN (write) |