AcpiSamples: Added SSDT-RTC0

This commit is contained in:
PMheart 2019-09-04 07:10:19 +08:00
parent 15170f620f
commit 1b61d9744d
2 changed files with 48 additions and 8 deletions

View File

@ -1,12 +1,13 @@
/*
* For 300-series only. If you can't force enable Legacy RTC in BIOS GUI.
* macOS does yet not support AWAC, so we have to force enable RTC. Do not use RTC ACPI patch.
*
* The Time and Alarm device provides an alternative to the real time clock (RTC), which is defined as a fixed feature hardware device.
* The wake timers allow the system to transition from the S3 (or optionally S4/S5) state to S0 state after a time period elapses.
* In comparison with the Real Time Clock (RTC) Alarm, the Time and Alarm device provides a larger scale of flexibility in the operation of the wake timers,
* and allows the implementation of the time source to be abstracted from the OSPM.
*/
* For 300-series only. If you can't force enable Legacy RTC in BIOS GUI.
* macOS does yet not support AWAC, so we have to force enable RTC. Do not use RTC ACPI patch.
*
* The Time and Alarm device provides an alternative to the real time clock (RTC), which is defined as a fixed feature hardware device.
* The wake timers allow the system to transition from the S3 (or optionally S4/S5) state to S0 state after a time period elapses.
* In comparison with the Real Time Clock (RTC) Alarm, the Time and Alarm device provides a larger scale of flexibility in the operation of the wake timers,
* and allows the implementation of the time source to be abstracted from the OSPM.
*/
DefinitionBlock ("", "SSDT", 2, "ACDT", "AWAC", 0x00000000)
{
External (STAS, IntObj)

View File

@ -0,0 +1,39 @@
/*
* For 300-series only and occasions where SSDT-AWAC is not applicable,
* which requires variable STAS to be present.
*
* On some boards RTC device is disabled by returning 0 from _STA status method and
* to enable it 0xF will be returned as expected by macOS.
*/
DefinitionBlock ("", "SSDT", 2, "ACDT", "RTC0", 0x00000000)
{
External (_SB_.PCI0.LPCB, DeviceObj) // (from opcode)
Scope (_SB.PCI0.LPCB)
{
Device (RTC0)
{
Name (_HID, EisaId ("PNP0B00")) // _HID: Hardware ID
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
IO (Decode16,
0x0070, // Range Minimum
0x0070, // Range Maximum
0x01, // Alignment
0x08, // Length
)
IRQNoFlags ()
{8}
})
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (_OSI ("Darwin")) {
Return (0x0F)
} Else {
Return (0);
}
}
}
}
}