Contribute
Register

USB port limit patch for 14.1, 14.2, 14.3, 14.5,14.6

Joined
Apr 18, 2018
Messages
12
Motherboard
Gigabyte Z370M-D3H M-ATX
CPU
Core i7-8700K Coffee Lake
Graphics
Gigabyte Radeon RX 560 4GB
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
@ydeng
This saved the day for me! All USB2 & 3 ports visible and working. Thank you
Do you still need USBInjectAll.kext together with the 3 patches?
Reading your last implies that EH01/02/EHC can be removed from port definitions?
 
Joined
May 27, 2016
Messages
84
Motherboard
Asus x99 Delux II
CPU
i7 6950
Graphics
Radeon VII
Mac
  1. iMac
Classic Mac
  1. PowerBook
Only applies to XHCI controllers. Removing explicit port definitions in DSDT and naming controllers to XHC (or anything not XHC1) so that AppleUSBXHCIPCI Info.plist do not provide default port definitions causes AppleUSBXHCI to enumerate all ports from controller capability registers. If you route EHCI controller ports to XHC by defining

<key>IOProviderMergeProperties</key>
<dict>
<key>kUSBMuxEnabled</key>
<true/>
</dict>

in AppleUSBEHCIPCI.kext/Contents/Info.plist or a separate AppleUSBMergeNub kext, it might work.
 
Joined
Feb 20, 2019
Messages
1
Motherboard
z370 Auros Gaming 3
CPU
17-8700k
Graphics
rx 580
Confirmed this is working ! I used all three patches. Not sure if its a culmination of all previous patches but I currently have this patch, USBinjector, Custom USB Kext made from another guide with FB patcher/Hackintool
 
Joined
Apr 8, 2011
Messages
50
Motherboard
Gigabyt H67MA USB3 B3
CPU
i7-3770
Graphics
Zotac Geforce GT640
Mac
  1. iMac
  2. MacBook Air
  3. Mac mini
Mobile Phone
  1. Android
  2. iOS
@ydeng you made my day! thanks a LOT for this one i was struggeling on USB3 for weeks.
I applied the 3 patches + the @edisonleenan one you mentioned and USB3 works perfectly at full speed.
Thanks you guys!
Romain
 
Joined
Nov 8, 2013
Messages
72
Motherboard
Gigabyte GA-Z97X-UD7 TH
CPU
i7-4770K
Graphics
GT 640
Mobile Phone
  1. Android
Can these patches be made directly/literally as in the first post to config.plist via a text editor under Linux? After the upgrade to Mojave on one of my machines, my USB keyboard and mouse don't work so I can't get past the login screen and therefore can't do it in Clover Configurator. It seems that the values are given as hashes rather than hex values:

<string>USB Port limit patch 10.14 (credits FredWst)</string>
<key>MatchOS</key>
<string>10.14.x</string>
<key>Name</key>
<string>com.apple.driver.usb.AppleUSBXHCI</string>
<key>Find</key>
<data>g32UDw+DlwQAAA==</data>
<key>Replace</key>
<data>g32UD5CQkJCQkA==</data>

This apparently should work, but doesn't. Should I change the data values as in the first post?

I can do the edits under Linux after mounting the MacOS EFI partition.

Thanks!
 
Joined
Feb 25, 2019
Messages
19
Motherboard
ASRock - H370M-ITX/ac
CPU
i5-8400
Graphics
Vega 56
Thanks @ydeng! You rock! :headbang:
After adding the patches mentioned in post1 I created a SSDT-UIAC.aml file using the USBMap script.
The patch allowed to run the script without disabling the SS_ or HS_ ports to perform the scan.
Actually, the USBMap guide should be made sticky.

After adding the SSDT to EFI/CLOVER/ACPI/patched and specifying the file name in the SortedOrder list I disabled the kext patches.

USB 3 works on all the blue ports. USB 2 works on all the black ports and the internal bluetooth module is working.

Attached the SSDT-UIAC.aml and USBMap.kext files for the Asrock H370m-ITX/ac with 6 USB2 ports: 5 internal ports and 2 at the back of MLB and 9 USB3 ports: 2 front panel and all the 3.1 ports on the MLB but the 3.2 ports (light blue).
 

Attachments

  • USBMap.zip
    3.8 KB · Views: 123
Last edited:
Joined
Aug 30, 2018
Messages
1,466
Motherboard
Asus ROG Strix Z390 I-Gaming
CPU
i7-8700K
Graphics
Vega 64
Mac
  1. MacBook
Classic Mac
  1. 512K
  2. iMac
Mobile Phone
  1. iOS
Some people say there might be memory error by allowing port number to go above 15. That is not true because AppleUSBXHCI actually read hardware registers to allocate memory, for example activeDeviceSet is constructed from Max Device Slots value in HCSPARAMS1. Port limit checks can be safely removed. People might wonder why the first place to limit ports is in AppleUSBXHCI not AppleUSBXHCIPCI. Well, AppleUSBXHCIPCI constructs ports property and calls super class (AppleUSBXHCI) method to enumerate ports. If ports property is defined, only ports listed will be constructed. If no such property exists, AppleUSBXHCI goes through all capabilities defined in the controller. That means by deleting all ACPI USB port definitions, all ports will be enumerated!

Just to be clear, are you saying that removing the port limit allows OSX to automatically enumerate all the ports safely? If that's the case, why would we even need an SSDT?
 
Last edited:

UtterDisbelief

Moderator
Joined
Feb 13, 2012
Messages
8,008
Motherboard
Gigabyte Z590i Aorus Ultra - OC 0.8.0
CPU
i5-10600k
Graphics
Dell RX560
Mac
  1. iMac
  2. Mac mini
Classic Mac
  1. eMac
  2. iBook
Mobile Phone
  1. iOS
This following patch allows root hub port limit over 0xf to 0x3f.

Patch 1
Comment: USB port limit patch 10.14.1 10.14.2 (credit ydeng)
Name: IOUSBHostFamily
Find: 00e0 83fb 0f0f 8716 0400
Replace: 00e0 83fb 3f0f 8716 0400

This need to be used together with AppleUSBXHCI patch published elsewhere (https://www.tonymacx86.com/threads/solved-mojave-10-14-1-update-lost-usb-3-0.264125/).

Patch 2
Comment: USB Port limit patch 10.14.1, 10.14.2
Name: com.apple.driver.usb.AppleUSBXHCI
Find: 00 00 83 FB 0F 0F 83 8F 04 00 00
Replace: 00 00 83 FB 3F 0F 83 8F 04 00 00

Mojave 14.1 has an additional check in AppleUSBHostPort::setPortLocation to limit maximum number of ports to 0xf.

__text:0000000000015CC6 test ebx, ebx; port number passed in the argument, zero for root hub ports
__text:0000000000015CC8 jnz short loc_15CD2
__text:0000000000015CCA mov ebx, [r12+0D0h] ; port id from port property
__text:0000000000015CD2 loc_15CD2:
__text:0000000000015CD2 mov r14d, 0E00002C2h
__text:0000000000015CD8 cmp ebx, 0Fh ; check port id is not above 0xf
__text:0000000000015CDB ja loc_160F7

Patch 3
One more to fix port names: https://www.tonymacx86.com/threads/usb-port-limit-patch-for-14-1-14-2-14-3.268893/#post-1888473

Hello @ydeng - You are doing some great work here, thank you, but please complete your PROFILE as outlined in the Official site Rules.

There seem to be limitations to these patches as they don't work on all hardware. It would be useful to know which motherboards/chipsets they work with :thumbup:
 

Feartech

Moderator
Joined
Aug 3, 2013
Messages
27,540
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
Hello @ydeng - You are doing some great work here, thank you, but please complete your PROFILE as outlined in the Official site Rules.

There seem to be limitations to these patches as they don't work on all hardware. It would be useful to know which motherboards/chipsets they work with :thumbup:
it's already in the signature :)
 
Top