Hello Mrengles!
Attached to this mail you'll find my DSDT with the USB patch (named experimental), the one without the patch to give you a chance to compare both and my main inspiration, the extracted ACPI data of a MacBook Pro 9,2. I also attached the 7 series chipset's datasheet because it was a valuable source of in information which helped me to understand Apple's code.
Lets start with the XHCI-Controller, device XHC. As the MacBook Pro's DSDT calls it HXC1 I renamed it but I don't think that this is crucial but it helped to minimize the changes in the code I took from the MacBook Pro's DSDT.
I removed all of the controller's initialization methods (CUID, POSC, ESEL, XSEL, XWAK) in my DSDT and inserted the _INI and _DSM methods found in the MacBook Pro's DSDT. I also had do edit Operation Region XH1C and add Operation Region XHC2. Please notice that the MacBook Pro's methods also switch some of the chipset's GPIO pins but I'm quite sure that is specific to the MacBook Pro's hardware.
Therefore I removed the instructions accessing the GPIO pins from the methods I copied over. You should be able to copy & paste the methods from my edited DSDT.
Next I added methods XHCA-XHCD and EHCA-EHCD which implement the switch of the ports between the controllers.
Finally I reworked the controllers hub device RHUB to look more like the MacBook Pro's one because MSI's original DSDT used to have a different multiplexing scheme. I removed the high speed ports HSP1-4 and renamed the super speed ports SSP1-4 to PRT1-4. I also removed some multiplexing instructions from each port's _PLD and _UPC methods. Please notice the labels Name (MUXS, "EHCA") to Name (MUXS, "EHCD") I added to the port's devices.
They are crucial for the switch to work because they seem to provide information about which methods have to be called in order to perform a switch.
The USB 3.0 controllers ports are multiplexed with the USB 2.0 ports of the controller found at address 0x001D0000 . Look for the code below.
In order to identify it. In my DSDT it's device EHC1 but it might be different in yours. It's the address that matters. Here I added methods XHCA-XHCD, EHCA-EHCD, _DSM and XHCN (copy & past from my DSDT should work). Next I had to add Name (MUXS, "XHCA") to Name (MUXS, "XHCD") to the controller's hub ports but as there are 8 ports and only 4 are multiplexed with the XHCI controller you'll have to find out which ones are the correct one's making this the most difficult part of all. In my case 4 of the ports have method _DSM while the other 4 ones don't. I took the ones without method _DSM and added Name (MUXS, "XHCA") to Name (MUXS, "XHCD") to them. I was lucky because it was the correct choice. It worked but you'll have to trial-and-error in order to find out the correct combination for your board!
Last you might have to make some changes to your original DSDT's code in order to reconcile it with the patches:
1) Add (copy & paste) method OSDW.
2) Edit method _OSC of device PCI0. After carefully comparing Apple's and MSI's implementation I decided to replace MSI's _OSC method with Apple's implementation with minimal changes: I removed only the GPIO related instructions. My advice is to copy & paste mine and see if it works.
3) Under Scope (_SB.PCI0) edit method _INI to include the lines
Code:
If (_OSI ("Darwin"))
{
Store (0x2710, OSYS)
}
The method is called during system initialization on order to inform the BIOS of the OS which is running.
4) Resolve any references to the XHCI controller's methods or devices you renamed or removed. For example I had to change method _WAK in order to call \_SB.PCI0.XHC1._INI instead of \_SB.PCI0.XHC.XWAK ().
Ok, I hope this information will be enough for you to successfully complete the patch. Feel free to contact me again if you have further questions or get stuck at some point. It will probably take some hours to get the work done.
Good luck!
Mieze