Qonfused / ASUS-ZenBook-Duo-14-UX481-Hackintosh

OpenCore configuration for the ASUS ZenBook Duo 14" (UX481FA/FL)
https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh
BSD 3-Clause "New" or "Revised" License
29 stars 1 forks source link

Add fan control w/ native fan impl on macOS #37

Open Qonfused opened 1 year ago

Qonfused commented 1 year ago

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:

Qonfused commented 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.

Qonfused commented 1 year ago

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 | }
Qonfused commented 1 year ago

Probably also need to remove the SMCSuperIO.kext if it isn't actually doing anything.

Qonfused commented 1 year ago

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.

Qonfused commented 1 year ago

May be worth revisiting as ITE SuperIO support was added in VirtualSMC recently:

Embedded ITE chip:

image image

xCuri0 commented 1 year ago

@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

xCuri0 commented 1 year ago

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)