Contribute
Register

[In progress] SSDT for Thunderbolt 3 Hotplug

Joined
Feb 4, 2011
Messages
66
Motherboard
Gigabyte GA-Z170N-WiFi
CPU
i7-6700K
Graphics
GT 640
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android
Hello all.
I know this thread is mostly about thunderbolt 3 on desktop but I'm hoping someone here can guide/help me with making the Type-C USB3.1 Gen2/Thunderbolt 3 work non ASUS Zenbook Pro UX580GE.

The USB3.1 Gen2/Thunderbolt 3 IC is "JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] with hardware ID: 8086:15D4.

The USB 2.0 is routed to the other USB3.1 Gen2 IC (8086:A36D) and they are working (hotplug, power ...)

If I start the laptop with no device connected to the 2 USB3/TB3 ports there the IC is not shown in IOReg and no USB3 device is detected but USB2 are (as they are routed to the other USB IC).

If I start the laptop with USB 3 flash drive connected to the 2 USB3/TB3 ports they appear in IOReg and the device gets mounted but if I remove and reconnect the device is no longer detected (so no hotplug).

I've read all the posts related to Thunderbolt 3 power/hot plug and most of them refer to USB3/TB3 on desktop configs and the ones I found for laptops are already compiled SSDTs with nothing in common with my config so I cant figure it out on how to do it on this platform.

Any help/hints are welcome

Attached is my debug dump with a dongle connected to USB3/TB3 port so the IC is shown in IOReg.
 

Attachments

Joined
Apr 5, 2016
Messages
899
Motherboard
GIGABYTE Z170X-Gaming 7
CPU
i7-6700K
Graphics
GTX TITAN X
Mac
iMac, MacBook, MacBook Air, MacBook Pro, Mac mini, Mac Pro
Classic Mac
Apple, LC, Power Mac
Mobile Phone
iOS
Hello all.
I know this thread is mostly about thunderbolt 3 on desktop but I'm hoping someone here can guide/help me with making the Type-C USB3.1 Gen2/Thunderbolt 3 work non ASUS Zenbook Pro UX580GE.

The USB3.1 Gen2/Thunderbolt 3 IC is "JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] with hardware ID: 8086:15D4.

The USB 2.0 is routed to the other USB3.1 Gen2 IC (8086:A36D) and they are working (hotplug, power ...)

If I start the laptop with no device connected to the 2 USB3/TB3 ports there the IC is not shown in IOReg and no USB3 device is detected but USB2 are (as they are routed to the other USB IC).

If I start the laptop with USB 3 flash drive connected to the 2 USB3/TB3 ports they appear in IOReg and the device gets mounted but if I remove and reconnect the device is no longer detected (so no hotplug).

I've read all the posts related to Thunderbolt 3 power/hot plug and most of them refer to USB3/TB3 on desktop configs and the ones I found for laptops are already compiled SSDTs with nothing in common with my config so I cant figure it out on how to do it on this platform.

Any help/hints are welcome

Attached is my debug dump with a dongle connected to USB3/TB3 port so the IC is shown in IOReg.
Is there a force power Thunderbolt setting in the laptop bios?
 
Joined
Feb 4, 2011
Messages
66
Motherboard
Gigabyte GA-Z170N-WiFi
CPU
i7-6700K
Graphics
GT 640
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android
Unfortunately no.
It has a minimal set of options and for Thunderbolt 3 it has only the security options as it can be seen in attached screenshot
P_20200306_223745.jpg

But if I open the bios file I have the following hidden options
Screen Shot 2020-03-06 at 10.44.57 PM.png
Screen Shot 2020-03-06 at 10.45.21 PM.png
Screen Shot 2020-03-06 at 10.45.45 PM.png
Screen Shot 2020-03-06 at 10.45.59 PM.png
Screen Shot 2020-03-06 at 10.46.06 PM.png

I can do a BIOS mod if it is required but I'd prefer to have stock BIOS and go with ACPI patching.

During my research I found a post regarding Thunderbolt 3 power but it refers to _PS0 method that I do not have inside _SB.PCI0.RP21 where the thunderbolt definition can be found on this laptop plus NHI0 device inside DSB0 and that chain I do not have and cant find a reference on what is the relation between that ACPI chain and the one this laptop has.
 
Last edited by a moderator:
Joined
Apr 5, 2016
Messages
899
Motherboard
GIGABYTE Z170X-Gaming 7
CPU
i7-6700K
Graphics
GTX TITAN X
Mac
iMac, MacBook, MacBook Air, MacBook Pro, Mac mini, Mac Pro
Classic Mac
Apple, LC, Power Mac
Mobile Phone
iOS
Unfortunately no.
It has a minimal set of options and for Thunderbolt 3 it has only the security options as it can be seen in attached screenshot

But if I open the bios file I have the following hidden options
What's the name of the exe that lets you see the hidden options? In macOS, I use UEFIExtract and Universal IFR Extractor.

I can do a BIOS mod if it is required but I'd prefer to have stock BIOS and go with ACPI patching.

During my research I found a post regarding Thunderbolt 3 power but it refers to _PS0 method that I do not have inside _SB.PCI0.RP21 where the thunderbolt definition can be found on this laptop plus NHI0 device inside DSB0 and that chain I do not have and cant find a reference on what is the relation between that ACPI chain and the one this laptop has.
BIOS mod might be the easiest way.
Another option would be to use ifrextract, find where the GPIO3 Force Pwr option is saved, then search output of uefiextract for efi drivers that read from that location to see how it forces power. That might not be necessary if GPIO3 is a specific GPIO with a standard method for modifying it (there may be Linux or Acpi or EFI code that does that).
 
Joined
Feb 4, 2011
Messages
66
Motherboard
Gigabyte GA-Z170N-WiFi
CPU
i7-6700K
Graphics
GT 640
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android
What's the name of the exe that lets you see the hidden options? In macOS, I use UEFIExtract and Universal IFR Extractor.
The screen shots are from AMIBCP done in Windows. I do not know of an app that dose the same thing for MacOS.

BIOS mod might be the easiest way.
True, but the manufacturer rolls out new updates to improve some of the features this laptop has and then I need to do them all over again.

Another option would be to use ifrextract, find where the GPIO3 Force Pwr option is saved, then search output of uefiextract for efi drivers that read from that location to see how it forces power. That might not be necessary if GPIO3 is a specific GPIO with a standard method for modifying it (there may be Linux or Acpi or EFI code that does that).
Thanks for the hints. I will ding into this and see what I can find. On the post I was talking about it did not say what tools were used to find the data used in making the DSDT patch.

From what I see it seems that this controller is detected under Linux so I will also look into the kernel source code and see what I can find.
 
Joined
Feb 26, 2020
Messages
3
Motherboard
X1 Carbon 6th
CPU
i7-8550U
Graphics
UHD620
Hello all.
I know this thread is mostly about thunderbolt 3 on desktop but I'm hoping someone here can guide/help me with making the Type-C USB3.1 Gen2/Thunderbolt 3 work non ASUS Zenbook Pro UX580GE.

The USB3.1 Gen2/Thunderbolt 3 IC is "JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] with hardware ID: 8086:15D4.

The USB 2.0 is routed to the other USB3.1 Gen2 IC (8086:A36D) and they are working (hotplug, power ...)

If I start the laptop with no device connected to the 2 USB3/TB3 ports there the IC is not shown in IOReg and no USB3 device is detected but USB2 are (as they are routed to the other USB IC).

If I start the laptop with USB 3 flash drive connected to the 2 USB3/TB3 ports they appear in IOReg and the device gets mounted but if I remove and reconnect the device is no longer detected (so no hotplug).

I've read all the posts related to Thunderbolt 3 power/hot plug and most of them refer to USB3/TB3 on desktop configs and the ones I found for laptops are already compiled SSDTs with nothing in common with my config so I cant figure it out on how to do it on this platform.

Any help/hints are welcome

Attached is my debug dump with a dongle connected to USB3/TB3 port so the IC is shown in IOReg.
Hi, did you try IOElectrify.kext?
With this kext and SSDT-TB3.aml, I have hotplug working for TB3, even when no device is plugged during boot.
However, the cpu cant get into idle state. Its known issue, but it results in 50% less battery life with my X1 Carbon.
Because I dont even have any TB3 device, just USB-C dock, I would prefer to disable TB3 controller and use pure USB-C, but I cant get that working.

I have an option in bios to put TB3 into assisted mode (supposed for pre-Win10 and Linux) which makes TB3 disabled in OS-X, but USB-C dock works only when plugged during boot. After it is plugged out, it is no longed recognized, so no hotplug, only USB2 part.

I will be grateful for any advice.
And sorry for my English...
 
Joined
Feb 4, 2011
Messages
66
Motherboard
Gigabyte GA-Z170N-WiFi
CPU
i7-6700K
Graphics
GT 640
Mac
MacBook Air, MacBook Pro
Mobile Phone
Android
@lubixxx96 thank you for pointing that out.

I've looked into the code of IOElectrify and found some bits of code that helped me understands how to find the power methods for thunderbolt in my config.

The fact that thunderbolt is permanently powered under MacOS is not a good thing for battery so I'm thinking of another approach to this but I have to read ACPI documentation to see if it is possible to create a fake/virtual PCI device that is available to MacOS (via SSDT with ot without a helper kext) and that routes requests from/to real device and in process of doing that it powers the real device and keeps it powered as long as it is used. The idea is that the virtual device is always on so there will not be an issue with the MacOS and when a device is connected to the physical device then the data is forwarded to MacOSX via virtual device.

For sure there is an interrupt call that gets triggered when a device is connected but i need to find that entry point in ACPI callback table.
 
  • Like
Reactions: dez
Joined
Jul 8, 2016
Messages
20
Motherboard
Gigabyte GA-X99-Designare EX
CPU
Intel i7 6950x
Graphics
EVGA Nvidia Geforce 1050ti
Mac
Mac Pro
I am posting in hopes someone might be able to offer some advise.
I am running Mojave 10.14.6 on a GA-X99-Designare EX mobo with a Gc titan ridge flashed with DSM2's firmware.
My issue I believe it has to do with the pci bridges on this board. Thunderbolt functions but no hotswap when I try to place the ssdt with my specific values.

As you can see here the controller is behind 2 pci bridges and PXSX does not exist.

Without SSDT.png

My card is at RP01 but without PXSX the SSDT won't work. So in the ssdt I renamed the first pci-bridge0 to PXSX.
Now with the ssdt in place, it appears the path in IO reg is half of what it should be and doesn't follow through with DSB0 and NHI0.

WIth TB SSDT.png

If anyone is willing to help I have attached a zip of my io reg with and without the ssdt as well as the ssdt .aml itself.
 

Attachments

Joined
Nov 13, 2012
Messages
65
Motherboard
Asrock Z390 Phantom Gaming 6
CPU
i9-9900K
Graphics
RX 5700 XT
Mac
MacBook Pro
Mobile Phone
iOS
I recently bought a LG Ultrafine 5k Thunderbolt display. It is detected in Windows 10 and macOS. Everything is working fine so far. I do not intend to hotplug it. However, there are some minor grumbles which I think might be related to hotplugging and this SSDT.

I am using a Gigabyte Titan Ridge updated to the newest firmware. I installed the SSDT-TB3.aml V3.1 from this thread and adapted to my RP21:

Screenshot 2020-03-13 at 12.04.49.png

My to issues are

1.
The screens USB Hub (and with it sound + downstream usb devices) are not detected after a soft reboot. This is true for Windows 10 and macOS. I have to shutdown (either Windows 10 or macOS) completely to have working Thunderbolt on the next boot. The screen itself (graphics) is working even with a soft reboot.

2.
Despite the fact the the screen is working and the integrated USB 3.1 hub of the screen is attached macOS says that no thunderbolt devices are detected:
Screenshot 2020-03-13 at 12.09.34.png

Screenshot 2020-03-13 at 12.10.11.png

Does anyone encounter the same issues?
 
  • Like
Reactions: dez
Top