Skip to content

Instantly share code, notes, and snippets.

@al3xtjames
Last active February 5, 2024 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al3xtjames/d5c1a90ac206e007a771e1a1892dca77 to your computer and use it in GitHub Desktop.
Save al3xtjames/d5c1a90ac206e007a771e1a1892dca77 to your computer and use it in GitHub Desktop.
DefinitionBlock ("", "SSDT", 2, "CASEY", "TBTMAPLE", 0x00000000)
{
External (_SB_.PC00.RP05, DeviceObj)
External (_SB_.PC00.RP05.HRUS, DeviceObj)
External (_SB_.PC00.RP05.PXSX, DeviceObj)
If (_OSI ("Darwin"))
{
Scope (\_SB.PC00.RP05)
{
If (CondRefOf (\_SB.PC00.RP05.PXSX))
{
Scope (PXSX)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (Zero)
}
}
}
If (CondRefOf (\_SB.PC00.RP05.HRUS))
{
Scope (HRUS)
{
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (Zero)
}
}
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Device (UPSB)
{
Name (_ADR, Zero) // _ADR: Address
OperationRegion (A1E0, PCI_Config, Zero, 0x40)
Field (A1E0, ByteAcc, NoLock, Preserve)
{
AVND, 32,
BMIE, 3,
Offset (0x18),
PRIB, 8,
SECB, 8,
SUBB, 8,
Offset (0x1E),
, 13,
MABT, 1
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Method (_BBN, 0, NotSerialized) // _BBN: BIOS Bus Number
{
Return (SECB) /* \_SB_.PC00.RP05.UPSB.SECB */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x04)
{
"built-in",
Buffer (One)
{
0x00 // .
},
"PCI-Thunderbolt",
One
})
}
Device (DSB0)
{
Name (_ADR, Zero) // _ADR: Address
OperationRegion (A1E0, PCI_Config, Zero, 0x40)
Field (A1E0, ByteAcc, NoLock, Preserve)
{
AVND, 32,
BMIE, 3,
Offset (0x18),
PRIB, 8,
SECB, 8,
SUBB, 8,
Offset (0x1E),
, 13,
MABT, 1
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Method (_BBN, 0, NotSerialized) // _BBN: BIOS Bus Number
{
Return (SECB) /* \_SB_.PC00.RP05.UPSB.DSB0.SECB */
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x04)
{
"built-in",
Buffer (One)
{
0x00 // .
},
"PCIHotplugCapable",
Zero
})
}
Device (NHI0)
{
Name (_ADR, Zero) // _ADR: Address
Name (_STR, Unicode ("Thunderbolt")) // _STR: Description String
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x0B)
{
"class-code",
Buffer (0x04)
{
0x00, 0x80, 0x08, 0x00 // ....
},
"device-id",
Buffer (0x04)
{
0xEB, 0x15, 0x00, 0x00 // ....
},
"ThunderboltDROM",
Buffer (0x93)
{
/* 0000 */ 0x93, 0x00, 0xBC, 0xFD, 0x45, 0x76, 0x1F, 0x87, // ....Ev..
/* 0008 */ 0x80, 0xDE, 0x77, 0xB7, 0x68, 0x01, 0x86, 0x00, // ..w.h...
/* 0010 */ 0x31, 0x00, 0x33, 0x50, 0x01, 0x26, 0x08, 0x81, // 1.3P.&..
/* 0018 */ 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, // ........
/* 0020 */ 0x90, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x83, // ........
/* 0028 */ 0x80, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x84, // ........
/* 0030 */ 0x90, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x85, // ........
/* 0038 */ 0x00, 0x00, 0x00, 0x05, 0x86, 0x50, 0x00, 0x00, // .....P..
/* 0040 */ 0x02, 0x87, 0x0B, 0x88, 0x20, 0x01, 0x00, 0x64, // .... ..d
/* 0048 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x89, 0x80, // ........
/* 0050 */ 0x05, 0x8A, 0x50, 0x00, 0x00, 0x05, 0x8B, 0x50, // ..P....P
/* 0058 */ 0x00, 0x00, 0x07, 0x01, 0x41, 0x53, 0x55, 0x53, // ....ASUS
/* 0060 */ 0x00, 0x1B, 0x02, 0x50, 0x52, 0x4F, 0x41, 0x52, // ...PROAR
/* 0068 */ 0x54, 0x20, 0x5A, 0x37, 0x39, 0x30, 0x20, 0x43, // T Z790 C
/* 0070 */ 0x52, 0x45, 0x41, 0x54, 0x4F, 0x52, 0x20, 0x57, // REATOR W
/* 0078 */ 0x49, 0x46, 0x49, 0x00, 0x0F, 0x09, 0x10, 0x04, // IFI.....
/* 0080 */ 0x43, 0x10, 0xF6, 0x87, 0x38, 0x38, 0x00, 0x00, // C...88..
/* 0088 */ 0x00, 0x00, 0x01, 0x08, 0x0B, 0x03, 0x81, 0x8C, // ........
/* 0090 */ 0x04, 0x82, 0x8D // ...
},
"linkDetails",
Buffer (0x08)
{
0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 // ........
},
"power-save",
One,
Buffer (One)
{
0x00 // .
}
})
}
}
}
Device (DSB1)
{
Name (_ADR, 0x00010000) // _ADR: Address
OperationRegion (A1E0, PCI_Config, Zero, 0x40)
Field (A1E0, ByteAcc, NoLock, Preserve)
{
AVND, 32,
BMIE, 3,
Offset (0x18),
PRIB, 8,
SECB, 8,
SUBB, 8,
Offset (0x1E),
, 13,
MABT, 1
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Method (_BBN, 0, NotSerialized) // _BBN: BIOS Bus Number
{
Return (SECB) /* \_SB_.PC00.RP05.UPSB.DSB1.SECB */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
}
Device (DSB2)
{
Name (_ADR, 0x00020000) // _ADR: Address
OperationRegion (A1E0, PCI_Config, Zero, 0x40)
Field (A1E0, ByteAcc, NoLock, Preserve)
{
AVND, 32,
BMIE, 3,
Offset (0x18),
PRIB, 8,
SECB, 8,
SUBB, 8,
Offset (0x1E),
, 13,
MABT, 1
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Method (_BBN, 0, NotSerialized) // _BBN: BIOS Bus Number
{
Return (SECB) /* \_SB_.PC00.RP05.UPSB.DSB2.SECB */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Device (XHC2)
{
Name (_ADR, Zero) // _ADR: Address
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x0E)
{
"AAPL,current-available",
0x0834,
"AAPL,current-extra",
0x0A8C,
"AAPL,current-in-sleep",
0x0A8C,
"AAPL,max-port-current-in-sleep",
0x0834,
"AAPL,device-internal",
Zero,
"AAPL,root-hub-depth",
0x1A,
"AAPL,XHC-clock-id",
One
})
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Device (RHUB)
{
Name (_ADR, Zero) // _ADR: Address
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
Device (HS01)
{
Name (_ADR, One) // _ADR: Address
Name (_UPC, Package (0x04) // _UPC: USB Port Capabilities
{
0xFF,
0x09,
Zero,
Zero
})
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x04)
{
"UsbCPortNumber",
One,
"UsbPowerSource",
One
})
}
}
Device (HS02)
{
Name (_ADR, 0x02) // _ADR: Address
Name (_UPC, Package (0x04) // _UPC: USB Port Capabilities
{
0xFF,
0x09,
Zero,
Zero
})
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x04)
{
"UsbCPortNumber",
0x02,
"UsbPowerSource",
0x02
})
}
}
Device (SSP1)
{
Name (_ADR, 0x03) // _ADR: Address
Name (_UPC, Package (0x04) // _UPC: USB Port Capabilities
{
0xFF,
0x09,
Zero,
Zero
})
Name (_PLD, Package (0x01) // _PLD: Physical Location of Device
{
ToPLD (
PLD_Revision = 0x1,
PLD_IgnoreColor = 0x1,
PLD_Red = 0x0,
PLD_Green = 0x0,
PLD_Blue = 0x0,
PLD_Width = 0x0,
PLD_Height = 0x0,
PLD_UserVisible = 0x1,
PLD_Dock = 0x0,
PLD_Lid = 0x0,
PLD_Panel = "UNKNOWN",
PLD_VerticalPosition = "UPPER",
PLD_HorizontalPosition = "LEFT",
PLD_Shape = "UNKNOWN",
PLD_GroupOrientation = 0x0,
PLD_GroupToken = 0x0,
PLD_GroupPosition = 0x0,
PLD_Bay = 0x0,
PLD_Ejectable = 0x0,
PLD_EjectRequired = 0x0,
PLD_CabinetNumber = 0x0,
PLD_CardCageNumber = 0x0,
PLD_Reference = 0x0,
PLD_Rotation = 0x0,
PLD_Order = 0x0,
PLD_VerticalOffset = 0x0,
PLD_HorizontalOffset = 0x0)
})
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x04)
{
"UsbCPortNumber",
One,
"UsbPowerSource",
One
})
}
}
Device (SSP2)
{
Name (_ADR, 0x04) // _ADR: Address
Name (_UPC, Package (0x04) // _UPC: USB Port Capabilities
{
0xFF,
0x09,
Zero,
Zero
})
Name (_PLD, Package (0x01) // _PLD: Physical Location of Device
{
ToPLD (
PLD_Revision = 0x1,
PLD_IgnoreColor = 0x1,
PLD_Red = 0x0,
PLD_Green = 0x0,
PLD_Blue = 0x0,
PLD_Width = 0x0,
PLD_Height = 0x0,
PLD_UserVisible = 0x1,
PLD_Dock = 0x0,
PLD_Lid = 0x0,
PLD_Panel = "UNKNOWN",
PLD_VerticalPosition = "UPPER",
PLD_HorizontalPosition = "LEFT",
PLD_Shape = "UNKNOWN",
PLD_GroupOrientation = 0x0,
PLD_GroupToken = 0x0,
PLD_GroupPosition = 0x0,
PLD_Bay = 0x0,
PLD_Ejectable = 0x0,
PLD_EjectRequired = 0x0,
PLD_CabinetNumber = 0x0,
PLD_CardCageNumber = 0x0,
PLD_Reference = 0x0,
PLD_Rotation = 0x0,
PLD_Order = 0x0,
PLD_VerticalOffset = 0x0,
PLD_HorizontalOffset = 0x0)
})
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
If (!Arg2)
{
Return (Buffer (One)
{
0x03 // .
})
}
Return (Package (0x04)
{
"UsbCPortNumber",
0x02,
"UsbPowerSource",
0x02
})
}
}
}
}
}
Device (DSB3)
{
Name (_ADR, 0x00030000) // _ADR: Address
OperationRegion (A1E0, PCI_Config, Zero, 0x40)
Field (A1E0, ByteAcc, NoLock, Preserve)
{
AVND, 32,
BMIE, 3,
Offset (0x18),
PRIB, 8,
SECB, 8,
SUBB, 8,
Offset (0x1E),
, 13,
MABT, 1
}
Method (_PRW, 0, NotSerialized) // _PRW: Power Resources for Wake
{
Return (Package (0x02)
{
0x69,
0x03
})
}
Method (_BBN, 0, NotSerialized) // _BBN: BIOS Bus Number
{
Return (SECB) /* \_SB_.PC00.RP05.UPSB.DSB3.SECB */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_RMV, 0, NotSerialized) // _RMV: Removal Status
{
Return (Zero)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment