Contribute
Register

[SUCCESS] Gigabyte Z170N-WIFI - Sierra- 10.12.6 - Custom SSDT for USBINjectall.kext

Status
Not open for further replies.
Joined
Feb 3, 2017
Messages
183
Motherboard
Dell XPS 13 9350 - BIOS 1.7
CPU
i7-6500U
Graphics
HD 520, 3200 x 1800
Mac
  1. iMac
  2. MacBook Air
  3. Mac mini
Mobile Phone
  1. iOS
Update 14/12/19
You can still do below but there is an easier ways to do this now - if you are not interested in the technical background -

USB using Hackintool




This is as per title a custom SSDT GA-Z170N-WIFI Mobo only.

*****
update 12 may 2018
updated my dsl .aml with correct porttypes for USB-C (porttype dec 10 or hex x0A, I have USBC without switch, so this creates an extra SS port when flipping connector over )and Express Card (porttype 2)
incorporated EC object and USBX object to allow correct powerproperties injection
as per link below.
https://www.tonymacx86.com/threads/guide-usb-power-property-injection-for-sierra-and-later.222266/

you can see my new dsl at post
#7
**********


1. Bios Options

XHCI - Smart auto

2. Disabling the default injectors

There are no EHCI controllers in 100 series so no need to patch for apple’s own default controller injectors.
Not sure about the second class of injectors (hub) (I don’t fully understand that yet) , will look at that if I run into problems.
See
https://www.tonymacx86.com/threads/guide-10-11-usb-changes-and-solutions.173616/

3. Install USBInjectAll.Kext

Install to /Library/Extensions

sudo cp -R Release/USBInjectAll.kext /Library/Extensions
sudo touch /Library/Extensions && sudo kextcache -u /

4. Install disable port limit patch
On this machine I have still Sierra 10.12.6 installed.
So find the patch in the file
config_patches.plist @ https://github.com/RehabMan/OS-X-USB-Inject-All
There is a 10.12.x patch for XHCI. (Great!)

<dict>
<key>Comment</key>
<string>change 15 port limit to 26 in XHCI kext</string>
<key>MatchOS</key>
<string>10.12.x</string>
<key>Name</key>
<string>com.apple.driver.usb.AppleUSBXHCIPCI</string>
<key>Find</key>
<data>g710////EA==</data>
<key>Replace</key>
<data>g710////Gw==</data>
</dict>



Open your config.plist on your EFI partition with PlistEditPro and add an entry under KernelAndKextPatches/KextstoPatch

kexttopatch 15 port limit to 26 in XHCI 1xx series.jpeg

5. Testing ports

After rebooting
Open your IoRegistryExplorer

IOResources/PCI0@0/AppleACPIPCO/XHC@14/XHC@14000000
XHCports fullinjection.jpeg



So
HS01 to HS14
SS01 to SS10
USR1 to USR2

By plugging in a USB2/3 hub ( I also had a USB-C hub ) into the ports you can see which ports correspond to which ports.
So I found
HS01 to HS07 , and
SS01 to SS07 , and
HS08 internal connected to my BCM2045A (I replace stock with wifi /BT card Dell 1830 )

Z170N WIFI backports .jpegZZ170Nwifi mobo photo.jpeg

6. Choosing ports for custom SSDT

To stay underneath the 14 port limit of XHC
I choose to allocate following 13 ports (you may want to change to others)
HS01/SS01 & HS02/SS02 for easy usb2/3 access at the top of my case
SS03: usb 3 only - have permanent external USB3 HDD attached
SS05 USB 3 only - I have permanent external USB3 HDD attached (so don’t need USB2)
HS04/SS04 & HS06/SS06 - two ports USB2/3 at the back
HS07/SS07: USB -C port


HS08: used for Broadcom B/T mini pcie m2 card


Z170N WIFI backports  trimmed.jpegInwin case open.jpeg

7. Creating Custom SSDT - DSL files
  • use SSDT-UIAC-ALL.dsl as a template (https://github.com/RehabMan/OS-X-USB-Inject-All/raw/master/SSDT-UIAC-ALL.dsl)
  • open the .dsl file in maciASL
  • remove configuration sections that don't apply to the target hardware, in this case the target hardware is pci8086,a12f (see IOName property for XHC14 in ioregiststry explorer, picture above) so just kept the 8086_a12f", Package()
  • remove ports from the various sections that are not needed: just keeping HS01, HS02, HS05,HS06,HS07,HS08, SS01, SS02,SS03,SS04,SS05,SS06
  • change UsbConnector values to match physical hardware/ports


Code:
// SSDT-UIAC-ALL.dsl GA-Z170N-WIFI 13 Ports chosen
//
// //
// Note:
//
//

DefinitionBlock ("", "SSDT", 2, "hack", "UIAC", 0)
{
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {

            "8086_a12f", Package()
            {
                "port-count", Buffer() { 26, 0, 0, 0 },
                "ports", Package()
                {
                    "HS01", Package() // see my guide for exact location of this port and other ports
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HS02", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HS06", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 6, 0, 0, 0 },
                    },
                    "HS07", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 7, 0, 0, 0 },
                    },
                    "HS08", Package()
                    {
                        "UsbConnector", 0,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
                    "SS01", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 17, 0, 0, 0 },
                    },
                    "SS02", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 18, 0, 0, 0 },
                    },
                    "SS03", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 19, 0, 0, 0 },
                    },
                    "SS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 20, 0, 0, 0 },
                    },
                    "SS05", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 21, 0, 0, 0 },
                    },
                    "SS06", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 22, 0, 0, 0 },
                    },
                    "SS07", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 23, 0, 0, 0 },
                    },
                },
            },
         })
     }
}
//EOF


Compile this file and place it in EFI/Clover/ACPI/patched.

In MaciASL, you can compile as AML by using File -> Save As, format: ACPI Machine Language Binary. Save it to a location you know how to navigate to (desktop).
maciASL save as.jpeg maciasl save as ACPI machine binary.jpeg


Then mount your EFI partition and copy it to EFI/Clover/ACPI/patched. You can use any name in the patched so I used SSDT-UIAC-Z170N WIFI 13 Ports.aml.

I have attached the .aml if you wanted to use.
***Please be aware that the layout of the ports may not suit your purposes, it serves mine. So if it doesn't create you own .dsl with the ports you like and compile

8. Reboot and check if SSDT is working

HS02 is my USB keyboard
HS08 Still broadcom
SS03 external USB3 HDD
SS05 external USB3 HDD

Working!
IOregtrimmed to 13 ports Z170N WIFI.jpeg



9. Remove the port limit patch

from entry under KernelAndKextPatches/KextstoPatch in your config.plist and reboot[/B]
 

Attachments

  • SSDT-UIAC-Z170N WIFI 13 Ports.aml
    620 bytes · Views: 345
Last edited:
@YoshiMac

Thanks a lot of the detailled instruction ! Will make use of it for sure to generate one for my board ! :)

May I ask you : How do you figure out which ports are for non usb port, i.e. Bluetooth for instance?
 
@YoshiMac

Thanks a lot of the detailled instruction ! Will make use of it for sure to generate one for my board ! :)

May I ask you : How do you figure out which ports are for non usb port, i.e. Bluetooth for instance?


You’re welcome!


Open up IORegistryExplorer.app (download if you haven’t yet)
go to XHC@14 (under AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI )
You will see all ports.
If port has a device it will have a triangle next to it, click on it to see more details ( if not already).
The description will usually be enough to figure out what device it is.

See below example
HS08 SS03 SS05 have devices in them (triangles)

HS08 has got BCM2045A0 (BCM=Broadcom)


XHCports fullinjection.jpeg
 
You’re welcome!


Open up IORegistryExplorer.app (download if you haven’t yet)
go to XHC@14 (under AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI )
You will see all ports.
If port has a device it will have a triangle next to it, click on it to see more details ( if not already).
The description will usually be enough to figure out what device it is.

See below example
HS08 SS03 SS05 have devices in them (triangles)

HS08 has got BCM2045A0 (BCM=Broadcom)


View attachment 325135

Thank you !

I am doing the procedure today for my Gigabyte Z370 Gaming Aorus Gaming 5 :)
 
Thank you !

I am doing the procedure today for my Gigabyte Z370 Gaming Aorus Gaming 5 :)

Good luck. Just be sure to check
Forums for 300-series support:
I think you will need to use the same XHCI injector as the 200-series but don’t know for sure.

See below

Specific Recommendations (200-series)

As of 10.12.3, there is no chipset support for the XHC controller on 200-series chipsets. As a result, we need an injector kext to load the 100-series driver. Use XHCI-200-series-injector.kext as per USBInjectAll README.

Also, see additional information for 100-series (below)
 
Good luck. Just be sure to check
Forums for 300-series support:
I think you will need to use the same XHCI injector as the 200-series but don’t know for sure.

See below

I used it because I installed it with Multibeast :) Haven't tried to remove the injector though.

I made my SSDT and it went flawlessly ! Thank you for your tutorial, it really did help when I was unsure to understand everything while reading the original tutorial by RehabMan
 
updated my asl file with proper power injection for USB and correct connector type for BT and USB type C.
my type C is without switch so I get two different SS ports depending on orientation of plug so added SS08

Code:
// SSDT-UIAC-ALL.dsl GA-H170N-WIFI 13 Ports chosen
//
// //
// Note:
// 
//

DefinitionBlock ("", "SSDT", 2, "hack", "UIAC", 0)
{
 // no EC device on H170N wifi so created a fake EC - to allow proper powerinjection USB   
    Device(_SB.EC) 
    {
        Name(_HID, "EC000000")
    }
// USBX needed because SMBIOS model (17,1) not in IOUSBHostFamily.kext/Contents/Info.plist
    Device(_SB.USBX) 
    {
        Name(_ADR, 0)
        Method (_DSM, 4)
        {
            If (!Arg2) { Return (Buffer() { 0x03 } ) }
            Return (Package()
            {
                // these values from iMac17,1
                "kUSBSleepPortCurrentLimit", 2100,
                "kUSBSleepPowerSupply", 5100,
                "kUSBWakePortCurrentLimit", 2100,
                "kUSBWakePowerSupply", 5100,
            })
        }
    }

    
    
  // USB injectall configuration - UIAC   
    
    
    
    
    
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {

            "8086_a12f", Package()
            {
                "port-count", Buffer() { 26, 0, 0, 0 },
                "ports", Package()
                {
                    "HS01", Package() // see my guide for exact location of this port and other ports
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HS02", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HS06", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 6, 0, 0, 0 },
                    },
                    "HS07", Package()
                    {
                        "UsbConnector", 10,
                        "port", Buffer() { 7, 0, 0, 0 },
                    },
                    "HS08", Package() // BT module needs usbconnector  2 - expresscard connector
                    {
                        "UsbConnector", 2,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
                    "SS01", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 17, 0, 0, 0 },
                    },
                    "SS02", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 18, 0, 0, 0 },
                    },
                    "SS03", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 19, 0, 0, 0 },
                    },
                    "SS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 20, 0, 0, 0 },
                    },
                    "SS05", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 21, 0, 0, 0 },
                    },
                    "SS06", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 22, 0, 0, 0 },
                    },
                    "SS07", Package() // USB C without switch port - 2 SSxx ports depending on orientation of plug
                    {
                        "UsbConnector", 10,
                        "port", Buffer() { 23, 0, 0, 0 },
                    },
                    "SS08", Package() // USB C without switch port - 2 SSxx ports depending on orientation of plug
                    {
                        "UsbConnector", 10,
                        "port", Buffer() { 24, 0, 0, 0 },
                    },

                },
            },
         })
     }
}
//EOF
 
Thanks Yoshi. I am finally able to use the USB-C port thanks to your tutorial. Awesome!
 
Thanks for this! I have no USB-C device to test the port but I could make everything work on a customized file!
I'm bugged by the problem that the integrated ethernet controller is not recognized and therefore I have no built in net device and can't authenticate on iCloud. Is there anything I can do about it related to this technique? I have your same MB, that's why I ask :) Thanks!
 
Thanks for this! I have no USB-C device to test the port but I could make everything work on a customized file!

You are welcome, glad the guide helped.
BTW I wrongly state in my guide that the port limit is 14 actually it is 15, so you have an extra port if you want.

I'm bugged by the problem that the integrated ethernet controller is not recognized and therefore I have no built in net device and can't authenticate on iCloud. Is there anything I can do about it related to this technique? I have your same MB, that's why I ask :) Thanks!


You mean Wifi ethernet controller or the wired Gigabit ethernet?

The wifi controller
You have to install a supported other card.
I haven't fully implemented yet, since I don't really need.
However I have ordered and received some new hardware and will try out when I have some more time.
When I do I will update my built page for this hardware setup
https://www.tonymacx86.com/threads/succesful-gigabyte-z170n-wifi-customac-mini-first-timer.214348/


Gigabit Wired Ethernet
However works great and is what I am using
I installed IntelMausiEtherenet.kext.
Only one port works though the one closest to the audio outputs ports above the usb2/3 ports.
The one above the usb-c port does not work.

built in ethernet.jpeg

Z170N WIFI backports  copy 2.jpg
 
Status
Not open for further replies.
Back
Top