playing with _TZ
avg at icyb.net.ua
Sun Mar 2 13:26:06 UTC 2008
I did what is described here a few years ago.
My primary drive was to reduce noise level from a CPU fan when a machine
was idle. This idea came to my mind when I was reading W83783S
specification and noticed that the chip supports PWM control of fan speed.
Also, while reading ACPI specification I came to understand that there
are different approaches to active cooling. ACPI framework is built on a
model where there are several fans and more of them get activated as
more cooling is needed. But it is certainly possible to emulate those
ACPI fans by setting different speed levels of a single fan. E.g. see
section 10.6 of ACPI 2.0 specification.
So this is what I decided to implement.
In addition I decided to implement hysteresis as described in section
22.214.171.124 of the same specification.
Also, I added a "RO" thermal zone to report chipset temperature.
Finally I fixed all iasl compiler warning, dropped some unused code and
added some comments.
Of great help in this process were:
1. ACPI specification, for understanding Thermal Zone and ASL language
(it is quite simple assembler-like one, but you still need a reference
to understand some methods, be sure of operand order, etc.
2. mbmon code to see how it reads certain measurements via SMB,
specifically for the HWM chip that I have
3. HWM chip W83783S specification, to understand details of what it can
do and how
4. PIIX4 specification, to understand SMB controller operation
Also, through experiments I determined some details about how W83783S
was wired on my motherboard. For example, the chip has the following
pins related to fan control:
3. FAN3-IN / PWM1-OUT
4. PWM2-OUT / SCI
So some pins can be wired and configured for different functions. My
motherboard (MP2-BX-X) has 3 fan connectors, one specifically designated
for CPU fan.
Turned out that FAN1-IN and PWM1-OUT are used to measure and regulate
speed of the CPU fan.
FAN2-IN reads speed of the first chassis fan.
PWM2-OUT / SCI is configured to generate SMI. So the for third fan we
can not neither nor control speed.
I had to play quite a lot to determine the above. Also through the
experiments I established a relation between PWM register value (0-0xff)
and actual fan RPM speed (mbmon was of great help, as well as a small
utility too read/write arbitrary registers of W83783S via SMB).
Various temperature levels were also chosen through experiments and
Here are the links to to the original and hacked DSDT ASLs:
Side-by-side diff would most probably be the most informative.
Here's an example of hw.acpi.thermal:
hw.acpi.thermal.tz0._ACx: 60.0C 53.0C 38.0C -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz1._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
BIG WARNING: should you ever decide to try to implement something like
what I did on your system, you must understand that you can damage or
destroy your hardware, or even come to personal harm. You must be very
careful. You must be able to physically observe/monitor your hardware
and you must be able interrupt your tests/experiments very quickly.
You must know your hardware very well, you must know ACPI Thermal
specification very well. You should not try any experiments if your
hardware can not withstand some overheating for some time.
I take no responsibility for any damage to your hardware or any personal
harm that may result for your trying to follow my example.
More information about the freebsd-acpi