Contribute
Register

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

Thanks! Easy guide to follow and this removed some warnings in kernel log on my X299.

iMacPro1,1 values are:

"kUSBSleepPowerSupply",
0x13EC,
"kUSBSleepPortCurrentLimit",
0x0834,
"kUSBWakePowerSupply",
0x13EC,
"kUSBWakePortCurrentLimit",
0x0834
 
But I checked my own ioreg and AppleBusPowerControllerUSB was not loaded anywhere. So now the question is what causes it to load... Another simple grep search will tell us:

Hi @RehabMan, my search with grep from this result, Why? thx

Code:
iMac-di-Samuel:~ samuel$ grep -l AppleBusPowerControllerUSB -R /System/Library/Extensions
/System/Library/Extensions/USBInjectAll.kext/Contents/Info.plist
iMac-di-Samuel:~ samuel$

My files attached
 

Attachments

  • debug_5580.zip
    2.1 MB · Views: 80
Last edited:
Hi @RehabMan, my search with grep from this result, Why? thx

Code:
iMac-di-Samuel:~ samuel$ grep -l AppleBusPowerControllerUSB -R /System/Library/Extensions
/System/Library/Extensions/USBInjectAll.kext/Contents/Info.plist
iMac-di-Samuel:~ samuel$

My files attached

Read post #1 regarding changes (AppleBusPowerController vs. AppleBusPowerControllerUSB) in 10.13.x.
 
Read post #1 regarding changes (AppleBusPowerController vs. AppleBusPowerControllerUSB) in 10.13.x.

Thank you @RehabMan.


Overriding the IOUSBHostFamily.kext/Contents/Info.plist

Although you could patch this kext Info.plist to provide different properties for any supported SMBIOS, it is desirable to do so without patching since patching would need to be redone after any update that provided a new copy of the file.

I have added support in USBInjectAll.kext to inject these properties. And, at least in my testing, the properties injected by USBInjectAll.kext are succesful in overriding those from IOUSBHostFamily.kext.

To specify power property overrides via USBInjectAll.kext, you must provide an "AppleBusPowerControllerUSB" in your UIAC.RMCF.

For example:

Code:
DefinitionBlock ("", "SSDT", 2, "hack", "usb", 0)
{
//
// Override for USBInjectAll.kext
//
    Device(UIAC)
    {
        Name(_HID, "UIA00000")
        Name(RMCF, Package()
        {
            // USB Power Properties for Sierra (using USBInjectAll injection)
            "AppleBusPowerControllerUSB", Package()
            {
                // these values happen to be iMac14,2 values...
                "kUSBSleepPortCurrentLimit", 2100,
                "kUSBSleepPowerSupply", 4700,
                "kUSBWakePortCurrentLimit", 2100,
                "kUSBWakePowerSupply", 4700,
            },
            // XHC overrides (8086:9cb1, NUC5)
            "8086_9cb1", Package()
            {
// other UIAC.RMCF content follows (for custom port injection)
...
}
//EOF

I have another Question. I do not understand having to enter this code, what is RMCF? I'm newbie:crazy:
 
Thank you @RehabMan.




Code:
DefinitionBlock ("", "SSDT", 2, "hack", "usb", 0)
{
//
// Override for USBInjectAll.kext
//
    Device(UIAC)
    {
        Name(_HID, "UIA00000")
        Name(RMCF, Package()
        {
            // USB Power Properties for Sierra (using USBInjectAll injection)
            "AppleBusPowerControllerUSB", Package()
            {
                // these values happen to be iMac14,2 values...
                "kUSBSleepPortCurrentLimit", 2100,
                "kUSBSleepPowerSupply", 4700,
                "kUSBWakePortCurrentLimit", 2100,
                "kUSBWakePowerSupply", 4700,
            },
            // XHC overrides (8086:9cb1, NUC5)
            "8086_9cb1", Package()
            {
// other UIAC.RMCF content follows (for custom port injection)
...
}
//EOF

I have another Question. I do not understand having to enter this code, what is RMCF? I'm newbie:crazy:

UIAC.RMCF is where we configure overrides for USBInjectAll.kext's Info.plist.
 
UIAC.RMCF is where we configure overrides for USBInjectAll.kext's Info.plist.
ok but this code where it should be inserted? in SSDT.UIAC.aml?
 
ok but this code where it should be inserted? in SSDT.UIAC.aml?

Of course SSDT-UIAC.aml... as written in post #1.
That is if you were to use that feature of USBInjectAll.kext. But the hardware in your profile does not require it, as you will use an SMBIOS that uses USBX.
 
Of course SSDT-UIAC.aml... as written in post #1.
That is if you were to use that feature of USBInjectAll.kext. But the hardware in your profile does not require it, as you will use an SMBIOS that uses USBX

in my SSDT.UIAC.aml I entered the values for usbx but I did not notice any difference in the system.
 
in my SSDT.UIAC.aml I entered the values for usbx but I did not notice any difference in the system.

Diagnosis regarding your mistake not possible without problem reporting files.

No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
 

Attachments

  • debug_26269.zip
    2.3 MB · Views: 77
Back
Top