Jump to content

[Guide] HOW TO: USB port mapping

Recommended Posts

  • Administrators

The goal of this guide is to help configuring our hack in a more comfortable way, without using Usbinjectall and no port limit config.plist patch.


In this way, our hack will be more "Apple style" and it will have 15 USB ports as any real OSX Apple pc has


A better way to have a perfect hack! :-)




Tools for this task:






USB pen (2.0, 3.0)


@PMheart[/mention] port limit patch in config.plist


Add usbinjectall.kext in EFI/CLOVER/ACPI/patched






Mapping procedure…




Open IOReg, search for XHC or XHCI


Note: If our USB are named XHC1 we have to use a config patch to rename it


scherm76.png"><a href=https://i62.servimg.com/u/f62/19/64/14/46/scherm76.png' alt='scherm76.png'>


Now we have to connect for all our USB ports (used or unused) an USB pen 2.0 and 3.0


Note: in this step IORegistryExplorer.app must be open and we have to do previous USB inserting procedure for all ports




After this task is complete we should have a situation like this:


scherm71.png"><a href=https://i62.servimg.com/u/f62/19/64/14/46/scherm71.png' alt='scherm71.png'>




USB will be shown in red color when detached from port


We have to analyze previous image and keep in mind unused USB ports ( in previous image are HS02-HS04)


It is only a guidelines, you should have different and unused ports as IE SSPx




Meaning of different naming for USB ports:


HSxx = USB 2.0


SSPx= USB 3.0




Now we need to create a SSDT to disable unused port (remember our goal is to have only 15 USB mapped ports)




Generic Rehabman method (SSDT based)



Open with MaciASL app our SSDT


We have to delete unused USB ports because this SSDT has inside all ports available in our motherboard


scherm72.png"><a href=https://i62.servimg.com/u/f62/19/64/14/46/scherm72.png' alt='scherm72.png'>


To remove unused USB ports you have to remove the highlighted portion in the image. It is only an example I can't know if that port is used or not in your system


When we have removed all ports we want, we have to define used port count number


"port-count", Buffer() { 26, 0, 0, 0 },


26 is the number of all USB ports available on Skilake chipset and greater.


OSX has a limit of 15 ports by default




we have to change 26 port count number with a number of 15…not greater than this.


By now focus our attention to "UsbConnector"


We have to define "port type", if it is an USB 2.0 or 3.0, if it is an internal one. See picture below


scherm73.png"><a href=https://i62.servimg.com/u/f62/19/64/14/46/scherm73.png' alt='scherm73.png'>




So usb 2.0 will have "UsbConnector", 0,


usb 3.0 will have "UsbConnector", 3,


Instead, internal usb will have "UsbConnector", 255, ( 0xFF)






@ Apple




@ Pokenguyen (He discovered in El Capitain era USB port limit introduced by Apple)


@ PJalm


@ Piker


@ Rehabman






Alternative Method based on own ACPI, compatible with Skylake chipset and greater one





This is method I prefer and i use it from many years for my hack or for my friend's hack


IMHO it is the best method because it uses our own SSDT without using others


Let extract our ACPI table with the help of Clover( this dump require clover itself installed on ESP)


Press F4 key in clover bootmenu stage (GUI). For safety (data writing on disk) wait about 30s before booting into OSX


We have to mount EFI boot disk partition


Go to EFI/Clover/acpi/origin


Here we will find all ACPI table of our system, we have to search in particular way USB related.


In the vast majority of cases table will be named xh_rvp08 or xh_rvp10




Open it with MaciASL app


Focus our attention on USB and on this code section of our motherboard, let start from first USB port (HS01):

[code]Scope (\_SB.PCI0.XHC.RHUB.HS01)
       Method (_UPC, 0, NotSerialized)  // _UPC: USB Port Capabilities
           Return (GUPC (One)).         }

       Method (_PLD, 0, NotSerialized)  // _PLD: Physical Location of Device
           Return (GPLD (One, 0x02))



Ok, now we have to modify simply this value, One means true/enabled,


For every single USB you have to modify this code's part:




Return (GUPC (One))




Enabled port we will leave One


Disabled port we will change One with Zero


Our code will be:

[code]Scope (\_SB.PCI0.XHC.RHUB.HS01)
       Method (_UPC, 0, NotSerialized)  // _UPC: USB Port Capabilities
           Return (GUPC (Zero))         }

       Method (_PLD, 0, NotSerialized)  // _PLD: Physical Location of Device
           Return (GPLD (One, 0x02))





When we have done all modify we desire we have done :)




End part




Put our SSDT to EFI/Clover/acpi/patched




This will not be enough because our original table (OEM) is always loaded and in this way our monied SSDT will not produce any good effect to our hack


We have "to drop" OEM table (USB table)


What does it mean?


It means to block original OEM table from loading to permit our SSDT to work fine


Open config.plist, look at ACPI/Drop Tables


Left mouse click to + symbol


Choose SSDT —> Tabled , close to it write the exact name of OEM table we have to block, in our case xh_rvp08


We will have this result:


scherm74.png"><a href=https://i62.servimg.com/u/f62/19/64/14/46/scherm74.png' alt='scherm74.png'>


Remove or disable port limit patch in kext to patch clover section and save it


Remove usbinjectall.kext from our EFI/clover/ACPI/KEXT/ folder








Run Ioreg explore app and searching on it for XHC we will see only used and mapped port


In this pictures is represented my working hack


scherm75.png"><a href=https://i62.servimg.com/u/f62/19/64/14/46/scherm75.png' alt='scherm75.png'>




Good Hack !

Link to post
Share on other sites
  • Administrators

Series 8/9 (Haswell) Method


Another method for this hardware series is to make some changes directly on the dsdt because the usb are defined here


All this is done by _UPC modifying and adding this part of the code

[code]Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
     0xFF, //Connector type (N/A for non-visible ports)



Manual editing and its addition may not be easy for everyone, so I wrote a patch to help you


The patch is written with, by default, the first usb2 port then HS01


So you will have to modify this patch for each port to be deactivated by changing it on HS01 with HS03 or SSP3 for example and then apply it again




Note: the patch may work on other series, but I have not tested it myself, so that's why I've defined for haswell


in case .. as well as in case of problems..have to know by attaching your tables clean acpi!





Link to post
Share on other sites
  • Administrators

X299 Update




The procedure is the same as Skylake and greater with some further attention and changes


Extract the acpi tables by pressing F4 in the clover gui, go to origin folder and look for ssdt related to usb




In my example it is SSDT-2-AMI.aml


once opened we find starting from the first usb



[code] Scope (\_SB.PC00.XHCI.RHUB.HS01)
       Method (_UPC, 0, NotSerialized)  // _UPC: USB Port Capabilities
           Return (GUPC (0x01))         }



As for the other cases we have to change GUPC (0x01) in GUPC (Zero)


To be repeated for each USB port to be deactivated


so the final code will be:



[code] Scope (\_SB.PC00.XHCI.RHUB.HS01)
       Method (_UPC, 0, NotSerialized)  // _UPC: USB Port Capabilities
           Return (GUPC (Zero))                }



finished to deactivate our ports not in use on X299 you need to make other changes


Having PC00 finished originally in the acpi, x299 must and uses a rename acpi on the config PC00 to PCI0




What is the problem?


If we put our ssdt in patched clover folder this one will not be loaded even if dropped original oem table because "all" the acpi have at that point, thanks to the clover rename PCI0


Our patched and injected again table instead will always have PC00 and this is not good .... so




In our compiler go on Find, let's check it on "Replace"


and we modify everything from PC00 to PCI0 as shown below

Schermata 2019-09-26 alle 17.09.25.jpg if you need to remove your patched ssdt, remember to remove the related Drop Tables


Otherwise you may have problems at boot or no usb working .. because obviously as said before that function blocks the loading of the OEM table and then this table will never be loaded because it is also missing from patched ..






NOTE-2: You can rename this ssdt put in patched .. for example SSDT_DisableUSB.aml


But remember that in SortedOrder the name must be the same


So as you change your name to the ssdt you change them too ...


Good Hack! empticons_thu

Schermata 2018-09-01 alle 16.56.46.png

drop tables.png



Schermata 2018-09-01 alle 16.56.46.png

drop tables.png



Link to post
Share on other sites
  • 6 months later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.