Contribute
Register

[Guide] USB power property injection for Sierra (and later)

Hi @RehabMan

I added a minor modification to support Docking Station's USB ports for Zbook 15 G2. It's using HS01 and SSP01 which wasn't included in your code. 4 USB 3.0 ports on the Docking Station work great in both 2.0 and 3.0 mode.

Code:
Device (UIAC)
    {
        Name (_HID, "UIA00000")  // _HID: Hardware ID
        Name (RMCF, Package (0x04)
        {
            "8086_9cb1",
            Package (0x02)
            {
                "ports",
                Package (0x10)
                {
                    "HS01",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x01, 0x00, 0x00, 0x00                   
                        }
                    },

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

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

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

                    "HS07",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0xFF,
                        "port",
                        Buffer (0x04)
                        {
                             0x07, 0x00, 0x00, 0x00                   
                        }
                    },

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

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

                    "SSP3",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0xFF,
                        "port",
                        Buffer (0x04)
                        {
                             0x0E, 0x00, 0x00, 0x00                   
                        }
                    }
                }
            },

            "8086_8c31",
            Package (0x02)
            {
                "ports",
                Package (0x16)
                {
                    "HS01",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0x03,
                        "port",
                        Buffer (0x04)
                        {
                             0x01, 0x00, 0x00, 0x00                   
                        }
                    },

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

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

                    "HS07",
                    Package (0x04)
                    {
                        "UsbConnector",
                        0xFF,
                        "port",
                        Buffer (0x04)
                        {
                             0x07, 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                   
                        }
                    },

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

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

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

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

Hope this is helpful for anyone that's looking for it.

FYI: Zbook 15 G2 with 3200x1800 screen has no IntelHD graphic (disabled by default). QE/CI with latest Lilu and Whatevergreen, brightness works.

Oops, it should be posted in here: https://www.tonymacx86.com/threads/guide-creating-a-custom-ssdt-for-usbinjectall-kext.211311/
I'm so sorry for my mistake, could you please move it. Thank you so much!

Off-topic. Please post to ProBook guide thread.
 
Few weeks late but I couldn't get it to work with my previous configuration, even after setting Devices/USB/Inject = true. HighCurrent true/false also didn't seem to make a difference.

I ended up changing my SMBIOS to iMac 18,3 to match my Kaby Lake/Z270 build, and am now trying to make it work using the USBX SSDT method. It still doesn't work, even though I see USBX@0 and EC loaded in IOReg. In system information it says 500mA when my iPhone is plugged in.
I'm attaching the gen_debug.sh output.

Thanks in advance!

The hub that your ioreg shows your iPhone is connected to is internal hub? or external hub?
 
The hub that your ioreg shows your iPhone is connected to is internal hub? or external hub?
It is connected to an internal usb 3 header. Just noticed that it is working properly on the ports on the back. Any way to get it working on the front ports?
 
It is connected to an internal usb 3 header.

Ports connected to internal devices should be marked UsbConnector=255.
 
Ports connected to internal devices should be marked UsbConnector=255.
Changing it to 255 shows the iPhone as a "built-in" device, but no changes in current.
I thought you only had to set UsbConnector=255 if the device was connected directly to the usb header, like a wifi/bt card.
 
Changing it to 255 shows the iPhone as a "built-in" device, but no changes in current.

Only the port attached to the hub should be marked built-in.
That will not make the iPhone built-in, but rather just the hub.

You failed to attach PR files.

Note: If the hub is actually within the phone itself, then you should NOT mark it as 255 (that is the case of an external hub). You should know whether the hub is external or internal (part of the phone) by examining ioreg before plugging the device.
 
Only the port attached to the hub should be marked built-in.
That will not make the iPhone built-in, but rather just the hub.

You failed to attach PR files.

Note: If the hub is actually within the phone itself, then you should NOT mark it as 255 (that is the case of an external hub). You should know whether the hub is external or internal (part of the phone) by examining ioreg before plugging the device.

The hub is just the front hub of the PC case. I'll attach screenshots of system information when the phone is plugged into the front port (through the hub) and directlly on one the motherboard back ports (which works correctly).

front:
front port.png
back:
back port.png
 

Attachments

  • debug_27913.zip
    2.2 MB · Views: 101
  • image.png
    image.png
    109.2 KB · Views: 114
The hub is just the front hub of the PC case. I'll attach screenshots of system information when the phone is plugged into the front port (through the hub) and directlly on one the motherboard back ports (which works correctly).

front:
View attachment 344418
back:
View attachment 344419

No need for an iPhone or any other device to determine whether you have a built-in hub or not.
You can see it clearly without any device connected just by looking at ioreg.

Plugging in a device will just confuse you, as the device itself may have a hub.
You can easily see all built-in devices by running ioreg (fresh) with no devices plugged in. Any device shown connected to ports at that point must be internal not external (hubs or other devices such as bluetooth, finger print readers, card readers, webcams are common especially on laptops).

General rule: An internal device is a device that is present before you plug anything in.
 
No need for an iPhone or any other device to determine whether you have a built-in hub or not.
You can see it clearly without any device connected just by looking at ioreg.

Plugging in a device will just confuse you, as the device itself may have a hub.
You can easily see all built-in devices by running ioreg (fresh) with no devices plugged in. Any device shown connected to ports at that point must be internal not external (hubs or other devices such as bluetooth, finger print readers, card readers, webcams are common especially on laptops).

General rule: An internal device is a device that is present before you plug anything in.

Ok, I understand. The iPhone is plugged into a hub then, I just wasn't sure if the UIAC configuration was correct since it showed "built in" under the iPhone item.
Is it possible to get the extra current through the hub? Or does it work only for ports directly connected to the bus?
 
Back
Top