xps15-9570-macos icon indicating copy to clipboard operation
xps15-9570-macos copied to clipboard

Potential TB3 hot plug?

Open adityahota opened this issue 4 years ago • 40 comments

https://www.elitemacx86.com/threads/guide-how-to-enable-thunderbolt-3-hotplug.462/

Is this something that could possibly be implemented in our system @xxxzc ?

I'll try to give it a shot next week.

adityahota avatar May 07 '20 03:05 adityahota

Replace SSDT-TYPC.aml with SSDT-TB3.aml.zip (don't forget to update config.plist).

Some people reported that this can make thunderbolt dock hot-pluggable but not eGPU.

xxxzc avatar May 13 '20 16:05 xxxzc

@xxxzc thank you for that! Could I ask why you switched to SSDT-TYPC.aml in the main config? I remember in an older version, you used SSDT-TB3.

Also, does this enable USB 3.0 over USB C port?

adityahota avatar May 13 '20 16:05 adityahota

在删除 SSDT-TYPC.aml 和 rp17 重命名并在 grub shell 修改了gpio3 force pwr 和gpio filter 的偏量值后雷电3设备(除egpu)可实现冷启动。

meisekiyou avatar Jun 06 '20 10:06 meisekiyou

在删除 SSDT-TYPC.aml 和 rp17 重命名并在 grub shell 修改了gpio3 force pwr 和gpio filter 的偏量值后雷电3设备(除egpu)可实现冷启动。

可以热插拔麽?

tofuliang avatar Jun 07 '20 03:06 tofuliang

在删除 SSDT-TYPC.aml 和 rp17 重命名并在 grub shell 修改了gpio3 force pwr 和gpio filter 的偏量值后雷电3设备(除egpu)可实现冷启动。

可以热插拔麽?

雷电不行,DP可以

meisekiyou avatar Jun 07 '20 10:06 meisekiyou

Quick update. So I've been trying to get TB3 Hot plug-ability for a long time now. After testing a few of different combinations it seems like I got fully working TB3 and USB-C hot plug.

Even tho xxxzc mentioned to not use both .aml simultaneously for USBC and TB3 I tried anyways. I also added one other thunderbolt related .aml I had laying around from a previous EFI based on clover and proceeded to use IOElectrify.kext to force-power the Thunderbolt controller on boot.

I have tested it with an Apollo X4 TB3 interface and can hot-plug with no problems. Also tried a USB-C SSD (sands extreme 1gb) and its working perfectly.

So far it is very stable and it even shows in PCI's Tab in System report.

Screen Shot 2020-12-23 at 23 52 20

Will do some more testing during the coming weeks. I'll also share my EFI so maybe someone with more knowledge about this can do some cleanup or optimizations of the AML/Kext in there to push it to the main release with TB3 hot plug enabled.

EFI.zip

andresandiah avatar Dec 24 '20 04:12 andresandiah

That's very interesting! I tried using the TB3 aml in the past and it would cause the laptop to crash upon wakeup--does the same happen for you? Also, does the thunderbolt port get hot even when nothing is plugged in?

adityahota avatar Dec 24 '20 05:12 adityahota

That's very interesting! I tried using the TB3 aml in the past and it would cause the laptop to crash upon wakeup--does the same happen for you? Also, does the thunderbolt port get hot even when nothing is plugged in?

It's just a little warm, will report back tomorrow if it gets hot or warm even without use.

Literally just tested putting it to sleep and the interface reconnected without a problem; no crashes.

I have to note that disabled Thunderbolt Auto Switch on Bios and it is set to Native.

andresandiah avatar Dec 24 '20 05:12 andresandiah

That’s great to hear. Do you think eGPUs would work as well?

adityahota avatar Dec 24 '20 15:12 adityahota

My XPS is more music production oriented so I do not own any kind of eGPU. I currently tested it with an Universal Audio Apollo X4 audio interface and it is working flawlessly. Since the thunderbolt controller seems to be fully loaded on boot I suppose it will work normally with any EGPU. It is worth a try if you have one to test with; just make sure to make a backup of your current working EFI.

andresandiah avatar Dec 24 '20 16:12 andresandiah

@xxxzc is this something you could potentially take a look at?

adityahota avatar Jan 05 '21 22:01 adityahota

After further testing it seems that the system still shows the thunderbolt card as active after a long sleep BUT will lose its ability to hot-plug until the next reboot. At least there is no panic or sudden shut down of the device.

Also, seems like the SSDT-Thunderbolt.aml in my EFI is not necessary. Only the USB-C, TB3 and IOElectrify.kext.

Wish there is some kind of workaround to this. Hope @xxxzc can take a look at this and work it out. 💪🏾

andresandiah avatar Jan 06 '21 19:01 andresandiah

I was taking a look at this EFI: https://github.com/tylernguyen/x1c6-hackintosh

There are lots of files related to TB3 there, and no IOElectrify kext is used. I wonder if it's possible to achieve the hotplugging completely through ACPI patching on this device.

adityahota avatar Jan 09 '21 23:01 adityahota

Ok, so it seems IOElectrify kext was not necessary. I removed it from my EFI, and also removed the SSDT-THUNDERBOLT that i added.

Hot Plug seems to be working normally until now. Even after a long sleep (while plugged) the thunderbolt device was still functioning after wake up; i even turned off and turned on my interface to see if it would still function and it did.

I cannot say that this hot plug is 100% functional as I need to keep testing in other scenarios, but it seems like it is functioning way beyond what i initially expected from it. Thanks for the work @xxxzc . Hope you can make some final refinements on the thunderbolt side of this EFI anytime soon. So far great job!

andresandiah avatar Jan 12 '21 16:01 andresandiah

@andresandiah very interesting! so you are only using SSDT-TB3.aml ~TbtForcePower.efi~? Or are there still other modifications to the EFI folder?

adityahota avatar Jan 12 '21 16:01 adityahota

@adityahota Currently the only modification to the EFI is the SSDT-TB3.aml in conjuction with the one for USB type C. That's it. Seems to be working fine.

andresandiah avatar Jan 12 '21 17:01 andresandiah

What is your TB3 mode set to in the BIOS settings? Could you let me know if it's set to Native or BIOS Assist? Thank you!

adityahota avatar Jan 12 '21 18:01 adityahota

It is set to Native. Make sure to select "No Authorization" if you are not dual-booting MacOS and Windows 10

andresandiah avatar Jan 12 '21 18:01 andresandiah

Okay. I tried adding just the SSDT-TB3 file to the EFI and now whenever I wake the laptop up from sleep (on battery), the laptop KPs and reboots. Here's the log I am getting. Screen Shot 2021-01-12 at 2 15 56 PM

adityahota avatar Jan 12 '21 19:01 adityahota

Mmmm, that's weird. I'll upload my current EFI. Feel free to check it out 👌🏾 EFI.zip

andresandiah avatar Jan 12 '21 19:01 andresandiah

Hmm, weirdly even with your EFI I am still getting the KP. Have you tried sleeping without the laptop plugged in? I wonder if that's part of the cause. I originally tried adding SSDT-TB3 to my EFI a few months ago and was getting the same issue. I'll try playing with my settings and see if I can get it to work.

adityahota avatar Jan 12 '21 20:01 adityahota

I'm on Big Sur for the record.

andresandiah avatar Jan 12 '21 22:01 andresandiah

Likewise. Which BIOS version are you on? Also do you have the i7 or the i9 model?

adityahota avatar Jan 13 '21 17:01 adityahota

I found that the one that gave me the least amount of problems was 1.11.2 (the one recommended on LuletterSoul's MacOS EFI). I have the i7 Model, 8750H

andresandiah avatar Jan 13 '21 17:01 andresandiah

Gotcha, it seems that apart from the BIOS version, our configs are the same. I'll try downgrading to 1.11.2 and see if that fixes the sleep wake issue. Did you have a chance to test TB3 hotplug after sleeping on battery? If so, could you let us know how that went?

adityahota avatar Jan 13 '21 18:01 adityahota

Okay even after downgrading, the reboot issue persists. I guess we’ll have to do some more testing across devices.

On Wed, Jan 13, 2021 at 12:55 andresandiah [email protected] wrote:

I found that the one that gave me the least amount of problems was 1.11.2 (the one recommended on LuletterSoul's MacOS EFI). I have the i7 Model, 8750H

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xxxzc/xps15-9570-macos/issues/40#issuecomment-759616441, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7PXAKB3F5UGFIZVOLTH53SZXNBVANCNFSM4M26732A .

adityahota avatar Jan 13 '21 18:01 adityahota

Man, thats weird. Try resetting BIOS default configuration and also resetting the NVRAM in OpenCore. I dont know if the kextcache command works normally in BigSur but I periodically run it anyways haha

andresandiah avatar Jan 13 '21 19:01 andresandiah

Thanks for the work @xxxzc . Hope you can make some final refinements on the thunderbolt side of this EFI anytime soon. So far great job!

That TB3.aml wasn't wrote by me, I have no other TB device except a nvidia eGPU. I can't be of more help, sorry.

xxxzc avatar Jan 14 '21 05:01 xxxzc

Ok. So I kept testing the thunderbolt connection while sleeping.

Situation A: XPS Not Plugged to AC -> Entered sleep status while thunderbolt device on. (15 min idle ) Wake XPS while thunderbolt device still turned on. Hot plug capability still remains and thunderbolt device works correctly

Situation B: XPS Not Plugged to AC -> Entered sleep status while thunderbolt device on. (15 min idle ) UNPLUGGED TB Device then proceeded to wake up XPS. To my surprise this causes a kernel panic and the XPS automatically shut downs.

I'll have to try one more situation where the XPS goes to sleep without battery and without any TB device connected to see if after wakeup it can still hot plug any thunderbolt device.

andresandiah avatar Jan 14 '21 22:01 andresandiah

Interesting... I wonder if using TbtForcePower.efi can help here. I believe that driver is used to prevent macOS from crashing if it doesn’t see the TB device powered on when waking from sleep.

adityahota avatar Jan 15 '21 16:01 adityahota