Contribute
Register

[Guide] Creating a Custom SSDT for USBInjectAll.kext

Joined
May 31, 2016
Messages
50
Motherboard
Asrock Z390 Phantom Gaming itx/ac - OC
CPU
i7-8700
Graphics
RX 460, 2560x1080
Mac
  1. MacBook Air
  2. Mac mini
Mobile Phone
  1. iOS
It appears you have EH02 disabled in BIOS.
It does not appear in ioreg or in misc/preboot.log (under GetDevices).
OK! My mistake, the previous debug files were collected with XHCI enable.
The new one is XHCI smart auto, EH02 enabled but still nothing attached to it. All my internal and external USB 2.0 ports are not functional.
If I plug keyboard and trackpad into USB 2.0 ports, they works at clover boot screen but failed after boot into OSX login screen.
Any suggestion? Thanks!
 

Attachments

  • debug_8002.zip
    3.9 MB · Views: 47
Last edited:

msh

Joined
Oct 31, 2013
Messages
265
Motherboard
Gigabyte GA-Z97X-UD3H
CPU
i5-4690S
Graphics
HD 4600
Mobile Phone
  1. Android
Now proceed with the guide in post #1. Please note that FakePCIID_XHCIMux.kext requires FakePCIID.kext.

If I am right, in front panel:
HP15: USB2 top right
HP16: USB2 bottom right
SS03: dual USB3 left
in rear panel:
HP13/SS04: USB3 rear top left
HP14/SS04:USB3 rear top right
HP21:USB2 middle rear right
HP22:USB2 middle rear left
HP23/SS04:USB3 rear bottom left
HP24/SS04:USB rear bottom right
I created two models of custom usbinjectall.kext: SS03 and SS04 as internal hub:connector type=255 or USB3:connector type=3
Code:
//
// This SSDT can be used as a template to build your own
// customization for USBInjectAll.kext.
//
// This SSDT contains all ports, so using it is the same as without
// a custom SSDT.  Delete ports that are not connected or ports you
// do not need.
//
// Change the UsbConnector or portType as needed to match your
// actual USB configuration.
//
// Note:
// portType=0 seems to indicate normal external USB2 port (as seen in MacBookPro8,1)
// portType=2 seems to indicate "internal device" (as seen in MacBookPro8,1)
// portType=4 is used by MacBookPro8,3 (reason/purpose unknown)
//

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {
            "HUB1", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "HP13", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP14", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HP15", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 5, 0, 0, 0 },
                    },
                    "HP16", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 6, 0, 0, 0 },
                   
                    },
               
                },
           
            },
            "HUB2", Package()
            {
                "port-count", Buffer() { 6, 0, 0, 0 },
                "ports", Package()
                {
                    "HP21", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HP22", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HP23", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP24", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                   
                    },
               
                },
           
            },
            "8086_1e31", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "SS03", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 7, 0, 0, 0 },
                    },
                    "SS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
             
                },
                             
            },
       
         })
     
     }

 }
//EOF

Code:
// SSDT-UIAC-ALL.dsl
//
// This SSDT can be used as a template to build your own
// customization for USBInjectAll.kext.
//
// This SSDT contains all ports, so using it is the same as without
// a custom SSDT.  Delete ports that are not connected or ports you
// do not need.
//
// Change the UsbConnector or portType as needed to match your
// actual USB configuration.
//
// Note:
// portType=0 seems to indicate normal external USB2 port (as seen in MacBookPro8,1)
// portType=2 seems to indicate "internal device" (as seen in MacBookPro8,1)
// portType=4 is used by MacBookPro8,3 (reason/purpose unknown)
//

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {
            "HUB1", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "HP13", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP14", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HP15", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 5, 0, 0, 0 },
                    },
                    "HP16", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 6, 0, 0, 0 },
                    
                    },
                
                },
            
            },
            "HUB2", Package()
            {
                "port-count", Buffer() { 6, 0, 0, 0 },
                "ports", Package()
                {
                    "HP21", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HP22", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HP23", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP24", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                    
                    },
                
                },
            
            },
            "8086_1e31", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "SS03", Package()
                    {
                        "UsbConnector", 255,
                        "port", Buffer() { 7, 0, 0, 0 },
                    },
                    "SS04", Package()
                    {
                        "UsbConnector", 255,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
              
                },
                              
            },
        
         })
      
     }

 }
//EOF
I am wondering if it is correct? Thanks!
 
Last edited:

RehabMan

Moderator
Joined
May 2, 2012
Messages
184,014
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hi,

I m using Asus VI impact (Intel 8 series) with : 6 USB 3.0/2.0 and 4 USB 2.0.
If i understood correctly, i can not go above 15 USB on XHC with intel 8 series.
Can i put the remaining port on EH01 ?

Thanks

FakePCIID_XHCIMux.kext can be used to route USB2 pins from XHC to EH0x.
 

RehabMan

Moderator
Joined
May 2, 2012
Messages
184,014
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
OK! My mistake, the previous debug files were collected with XHCI enable.
The new one is XHCI smart auto, EH02 enabled but still nothing attached to it. All my internal and external USB 2.0 ports are not functional.
If I plug keyboard and trackpad into USB 2.0 ports, they works at clover boot screen but failed after boot into OSX login screen.
Any suggestion? Thanks!

With EHCI controllers enabled (xHCI="auto" or "smart auto"), you will probably need FakePCIID_XHCIMux.kext.
Also, you will not want to be disabling EHCI controllers (eg. SSDT-DEH01.aml is nonsense in that scenario).
 

RehabMan

Moderator
Joined
May 2, 2012
Messages
184,014
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
If I am right, in front panel:
HP15: USB2 top right
HP16: USB2 bottom right
SS03: dual USB3 left
in rear panel:
HP13/SS04: USB3 rear top left
HP14/SS04:USB3 rear top right
HP21:USB2 middle rear right
HP22:USB2 middle rear left
HP23/SS04:USB3 rear bottom left
HP24/SS04:USB rear bottom right
I created two models of custom usbinjectall.kext: SS03 and SS04 as internal hub:connector type=255 or USB3:connector type=3
Code:
//
// This SSDT can be used as a template to build your own
// customization for USBInjectAll.kext.
//
// This SSDT contains all ports, so using it is the same as without
// a custom SSDT.  Delete ports that are not connected or ports you
// do not need.
//
// Change the UsbConnector or portType as needed to match your
// actual USB configuration.
//
// Note:
// portType=0 seems to indicate normal external USB2 port (as seen in MacBookPro8,1)
// portType=2 seems to indicate "internal device" (as seen in MacBookPro8,1)
// portType=4 is used by MacBookPro8,3 (reason/purpose unknown)
//

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {
            "HUB1", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "HP13", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP14", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HP15", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 5, 0, 0, 0 },
                    },
                    "HP16", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 6, 0, 0, 0 },
                  
                    },
              
                },
          
            },
            "HUB2", Package()
            {
                "port-count", Buffer() { 6, 0, 0, 0 },
                "ports", Package()
                {
                    "HP21", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HP22", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HP23", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP24", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                  
                    },
              
                },
          
            },
            "8086_1e31", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "SS03", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 7, 0, 0, 0 },
                    },
                    "SS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
            
                },
                            
            },
      
         })
    
     }

 }
//EOF

Code:
// SSDT-UIAC-ALL.dsl
//
// This SSDT can be used as a template to build your own
// customization for USBInjectAll.kext.
//
// This SSDT contains all ports, so using it is the same as without
// a custom SSDT.  Delete ports that are not connected or ports you
// do not need.
//
// Change the UsbConnector or portType as needed to match your
// actual USB configuration.
//
// Note:
// portType=0 seems to indicate normal external USB2 port (as seen in MacBookPro8,1)
// portType=2 seems to indicate "internal device" (as seen in MacBookPro8,1)
// portType=4 is used by MacBookPro8,3 (reason/purpose unknown)
//

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {
            "HUB1", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "HP13", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP14", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HP15", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 5, 0, 0, 0 },
                    },
                    "HP16", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 6, 0, 0, 0 },
                   
                    },
               
                },
           
            },
            "HUB2", Package()
            {
                "port-count", Buffer() { 6, 0, 0, 0 },
                "ports", Package()
                {
                    "HP21", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HP22", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HP23", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HP24", Package()
                    {
                        //"UsbConnector", 0,
                        "portType", 0,
                        "port", Buffer() { 4, 0, 0, 0 },
                   
                    },
               
                },
           
            },
            "8086_1e31", Package()
            {
                "port-count", Buffer() { 8, 0, 0, 0 },
                "ports", Package()
                {
                    "SS03", Package()
                    {
                        "UsbConnector", 255,
                        "port", Buffer() { 7, 0, 0, 0 },
                    },
                    "SS04", Package()
                    {
                        "UsbConnector", 255,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
             
                },
                             
            },
       
         })
     
     }

 }
//EOF
I am wondering if it is correct? Thanks!

I cannot provide any advice without problem reporting files as requested in post #1.
You didn't attach anything.
 
Joined
Nov 29, 2011
Messages
116
Motherboard
Gigabyte H370M-D3H-Clover
CPU
i3-8350K
Graphics
RX 570, 1920x1080
Mobile Phone
  1. iOS
Just wanted to pass along, what I believe is a successful implementation of this guide. I've been analyzing the thread for a few months prior to my recent build.

Updated USB Port Mapping
  • Originally tried this guide - https://www.tonymacx86.com/threads/254559/
    • To be honest, didn't really know what I was doing
    • If you check the thread, I was having multiple issues
    • Eventually scrapped it
  • Followed this guide - https://www.tonymacx86.com/threads/guide-creating-a-custom-ssdt-for-usbinjectall-kext.211311/
    • Not as painful as you think - start to finish about 3 hours
    • Requirements, I added EHC1, EHC2 and 2 versions of XHCI renames (had to search for these) to Clover
    • Ensure you put USBInjectAll.kext into S/L/E --> didn't do this at first
    • Added XHCI-unsupported kext into S/L/E
    • Syntax is really important when performing the -uia excludes and includes
      • -uia_exclude_hs uia_include=HS04
      • -uia_exclude_ss uia_exclude=USR1,USR2
    • Plugged in the various USB2 and USB3 devices (see ioreg screen shots)
    • XHC Device ID = <6d a3 00 00
    • Created SSDT-UIAC.aml and put in EFI/Clover/ACPI/patched (see attached file)
    • Restarted and checked all of my USB ports in System Information and all ports are functioning as designed
    • Due to the 15 port limit, I did not load HS07,08 USB2 so I could get USB3 values for SS07,08
    • On this last bullet, I've created a few different versions of the SSDT-UIAC. I'm attaching v3 which removes HS07 and HS08
Clover/acpi/dsdt/patches
full


-uia_exclude_ss uia_exclude=USR1,USR2
full


-uia_exclude_hs uia_include=HS04
full


All USB2 shown as 480 Mb/sec and USB3 at 5 Gb/sec in System Information
full

  • Top of case = USB2 and USB3
  • Back Top (a ports) = USB2, can recognize USB3 devices at 480 Mb/sec
  • Back Middle Blue (e ports) = USB3 only, turned off HS07 and HS08
  • Back Lower Blue (e ports) = USB2 and USB3
  • Middle Red, right (g port) = USB2 and USB3
  • Middle Red, left (h port) = not tested yet
List of all ports based on USB2|USB3 discovery
  • HS01 - middle red, right, usb2, usb3
  • HS02
  • HS03 - top case, right, usb2
  • HS04 - top case, left, usb2 (kb/mouse)
  • HS05 - back, lower blue, left, usb2
  • HS06 - back, lower blue, right, usb2
  • HS07 - back, middle blue, left, usb2
  • HS08 - back, middle blue, right, usb2
  • HS09 - back, top, right, usb2, usb3 (480 Mb/sec)
  • HS10 - back, top, left, usb2, usb3 (480 Mb/sec)
  • HS11
  • HS12 - internal, Bluetooth hub
  • HS13
  • HS14
  • USR1
  • SS01 - middle red, right, USB3
  • SS02 -
  • SS03 - top case, right, USB3
  • SS04 - top case, left, USB3
  • SS05 - back, lower blue, left, USB3
  • SS06 - back, lower blue, right, USB3
  • SS07 - back, middle blue, left, USB3
  • SS08 - back, middle blue, right, USB3
  • USR1 -
  • USR2 -
I'm marking USB as working!
 

Attachments

  • SSDT-UIACv3.zip
    2.8 KB · Views: 71
Joined
Jun 4, 2017
Messages
112
Motherboard
Asus X299 WS SAGE
CPU
i9 10940x
Graphics
vega 64
I have Asus X299-A Prime motherboard (x299), i7-9800x cpu, os is mojave. My xhci controller have 0x8086a2af address, so it's supported by AppleUSBXHCIPCI. But i can't find out, why this driver (it's loaded and works with asmedia ports) didn't bound to standard 200-series XHCI controller. In IOReg i see XHCI device, but without binded driver to it. I haven't noticed any errors into log. I've also tried USBEjectAll + xhci-unsupported kexts (last is not needed i think) but this didn't changed anything. Is any ideas how to debug, why AppleUSBXHCIPCI didn't want to bind to 0x8086a2af (but works with asmedia ports)?

ps. on each boot i see following in my log:

XHCI@(null): AppleUSBXHCI::start: hardware exception occured

UPDATE: solved problem with adding npci=0x3000 to kernel parameters
 

Attachments

  • Screen Shot 2018-12-27 at 10.49.11 AM.png
    Screen Shot 2018-12-27 at 10.49.11 AM.png
    1.5 MB · Views: 75
Last edited:
Joined
Nov 28, 2018
Messages
78
Motherboard
asus z370-i
CPU
i7-9700k
Graphics
RX 580
Mac
  1. iMac
  2. MacBook
  3. Mac Pro
Classic Mac
  1. Apple
Mobile Phone
  1. iOS
Just for curiosity, I'd reviewed my Boot.log. Those messages are showing up.

RCBA disabled; cannot use it.
ATI injection not set


Does anybody know what does it mean and how to clean these events?
 
Top