Patching ACPI
December 2, 2019 ยท View on GitHub
Once the native LC is disabled through either ThunderboltReset or native NVM patches, you need custom ACPI entries to support power management (including S3hot) and hot-plug.
New Board
Start by making a copy of the closest board config in ThunderboltNative and
name it SSDT-TbtOnPCH-TARGETNAME.asl.
There are a list of defines near the top of the file that must be changed:
TBT_HOTPLUG_GPE: details in the next sectionTBT_ROOT: Root device path for TB controller. Useioregand find the PCI device that connects to aAppleThunderboltHAL.TBT_HAS_COMPANION: Companion device used only for power saving on boards that support it. Safe to always disable.XHC_ROOT: Only used with companion device. Path to XHCI controller where the companion ports are connected to.TBT_USB_PORT_1_COMPANION: Only used with companion device. First port number.TBT_USB_PORT_2_COMPANION: Only used with companion device. Second port number.
Finding GPE
- Have Thunderbolt working either with the ThunderboltReset plugin or patched NVM.
- Install RehabMan's ACPI logger.
- Dump your DSDT/SSDT tables and find all methods with names beginning with
_Land_E. - Modify the template in
ThunderboltNative/SSDT-HPLog.aslwith your GPE candidates. - Build and install
ThunderboltNative/SSDT-HPLog.asl. - Add the ACPI patches to your config.plist renaming all the different
_Lxxand_Exxmethod names toXLxxandXExxwherexxis each GPE number. - Reboot with a TB device plugged in.
- Open a Terminal and type in
log stream --process 0 | grep ACPI - Unplug and re-plugin the TB device
- Look at the Terminal window to see which GPE is printed. That is your hotplug GPE.
- You can delete all the ACPI patches from config.plist except for the hotplug GPE.
Building ACPI
Have iasl in your PATH and run make TARGET=TARGETNAME in
ThunderboltNative.