Contribute
Register

A Beginner's Guide to Creating a Custom USB SSDT

The screenshots is showing the EHCI and XHC sections respectively.

Also the system report page. There are three devices showing, each with a different device ID as stated above.

Also in config.plist I have disabled all of the renaming for both EHCI and XHC.

EHCI-handoff is still enabled in BIOS.

In total, port discovery led me to a total of 19 ports.

The code below is what I am using currently. Seems to be working, but I would like to figure out if i did anything wrong, and trying to understand what the heck is EHCI and if i should bother with it at all.


Code:
/*
DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0x00000000)
{
    Device (UIAC)
    {
        Name (_HID, "UIA00000")  // _HID: Hardware ID
        Name (RMCF, Package (0x02)
        {
            "8086_8xxx",
            Package (0x04)
            {
                "port-count",
                Buffer (0x04)
                {
                     0x15, 0x00, 0x00, 0x00                      
                },

                "ports",
                Package (0x1E)
                {
                    "HS03",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x03, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS04",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x04, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS05",
                    Package (0x04)
                    {
                        "UsbConnector",
                        Zero,
                        "port",
                        Buffer (0x04)
                        {
                             0x05, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS06",
                    Package (0x04)
                    {
                        "UsbConnector",
                        Zero,
                        "port",
                        Buffer (0x04)
                        {
                             0x06, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS09",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x09, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS10",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x0A, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS12",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0xFF,
                        "port",
                        Buffer (0x04)
                        {
                             0x0C, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS13",
                    Package (0x04)
                    {
                        "UsbConnector",
                        Zero,
                        "port",
                        Buffer (0x04)
                        {
                             0x0D, 0x00, 0x00, 0x00                      
                        }
                    },

                    "HS14",
                    Package (0x04)
                    {
                        "UsbConnector",
                        Zero,
                        "port",
                        Buffer (0x04)
                        {
                             0x0E, 0x00, 0x00, 0x00                      
                        }
                    },

                    "SS01",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x10, 0x00, 0x00, 0x00                      
                        }
                    },

                    "SS02",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x11, 0x00, 0x00, 0x00                      
                        }
                    },

                    "SS03",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x12, 0x00, 0x00, 0x00                      
                        }
                    },

                    "SS04",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x13, 0x00, 0x00, 0x00                      
                        }
                    },

                    "SS05",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x14, 0x00, 0x00, 0x00                      
                        }
                    },

                    "SS06",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x15, 0x00, 0x00, 0x00                      
                        }
                    }
                }
            }
        })
    }
}

Thank you very much for your time at looking at my stuff!

1) Well EHCI controllers are USB2. They are the generation before XHCI and USB3. Of course XHC can run USB3 AND USB2 ports. Hackintosh builders often use the EHC to divert the USB2 away from XHC so that they can configure motherboard USB2 hubs and the like. And sometimes an old motherboard only has EHC. So this is why we have the configuration options we do have. A little confusing sometimes, agreed.

2) You have the EHC renames disabled - re-enable them if you wish to use them (I would).

3) Yes, from System Report I can see the XHC controller Device ID (8c31) and the other two will be your enabled EHCIs.

4) I notice your SSDT template is not the one from the guide. Is it one generated by Hackintool? Or somewhere else?

You do not have a valid Device ID in there. You have "8086_8xxx". Why not try changing this first to 8086_8c31 which is the XHC, and see what changes? If anything?

However, bear in mind the Hackintool method of configuration doesn't quite fit with the one covered by this Beginner's Guide. It uses a codeless kext along with aml files.

:)
 
Ya i am using the SSDT Template from RehabMan's guide.

I am using 8086_8xxx because all three device IDs starts with 8, and I wasn't sure if i need to do three separate packages in the SSDT file for all three device IDs. I was hoping 8086_8xxx would cover all three of them :mrgreen: . If i misunderstood anything, please educate me.

So what benefits would there be for me to divert the USB 2.0s to EHCI vs staying with 100% XHC?
 
Ya i am using the SSDT Template from RehabMan's guide.

I am using 8086_8xxx because all three device IDs starts with 8, and I wasn't sure if i need to do three separate packages in the SSDT file for all three device IDs. I was hoping 8086_8xxx would cover all three of them :mrgreen: . If i misunderstood anything, please educate me.

So what benefits would there be for me to divert the USB 2.0s to EHCI vs staying with 100% XHC?

Okay.

Using @RehabMan 's guide is probably the best route for your hardware as he covers the subject in much more detail, and a Beginner's Guide is clearly not sufficient for what you need. You could always switch to Hackintool by @headkaze because the method used there is more instant and visual :thumbup:

In the bigger guide yes, it is stated you can use a 8086:9xxx wildcard (as an example) instead of the actual Device ID BUT that it is better to use the correct one. Clearly it can not cover more than one controller though - and in your case that's x3 - because they would have the same port addresses allocated and that would not work.

I've already explained why the EHC controller is sometimes used alongside the XHC in a previous post.

So my advice is to choose one method and stick with it throughout - beginning to end. That way confusion can be kept at bay.

:)
 
I've already explained why the EHC controller is sometimes used alongside the XHC in a previous post.
:)

Can you please point me to the post please? I just went through all of the pages of this thread and maybe I've missed it, but i didn't see anything.
 
Hello there.

Please complete your hardware Profile so that we can help you with your problem. It's a part of the site Rules :thumbup:

Okay, well I'm guessing you have a Z97 or similar motherboard (?) But I can't tell which macOS.

Your SSDT has many errors in it. For example you use the same address for many ports. HS01 is 0x01 and so is SS01. Four ports use 0x09 and two ports use 0x0a. Each port should have a unique address. Please check the guide again.

:)

Please complete your hardware Profile
--> For some reason I am not able to add Build Signature.
--> My Build:
-----> Motherboard: Asus Maximus VII Hero
-----> CPU: i7-4790K
-----> OS: MacOS Mojave 10.14.4

I'm guessing you have a Z97
--> Yes, Asus Maximus VII Hero

You use the same address for many ports. HS01 is 0x01 and so is SS0
--> I thought we need to assign both USB2 and USB3 to USB3 ports. Since I am very new to Hackintosh I am getting lost at the ports address assignment parts.

I have included the port layout that I got after testing each port. Each port has correct labels that got activated while testing the ports.

Thank you very much.
 

Attachments

  • USB_Ports_Layout.png
    USB_Ports_Layout.png
    408.5 KB · Views: 66
Please complete your hardware Profile
--> For some reason I am not able to add Build Signature.
--> My Build:
-----> Motherboard: Asus Maximus VII Hero
-----> CPU: i7-4790K
-----> OS: MacOS Mojave 10.14.4

I'm guessing you have a Z97
--> Yes, Asus Maximus VII Hero

You use the same address for many ports. HS01 is 0x01 and so is SS0
--> I thought we need to assign both USB2 and USB3 to USB3 ports. Since I am very new to Hackintosh I am getting lost at the ports address assignment parts.

I have included the port layout that I got after testing each port. Each port has correct labels that got activated while testing the ports.

Thank you very much.

Okay.

Each port you configure has a different address. Here's the section from the original guide:

Now…

… we set the port address, by default the template shows: “port”, Buffer() { 0x1, 0, 0, 0 }, - that ‘0x1’ bit at the end is the address.

You can get the actual address from the port record in when you plug-in the device.

Look in the right-hand column for: Property “port”, Type “Data”, fourth from the bottom.

389994

Yes, a single physical USB3 port can have two definitions - one USB2 and one USB3 - and the system allocates each a separate address. When you check your ports during the port discovery section you need to change the code in the template to reflect the one showing in your IORegistryExporer output (You can see my example for HS14 in the graphic above). As I explain for most full-size modern motherboards the address of the SS port is 16 higher than the HS port. Some low-end motherboards may have fewer and the addresses not so far apart. If you need visual confirmation use two different USB flash-drives when checking the ports - first a USB2 and then a USB3.

:)
 
Last edited:
Okay.

Each port you configure has a different address. Here's the section from the original guide:



Yes, a single physical USB3 port can have two definitions - one USB2 and one USB3 - and the system allocates each a separate address. When you check your ports during the port discovery section you need to change the code in the template to reflect the one showing in your IORegistryExporer output (You can see my example for HS14 in the graphic above). As I explain for most full-size modern motherboards the address of the SS port is 16 higher than the HS port. Some low-end motherboards may have fewer and the addresses not so far apart. If you need visual confirmation use two different USB flash-drives when checking the ports - first a USB2 and then a USB3.

:)

Thank you so much for taking out time to reply. I am a bit confused about the port Address calculation. How do I calculate for the port that has a letter in the address:
Code:
<0e 00 00 00>
?

For USB 3 we need to add two entries like below one right?

Code:
 "SS01", Package() // USB3 port located ..., port <0x01, 0, 0, 0>
 {
                        "UsbConnector", 3,
                        "port", Buffer() { 0x01, 0, 0, 0 },
                    },

                    "HS01", Package() // USB2 device on a USB3 port located ... port <0x01, 0, 0, 0>
                    {
                        "UsbConnector", 0,
                        "port", Buffer() { 0x16, 0, 0, 0 },
                    },


I have attached a screenshot of the same. Also, when I test the ports only HS* labels shows.
 

Attachments

  • Kevin’s iMac IORegistryExplorer.ioreg
    4 MB · Views: 59
  • Kevin’s_iMac_—_IOService_—_HS14_14e00000_and_A_Beginner_s_Guide_to_Creating_a_Custom_USB_SSDT_...png
    Kevin’s_iMac_—_IOService_—_HS14_14e00000_and_A_Beginner_s_Guide_to_Creating_a_Custom_USB_SSDT_...png
    122 KB · Views: 60
Thank you so much for taking out time to reply. I am a bit confused about the port Address calculation. How do I calculate for the port that has a letter in the address:
Code:
<0e 00 00 00>
?

For USB 3 we need to add two entries like below one right?

Code:
 "SS01", Package() // USB3 port located ..., port <0x01, 0, 0, 0>
{
                        "UsbConnector", 3,
                        "port", Buffer() { 0x01, 0, 0, 0 },
                    },

                    "HS01", Package() // USB2 device on a USB3 port located ... port <0x01, 0, 0, 0>
                    {
                        "UsbConnector", 0,
                        "port", Buffer() { 0x16, 0, 0, 0 },
                    },


I have attached a screenshot of the same. Also, when I test the ports only HS* labels shows.

Hi there.

1) When the port has a letter in the address - as in your case "0e" - then just use that in your SSDT :thumbup:

2) Yes, two entries BUT the connector type stays the same. In your example that HS01 port would not be "0" but another "3" also.

The reason is, if "HS01" is a BLUE USB3 port, you are defining a USB2 port but the actual physical port involved has more contacts in it. It is physically a USB3 port etc. However if it is BLACK and a USB2 port only then it is "0", because it has less, and you wouldn't define an SS port.

:)
 
Hi there.

1) When the port has a letter in the address - as in your case "0e" - then just use that in your SSDT :thumbup:

2) Yes, two entries BUT the connector type stays the same. In your example that HS01 port would not be "0" but another "3" also.

The reason is, if "HS01" is a BLUE USB3 port, you are defining a USB2 port but the actual physical port involved has more contacts in it. It is physically a USB3 port etc. However if it is BLACK and a USB2 port only then it is "0", because it has less, and you wouldn't define an SS port.

:)

Hi, I created the SSDT-USB.aml file again and placed it under /EFI/CLOVER/ACPI/PATCHED but it looks like there is no effect even after restarting. I have attached the modified template file. I would be very thankful if you could look into it. Thank you
 

Attachments

  • SSDT-USB-Template.dsl
    3.9 KB · Views: 77
Back
Top