Based on goodwin's post I wrote a driver: IOElectrify.
In short IOElectrify interfaces with the ACPI WMI interface to call the Intel Thunderbolt force-power method identified by the guid. It ensures force-power is enabled on wake and disabled on sleep.
With this configuration AppleThunderboltHAL attaches to the Thunderbolt controller successfully. Additionally AppleThunderboltHAL successfully initializes AppleThunderboltNHIType3 (Correct for Alpine Ridge 2C) as well as the IOThunderboltController, IOThunderboltLocalNode and IOThunderboltPort.
There seems to be no requirement for the device to be named NHI0 or FakePCI to force matching of PCI identifiers.
Note that I have no devices to test the Thunderbolt functionality. Hopefully someone can test if Thunderbolt connectivity works as expected.
From the USB-C side of things, force powering the Intel Thunderbolt controller has some positive side-effects (no more Express card icon).
The following things are working now out of the box (after fixing the recursive mutex issue in XPS 9360 ACPI):
- Booting with USB-C adapter connected
- USB-C hotplug at any time after boot
- Sleeping and returning from sleep successfully with USB-C connected
- Sleeping, unplugging and replugging before wake-up
The remaining main issues are:
- Booting without USB-C device connected. In this case the entire Intel Thunderbolt controller is powered down.
Either ACPI needs to be modified to power the device successfully and/or IOElectrify extended with IOElectrifyBridge to force the Thunderbolt IOPCI2PCIBridge to rescan after ACPI code has initialized the device.
IOElectrifyBridge could listen for the _E42 GPE event from the ACPI to determine when to re-probe the bus.
- Returning without USB-C device from sleep. _E42 GPE event is triggering when plugging in a device, but either ACPI is not successfully enabling the Thunderbolt controller or macOS does not rescan the PCI bus properly.
In short, next steps would involve either a fix on ACPI side or listening to ACPI Thunderbolt hotplug events and causing macOS to re-scan the PCI bus/reconfigure the PCI bus as hot-pluggable.
Hotplug support seems to be there in macOS in some capacity.
IOElectrify source code and v0.0.1 precompiled kext can be found here:
https://github.com/the-darkvoid/macOS-IOElectrify/