Contribute
Register

[In progress] SSDT for Thunderbolt 3 Hotplug

Joined
Aug 17, 2017
Messages
194
Motherboard
Z370 AORUS Ultra Gaming
CPU
I7-8700K
Graphics
GTX 970
Mac
MacBook Pro
Mobile Phone
iOS
Overview
The Thunderbolt hotplug is a problem that has existed for many years, and until now the only way to have working TB devices is to connect them and turn them on before boot.
Finally after a long time some progress has been made.

This is not a guide! But a starting point for further progress.

CHIPSET X299 - TB on PEG
Thunderbolt hotplug is fully supported!
The complete guide for the X299 TB hotplug can be found HERE in the @kgp guide.


OTHERS CHIPSET - TB on PCH
The hotplug has not yet been fully implemented for now, but considerable progress has been made.
ATTENTION:
All the next SSDTs are based on my ACPI paths (PCI0.RP05), if your paths are different you have to modify them inside the SSDT.
> If you're not familiar with this check the EXTRA part at the end of this post <


For many Gigabyte user with 300_Series chipsets, the hotplug now works perfectly!
Seems that the TB hotplug is BIOS-dependent.

What you need:
It is necessary to update/downgrade the BIOS to a specific version that shows this description:
  1. Update CPU microcode for upcoming CPU
  2. Improve windows boot time
For example for the GB Z370 Ultra Gaming is the F10.
BIOS GB_Z370_UG.png

Remember to clean the CMOS after bios update and use the appropriate settings for your OS.

At this point in the section Peripherals/Thunderbolt, use these settings:
IMPORTANT!! Do not change the settings inside the red square!! They could kill your PCI-TB card.
BIOS_TB_Settings.jpg

Save everything and boot your system. I suggest doing an NVRAM reset by pressing f11 on the clover screen.

Now download the SSDT TB from the kgp guide, or use the one pre-edited on this thread: DOWNLOAD SSDT-Z370-THB3HP
No other clover settings are needed. Reboot, et voilà!

Unfortunately I do not know if the new Titan Ridge works, because it requires a later BIOS version.
If you use a TB dock (with auto power off), turn off the ERP in the bios, otherwise it will not turn on automatically at boot, but you will be forced to disconnect and reconnect it.



There are other ways to have the hotplug, but they are incomplete..

METHOD 1
Experimental SSDT to force the hotplug on TB port 1
Works only with the THB_C cable connected.

I started by adapting the SSDTs used for the X299 chipset and by modifying some _DSM methods I got positive results.
For these changes I used the original Apple Thunderbolt SSDTs:
SSDT-Thunderbolt original iMac18,3 Download
SSDT-Thunderbolt original iMacPro Download

If you have only one Thunderbolt device you can use next two SSDT!
Both SSDTs add the PCI information to System info.
USB-C not tested, I do not know if it works correctly.
Both ssdt work up to the second device, the next ones are not disconnected/reconnected correctly.
These SSDTs (V1 and V2) could be cause reboot after shutdown, it is recommended to use Fix Shutdown in Clover.
A) SSDT V1: Download
No arbitrary inject in Clover are needed.
I inserted the "PCI-Thunderbolt One" _DSM Method on DSB1 and in this way you can hotplug one device at a time.
Precisely this is what happens:
STEP 1: UAD-2 Satellite and Apollo Twin connected and turned on at boot time.
STEP 2: I turned off and then turned on the only the Apollo Twin, which was reconnected properly.
STEP 3: I turned off and on both devices, but only the first (UAD-2 Satellite) connected correctly.


B) SSDT V2: Download
No arbitrary inject in Clover are needed.
This is similar to the SSDT V1, but I added the "PCIHotplugcapable Zero" _DSM Method on DSB2 (like in iMac18,3 and iMacPro).
STEP 1: UAD-2 Satellite and Apollo Twin connected and turned on at boot time.
STEP 2: I turned off and on both devices, but only the first (UAD-2 Satellite) connected correctly, while the Apollo Twin is not recognized correctly.
The addresses of the devices change, in fact they are mixed in a strange way on IOReg.


METHOD 2 (without THB_C cable): SSDT below
PREMISE: This method is only applicable to those using a PCI-Thunderbolt card and it can be useful to those who use a TB dock because it requires a device connected and turned on at boot.
Based on a discovery made by @crismac2013, I removed the THB_C cable from my GC-Alpine Ridge and something strange happened.
If you turn on the computer without Thunderbolt devices connected the PCI-TB card is not loaded, see Ioreg:

But if I have a device connected and turned on before boot the PCI card is recognized and loaded correctly, but not only, in this way you have the hotplug of all devices!


Because this happens you have 2 choices:
1- Add these Arbitrary inject on Clover:

The PciAddr is that of PXSX (See on your ioreg):


2- Or use this SSDT without Arbitrary inject: SSDT V3 Download
This solution is preferable because in this way the connected devices are shown correctly on System Info under PCI.

To succeed try these steps:
1- With your computer turned off, remove the THB_C cable.
2- Boot, enable Fix Shutdown* in Clover and add the SSDT
3- Turn off the computer
4- Connect the TB dock (The TB docks are equipped with auto power off, check that once connected it will turn on -green LED-)
5- Wait few seconds and turn on the computer
Now you should have the hotplug of all TB devices.

*I noticed that with Fix Shutdown the computer is not totally switched off, the USB and TB devices remain on.

The main problem is that when the TB is shared in the PCH lines it is not loaded by the system without THB_C cable, unlike those who have the TB under the PEG lines.

Obviously this is not a solution, but it makes clear that the problems with the TB hotplug derive from the functions that add the THB_C cable, so we are faced with two ways:
1- Finding the way to make the PCI card load from the system even without a connected THB_C cable
2- Understand what features this cable provides and whether it can be found in ACPI paths to include it in the SSDT. This would solve the problem for everyone.

>> Anyone who discovers something new that can help, is invited to share it possibly by inserting IOREG or any other data that can help to better understand <<


______________________________
ADDITIONAL HELPFUL INFORMATION



EXTRA:
An idiot mini guide to change the SSDTs ACPI path correctly :thumbup:

Download IORegistryExplorer.app (search on the web)
Download the last MaciASL.app from Rehabman repository: Download

Open your IOReg and type "Thunderbolt" in search bar in IOService view.
IOReg search.png

If your ACPI paths are different from mine (PCI0 and RP05) you will need to replace them.
Then open your SSDT with MaciASL and go to Edit > Find > Find and Replace
Check that they are correct and click on All (I entered RP09 as an example).
Do the same thing also with PCI0 if it is different from mine.
MaciASL edit.png

When you have replaced all ACPI paths, save and exit.
 

Attachments

Last edited:
Joined
May 31, 2016
Messages
619
Motherboard
Z170X-UD5 TH
CPU
6700K
Graphics
GTX1080 (Asus ROG Strix)
Mac
iMac, MacBook, MacBook Pro, Mac mini
Classic Mac
PowerBook, Quadra
Mobile Phone
iOS
Great work!
I'll test this on my Z170 (which also has TB3 at RP05/IOPP/PXSX/) and let you know how it goes.
 
Joined
May 31, 2016
Messages
619
Motherboard
Z170X-UD5 TH
CPU
6700K
Graphics
GTX1080 (Asus ROG Strix)
Mac
iMac, MacBook, MacBook Pro, Mac mini
Classic Mac
PowerBook, Quadra
Mobile Phone
iOS
Here's my system (17,1 SMBIOS) with SSDT-B vs real iMac (17,1)
Hopefully this information is useful
Hack17_1.jpg
Real17_1.jpg

Furthermore: with SSDT-B, Devices show up if plugged in before boot (as before), but the system recognizes when they've been disconnected, but not reattached. (First time this has happened) so that's good progress. 1/2 way there! :)
 
Last edited:
Joined
May 31, 2016
Messages
619
Motherboard
Z170X-UD5 TH
CPU
6700K
Graphics
GTX1080 (Asus ROG Strix)
Mac
iMac, MacBook, MacBook Pro, Mac mini
Classic Mac
PowerBook, Quadra
Mobile Phone
iOS
had a closer look at the real iMac17,1 vs my Hack, and noticed there is a difference in IOPowermanagement>Capability Flags, and the NVMs are different (but that's probably true)

RealData.jpg
hackdata.jpg

Not sure if that means anything (my test devices is a BlackMagic Decklink Minimonitor (TB to HDMI/HD-SDI output)
 
Joined
Aug 17, 2017
Messages
194
Motherboard
Z370 AORUS Ultra Gaming
CPU
I7-8700K
Graphics
GTX 970
Mac
MacBook Pro
Mobile Phone
iOS
I do not know your interface, but with the Thunderbolt devices I made comparisons with my MacBookPro9.1

IOReg Z370 Gigabyte - Alpine Ridge with SSDT B: IOReg SSDT.zip
IOReg MacBookPro9.1 with devices connected and turned on, then off and on again: MacBook Pro Device OFF-ON.zip

In the Macbook you notice different voices like Thunderbolt Path and Thunderbolt Entry ID.

Someone with good skills in SSDT would be very helpful! I do not know if @apfelnico can help us
 

Attachments

beelzebozo

Super Moderator
Joined
Mar 31, 2010
Messages
3,807
Motherboard
Main Build: ASUS z170-Deluxe
CPU
i7 - 6700K
Graphics
GTX 1080
Mac
MacBook Pro
Classic Mac
Power Mac
Mobile Phone
iOS
had a closer look at the real iMac17,1 vs my Hack, and noticed there is a difference in IOPowermanagement>Capability Flags, and the NVMs are different (but that's probably true)

View attachment 321459
View attachment 321460

Not sure if that means anything (my test devices is a BlackMagic Decklink Minimonitor (TB to HDMI/HD-SDI output)
Can you attach iMac 17,1 ACPI tables if you don't mind in a zip file?
 
Joined
Feb 9, 2012
Messages
319
Motherboard
Razer Blade Stealth
CPU
i7-8565U
Graphics
UHD 620, 1920 x 1080
Mac
iMac, MacBook Pro
Mobile Phone
iOS
Thank you!! hopefully working my Ultrafine 5k monitor after sleep.
 
Top