Contribute
Register

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

Joined
Apr 28, 2011
Messages
910
Motherboard
ASRock Fatal1ty Z370 Gaming-ITX/ac
CPU
i7-8700
Graphics
UHD 630
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
BTW, I would suggest naming your SSDTs after their function instead of with numbers.
Generally, we reserve SSDT-xx (where xx are digits) for patched OEM SSDTs (eg. SSDTs sourced from ACPI/origin).
I know it's a bit off topic, but is there some specific rule to name SSDTs.aml (maybe with the wrong name Clover can't load them?). I know I can use the clover configurator feature "SortedOrder", but aside from that (which I don't want to use) can I just name an SSDT.aml after anything I want?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Inserted all entries and SSDT's please check it.
If the USB Port injection and USB Power property are ok now?

Power properties are now present in ioreg (look under the 'EC' node).
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I know it's a bit off topic, but is there some specific rule to name SSDTs.aml (maybe with the wrong name Clover can't load them?). I know I can use the clover configurator feature "SortedOrder", but aside from that (which I don't want to use) can I just name an SSDT.aml after anything I want?

Any name ending in .aml will be loaded by Clover, provided no SortedOrder specified.
 
Joined
Dec 13, 2016
Messages
76
Motherboard
Gigabyte Z270X Ultra Gaming
CPU
i5-7600K
Graphics
970 GTX
Thanks, this is awesome! Keep up the great work RehabMan, I'm sure you hear it all the time, but your work and effort is deeply appreciated by the members of the Hackintosh community!

This means I can finally use Duet Display with my iPad, without it quickly running out of power :D
 
Joined
Oct 27, 2012
Messages
2
Motherboard
asrock z170 pro/d3
CPU
i5-6600k
Graphics
gtx 650 ti
Great work, i also want to report that after adding fake EC device and USBX, my boot in verbose is much cleaner, now i don't have anymore the message spamming "AppleUSBHostResources::allocateDownstreamBusCurrentGated: assuming successful wakeUnits...." for each port using 17,1 definition
 
Joined
Sep 26, 2015
Messages
126
Motherboard
Gigabyte H270N WiFi
CPU
i5-7500
Graphics
Quadro K1200
Mac
  1. MacBook Pro
This is probably the shortest and easiest SSDT fix I have read.
I am on z97 platform using iMac 16,2. Injected a fake EC, and also USBX in the SSDT-UIAC(currently overriding to the default value).
Not sure I'm doing it right.
All my USB ports were charging fine before this fix, they were slow, I am testing if I can override the default value to see if there's any change.
 

Attachments

  • ssdt-ec ssdt-uiac IOreg.zip
    908.6 KB · Views: 96

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
This is probably the shortest and easiest SSDT fix I have read.
I am on z97 platform using iMac 16,2. Injected a fake EC, and also USBX in the SSDT-UIAC(currently overriding to the default value).
Not sure I'm doing it right.
All my USB ports were charging fine before this fix, they were slow, I am testing if I can override the default value to see if there's any change.

iMac16,2 is not in the IOUSBHostFamily Info.plist, so you don't need the "AppleBusPowerControllerUSB" override (it is redundant)... only the USBX.
Other than that, you have the right idea...

Note: You could bring the code from SSDT-EC into your SSDT-UIAC if you wanted...
 
Joined
Jun 18, 2010
Messages
129
Motherboard
z390 Designaire
CPU
i9-9900K
Graphics
AMD Radeon VII
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
  4. Mac Pro
Classic Mac
  1. 128K
  2. 512K
  3. Classic
  4. Lisa
  5. Plus
  6. Portable
  7. Power Mac
  8. PowerBook
  9. Quadra
Mobile Phone
  1. iOS
I have several problems with USB. After wake from sleep I get continuous log spam about failures resetting the USB power state. Googling the error show that this happens to real Macs occasionally. The problem is similar to this thread https://www.tonymacx86.com/threads/usb-c-hotplug-questions.211313/

I get messages that the usb devices were disconnected improperly ( one message per device per dark ware cycle). I’ve tried Jettison and the solutions offered here but the problem persists.

My USB microphone does not connect on reboot or after sleep but un plugging and re plugging it fixes it.
This is the log spam that get output continuously after sleep:
Code:
default    14:22:30.745468 -0700    kernel    015183.452031 AppleUSBXHCIAR@00000000: AppleUSBXHCI::hardwareException: Error saving state
default    14:22:30.745475 -0700    kernel    015183.452040 AppleUSBXHCIAR@00000000: AppleUSBHostController::setPowerStateGated: going to state 1 returned 0xe00002e9
default    14:22:30.745530 -0700    kernel    015183.452094 AppleUSBXHCIAR@00000000: AppleUSBXHCIPCI::hardwareException: controller unplugged (regRead32)
default    14:22:30.745532 -0700    kernel    015183.452098 AppleUSBXHCIAR@00000000: AppleUSBXHCI::hardwareException: kUSBStatusControllerNotReady did not clear
default    14:22:30.745538 -0700    kernel    015183.452104 AppleUSBXHCIAR@00000000: AppleUSBHostController::setPowerStateGated: going to state 2 failed with 0xe00002e9
default    14:22:30.845713 -0700    kernel    015183.552260 AppleUSB20XHCIPort@00100000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
default    14:22:30.845722 -0700    kernel    015183.552286 AppleUSB20XHCIPort@00200000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
default    14:22:30.845723 -0700    kernel    015183.552286 AppleUSB30XHCIPort@00400000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
default    14:22:30.845727 -0700    kernel    015183.552292 AppleUSB30XHCIPort@00300000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
de
 

Attachments

  • ioreg.zip
    885.5 KB · Views: 63
  • RehabMan patchmatic z170x ud3 ultra .zip
    57.2 KB · Views: 57
  • Terminal Saved Output.zip
    1.3 KB · Views: 62
Last edited:

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I have several problems with USB. After wake from sleep I get continuous log spam about failures resetting the USB power state. Googling the error show that this happens to real Macs occasionally. The problem is similar to this thread https://www.tonymacx86.com/threads/usb-c-hotplug-questions.211313/

I get messages that the usb devices were disconnected improperly ( one message per device per dark ware cycle). I’ve tried Jettison and the solutions offered here but the problem persists.

My USB microphone does not connect on reboot or after sleep but un plugging and re plugging it fixes it.
This is the log spam that get output continuously after sleep:
Code:
default    14:22:30.745468 -0700    kernel    015183.452031 AppleUSBXHCIAR@00000000: AppleUSBXHCI::hardwareException: Error saving state
default    14:22:30.745475 -0700    kernel    015183.452040 AppleUSBXHCIAR@00000000: AppleUSBHostController::setPowerStateGated: going to state 1 returned 0xe00002e9
default    14:22:30.745530 -0700    kernel    015183.452094 AppleUSBXHCIAR@00000000: AppleUSBXHCIPCI::hardwareException: controller unplugged (regRead32)
default    14:22:30.745532 -0700    kernel    015183.452098 AppleUSBXHCIAR@00000000: AppleUSBXHCI::hardwareException: kUSBStatusControllerNotReady did not clear
default    14:22:30.745538 -0700    kernel    015183.452104 AppleUSBXHCIAR@00000000: AppleUSBHostController::setPowerStateGated: going to state 2 failed with 0xe00002e9
default    14:22:30.845713 -0700    kernel    015183.552260 AppleUSB20XHCIPort@00100000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
default    14:22:30.845722 -0700    kernel    015183.552286 AppleUSB20XHCIPort@00200000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
default    14:22:30.845723 -0700    kernel    015183.552286 AppleUSB30XHCIPort@00400000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
default    14:22:30.845727 -0700    kernel    015183.552292 AppleUSB30XHCIPort@00300000: AppleUSBXHCIPort::powerOn: deadline passed (PORTSC 0x00000000)
de

I don't think your issue is related to this topic, but you have not implemented post #1... (missing EC device). Your H_EC is inactive (_STA returns 0), so you don't want use use the H_EC rename. Remove it and add SSDT-EC.aml.

Also a different topic, but your UsbConnector values look wrong.
It is impossible to have 6 SSxx ports marked UsbConnector=3, but 8 HSxx ports also marked UsbConnector=3.
There should be a 1:1 correlation between HSxx/SSxx marked UsbConnector=3.
 
Last edited:
Joined
Jan 29, 2012
Messages
73
Motherboard
Gigabyte z390 Designare
CPU
i9 9900k
Graphics
Vega 64
Mac
  1. MacBook Pro
  2. Mac mini
Mobile Phone
  1. iOS
Hi RehabMan. Can you take a look at my files? Still can't get this working. Last time I was able to charge my iPad and use an external Apple DVD drive was under Yosemite... Thanks for all you do.
 

Attachments

  • EFI copy.zip
    2.2 MB · Views: 64
  • T-Mac.ioreg
    9.7 MB · Views: 110
Top