Skip to content

Instantly share code, notes, and snippets.

@rbradford
Created January 24, 2020 11:04
Show Gist options
  • Save rbradford/6a8bc507fa92875d7b802fb3190130e2 to your computer and use it in GitHub Desktop.
Save rbradford/6a8bc507fa92875d7b802fb3190130e2 to your computer and use it in GitHub Desktop.
DefinitionBlock ("", "DSDT", 6, "CLOUDH", "CHDSDT ", 0x00000001)
{
Device (_SB.PCI0)
{
Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID
Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID
Name (_ADR, Zero) // _ADR: Address
Name (_SEG, Zero) // _SEG: PCI Segment
Name (_UID, Zero) // _UID: Unique ID
Name (SUPP, Zero)
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
0x0000, // Granularity
0x0000, // Range Minimum
0x00FF, // Range Maximum
0x0000, // Translation Offset
0x0100, // Length
,, )
IO (Decode16,
0x0CF8, // Range Minimum
0x0CF8, // Range Maximum
0x01, // Alignment
0x08, // Length
)
WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000, // Granularity
0x0000, // Range Minimum
0x0CF7, // Range Maximum
0x0000, // Translation Offset
0x0CF8, // Length
,, , TypeStatic, DenseTranslation)
WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000, // Granularity
0x0D00, // Range Minimum
0xFFFF, // Range Maximum
0x0000, // Translation Offset
0xF300, // Length
,, , TypeStatic, DenseTranslation)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Granularity
0xC0000000, // Range Minimum
0xE7FFFFFF, // Range Maximum
0x00000000, // Translation Offset
0x28000000, // Length
,, , AddressRangeMemory, TypeStatic)
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x0000000000000000, // Granularity
0x0000000100000000, // Range Minimum
0x0000007FFFFFFFFF, // Range Maximum
0x0000000000000000, // Translation Offset
0x0000007F00000000, // Length
,, , AddressRangeMemory, TypeStatic)
})
}
Device (_SB.MBRD)
{
Name (_HID, EisaId ("PNP0C02") /* PNP Motherboard Resources */) // _HID: Hardware ID
Name (_UID, Zero) // _UID: Unique ID
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
Memory32Fixed (ReadWrite,
0xE8000000, // Address Base
0x10000000, // Address Length
)
})
}
Name (_S5, Package (0x01) // _S5_: S5 System State
{
0x05
})
Device (_SB.GED)
{
Name (_HID, "ACPI0013" /* Generic Event Device */) // _HID: Hardware ID
Name (_UID, Zero) // _UID: Unique ID
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
{
0x00000005,
}
})
OperationRegion (GDST, SystemMemory, 0x0000007FFFFFE000, 0x01)
Field (GDST, ByteAcc, NoLock, WriteAsZeros)
{
GDAT, 8
}
Method (_EVT, 1, Serialized) // _EVT: Event
{
Local0 = GDAT /* \_SB_.GED_.GDAT */
Local1 = (Local0 & One)
If ((Local1 == One))
{
\_SB.CPUS.CSCN ()
}
Local1 = (Local0 & 0x02)
If ((Local1 == 0x02))
{
\_SB.MHPC.MSCN ()
}
}
}
Device (_SB.PRES)
{
Name (_HID, EisaId ("PNP0A06") /* Generic Container Device */) // _HID: Hardware ID
Mutex (CPLK, 0x00)
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x0000000000000000, // Granularity
0x0000007FFFEFD000, // Range Minimum
0x0000007FFFEFD00B, // Range Maximum
0x0000000000000000, // Translation Offset
0x000000000000000C, // Length
,, , AddressRangeMemory, TypeStatic)
})
OperationRegion (PRST, SystemMemory, 0x0000007FFFEFD000, 0x0C)
Field (PRST, ByteAcc, NoLock, WriteAsZeros)
{
Offset (0x04),
CPEN, 1,
CINS, 1,
CRMV, 1,
CEJ0, 1,
Offset (0x05),
CCMD, 8
}
Field (PRST, DWordAcc, NoLock, Preserve)
{
CSEL, 32,
Offset (0x08),
CDAT, 32
}
}
Device (_SB.CPUS)
{
Name (_HID, "ACPI0010" /* Processor Container Device */) // _HID: Hardware ID
Name (_CID, EisaId ("PNP0A05") /* Generic Container Device */) // _CID: Compatible ID
Method (CSTA, 1, Serialized)
{
Acquire (\_SB.PRES.CPLK, 0x0FFF)
\_SB.PRES.CSEL = Arg0
Local0 = Zero
If ((\_SB.PRES.CPEN == One))
{
Local0 = 0x0F
}
Release (\_SB.PRES.CPLK)
Return (Local0)
}
Method (CTFY, 2, Serialized)
{
If ((Arg0 == 0x00))
{
Notify (C000, Arg1)
}
}
Method (CEJ0, 1, Serialized)
{
Acquire (\_SB.PRES.CPLK, 0x0FFF)
\_SB.PRES.CSEL = Arg0
\_SB.PRES.CEJ0 = One
Release (\_SB.PRES.CPLK)
}
Method (CSCN, 0, Serialized)
{
Acquire (\_SB.PRES.CPLK, 0x0FFF)
Local0 = Zero
While ((Local0 < 0x01))
{
\_SB.PRES.CSEL = Local0
If ((\_SB.PRES.CINS == One))
{
CTFY (Local0, One)
\_SB.PRES.CINS = One
}
If ((\_SB.PRES.CRMV == One))
{
CTFY (Local0, 0x03)
\_SB.PRES.CRMV = One
}
Local0 += One
}
Release (\_SB.PRES.CPLK)
}
Device (C000)
{
Name (_HID, "ACPI0007" /* Processor Device */) // _HID: Hardware ID
Name (_UID, 0x00) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (CSTA (0x00))
}
Name (_MAT, Buffer (0x08) // _MAT: Multiple APIC Table Entry
{
0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 // ........
})
Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device, x=0-9
{
Return (CEJ0 (0x00))
}
}
}
Device (_SB.MHPC)
{
Name (_HID, EisaId ("PNP0A06") /* Generic Container Device */) // _HID: Hardware ID
Mutex (MLCK, 0x00)
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x0000000000000000, // Granularity
0x0000007FFFFFF000, // Range Minimum
0x0000007FFFFFF017, // Range Maximum
0x0000000000000000, // Translation Offset
0x0000000000000018, // Length
,, , AddressRangeMemory, TypeStatic)
})
OperationRegion (MHPR, SystemMemory, 0x0000007FFFFFF000, 0x18)
Field (MHPR, DWordAcc, NoLock, Preserve)
{
MHBL, 32,
MHBH, 32,
MHLL, 32,
MHLH, 32
}
Field (MHPR, DWordAcc, NoLock, Preserve)
{
Offset (0x10),
MHPX, 32
}
Field (MHPR, ByteAcc, NoLock, WriteAsZeros)
{
Offset (0x14),
MEN, 1,
MINS, 1,
MRMV, 1,
MEJ0, 1
}
Field (MHPR, DWordAcc, NoLock, Preserve)
{
MSEL, 32,
MOEV, 32,
MOSC, 32
}
Method (MTFY, 2, Serialized)
{
If ((Arg0 == 0x00))
{
Notify (M000, Arg1)
}
If ((Arg0 == 0x01))
{
Notify (M001, Arg1)
}
If ((Arg0 == 0x02))
{
Notify (M002, Arg1)
}
If ((Arg0 == 0x03))
{
Notify (M003, Arg1)
}
If ((Arg0 == 0x04))
{
Notify (M004, Arg1)
}
If ((Arg0 == 0x05))
{
Notify (M005, Arg1)
}
If ((Arg0 == 0x06))
{
Notify (M006, Arg1)
}
If ((Arg0 == 0x07))
{
Notify (M007, Arg1)
}
}
Method (MSCN, 0, Serialized)
{
Acquire (MLCK, 0x0FFF)
Local0 = Zero
While ((Local0 < 0x08))
{
\_SB.MHPC.MSEL = Local0
If ((\_SB.MHPC.MINS == One))
{
MTFY (Local0, One)
\_SB.MHPC.MINS = One
}
If ((\_SB.MHPC.MRMV == One))
{
MTFY (Local0, 0x03)
\_SB.MHPC.MRMV = One
}
Local0 += One
}
Release (MLCK)
}
Method (MSTA, 1, Serialized)
{
Acquire (MLCK, 0x0FFF)
\_SB.MHPC.MSEL = Arg0
Local0 = Zero
If ((\_SB.MHPC.MEN == One))
{
Local0 = 0x0F
}
Release (MLCK)
Return (Local0)
}
Method (MCRS, 1, Serialized)
{
Acquire (MLCK, 0x0FFF)
\_SB.MHPC.MSEL = Arg0
Name (MR64, ResourceTemplate ()
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
0x0000000000000000, // Granularity
0x0000000000000000, // Range Minimum
0xFFFFFFFFFFFFFFFE, // Range Maximum
0x0000000000000000, // Translation Offset
0xFFFFFFFFFFFFFFFF, // Length
,, _Y00, AddressRangeMemory, TypeStatic)
})
CreateDWordField (MR64, \_SB.MHPC.MCRS._Y00._MIN, MINL) // _MIN: Minimum Base Address
CreateDWordField (MR64, 0x12, MINH)
CreateDWordField (MR64, \_SB.MHPC.MCRS._Y00._MAX, MAXL) // _MAX: Maximum Base Address
CreateDWordField (MR64, 0x1A, MAXH)
CreateDWordField (MR64, \_SB.MHPC.MCRS._Y00._LEN, LENL) // _LEN: Length
CreateDWordField (MR64, 0x2A, LENH)
MINL = \_SB.MHPC.MHBL
MINH = \_SB.MHPC.MHBH
LENL = \_SB.MHPC.MHLL
LENH = \_SB.MHPC.MHLH
MAXL = (MINL + LENL) /* \_SB_.MHPC.MCRS.LENL */
MAXH = (MINH + LENH) /* \_SB_.MHPC.MCRS.LENH */
MAXH -= One
Release (MLCK)
Return (MR64) /* \_SB_.MHPC.MCRS.MR64 */
}
Device (M000)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x00) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x00))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x00))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M001)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x01) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x01))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x01))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M002)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x02) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x02))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x02))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M003)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x03) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x03))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x03))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M004)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x04) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x04))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x04))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M005)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x05) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x05))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x05))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M006)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x06) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x06))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x06))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
Device (M007)
{
Name (_HID, EisaId ("PNP0C80") /* Memory Device */) // _HID: Hardware ID
Name (_UID, 0x07) // _UID: Unique ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (MSTA (0x07))
}
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Return (MCRS (0x07))
}
Method (_PXM, 0, NotSerialized) // _PXM: Device Proximity
{
Return (0x00000000)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment