Open Qonfused opened 1 year ago
It seems that the ST98
EC method controls the maximum allowed fan RPM; technically this is how fan speed is actually changed.
CPU fan control (WMND, IIA0=0x00110013):
55455 | If ((IIA0 == 0x00110013))
55456 | {
55457 | Local0 = ^^PCI0.LPCB.EC0.RRAM (0xCC, 0x30)
55458 | If ((IIA1 == Zero))
55459 | {
55460 | Local1 = (Local0 & 0xFFFFFFFFFFFFFFBF)
55461 | }
55462 | ElseIf ((IIA1 == One))
55463 | {
55464 | Local1 = (Local0 | 0x40)
55465 | }
55466 |
55467 | ^^PCI0.LPCB.EC0.WRAM (0xCD, 0x30, Local1)
55468 | Return (One)
55469 | }
^^ This appears to toggle max fan rpm.
(WMND, IIA0=0x00110019):
55176 | If ((IIA0 == 0x00110019))
55177 | {
55178 | If ((FANF == One))
55179 | {
55180 | Return (0x00010001)
55181 | }
55182 | Else
55183 | {
55184 | Return (0x00010000)
55185 | }
55186 | }
...
55428 | If ((IIA0 == 0x00110019))
55429 | {
55430 | FANL (IIA1)
55431 | Return (One)
55432 | }
Probably also need to remove the SMCSuperIO.kext if it isn't actually doing anything.
I'll close this issue for now as there is no VirtualSMC support for controlling these fans (albeit there may be FakeSMC support). It may also be possible within AsusSMC to extend the current fan control by polling/listening for ACPI events, which I'll revisit once that implementation becomes clearer.
May be worth revisiting as ITE SuperIO support was added in VirtualSMC recently:
Embedded ITE chip:
@Qonfused EC fan writing isn't allowed in it yet, I'm unsure if EC fan reading even works I just left it because it already was
Also now that VirtualSMC has classes relating to fan speed control it should be easy to add speed writing to the already existing laptop EC support (see Embedded controllers.md in Docs)
Hi.
_TMP
method seems to wait 5 loops if the temperature exceeds the threshold of TCRT
to return the current temperature.
Critical temperature method _CRT
calls RCRT
which reads the critical value from ECRT
and stores the value in TCRT
.
And DEVS
0x110013
seems to set fan mode to auto, manual, or full speed if this is translated to newer Zenbook variants. Traditionally, the offsets were at 0x521
, but for your laptop it seems to be at 0x30
. You can check by calculating bitwise operations with 0x85
, 0x35
, and 0xC5
as they circle among themselves.
My old laptop X510UAR doesn't have FANL
or FANF
, which I guess is used by MyASUS for fan adjustment in newer laptops. But in your DSDT they end up calling DGPS
which interacts with RP05.PEGP
, which I believe is the DGPU, which is to be turned off.
You can use the traditional fan mod SSDT (originally by black.dragon74, now in hiep's Clover branch of Asus Zenbook repo) with ACPIPoller.kext seeing how it doesn't use low-level offsets but high-level methods. It does mod your fan speeds, although I haven't thoroughly tested it now that I think it has some errors. Or if you want to change the offsets from 0x521
to 0x30
and test experimental fan mod I recovered in AsusSMC, please see https://github.com/hieplpvip/AsusSMC/issues/114 and https://github.com/yjmd2222/AsusSMC.
Exceptional work on your hack! I enjoyed reading your development.
This is mainly relevant for the UX481FA/FL since the UX581/UX582 models have a media key + native ACPI implementation for toggling thermal policy. For all models, both (2) fans are controlled by the BIOS + embedded controller, though cooling policy is still configurable via ACPI methods as hinted by the system control driver used by MyASUS.
RW-Everything on Windows should show what EC registers are actually being used for fan control, however there should be more standard ACPI methods called by the system control driver (which you should always use rather than writing to EC registers directly).
Below are some observations that may clue into the native ACPI implementation of this:
\_TZ_.RTMP
reads and stores the current CPU temperature.ECPU
EC method reads the current CPU temperature._TMP
method of theTHRM
thermalzone, which should shed some light on how cooling policy is configured.\_TZ_.RFAN
method (in the same scope) is responsible for reading the fan speed.ECAV
EC method checks if the embedded controller is available/ready, otherwise the method aborts with value zero.ST83
EC method outputs byte values for a given fan idx (range appears to be between 0x00 and 0xFF)TACH
EC method outputs the RPM from a tachometer for a given fan idx (appears to max at 6000 RPM).FANF
variable.