Jump to content

USB SSDT power management GIGABYTE Z390 M GAMING


Aldaro
 Share

2 posts in this topic

Recommended Posts

I followed RehabMan's guide for creating an SSDT for my USB ports, and while all specified ports seem to be injected correctly, I am having numerous issues with power management. I am getting the usual errors like "device using too much power" and "connect accessory to port on your Mac". When I look at system profiler, USB, I notice that a number of devices report a power requirement of 0 mA (which is of course incorrect). I disassembled my DSDT, and noticed that the device h_EC had a method STA that returned zero, which, as far as I know, means that device is unused as per ACPI specification. I created a simple SSDT-EC, as well as SSDT-USBX to try to inject power properties, and while the EC device seems to load in IOreg, I am not having any luck in getting this to work correctly. What am I missing?

 

SSDT-UIAC

// SSDT-UIAC-ALL.dsl
//
// This SSDT can be used as a template to build your own
// customization for USBInjectAll.kext.
//
// This SSDT contains all ports, so using it is the same as without
// a custom SSDT.  Delete ports that are not connected or ports you
// do not need.
//
// Change the UsbConnector or portType as needed to match your
// actual USB configuration.
//
// Note:
// portType=0 seems to indicate normal external USB2 port (as seen in MacBookPro8,1)
// portType=2 seems to indicate "internal device" (as seen in MacBookPro8,1)
// portType=4 is used by MacBookPro8,3 (reason/purpose unknown)
//

DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0)
{
        Device (_SB.USBX)
    {
        Name (_ADR, Zero)  // _ADR: Address
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (!Arg2)
            {
                Return (Buffer (One)
                {
                     0x03                                             // .
                })
            }

            Return (Package (0x08)
            {
                "kUSBSleepPortCurrentLimit", 
                0x0834, 
                "kUSBSleepPowerSupply", 
                0x13EC, 
                "kUSBWakePortCurrentLimit", 
                0x0834, 
                "kUSBWakePowerSupply", 
                0x13EC
            })
        }
    }
    Device(UIAC)
    {
        Name(_HID, "UIA00000")

        Name(RMCF, Package()
        {
            "8086_a36d", Package()
            {
                "port-count", Buffer() { 26, 0, 0, 0 },
                "ports", Package()
                {
                    "HS01", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 1, 0, 0, 0 },
                    },
                    "HS02", Package()
                    {
                        "UsbConnector", 9,
                        "port", Buffer() { 2, 0, 0, 0 },
                    },
                    "HS03", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 3, 0, 0, 0 },
                    },
                    "HS04", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 4, 0, 0, 0 },
                    },
                    "HS05", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 5, 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", 3,
                        "port", Buffer() { 8, 0, 0, 0 },
                    },
                    "SS01", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 17, 0, 0, 0 },
                    },
                    "SS02", Package()
                    {
                        "UsbConnector", 9,
                        "port", Buffer() { 18, 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 },
                    },
                    "SS08", Package()
                    {
                        "UsbConnector", 3,
                        "port", Buffer() { 24, 0, 0, 0 },
                    },

                },
            },
        })
    }
}
//EOF

SSDT-EC

// Inject Fake EC device
DefinitionBlock("", "SSDT", 2, "hack", "EC", 0)
{
    Device(_SB.EC)
    {
        Name(_HID, "EC000000")
    }
}
//EOF

 

The specs for my hack are as follows:

 

Mobo: GIGABYTE Z390 M GAMING - UEFI vF8

CPU: Intel core i5 9600k

RAM: 4x 8GB sticks of Crucial Ballistic DDR4 clocked at 2666 MHz

GPU: MSI AMD Radeon RX 580 w/ 8GB vram

NIC: Intel i210 - I got this, because I wanted something that was natively supported by macOS, as well as having one less additional kext to worry about

Storage 2x Samsung 970 EVOs (500GB) and Intel 660p 512GB. One of the 970 EVOs is connected to a PCIe x4 NVME card

Case: Thermaltake core v21

PSU SeaSonic 750w 80 plus platinum

 

UEFI settings worth mentioning:

iGPU > enabled

DVMT preallocated memory > 32MB (anything higher results in the dreaded "cannot allocate runtime area" error on boot up)

Above 4g decoding > enabled

 

Clover - drivers

ApfsDriverLoader.efi

DataHubDxe.efi

EmuVariableUefi.efi

FSInject.efi

HFSPlus-64.efi

OsxAptioFix3Drv.efi

PartitionDxe.efi

VirtualSMC.efi

 

clover - kexts (injected if needed found in KEXTS/Other)

AppleALC

Lilu

WhateverGreen

VirtualSMC

USBInjectall

these kexts, as well as lilufriend, and some of the other VirtualSMC kexts are installed in L/E

 

Clover - config.plist options

ACPI fixes

FixHPET, FixRTC, add MCHC, FixTNR, FixPIC

ACPI renames

XHCI > XHC, XHC1 > XHC, SAT0 > SATA, as well as EHC1/2 > EH01/2

ACPI DSDT drop tables: DMAR & MATS (FixHeaders also checked)

Generate options: Plugin type

 

I am using the iMac 19,1 SMBIOS for this build as it closely resembles my specs. Anyway, thank you to everyone for taking the time to read this!

Link to comment
Share on other sites

  • 2 months later...

try it, it works for me
 

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20200110 (64-bit version)
 * Copyright (c) 2000 - 2020 Intel Corporation
 * 
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of iASLH4HVo9.aml, Fri Jan 31 19:06:11 2020
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x0000026D (621)
 *     Revision         0x01
 *     Checksum         0x71
 *     OEM ID           "hack"
 *     OEM Table ID     "UIAC"
 *     OEM Revision     0x00003000 (12288)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20200110 (538968336)
 */
DefinitionBlock ("", "SSDT", 1, "hack", "UIAC", 0x00003000)
{
    Device (UIAC)
    {
        Name (_HID, "UIA00000")  // _HID: Hardware ID
        Name (RMCF, Package (0x02)
        {
            "8086_a36d", 
            Package (0x04)
            {
                "port-count", 
                Buffer (0x04)
                {
                     0x18, 0x00, 0x00, 0x00                           // ....
                }, 

                "ports", 
                Package (0x1A)
                {
                    "SS01", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x11, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "SS02", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x12, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS03", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x02, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x03, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS04", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x02, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x04, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS05", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x05, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "SS05", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x15, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS06", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x06, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "SS06", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x16, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS07", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x07, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "SS07", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x17, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS08", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x08, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "SS08", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0x03, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x18, 0x00, 0x00, 0x00                           // ....
                        }
                    }, 

                    "HS10", 
                    Package (0x04)
                    {
                        "UsbConnector", 
                        0xFF, 
                        "port", 
                        Buffer (0x04)
                        {
                             0x0A, 0x00, 0x00, 0x00                           // ....
                        }
                    }
                }
            }
        })
    }
}
Edited by #McFly
Link to comment
Share on other sites

 Share

×
×
  • Create New...