Contribute
Register

HowTo: Real Thunderbolt HotPlug/HotSwap on the fly

Any news?
Yes I actually have hot swap working after booting with a drive attached. It all hinges on an SSDT and being able to use ioreg to customize the SSDT. I will grab mine at work toomorrow and post it.

Kevin
 
Yes I actually have hot swap working after booting with a drive attached. It all hinges on an SSDT and being able to use ioreg to customize the SSDT. I will grab mine at work toomorrow and post it.

Kevin
Hi Kevin and thanks for your reply. I have it working when I turn on a unit connected at startup but I have seen that there are many advances. Is it possible to have it working without a drive at boot, some way to force?
 
Hi, I have the ASRock Z270 Super Carrier. Can you please post the UEFI BIOS that has the unlocked thunderbolt settings? Also your EFI folder (minus your serial number), or PM me??



Want real Thunderbolt HotPlug/HotSwap on the fly while your Hackintosh is running? Well, than this might be your solution:

I have tested a lot of so promising Thunderbolt HotPlug SSDTs out there and none of them provide a working solution for me, so i decided to spend some time on a working solution for real Thunderbolt HotPlug/HotSwap, where you can change your Thunderbolt devices on the fly w/o restarting your Hackintosh every time you connect/change a device. Also this tutorial will work for motherboards with onboard Thunderbolt as well as for motherboards with Thunderbold Header connector.

Ok, lets start how to make it work:
as in many other threads the first thing you have to know is where your Thunderbolt hardware belongs in your ACPI path. To find out where it belongs, just open "IORegistryExlorer" while bootet normaly into macOS. Than search for some entrys like this:


Sample of ASRock Z270 Super Carrier​
Sample of ASRock Z370 Professional Gaming i7​


Just for explanation: ASRock Z270 Super Carrier used builtin/onboard Thunderbolt 3, while ASRock Z370 Professional Gaming i7 uses Thunderbolt Header and a GC Gigabyte Titan Ridge PCIe card for Thunderbolt 3. As you can see for the Z270 the ACPI path looks like RP01/PXSX, while ACPI path for Z370 looks like PEG2/PEGP. Rememeber these entrys for later modification when it comes to edit the Thunderbolt SSDT file.

Second: lets set the right BIOS settings for working Thunderbolt HotPlug/HotSwitch
Lets take a look at the default BIOS settings for the given two sample motherboards ASRock Z270/370. The following screenshots shows their default settings for Thunderbolt when you install their latest BIOS revisions:

ASRock Z270 Super Carrier BIOS 2.40​
ASRock Z370 Professional Gaming i7 BIOS 4.00​


These are all settings for Thunderbolt given by default from ASRock on their Motherboards. But there are even more settings for Thunderbolt within their BIOS files, which need to be "unlocked" first. After doing so, there might be a lot of more settings, like this:

ASRock Z270 Super Carrier all settings unlocked​
ASRock Professional Gaming i7 all settings unlocked​


To make HotPlug/HotSwap working for your motherboard, just look for similar settings in your BIOS for Thunderbolt and set them as shown in the above screens. Sorry, i could only provide screenshots from ASRock machines, cause i do not have any other manufacturer. The most importent settings you need are "Thunderbolt (TM) Force Power" (which not all boards will have) and "GPIO3 Force Pwr" (which i recognized allmost every manufacturer will have in their BIOS settings for Thunderbolt). Just set these two settings to "ENABLED". <--- otherwise HotPlug/HotSwap will not work as expected. Also important is to switch a setting called "AIC Location" from "NB PCIE D01F0" to "NB PCIE D01F2". Notice: on Z270 Super Carrier i had to set this setting from NB PCIE D01F0 to NB PCIE D01F2 while on the Z370 Professional Gaming i7 it was set to NB PCIE D01F02 by default. If all settings set as described, save your settings and restart your Hackintosh.

Third: prepare an SSDT for Thunderbolt to use with your Hackintosh. Place the SSDT file in the following location:


EFI/CLOVER/ACPI/patched

Attached to this tutorial you will find a sample SSDT (SSDT-10-TbtOnPch.aml), which we use to modify for our needs. Lets take a look at its code:

Code:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20161210-64(RM)
* Copyright (c) 2000 - 2016 Intel Corporation
*
* Disassembling to non-symbolic legacy ASL operators
*
* Disassembly of iASLI5x7qz.aml, Sun Sep  1 21:42:58 2019
*
* Original Table Header:
*     Signature        "SSDT"
*     Length           0x000002C8 (712)
*     Revision         0x02
*     Checksum         0x40
*     OEM ID           "APPLE "
*     OEM Table ID     "TbtOnPCH"
*     OEM Revision     0x00001000 (4096)
*     Compiler ID      "INTL"
*     Compiler Version 0x20161210 (538317328)
*/
DefinitionBlock ("", "SSDT", 2, "APPLE ", "TbtOnPCH", 0x00001000)
{
    External (_SB_.PCI0.RP01, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.RP01.PXSX, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.XHC_, DeviceObj)    // (from opcode)
    External (DTGP, MethodObj)    // 5 Arguments (from opcode)
    External (PXSX, DeviceObj)    // (from opcode)

    Scope (_SB.PCI0.RP01)
    {
        Scope (PXSX)
        {
            Name (_STA, Zero)  // _STA: Status
            Method (NTFY, 2, NotSerialized)
            {
                If (LEqual (Arg0, 0x02))
                {
                    Notify (\_SB.PCI0.RP01.UPSB.DSB0.NHI0, 0x02)
                }
            }
        }

        Device (UPSB)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Device (DSB0)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

                Device (NHI0)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    Name (_STR, Unicode ("Thunderbolt"))  // _STR: Description String
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        Return (0x0F)
                    }

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
                        {
                            Store (Package (0x0B)
                                {
                                    "AAPL,slot-name",
                                    Buffer (0x09)
                                    {
                                        "Built In"
                                    },

                                    "device_type",
                                    Buffer (0x19)
                                    {
                                        "Thunderbolt 3 Controller"
                                    },

                                    "model",
                                    Buffer (0x1E)
                                    {
                                        "GC Titan Ridge TB3 Controller"
                                    },

                                    "name",
                                    Buffer (0x0F)
                                    {
                                        "UPSB-DSB0-NHI0"
                                    },

                                    "power-save",
                                    One,
                                    Buffer (One)
                                    {
                                         0x00                                   
                                    }
                                }, Local0)
                            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                            Return (Local0)
                        }

                        Return (Zero)
                    }
                }

                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
                    {
                        Store (Package (0x06)
                            {
                                "model",
                                Buffer (0x0A)
                                {
                                    "UPSB-DSB0"
                                },

                                "name",
                                Buffer (0x0A)
                                {
                                    "UPSB-DSB0"
                                },

                                "PCIHotplugCapable",
                                One
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }

                    Return (Zero)
                }
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
                {
                    Store (Package (0x06)
                        {
                            "model",
                            Buffer (0x0A)
                            {
                                "UPSB"
                            },

                            "name",
                            Buffer (0x0A)
                            {
                                "UPSB"
                            },

                            "PCI-Thunderbolt",
                            One
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }

                Return (Zero)
            }
        }
    }
}

Remeber your ACPI values from part one of this tutorial? These values are now needed to make this SSDT work for your personal machine. You might notice that the sample SSDT file is from my ASRock Z270 Super Carrier, cause the used ACPI values are RP01/PXSX within our sample. So all you need to do, is to change the values RP01/PXSX used in this sample SSDT to your values. If you open the sample SSDT within "MaciASL" you will get linenumbers, so i tell you, for which line you have to edit the given values:

Line 23: External (_SB_.PCI0.RP01, DeviceObj)
Line 24: External (_SB_.PCI0.RP01.PXSX, DeviceObj)
Line 27: External (PXSX, DeviceObj) // (from opcode)
Line 29: Scope (_SB.PCI0.RP01)
Line 31: Scope (PXSX)
Line 38: Notify (\_SB.PCI0.RP01.UPSB.DSB0.NHI0, 0x02)

After you change these values to the values you found for your ACPI path, just save the so modified SSDT to the above given path, restart your Hackintosh and enjoy full working
HotPlug/HotSwap for all your Thunderbolt devices (also working for USB-C devices connected to your Thunderbolt ports).

Feedback on how it works for you is welcome. I might help as long as i can.

Regards,
Mork vom Ork
 
So how do I unlock hidden bios settings on ASRock motherboard?
 
@canyondust Did you ever get hot swap to work on your system? I have the same board as you and I haven't got it to work. Thanks!
I did, but with some weird caveats that made it a wash. Hotswap working, but cannot have devices plugged in during boot up or shutdown, and the computer would sometimes restart once shutdown. Progress is being made but a lot of stuff still needs figuring out. :)
 
Anybody figure out how to unlock the extra options in bios? I've googled and googled with no luck...
At one's own risk!

It's so easy.

Example (ASRock Z390 Phantom Gaming-ITX/ac 4.40, open GPIO3 Force Pwr):

First, get UEFITool 0.28.0 (No version Axx). Open bios in UEFITool.
Screen Shot 2020-06-29 at 12.59.50.png
Press Cmd+F, select Text Force Pwr.
After search you will get Force Pwr in Dxe driver Setup.
Screen Shot 2020-06-29 at 13.01.53.png

Press "Extract body" and select folder where you want save.

Get latest Universal-IFR-Extractor and run from terminal (if you use osx/linux).

Screen Shot 2020-06-29 at 13.07.03.png
Open example.txt file and search GPIO3 Force Pwr (this function for default is disabled).

In upper you can find condition showing function.

Screen Shot 2020-06-29 at 13.12.03.png

Copy this bytes 12 06 25 2B 00 00 and replace to 12 06 25 2B FF 00 use hex editor.

Screen Shot 2020-06-29 at 13.15.32.png
Press Replace All, then save.

Use UEFITool to replace Setup module
Screen Shot 2020-06-29 at 13.17.01.png
Then save file and rename to default name (Z39PGIX4.40).

Thanks.
 
At one's own risk!

It's so easy.

Example (ASRock Z390 Phantom Gaming-ITX/ac 4.40, open GPIO3 Force Pwr):

First, get UEFITool 0.28.0 (No version Axx). Open bios in UEFITool.
View attachment 478420
Press Cmd+F, select Text Force Pwr.
After search you will get Force Pwr in Dxe driver Setup.
View attachment 478421

Press "Extract body" and select folder where you want save.

Get latest Universal-IFR-Extractor and run from terminal (if you use osx/linux).

View attachment 478422
Open example.txt file and search GPIO3 Force Pwr (this function for default is disabled).

In upper you can find condition showing function.

View attachment 478423

Copy this bytes 12 06 25 2B 00 00 and replace to 12 06 25 2B FF 00 use hex editor.

View attachment 478424
Press Replace All, then save.

Use UEFITool to replace Setup module
View attachment 478425
Then save file and rename to default name (Z39PGIX4.40).

Thanks.
What format do I save the edited z39pgix4.40 file as (in uefitool)? I Tried both doc and .rom but instant flash said "secure flash check fail" for both. It failed and rebooted. Without any problem thank the lord.. What am I missing?
 
Last edited:
Back
Top