profzei / Matebook-X-Pro-2018

💻 macOS on Huawei Matebook X Pro 2018
Apache License 2.0
369 stars 48 forks source link

Thunderbolt Hotplug ( maybe some ideas ? ) #211

Closed BigEmperor26 closed 3 months ago

BigEmperor26 commented 2 years ago

I don't know if you tried already, but according to these two guides the only way to get native thunderbolt hotplug is to flash a compatible firmware from a real mac. However, this will break windows compatibility.

https://elitemacx86.com/threads/how-to-enable-thunderbolt-3-hotplug-on-macos.462/

https://osy.gitbook.io/hac-mini-guide/details/thunderbolt-3-fix-part-3

The reason is how Windows and MacOS handle the thunderbolt controller. MacOS expects the controller to be powered on at all times, whereas Windows is able to turn it on and off ( according to my understanding ). However our Thunderbolt controller is a JHL6240, which is limited to 20gpbs of bandwidth. No real mac has this same limitation and for this reason I think it might be hard a MacOS compatible controller firmware.

My biggest issue with thunderbolt now is that not only thunderbolt, but also normal USB C to C 3.0 or 3.1 cables do not support hotplug. I have a usb c 3.1 drive and I cannot use the second port unless I plug the devices before boot. I think the reason is that USB 3.1 uses the same unsupported thunderbolt controller. I tried to disable and enable your patches, but I don't really understand how they work ( sorry ).

I wonder if you managed to get at least that part working.

(edit. Typos and grammar ... lol)

profzei commented 2 years ago

@BigEmperor26 Thank you for your suggestions: I studied all the links you provided some time ago... I agree with you that hotplug could be achieved injecting custom firmware into Thunderbolt controller (you could also brick it in this way...)... but I'm trying to see how far I can go only with SSDT... probably I'm not far from limit since I'm able to refresh Thunderbolt tree structure + attach my external OWC Envoy Express BUT not loading IONVMeController for my external ExFat partition

I need to debug deeply (also with a fresh mind) what I wrote... but it is very time consuming and now I'm very busy since I have some deadlines to accomplish (in real life).

One USB type-C port is loaded by Thunderbolt controller... while the other is based on Intel controller:

BTW, I see you are Italian as I am...

tlefko commented 2 years ago

@BigEmperor26 Thank you for your suggestions: I studied all the links you provided some time ago... I agree with you that hotplug could be achieved injecting custom firmware into Thunderbolt controller (you could also brick it in this way...)... but I'm trying to see how far I can go only with SSDT... probably I'm not far from limit since I'm able to refresh Thunderbolt tree structure + attach my external OWC Envoy Express BUT not loading IONVMeController for my external ExFat partition

I need to debug deeply (also with a fresh mind) what I wrote... but it is very time consuming and now I'm very busy since I have some deadlines to accomplish (in real life).

One USB type-C port is loaded by Thunderbolt controller... while the other is based on Intel controller:

  • attaching a USB type-C to DisplayPort adapter is obviously working since (apart from connector type) you are NOT relying on real Thunderbolt interface
  • attaching a normal USB type-C to C 3.0 or 3.1 cables could not support hotplug if Thunderbolt controller is not supporting such feature (this is my understanding...)

BTW, I see you are Italian as I am...

what if the kexts were attached to a null hidden NVME device by default so they would always be loaded in and therefore 'on', same with other thunderbolt accessories, without being visible. (Assuming the TB driver would detect the change once a real device is attached)