Contribute
Register

The New Beginner's Guide to USB Port Configuration

Joined
Jun 20, 2014
Messages
1,019
Motherboard
Gigabyte Aero 15X v8-BK4K4P
CPU
i7-8750H
Graphics
UHD 630 / GTX 1070
@UtterDisbelief I would appreciate some advice if you have some time. So a user recently asked me the difference between the SSDT-EC and SSDT-USBX files generated by Hackintool and the OpenCore SSDT-EC and SSDT-EC-USBX located @ OpenCorePkg/tree/master/Docs/AcpiSamples.

At first I didn't think there was much difference until I read the following:
Try NOT to rename EC0, H_EC, etc. to EC. These devices are incompatible with macOS and may break at any time. AppleACPIEC kext must NOT load. See the disable code below.

Reference USB: https://applelife.ru/posts/550233
Reference EC: https://applelife.ru/posts/807985
And a bit further down:
Uncomment replacing EC0 with your own value in case your motherboard has an existing embedded controller of PNP0C09 type. While renaming EC0 to EC might potentially work initially, it connects an incompatible driver (AppleACPIEC) to your hardware. This can make your system unbootable at any time or hide bugs that could trigger randomly.

The way Hackintool would work in previous versions:
1. If AppleBusPowerController exists in IORegistry then we don't need an SSDT's or renames
2. Check for EC, EC0, H_EC and ECDV entries in IORegistry
3. If the name matches "PNP0C09" and _STA is not 0 then add a rename to config.plist (Eg. EC0->EC, H_EC->EC)
4. Else generate an SSDT-EC

Generally I like to follow OpenCore advice so I updated Hackintool to work like this:
1. Check for any entry in ACPI (other than "EC") for a "PNP0C09" entry
2. If the entry is found it will uncomment the code from SSDT-EC-USBX replacing EC0 with this entry
3. If it's not found it will still generate SSDT-EC-USBX but without the commented code

So on my laptop I have a rename ECDV->EC. So I thought I would just remove this rename and use SSDT-EC-USBX instead with the uncommented code and ECDV replacing EC0.
ie.
Code:
    External (_SB_.PCI0.LPCB.ECDV, DeviceObj)

    Scope (\_SB.PCI0.LPCB.ECDV)
    {
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            If (_OSI ("Darwin"))
            {
                Return (0)
            }
            Else
            {
                Return (0x0F)
            }
        }
    }

But my machine would not boot! So now I'm trying to decide if the changes were a good move or not. What do you think I should do?
 

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,934
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. Android
@UtterDisbelief I would appreciate some advice if you have some time. So a user recently asked me the difference between the SSDT-EC and SSDT-USBX files generated by Hackintool and the OpenCore SSDT-EC and SSDT-EC-USBX located @ OpenCorePkg/tree/master/Docs/AcpiSamples.

At first I didn't think there was much difference until I read the following:

And a bit further down:


The way Hackintool would work in previous versions:
1. If AppleBusPowerController exists in IORegistry then we don't need an SSDT's or renames
2. Check for EC, EC0, H_EC and ECDV entries in IORegistry
3. If the name matches "PNP0C09" and _STA is not 0 then add a rename to config.plist (Eg. EC0->EC, H_EC->EC)
4. Else generate an SSDT-EC

Generally I like to follow OpenCore advice so I updated Hackintool to work like this:
1. Check for any entry in ACPI (other than "EC") for a "PNP0C09" entry
2. If the entry is found it will uncomment the code from SSDT-EC-USBX replacing EC0 with this entry
3. If it's not found it will still generate SSDT-EC-USBX but without the commented code

So on my laptop I have a rename ECDV->EC. So I thought I would just remove this rename and use SSDT-EC-USBX instead with the uncommented code and ECDV replacing EC0.
ie.
Code:
    External (_SB_.PCI0.LPCB.ECDV, DeviceObj)

    Scope (\_SB.PCI0.LPCB.ECDV)
    {
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            If (_OSI ("Darwin"))
            {
                Return (0)
            }
            Else
            {
                Return (0x0F)
            }
        }
    }

But my machine would not boot! So now I'm trying to decide if the changes were a good move or not. What do you think I should do?


Hi @headkaze .

I think the world needs to know, the reality is, I would come to you for advice! :thumbup:

However I delved into this and like you, found it intrguing. Your laptop ACPI code looks pretty much as it should. I only have a desktop to play with and the PNP0C09 shows-up in DSDT, but not against EC. The figures in "AppleBusPowerController" are against EC for extra power, so I don't need an SSDT or rename. I confess I wondered what the "switch" was that caused Hackintool to generate the SSDT-EC/USBX.aml's, and now I can see that.

Yes, reading the notes it does look unsafe to do the rename routine and better to stop AppleACPIEC loading at all. I guess the logic is that as an EISA device related to non-Mac hardware you don't want to load an Apple control as it doesn't "fit". Better to just patch ACPI with an SSDT-EC.

As for the USBX element, can the values against kusbsleep and kusbwake in "AppleBusPowerController" be more simply changed? Is the failure to boot caused by a power level being set low?

I'm probably swimming out of my depth now ... Your new method seems sound to me.

Only thing which leaves me :crazy:, is why PNP0C09 shows up against GFX0.CLID in my DSDT? But I can't complain. It boots. It works.

Sorry that's probably not what you need. At this point in Lockdown I've run out of brain ... :lol:
 
Last edited:
Joined
Jun 20, 2014
Messages
1,019
Motherboard
Gigabyte Aero 15X v8-BK4K4P
CPU
i7-8750H
Graphics
UHD 630 / GTX 1070
The figures in "AppleBusPowerController" are against EC for extra power, so I don't need an SSDT or rename.

I just remembered this tidbit from @whatnameisit

An EC device is needed so AppleBusPowerController attaches to it and injects correct power properties to XHC/EHCx in Mojave and older. In Catalina (as of now and probably higher), an EC device is needed for booting, and AppleBusPowerController loads if IORTC is found and then attaches to IOResources.

So I think I need to add a check for Catalina and not include the EC part if it is.

I think the world needs to know, the reality is, I would come to you for advice! :thumbup:

I must have the world fooled that I know what I'm doing! lol. Unless you've been doing this for many years and understand all the different nuances it's really a matter of research. I only have two Hacks now as I accidentally flashed the wrong BIOS on my old Hack (which was always really useful for testing purposes). These days I rely a lot on feedback as there are so many configuration quirks that can screw things up. It's hard to keep up sometimes!

Sorry that's probably not what you need. At this point in Lockdown I've run out of brain ... :lol:

I know the feeling! :lol:
 
Joined
Nov 13, 2010
Messages
123
Motherboard
Asus Prime Z370-A
CPU
i7-8700K
Graphics
RX580
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
Managed to boot back in, had to restore those 2 files I deleted :crazy:

There's quite a lot there and there are duplicate keys for some of these, here is the full config.plist attached

Anyone has any ideas about this one?
 

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,934
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. Android
Anyone has any ideas about this one?


Hi there. Thanks for the config.plist.

Try changing the setting in config.plist for <key>SystemParameters</key> <key>InjectKexts</key> to "Inject" (You can use Clover Configurator).

Your port-limit removal patches are actually still active in the config.plist. So if USBPorts.kext is installed, disable them.:thumbup:

Leave the SSDT-EC and SSDT-USBX aml files in place.

If you still get no joy there is an alternate method you can use to enable the EC controller, but as we were just discussing it is not ideal. Worth a test though ... Add this rename -

EC.png


Might not work either, given your problems, but you never know until you try.

Finally you have a RenameDevices setting in place -

#_SB.PCI0.RP01.PXSX to ARPT

This is not something I ever came across as needed on a Z370, but YMMV as they say. Try without?

Good luck!

:)
 
Joined
Oct 6, 2018
Messages
73
Motherboard
Asus Vivobook X510UA-BQ490
CPU
i5-8250u
Graphics
UHD 620, 1920x1080
@headkaze desktops don't normally need embedded control device which is why the SSDT provided in OC docs has disable code for it. For laptops, please refer to https://github.com/acidanthera/bugtracker/issues/743
There, Andrey1970AppleLife says to rename embedded control device name to EC. (This is because modern laptops need actual embedded control device for battery readings and EC queries for fn keys like brightness control and many others, but at the same time let macOS to look up the name EC)
vit9696 says to add fake EC on top of existing embedded control device. (which would preserve original embedded control device for working battery, etc and let fake EC do its job with allowing macOS to boot in Catalina and USB power in Mojave and older.)
They didn't exactly say the things I put in (), but I guess they meant this because I looked up so many guides...
 
Joined
Nov 14, 2011
Messages
61
Motherboard
Gigabyte GA-Z77X-UP5 TH
CPU
i7-3770K
Graphics
RX 580
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
Hi,

I have an issue with my hackintosh on the latest update and the issue was there on mojave as well ! I've bought a steelseries arctis pro + DAC and the DAC prevent my hackintosh for sleeping and staying asleep !

I've created and USB mapping with hackintool and the issue won't go away and it's really annoying !

Can you please guys help me ! Thanks
 
Joined
Feb 17, 2016
Messages
52
Motherboard
ASUS Z390 ROG Maximus XI
CPU
i9-9900K
Graphics
RX 580
Mac
  1. MacBook Pro
  2. Mac mini
Classic Mac
  1. PowerBook
Mobile Phone
  1. iOS
@UtterDisbelief Thanks for the excellent guide. I really help me get up to speed on configuring my motherboard to now work as expected.

I did have some trouble getting the USB-C connector working correctly. I finally seem to have some luck with the TypeC+Sw (UsbConnector=9). When testing in SS only mode, sometime the connected device would showup, sometime not. I could not determine if the enumeration was due to cable orientation.

Question: Is it best to configure each USB 3.x port as HS/SS pair? Is this typically recommended if the port is going to be used by hub?

Thanks again for the great write up... I have posted my config here for others using my Asus ROG Maximus XI Z390 (It includeds the external ports, but also the internal USB2.0 Hub that has Bluetooth on it, and the Aura RGB port (probs not needed :crazy: )
 

Attachments

  • SSDT-UIAC.dsl
    5.1 KB · Views: 23
  • USB-ASUS-ROG-MAXIMUS-XI-WIFI.png
    USB-ASUS-ROG-MAXIMUS-XI-WIFI.png
    78.9 KB · Views: 27

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
4,934
Motherboard
Gigabyte Z390M Gaming - Clover 5102
CPU
i5-9600K
Graphics
RX 570 1920x1080
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. Android
@UtterDisbelief Thanks for the excellent guide. I really help me get up to speed on configuring my motherboard to now work as expected.

I did have some trouble getting the USB-C connector working correctly. I finally seem to have some luck with the TypeC+Sw (UsbConnector=9). When testing in SS only mode, sometime the connected device would showup, sometime not. I could not determine if the enumeration was due to cable orientation.

Question: Is it best to configure each USB 3.x port as HS/SS pair? Is this typically recommended if the port is going to be used by hub?

Thanks again for the great write up... I have posted my config here for others using my Asus ROG Maximus XI Z390 (It includeds the external ports, but also the internal USB2.0 Hub that has Bluetooth on it, and the Aura RGB port (probs not needed :crazy: )


Hi there.

Yes, I know what you mean about the USB-C port. I am looking into this myself. My own experience is that configuring as USB2 is what makes the port appear/disappear. Now I just configure as USB3 and it seems more reliable. The Switch orientation doesn't seem to affect this. However I'm on a Gigabyte board and yours looks like Asus. I only have this with USBPorts.kext though. Investigations on-going ...

Standard Blue ports can operate as both USB3 and USB2 ports so, yes, you can configure an HS/SS pair for each BUT you are free to remove any you do not wish to use. So if, say, you plan on using a port for a USB2 device only, you can disable the USB3 side and save one port from your 15-limit. Doing so means a USB3 device will not be 'seen' and vice-versa.

Doesn't matter what the hub is - type, speed, power - as far as macOS is concerned it is just the single USB Port the hub is plugged into. So you only need a single USB port configuration based on the maximum speed the hub works at. Hubs can crash the sub-system if they draw too much power and don't have their own supply.

Thanks for helping others with your configuration template :thumbup:
 
Top