[In progress] SSDT for Thunderbolt 3 Hotplug

Discussion in 'SSDT' started by LeleTuratti, Mar 27, 2018.

  1. LeleTuratti

    LeleTuratti

    Joined:
    Aug 17, 2017
    Messages:
    140
    Motherboard:
    Z370 AORUS Ultra Gaming
    CPU:
    I7-8700K
    Graphics:
    GTX 970
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Mar 27, 2018 at 8:35 PM #1
    LeleTuratti

    LeleTuratti

    Joined:
    Aug 17, 2017
    Messages:
    140
    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!
    Simply remove the THB_C cable between your PCI-TB card and motherboard and use an SSDT.
    The complete guide for the X299 TB hotplug can be found in point E.9.3 of 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 <

    Some SSDTs (V1 and V2) could be cause reboot after shutdown, it is recommended to use Fix Shutdown in Clover.

    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.

    METHOD 1
    A) SSDT V1: Download
    Experimental SSDT to force the hotplug on TB port 1, works only with the THB_C cable connected.
    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.
    [​IMG]

    B) SSDT V2: Download
    Experimental SSDT to force the hotplug on TB port 1, works only with the THB_C cable connected.
    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.
    [​IMG]



    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:
    [​IMG]
    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!
    [​IMG]

    Because this happens you have 2 choices:
    1- Add these Arbitrary inject on Clover:
    [​IMG]
    The PciAddr is that of PXSX (See on your ioreg):
    [​IMG]

    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.
     
    de_kp, themacmeister, zzmadd and 11 others like this.

    Attached Files:

    Last edited: Aug 28, 2018
  2. canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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
    Mar 27, 2018 at 10:40 PM #2
    canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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.
     
  3. canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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
    Mar 28, 2018 at 2:11 PM #3
    canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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! :)
     
    ssprod and LeleTuratti like this.
    Last edited: Mar 28, 2018
  4. canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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
    Mar 29, 2018 at 4:30 AM #4
    canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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)
     
  5. LeleTuratti

    LeleTuratti

    Joined:
    Aug 17, 2017
    Messages:
    140
    Motherboard:
    Z370 AORUS Ultra Gaming
    CPU:
    I7-8700K
    Graphics:
    GTX 970
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Mar 29, 2018 at 3:57 PM #5
    LeleTuratti

    LeleTuratti

    Joined:
    Aug 17, 2017
    Messages:
    140
    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
     

    Attached Files:

  6. beelzebozo

    beelzebozo Super Moderator

    Joined:
    Mar 31, 2010
    Messages:
    3,754
    Motherboard:
    Main Build: ASUS z170-Deluxe
    CPU:
    i7 - 6700K
    Graphics:
    GTX 1080
    Mac:
    MacBook Pro
    Classic Mac:
    Power Mac
    Mobile Phone:
    iOS
    Mar 29, 2018 at 4:28 PM #6
    beelzebozo

    beelzebozo Super Moderator

    Joined:
    Mar 31, 2010
    Messages:
    3,754
    Motherboard:
    Main Build: ASUS z170-Deluxe
    CPU:
    i7 - 6700K
    Graphics:
    GTX 1080
    Mac:
    MacBook Pro
    Classic Mac:
    Power Mac
    Mobile Phone:
    iOS
    Can you attach iMac 17,1 ACPI tables if you don't mind in a zip file?
     
  7. canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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
    Mar 29, 2018 at 6:07 PM #7
    canyondust

    canyondust

    Joined:
    May 31, 2016
    Messages:
    474
    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
    Absolutely! Find them attached.
     
    beelzebozo likes this.

    Attached Files:

  8. Consigliere

    Consigliere

    Joined:
    Mar 28, 2011
    Messages:
    139
    Motherboard:
    Aorus z370 Gaming 5
    CPU:
    8700K
    Graphics:
    Aorus RX580 8GB
    Mac:
    iMac, MacBook Pro
    Mar 29, 2018 at 11:00 PM #8
    Consigliere

    Consigliere

    Joined:
    Mar 28, 2011
    Messages:
    139
    Motherboard:
    Aorus z370 Gaming 5
    CPU:
    8700K
    Graphics:
    Aorus RX580 8GB
    Mac:
    iMac, MacBook Pro
    Keep up the good work! So glad that people prioritise this a bit.
     
  9. buyjoey

    buyjoey

    Joined:
    Feb 9, 2012
    Messages:
    272
    Motherboard:
    GA-Z370 Aorus Gaming 7
    CPU:
    i7 8700k
    Graphics:
    Vega 64 Liquid cool
    Mac:
    iMac, MacBook Pro
    Mobile Phone:
    iOS
    Mar 30, 2018 at 6:18 AM #9
    buyjoey

    buyjoey

    Joined:
    Feb 9, 2012
    Messages:
    272
    Motherboard:
    GA-Z370 Aorus Gaming 7
    CPU:
    i7 8700k
    Graphics:
    Vega 64 Liquid cool
    Mac:
    iMac, MacBook Pro
    Mobile Phone:
    iOS
    Thank you!! hopefully working my Ultrafine 5k monitor after sleep.
     
    nmano likes this.
  10. zipb

    zipb

    Joined:
    Aug 25, 2012
    Messages:
    539
    Motherboard:
    Gigabyte Z170X-UD5-TH
    CPU:
    Intel i7 6700K
    Graphics:
    MSI AMD RX480/8GB
    Mac:
    MacBook Pro
    Classic Mac:
    Performa, Power Mac, PowerBook
    Mar 30, 2018 at 10:24 AM #10
    zipb

    zipb

    Joined:
    Aug 25, 2012
    Messages:
    539
    Motherboard:
    Gigabyte Z170X-UD5-TH
    CPU:
    Intel i7 6700K
    Graphics:
    MSI AMD RX480/8GB
    Mac:
    MacBook Pro
    Classic Mac:
    Performa, Power Mac, PowerBook
    Great! Proper Thunderbolt behaviour is the final frontier on my Hack.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice