Bit of clean up

This commit is contained in:
Mykola Grymalyuk
2020-05-28 19:11:22 -06:00
parent 46c3d95115
commit 3756ef935b
41 changed files with 328 additions and 30 deletions

View File

@@ -0,0 +1,16 @@
/*
* Forces enables legacy RTC clock, also gets arond INI conflict found on X299X boards
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "AWAC", 0x00000000)
{
External (STAS, IntObj)
Scope (_SB)
{
If (_OSI ("Darwin"))
{
STAS = One
}
}
}

View File

@@ -0,0 +1,759 @@
/*
* What this mess of an SSDT tries to accomplish is this:
* - Disable valid ECs, they will have the following properties:
* - _HID
* - _CRS
* - _GPE
* - Check for _STA to avoid conflicts
* - Create a new fake EC to let macOS play with
* - Create a USBX device for Skylake and newer
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "SsdtEC", 0x00001000)
{
// AMD Trash and glorious Core2 hardware
External (_SB_.PCI0.SBRG, DeviceObj)
External (_SB_.PCI0.SBRG.EC, DeviceObj)
External (_SB_.PCI0.SBRG.EC0, DeviceObj)
External (_SB_.PCI0.SBRG.H_EC, DeviceObj)
External (_SB_.PCI0.SBRG.ECDV, DeviceObj)
External (_SB_.PCI0.SBRG.PGEC, DeviceObj)
// Consumer Desktop
External (_SB_.PCI0.LPCB, DeviceObj)
External (_SB_.PCI0.LPCB.EC, DeviceObj)
External (_SB_.PCI0.LPCB.EC0, DeviceObj)
External (_SB_.PCI0.LPCB.H_EC, DeviceObj)
External (_SB_.PCI0.LPCB.ECDV, DeviceObj)
External (_SB_.PCI0.LPCB.PGEC, DeviceObj)
// Other laptop variations(I'm sure Lenovo uses it in some weird desktop)
External (_SB_.PCI0.LPC, DeviceObj)
External (_SB_.PCI0.LPC.EC, DeviceObj)
External (_SB_.PCI0.LPC.EC0, DeviceObj)
External (_SB_.PCI0.LPC.H_EC, DeviceObj)
External (_SB_.PCI0.LPC.ECDV, DeviceObj)
External (_SB_.PCI0.LPC.PGEC, DeviceObj)
// Cursed X58
External (_SB_.PCI0.PX40, DeviceObj)
External (_SB_.PCI0.PX40.EC, DeviceObj)
External (_SB_.PCI0.PX40.EC0, DeviceObj)
External (_SB_.PCI0.PX40.H_EC, DeviceObj)
External (_SB_.PCI0.PX40.ECDV, DeviceObj)
External (_SB_.PCI0.PX40.PGEC, DeviceObj)
// Cursed X79 and X99
External (_SB_.PCI0.LPC0, DeviceObj)
External (_SB_.PCI0.LPC0.EC, DeviceObj)
External (_SB_.PCI0.LPC0.EC0, DeviceObj)
External (_SB_.PCI0.LPC0.H_EC, DeviceObj)
External (_SB_.PCI0.LPC0.ECDV, DeviceObj)
External (_SB_.PCI0.LPC0.PGEC, DeviceObj)
// Even more cursed X299
External (_SB_.PC00.LPC0, DeviceObj)
External (_SB_.PC00.LPC0.EC, DeviceObj)
External (_SB_.PC00.LPC0.EC0, DeviceObj)
External (_SB_.PC00.LPC0.H_EC, DeviceObj)
External (_SB_.PC00.LPC0.ECDV, DeviceObj)
External (_SB_.PC00.LPC0.PGEC, DeviceObj)
// Let the AMD Trash being(and glorious Core2)
If ((CondRefOf (\_SB.PCI0.SBRG.EC)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.EC._HID) && CondRefOf (\_SB.PCI0.SBRG.EC._CRS)) && CondRefOf (\_SB.PCI0.SBRG.EC._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.EC._STA)))
{
Scope (\_SB.PCI0.SBRG.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.EC0._HID) && CondRefOf (\_SB.PCI0.SBRG.EC0._CRS)) && CondRefOf (\_SB.PCI0.SBRG.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.EC0._STA)))
{
Scope (\_SB.PCI0.SBRG.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.H_EC._HID) && CondRefOf (\_SB.PCI0.SBRG.H_EC._CRS)) && CondRefOf (\_SB.PCI0.SBRG.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.H_EC._STA)))
{
Scope (\_SB.PCI0.SBRG.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.ECDV._HID) && CondRefOf (\_SB.PCI0.SBRG.ECDV._CRS)) && CondRefOf (\_SB.PCI0.SBRG.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.ECDV._STA)))
{
Scope (\_SB.PCI0.SBRG.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.SBRG.PGEC._HID)) && CondRefOf (
\_SB.PCI0.SBRG.PGEC._CRS)) && CondRefOf (\_SB.PCI0.SBRG.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.SBRG.PGEC._STA)))
{
Scope (\_SB.PCI0.SBRG.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// Now we go to consumer
If ((CondRefOf (\_SB.PCI0.LPCB.EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.EC._HID) && CondRefOf (\_SB.PCI0.LPCB.EC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.EC._STA)))
{
Scope (\_SB.PCI0.LPCB.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.EC0._HID) && CondRefOf (\_SB.PCI0.LPCB.EC0._CRS)) && CondRefOf (\_SB.PCI0.LPCB.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.EC0._STA)))
{
Scope (\_SB.PCI0.LPCB.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.H_EC._HID) && CondRefOf (\_SB.PCI0.LPCB.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.H_EC._STA)))
{
Scope (\_SB.PCI0.LPCB.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.ECDV._HID) && CondRefOf (\_SB.PCI0.LPCB.ECDV._CRS)) && CondRefOf (\_SB.PCI0.LPCB.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.ECDV._STA)))
{
Scope (\_SB.PCI0.LPCB.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.LPCB.PGEC._HID)) && CondRefOf (
\_SB.PCI0.LPCB.PGEC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.LPCB.PGEC._STA)))
{
Scope (\_SB.PCI0.LPCB.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// Laptop trash
If ((CondRefOf (\_SB.PCI0.LPC.EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.EC._HID) && CondRefOf (\_SB.PCI0.LPC.EC._CRS)) && CondRefOf (\_SB.PCI0.LPC.EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.EC._STA)))
{
Scope (\_SB.PCI0.LPC.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.EC0._HID) && CondRefOf (\_SB.PCI0.LPC.EC0._CRS)) && CondRefOf (\_SB.PCI0.LPC.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.EC0._STA)))
{
Scope (\_SB.PCI0.LPC.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.H_EC._HID) && CondRefOf (\_SB.PCI0.LPC.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPC.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.H_EC._STA)))
{
Scope (\_SB.PCI0.LPC.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.ECDV._HID) && CondRefOf (\_SB.PCI0.LPC.ECDV._CRS)) && CondRefOf (\_SB.PCI0.LPC.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.ECDV._STA)))
{
Scope (\_SB.PCI0.LPC.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.LPC.PGEC._HID)) && CondRefOf (
\_SB.PCI0.LPC.PGEC._CRS)) && CondRefOf (\_SB.PCI0.LPC.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.LPC.PGEC._STA)))
{
Scope (\_SB.PCI0.LPC.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// X58 trash
If ((CondRefOf (\_SB.PCI0.PX40.EC)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.EC._HID) && CondRefOf (\_SB.PCI0.PX40.EC._CRS)) && CondRefOf (\_SB.PCI0.PX40.EC._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.EC._STA)))
{
Scope (\_SB.PCI0.PX40.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.EC0._HID) && CondRefOf (\_SB.PCI0.PX40.EC0._CRS)) && CondRefOf (\_SB.PCI0.PX40.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.EC0._STA)))
{
Scope (\_SB.PCI0.PX40.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.H_EC._HID) && CondRefOf (\_SB.PCI0.PX40.H_EC._CRS)) && CondRefOf (\_SB.PCI0.PX40.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.H_EC._STA)))
{
Scope (\_SB.PCI0.PX40.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.ECDV._HID) && CondRefOf (\_SB.PCI0.PX40.ECDV._CRS)) && CondRefOf (\_SB.PCI0.PX40.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.ECDV._STA)))
{
Scope (\_SB.PCI0.PX40.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.PX40.PGEC._HID)) && CondRefOf (
\_SB.PCI0.PX40.PGEC._CRS)) && CondRefOf (\_SB.PCI0.PX40.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.PX40.PGEC._STA)))
{
Scope (\_SB.PCI0.PX40.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// X79 and X99 trash
If ((CondRefOf (\_SB.PCI0.LPC0.EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.EC._HID) && CondRefOf (\_SB.PCI0.LPC0.EC._CRS)) && CondRefOf (\_SB.PCI0.LPC0.EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.EC._STA)))
{
Scope (\_SB.PCI0.LPC0.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.EC0._HID) && CondRefOf (\_SB.PCI0.LPC0.EC0._CRS)) && CondRefOf (\_SB.PCI0.LPC0.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.EC0._STA)))
{
Scope (\_SB.PCI0.LPC0.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.H_EC._HID) && CondRefOf (\_SB.PCI0.LPC0.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPC0.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.H_EC._STA)))
{
Scope (\_SB.PCI0.LPC0.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.ECDV._HID) && CondRefOf (\_SB.PCI0.LPC0.ECDV._CRS)) && CondRefOf (\_SB.PCI0.LPC0.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.ECDV._STA)))
{
Scope (\_SB.PCI0.LPC0.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.LPC0.PGEC._HID)) && CondRefOf (
\_SB.PCI0.LPC0.PGEC._CRS)) && CondRefOf (\_SB.PCI0.LPC0.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.LPC0.PGEC._STA)))
{
Scope (\_SB.PCI0.LPC0.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// Cursed X299
If ((CondRefOf (\_SB.PC00.LPC0.EC)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.EC._HID) && CondRefOf (\_SB.PC00.LPC0.EC._CRS)) && CondRefOf (\_SB.PC00.LPC0.EC._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.EC._STA)))
{
Scope (\_SB.PC00.LPC0.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.EC0)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.EC0._HID) && CondRefOf (\_SB.PC00.LPC0.EC0._CRS)) && CondRefOf (\_SB.PC00.LPC0.EC0._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.EC0._STA)))
{
Scope (\_SB.PC00.LPC0.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.H_EC)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.H_EC._HID) && CondRefOf (\_SB.PC00.LPC0.H_EC._CRS)) && CondRefOf (\_SB.PC00.LPC0.H_EC._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.H_EC._STA)))
{
Scope (\_SB.PC00.LPC0.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.ECDV)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.ECDV._HID) && CondRefOf (\_SB.PC00.LPC0.ECDV._CRS)) && CondRefOf (\_SB.PC00.LPC0.ECDV._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.ECDV._STA)))
{
Scope (\_SB.PC00.LPC0.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.PGEC)))
{
If (((((CondRefOf (\_SB.PC00.LPC0.PGEC._HID)) && CondRefOf (
\_SB.PC00.LPC0.PGEC._CRS)) && CondRefOf (\_SB.PC00.LPC0.PGEC._GPE)) && !CondRefOf (\_SB.PC00.LPC0.PGEC._STA)))
{
Scope (\_SB.PC00.LPC0.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// And finally, create our fake EC and USBX
Scope (\_SB)
{
Device (EC) // The EC is supposed to be located after the LPC device but doesn't actually matter since this is just a dummy device
{
Name (_HID, "ACID0001") // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
}
}

View File

@@ -0,0 +1,36 @@
/* Purpose of this SSDT is to:
*
* - Find references of devices named EC__
* - If none are found, only then create a new EC
*
* Reason for this is to avoid having multiple EC__ in devices
* like Lenovo who already use the name EC__
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "SsdtEC", 0x00001000)
{
External (_SB_.PCI0.LPC_.EC__, DeviceObj)
External (_SB_.PCI0.LPCB.EC__, DeviceObj)
If ((!CondRefOf (\_SB.PCI0.LPCB.EC) && !CondRefOf (\_SB.PCI0.LPC.EC)))
{
Scope (\_SB)
{
Device (EC)
{
Name (_HID, "ACID0001") // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
}
}
}

View File

@@ -0,0 +1,785 @@
/*
* What this mess of an SSDT tries to accomplish is this:
* - Disable valid ECs, they will have the following properties:
* - _HID
* - _CRS
* - _GPE
* - Check for _STA to avoid conflicts
* - Create a new fake EC to let macOS play with
* - Create a USBX device for Skylake and newer
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "SsdtEC", 0x00001000)
{
// AMD Trash and glorious Core2 hardware
External (_SB_.PCI0.SBRG, DeviceObj)
External (_SB_.PCI0.SBRG.EC, DeviceObj)
External (_SB_.PCI0.SBRG.EC0, DeviceObj)
External (_SB_.PCI0.SBRG.H_EC, DeviceObj)
External (_SB_.PCI0.SBRG.ECDV, DeviceObj)
External (_SB_.PCI0.SBRG.PGEC, DeviceObj)
// Consumer Desktop
External (_SB_.PCI0.LPCB, DeviceObj)
External (_SB_.PCI0.LPCB.EC, DeviceObj)
External (_SB_.PCI0.LPCB.EC0, DeviceObj)
External (_SB_.PCI0.LPCB.H_EC, DeviceObj)
External (_SB_.PCI0.LPCB.ECDV, DeviceObj)
External (_SB_.PCI0.LPCB.PGEC, DeviceObj)
// Other laptop variations(I'm sure Lenovo uses it in some weird desktop)
External (_SB_.PCI0.LPC, DeviceObj)
External (_SB_.PCI0.LPC.EC, DeviceObj)
External (_SB_.PCI0.LPC.EC0, DeviceObj)
External (_SB_.PCI0.LPC.H_EC, DeviceObj)
External (_SB_.PCI0.LPC.ECDV, DeviceObj)
External (_SB_.PCI0.LPC.PGEC, DeviceObj)
// Cursed X58
External (_SB_.PCI0.PX40, DeviceObj)
External (_SB_.PCI0.PX40.EC, DeviceObj)
External (_SB_.PCI0.PX40.EC0, DeviceObj)
External (_SB_.PCI0.PX40.H_EC, DeviceObj)
External (_SB_.PCI0.PX40.ECDV, DeviceObj)
External (_SB_.PCI0.PX40.PGEC, DeviceObj)
// Cursed X79 and X99
External (_SB_.PCI0.LPC0, DeviceObj)
External (_SB_.PCI0.LPC0.EC, DeviceObj)
External (_SB_.PCI0.LPC0.EC0, DeviceObj)
External (_SB_.PCI0.LPC0.H_EC, DeviceObj)
External (_SB_.PCI0.LPC0.ECDV, DeviceObj)
External (_SB_.PCI0.LPC0.PGEC, DeviceObj)
// Even more cursed X299
External (_SB_.PC00.LPC0, DeviceObj)
External (_SB_.PC00.LPC0.EC, DeviceObj)
External (_SB_.PC00.LPC0.EC0, DeviceObj)
External (_SB_.PC00.LPC0.H_EC, DeviceObj)
External (_SB_.PC00.LPC0.ECDV, DeviceObj)
External (_SB_.PC00.LPC0.PGEC, DeviceObj)
// Let the AMD Trash being(and glorious Core2)
If ((CondRefOf (\_SB.PCI0.SBRG.EC)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.EC._HID) && CondRefOf (\_SB.PCI0.SBRG.EC._CRS)) && CondRefOf (\_SB.PCI0.SBRG.EC._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.EC._STA)))
{
Scope (\_SB.PCI0.SBRG.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.EC0._HID) && CondRefOf (\_SB.PCI0.SBRG.EC0._CRS)) && CondRefOf (\_SB.PCI0.SBRG.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.EC0._STA)))
{
Scope (\_SB.PCI0.SBRG.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.H_EC._HID) && CondRefOf (\_SB.PCI0.SBRG.H_EC._CRS)) && CondRefOf (\_SB.PCI0.SBRG.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.H_EC._STA)))
{
Scope (\_SB.PCI0.SBRG.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.SBRG.ECDV._HID) && CondRefOf (\_SB.PCI0.SBRG.ECDV._CRS)) && CondRefOf (\_SB.PCI0.SBRG.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.SBRG.ECDV._STA)))
{
Scope (\_SB.PCI0.SBRG.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.SBRG.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.SBRG.PGEC._HID)) && CondRefOf (
\_SB.PCI0.SBRG.PGEC._CRS)) && CondRefOf (\_SB.PCI0.SBRG.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.SBRG.PGEC._STA)))
{
Scope (\_SB.PCI0.SBRG.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// Now we go to consumer
If ((CondRefOf (\_SB.PCI0.LPCB.EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.EC._HID) && CondRefOf (\_SB.PCI0.LPCB.EC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.EC._STA)))
{
Scope (\_SB.PCI0.LPCB.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.EC0._HID) && CondRefOf (\_SB.PCI0.LPCB.EC0._CRS)) && CondRefOf (\_SB.PCI0.LPCB.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.EC0._STA)))
{
Scope (\_SB.PCI0.LPCB.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.H_EC._HID) && CondRefOf (\_SB.PCI0.LPCB.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.H_EC._STA)))
{
Scope (\_SB.PCI0.LPCB.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.LPCB.ECDV._HID) && CondRefOf (\_SB.PCI0.LPCB.ECDV._CRS)) && CondRefOf (\_SB.PCI0.LPCB.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.LPCB.ECDV._STA)))
{
Scope (\_SB.PCI0.LPCB.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPCB.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.LPCB.PGEC._HID)) && CondRefOf (
\_SB.PCI0.LPCB.PGEC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.LPCB.PGEC._STA)))
{
Scope (\_SB.PCI0.LPCB.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// Laptop trash
If ((CondRefOf (\_SB.PCI0.LPC.EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.EC._HID) && CondRefOf (\_SB.PCI0.LPC.EC._CRS)) && CondRefOf (\_SB.PCI0.LPC.EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.EC._STA)))
{
Scope (\_SB.PCI0.LPC.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.EC0._HID) && CondRefOf (\_SB.PCI0.LPC.EC0._CRS)) && CondRefOf (\_SB.PCI0.LPC.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.EC0._STA)))
{
Scope (\_SB.PCI0.LPC.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.H_EC._HID) && CondRefOf (\_SB.PCI0.LPC.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPC.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.H_EC._STA)))
{
Scope (\_SB.PCI0.LPC.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.LPC.ECDV._HID) && CondRefOf (\_SB.PCI0.LPC.ECDV._CRS)) && CondRefOf (\_SB.PCI0.LPC.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.LPC.ECDV._STA)))
{
Scope (\_SB.PCI0.LPC.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.LPC.PGEC._HID)) && CondRefOf (
\_SB.PCI0.LPC.PGEC._CRS)) && CondRefOf (\_SB.PCI0.LPC.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.LPC.PGEC._STA)))
{
Scope (\_SB.PCI0.LPC.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// X58 trash
If ((CondRefOf (\_SB.PCI0.PX40.EC)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.EC._HID) && CondRefOf (\_SB.PCI0.PX40.EC._CRS)) && CondRefOf (\_SB.PCI0.PX40.EC._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.EC._STA)))
{
Scope (\_SB.PCI0.PX40.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.EC0._HID) && CondRefOf (\_SB.PCI0.PX40.EC0._CRS)) && CondRefOf (\_SB.PCI0.PX40.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.EC0._STA)))
{
Scope (\_SB.PCI0.PX40.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.H_EC._HID) && CondRefOf (\_SB.PCI0.PX40.H_EC._CRS)) && CondRefOf (\_SB.PCI0.PX40.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.H_EC._STA)))
{
Scope (\_SB.PCI0.PX40.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.PX40.ECDV._HID) && CondRefOf (\_SB.PCI0.PX40.ECDV._CRS)) && CondRefOf (\_SB.PCI0.PX40.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.PX40.ECDV._STA)))
{
Scope (\_SB.PCI0.PX40.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.PX40.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.PX40.PGEC._HID)) && CondRefOf (
\_SB.PCI0.PX40.PGEC._CRS)) && CondRefOf (\_SB.PCI0.PX40.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.PX40.PGEC._STA)))
{
Scope (\_SB.PCI0.PX40.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// X79 and X99 trash
If ((CondRefOf (\_SB.PCI0.LPC0.EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.EC._HID) && CondRefOf (\_SB.PCI0.LPC0.EC._CRS)) && CondRefOf (\_SB.PCI0.LPC0.EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.EC._STA)))
{
Scope (\_SB.PCI0.LPC0.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.EC0)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.EC0._HID) && CondRefOf (\_SB.PCI0.LPC0.EC0._CRS)) && CondRefOf (\_SB.PCI0.LPC0.EC0._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.EC0._STA)))
{
Scope (\_SB.PCI0.LPC0.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.H_EC)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.H_EC._HID) && CondRefOf (\_SB.PCI0.LPC0.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPC0.H_EC._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.H_EC._STA)))
{
Scope (\_SB.PCI0.LPC0.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.ECDV)))
{
If ((((CondRefOf (\_SB.PCI0.LPC0.ECDV._HID) && CondRefOf (\_SB.PCI0.LPC0.ECDV._CRS)) && CondRefOf (\_SB.PCI0.LPC0.ECDV._GPE
)) && !CondRefOf (\_SB.PCI0.LPC0.ECDV._STA)))
{
Scope (\_SB.PCI0.LPC0.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PCI0.LPC0.PGEC)))
{
If (((((CondRefOf (\_SB.PCI0.LPC0.PGEC._HID)) && CondRefOf (
\_SB.PCI0.LPC0.PGEC._CRS)) && CondRefOf (\_SB.PCI0.LPC0.PGEC._GPE)) && !CondRefOf (\_SB.PCI0.LPC0.PGEC._STA)))
{
Scope (\_SB.PCI0.LPC0.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// Cursed X299
If ((CondRefOf (\_SB.PC00.LPC0.EC)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.EC._HID) && CondRefOf (\_SB.PC00.LPC0.EC._CRS)) && CondRefOf (\_SB.PC00.LPC0.EC._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.EC._STA)))
{
Scope (\_SB.PC00.LPC0.EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.EC0)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.EC0._HID) && CondRefOf (\_SB.PC00.LPC0.EC0._CRS)) && CondRefOf (\_SB.PC00.LPC0.EC0._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.EC0._STA)))
{
Scope (\_SB.PC00.LPC0.EC0)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.H_EC)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.H_EC._HID) && CondRefOf (\_SB.PC00.LPC0.H_EC._CRS)) && CondRefOf (\_SB.PC00.LPC0.H_EC._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.H_EC._STA)))
{
Scope (\_SB.PC00.LPC0.H_EC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.ECDV)))
{
If ((((CondRefOf (\_SB.PC00.LPC0.ECDV._HID) && CondRefOf (\_SB.PC00.LPC0.ECDV._CRS)) && CondRefOf (\_SB.PC00.LPC0.ECDV._GPE
)) && !CondRefOf (\_SB.PC00.LPC0.ECDV._STA)))
{
Scope (\_SB.PC00.LPC0.ECDV)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
If ((CondRefOf (\_SB.PC00.LPC0.PGEC)))
{
If (((((CondRefOf (\_SB.PC00.LPC0.PGEC._HID)) && CondRefOf (
\_SB.PC00.LPC0.PGEC._CRS)) && CondRefOf (\_SB.PC00.LPC0.PGEC._GPE)) && !CondRefOf (\_SB.PC00.LPC0.PGEC._STA)))
{
Scope (\_SB.PC00.LPC0.PGEC)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (Zero)
}
Else
{
Return (0x0F)
}
}
}
}
}
// And finally, create our fake EC and USBX
Scope (\_SB)
{
Device (EC) // The EC is supposed to be located after the LPC device but doesn't actually matter since this is just a dummy device
{
Name (_HID, "ACID0001") // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
Device (USBX)
{
Name (_ADR, Zero) // _ADR: Address
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If ((Arg2 == Zero))
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x08)
{
"kUSBSleepPowerSupply",
0x13EC,
"kUSBSleepPortCurrentLimit",
0x0834,
"kUSBWakePowerSupply",
0x13EC,
"kUSBWakePortCurrentLimit",
0x0834
})
}
}
}
}

View File

@@ -0,0 +1,62 @@
/* Purpose of this SSDT is to:
*
* - Find references of devices named EC__
* - If none are found, only then create a new EC
*
* Reason for this is to avoid having multiple EC__ in devices
* like Lenovo who already use the name EC__
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "SsdtEC", 0x00001000)
{
External (_SB_.PCI0.LPC_.EC__, DeviceObj)
External (_SB_.PCI0.LPCB.EC__, DeviceObj)
If ((!CondRefOf (\_SB.PCI0.LPCB.EC) && !CondRefOf (\_SB.PCI0.LPC.EC)))
{
Scope (\_SB)
{
Device (EC)
{
Name (_HID, "ACID0001") // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
}
}
}
Device (USBX)
{
Name (_ADR, Zero) // _ADR: Address
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If ((Arg2 == Zero))
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x08)
{
"kUSBSleepPowerSupply",
0x13EC,
"kUSBSleepPortCurrentLimit",
0x0834,
"kUSBWakePowerSupply",
0x13EC,
"kUSBWakePortCurrentLimit",
0x0834
})
}
}
}

View File

@@ -0,0 +1,16 @@
// Source: https://github.com/daliansky/OC-little
DefinitionBlock("", "SSDT", 2, "DRTNIA", "GPI0", 0)
{
External(GPEN, FieldUnitObj)
Scope (\)
{
If (_OSI ("Darwin"))
{
GPEN = One
}
Else
{
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,46 @@
// Used for disabling unsupported GPUs in macOS
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "spoof", 0x00000000)
{
External (_SB_.PCI0.PEG0.PEGP, DeviceObj)
Method (_SB.PCI0.PEG0.PEGP._DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If ((!Arg2 || (_OSI ("Darwin") == Zero)))
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x0A)
{
"name",
Buffer (0x09)
{
"#display"
},
"IOName",
"#display",
"class-code",
Buffer (0x04)
{
0xFF, 0xFF, 0xFF, 0xFF // ....
},
"vendor-id",
Buffer (0x04)
{
0xFF, 0xFF, 0x00, 0x00 // ....
},
"device-id",
Buffer (0x04)
{
0xFF, 0xFF, 0x00, 0x00 // ....
}
})
}
}

Binary file not shown.

View File

@@ -0,0 +1,74 @@
// Based off of WhateverGreen's sample.dsl
// https://github.com/acidanthera/WhateverGreen/blob/master/Manual/Sample.dsl
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "AMDGPU", 0x00001000)
{
External (_SB_.PCI0, DeviceObj)
External (_SB_.PCI0.PEG0.PEGP, DeviceObj)
Scope (\_SB.PCI0.PEG0.PEGP)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (_OSI ("Darwin"))
{
Store (Package ()
{
// Where we shove our FakeID
"device-id",
Buffer (0x04)
{
0xB0, 0x67, 0x00, 0x00
},
// Changing the name of the GPU reported, mainly cosmetic
"model",
Buffer ()
{
"AMD Radeon R9 390"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
Else
{
}
}
}
Scope (\_SB.PCI0)
{
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}
If (LEqual (Arg2, One))
{
Return (One)
}
}
}
Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,50 @@
/*
* Disable discrete graphics (c) Bumblebee-Project
* >> https://github.com/Bumblebee-Project/Bumblebee/wiki/ACPI-for-Developers#acpi-and-the-nvidia-card
* ---
* Important: Change all ACPI paths accordingly.
* Credit to Maemo for original idea and midi1996 for the SSDT
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "NoHybGfx", 0x00000000)
{
External (_SB_.PCI0.PEG0.PEGP._DSM, MethodObj) // dGPU ACPI Path
External (_SB_.PCI0.PEG0.PEGP._PS3, MethodObj) // dGPU ACPI Path
Device (NHG1)
{
Name (_HID, "NHG10000") // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
Method (_INI, 0, NotSerialized) // _INI: Initialize
{
If (_OSI ("Darwin"))
{
// If conditional methods reference creation successful
If ((CondRefOf (\_SB.PCI0.PEG0.PEGP._DSM) && CondRefOf (\_SB.PCI0.PEG0.PEGP._PS3)))
{
// Card Off Request
\_SB.PCI0.PEG0.PEGP._DSM (ToUUID ("a486d8f8-0bda-471b-a72b-6042a6b5bee0"), 0x0100, 0x1A, Buffer (0x04)
{
0x01, 0x00, 0x00, 0x03
})
// Card Off
\_SB.PCI0.PEG0.PEGP._PS3 ()
}
}
Else
{
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,197 @@
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20200214 (64-bit version)
* Copyright (c) 2000 - 2020 Intel Corporation
*
* Disassembling to symbolic ASL+ operators
*
* Disassembly of /Users/mykolagrymalyuk/Documents/GitHub/Getting-Started-With-ACPI/extra-files/compiled/SSDT-PLUG-DRTNIA.aml, Thu May 28 18:59:18 2020
*
* Original Table Header:
* Signature "SSDT"
* Length 0x000002B5 (693)
* Revision 0x02
* Checksum 0xDD
* OEM ID "DRTNIA"
* OEM Table ID "CpuPlug"
* OEM Revision 0x00003000 (12288)
* Compiler ID "INTL"
* Compiler Version 0x20190509 (538510601)
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "CpuPlug", 0x00003000)
{
External (_PR_.C000, ProcessorObj)
External (_PR_.CPU0, ProcessorObj)
External (_PR_.P000, ProcessorObj)
External (_PR_.PR00, ProcessorObj)
External (_SB_.CPU0, ProcessorObj)
External (_SB_.PC00.LPC0, DeviceObj)
External (_SB_.PC00.LPC0.EC0_, DeviceObj)
External (_SB_.PC00.LPC0.EC__, DeviceObj)
External (_SB_.PC00.LPC0.ECDV, DeviceObj)
External (_SB_.PC00.LPC0.H_EC, DeviceObj)
External (_SB_.PC00.LPC0.PGEC, DeviceObj)
External (_SB_.PCI0.LPC0, DeviceObj)
External (_SB_.PCI0.LPC0.EC0_, DeviceObj)
External (_SB_.PCI0.LPC0.EC__, DeviceObj)
External (_SB_.PCI0.LPC0.ECDV, DeviceObj)
External (_SB_.PCI0.LPC0.H_EC, DeviceObj)
External (_SB_.PCI0.LPC0.PGEC, DeviceObj)
External (_SB_.PCI0.LPC_, DeviceObj)
External (_SB_.PCI0.LPC_.EC0_, DeviceObj)
External (_SB_.PCI0.LPC_.EC__, DeviceObj)
External (_SB_.PCI0.LPC_.ECDV, DeviceObj)
External (_SB_.PCI0.LPC_.H_EC, DeviceObj)
External (_SB_.PCI0.LPC_.PGEC, DeviceObj)
External (_SB_.PCI0.LPCB, DeviceObj)
External (_SB_.PCI0.LPCB.EC0_, DeviceObj)
External (_SB_.PCI0.LPCB.EC__, DeviceObj)
External (_SB_.PCI0.LPCB.ECDV, DeviceObj)
External (_SB_.PCI0.LPCB.H_EC, DeviceObj)
External (_SB_.PCI0.LPCB.PGEC, DeviceObj)
External (_SB_.PCI0.PX40, DeviceObj)
External (_SB_.PCI0.PX40.EC0_, DeviceObj)
External (_SB_.PCI0.PX40.EC__, DeviceObj)
External (_SB_.PCI0.PX40.ECDV, DeviceObj)
External (_SB_.PCI0.PX40.H_EC, DeviceObj)
External (_SB_.PCI0.PX40.PGEC, DeviceObj)
External (_SB_.PCI0.SBRG, DeviceObj)
External (_SB_.PCI0.SBRG.EC0_, DeviceObj)
External (_SB_.PCI0.SBRG.EC__, DeviceObj)
External (_SB_.PCI0.SBRG.ECDV, DeviceObj)
External (_SB_.PCI0.SBRG.H_EC, DeviceObj)
External (_SB_.PCI0.SBRG.PGEC, DeviceObj)
External (_SB_.PR00, ProcessorObj)
External (_SB_.SCK0.CP00, ProcessorObj)
External (_SB_.SCK0.PR00, ProcessorObj)
Method (PMPM, 4, NotSerialized)
{
If ((Arg2 == Zero))
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x02)
{
"plugin-type",
One
})
}
If (CondRefOf (\_SB.CPU0))
{
If ((ObjectType (\_SB.CPU0) == 0x0C))
{
Scope (\_SB.CPU0)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_PR.CPU0))
{
If ((ObjectType (\_PR.CPU0) == 0x0C))
{
Scope (\_PR.CPU0)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_SB.PR00))
{
If ((ObjectType (\_SB.PR00) == 0x0C))
{
Scope (\_SB.PR00)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_PR.C000))
{
If ((ObjectType (\_PR.C000) == 0x0C))
{
Scope (\_PR.C000)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_PR.P000))
{
If ((ObjectType (\_PR.P000) == 0x0C))
{
Scope (\_PR.P000)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_PR.PR00))
{
If ((ObjectType (\_PR.PR00) == 0x0C))
{
Scope (\_PR.PR00)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_SB.SCK0.CP00))
{
If ((ObjectType (\_SB.SCK0.CP00) == 0x0C))
{
Scope (\_SB.SCK0.CP00)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
If (CondRefOf (\_SB.SCK0.PR00))
{
If ((ObjectType (\_SB.SCK0.PR00) == 0x0C))
{
Scope (\_SB.SCK0.PR00)
{
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Return (PMPM (Arg0, Arg1, Arg2, Arg3))
}
}
}
}
}

View File

@@ -0,0 +1,50 @@
/*
* XCPM power management compatibility table.
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "CpuPlug", 0x00003000)
{
External (_PR_.CPU0, ProcessorObj) // Rename this
Scope (\_PR.CPU0) // Rename this
{
Method (DTGP, 5, NotSerialized)
{
If ((Arg0 == ToUUID ("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
{
If ((Arg1 == One))
{
If ((Arg2 == Zero))
{
Arg4 = Buffer (One)
{
0x03 // .
}
Return (One)
}
If ((Arg2 == One))
{
Return (One)
}
}
}
Arg4 = Buffer (One)
{
0x00 // .
}
Return (Zero)
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Local0 = Package (0x02)
{
"plugin-type",
One
}
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,100 @@
/*
* Goal of this SSDT is to check for all LPC edge cases, as laptops are known for naming variation
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "PMCR", 0x00001000)
{
External (_SB_.PCI0.LPCB, DeviceObj)
External (_SB_.PCI0.LPC0, DeviceObj)
External (_SB_.PCI0.LPC, DeviceObj)
If (CondRefOf (\_SB.PCI0.LPCB))
{
Scope (_SB.PCI0.LPCB)
{
Device (PMCR)
{
Name (_HID, EisaId ("APP9876")) // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0B)
}
Else
{
Return (Zero)
}
}
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
Memory32Fixed (ReadWrite,
0xFE000000, // Address Base
0x00010000, // Address Length
)
})
}
}
}
If (CondRefOf (\_SB.PCI0.LPC0))
{
Scope (_SB.PCI0.LPC0)
{
Device (PMCR)
{
Name (_HID, EisaId ("APP9876")) // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0B)
}
Else
{
Return (Zero)
}
}
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
Memory32Fixed (ReadWrite,
0xFE000000, // Address Base
0x00010000, // Address Length
)
})
}
}
}
If (CondRefOf (\_SB.PCI0.LPC))
{
Scope (_SB.PCI0.LPC)
{
Device (PMCR)
{
Name (_HID, EisaId ("APP9876")) // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0B)
}
Else
{
Return (Zero)
}
}
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
Memory32Fixed (ReadWrite,
0xFE000000, // Address Base
0x00010000, // Address Length
)
})
}
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20200214 (64-bit version)
* Copyright (c) 2000 - 2020 Intel Corporation
*
* Disassembling to symbolic ASL+ operators
*
* Disassembly of /Users/mykolagrymalyuk/Documents/GitHub/Getting-Started-With-ACPI/extra-files/compiled/SSDT-PNLF-CFL.aml, Thu May 28 18:59:18 2020
*
* Original Table Header:
* Signature "SSDT"
* Length 0x0000007D (125)
* Revision 0x02
* Checksum 0x84
* OEM ID "ACDT"
* OEM Table ID "PNLFCFL"
* OEM Revision 0x00000000 (0)
* Compiler ID "INTL"
* Compiler Version 0x20190509 (538510601)
*/
DefinitionBlock ("", "SSDT", 2, "ACDT", "PNLFCFL", 0x00000000)
{
External (_SB_.PCI0.GFX0, DeviceObj)
Device (_SB.PCI0.GFX0.PNLF)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, EisaId ("APP0002")) // _HID: Hardware ID
Name (_CID, "backlight") // _CID: Compatible ID
Name (_UID, 0x13) // _UID: Unique ID
Name (_STA, 0x0B) // _STA: Status
}
}

View File

@@ -0,0 +1,51 @@
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20190509 (64-bit version)
* Copyright (c) 2000 - 2019 Intel Corporation
*
* Disassembling to symbolic ASL+ operators
*
* Disassembly of iASLYWTc6v.aml, Thu May 28 19:06:11 2020
*
* Original Table Header:
* Signature "SSDT"
* Length 0x00000143 (323)
* Revision 0x02
* Checksum 0x6C
* OEM ID "DRTNIA"
* OEM Table ID "XOSI"
* OEM Revision 0x00001000 (4096)
* Compiler ID "INTL"
* Compiler Version 0x20190509 (538510601)
*/
DefinitionBlock ("", "SSDT", 2, "DRTNIA", "XOSI", 0x00001000)
{
Method (XOSI, 1, NotSerialized)
{
Local0 = Package (0x11)
{
"Windows 2001",
"Windows 2001.1",
"Windows 2001 SP1",
"Windows 2001 SP2",
"Windows 2001 SP3",
"Windows 2006",
"Windows 2006 SP1",
"Windows 2009",
"Windows 2012",
"Windows 2013",
"Microsoft Windows NT",
"Microsoft Windows",
"Microsoft WindowsME: Millennium Edition"
}
If (_OSI ("Darwin"))
{
Return ((Ones != Match (Local0, MEQ, Arg0, MTR, Zero, Zero)))
}
Else
{
Return (_OSI (Arg0))
}
}
}

View File

@@ -0,0 +1,35 @@
/* Based off of Rebaman's work:
* https://github.com/RehabMan/OS-X-Clover-Laptop-Config/blob/master/hotpatch/SSDT-DDGPU.dsl
*/
DefinitionBlock("", "SSDT", 2, "DRTNIA", "dGPU-Off", 0)
{
External(_SB.PCI0.PEG0.PEGP._OFF, MethodObj) // ACPI Path of dGPU
Device(RMD1)
{
Name(_HID, "RMD10000") // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin"))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
Method(_INI)
{
If (_OSI ("Darwin"))
{
// disable discrete graphics (Nvidia/Radeon) if it is present
If (CondRefOf(\_SB.PCI0.PEG0.PEGP._OFF)) { \_SB.PCI0.PEG0.PEGP._OFF() }
}
Else
{
}
}
}
}

Binary file not shown.