2020-05-07 08:42:03 +02:00
|
|
|
/** @file
|
|
|
|
The definition block in ACPI table for PRM Operation Region
|
|
|
|
|
2020-09-08 08:57:18 +02:00
|
|
|
Copyright (c) 2020-2021, Intel Corporation. All rights reserved.<BR>
|
2020-05-07 08:42:03 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
|
|
|
|
DefinitionBlock (
|
|
|
|
"Prm.aml",
|
|
|
|
"SSDT",
|
2020-05-20 19:56:03 +02:00
|
|
|
2,
|
|
|
|
"OEMID ",
|
2020-05-07 08:42:03 +02:00
|
|
|
"PRMOPREG",
|
2020-05-20 19:56:03 +02:00
|
|
|
0x1000
|
2020-05-07 08:42:03 +02:00
|
|
|
)
|
|
|
|
{
|
|
|
|
Scope (\_SB)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// PRM Test Device
|
|
|
|
//
|
|
|
|
Device (PRMT)
|
|
|
|
{
|
|
|
|
Name (_HID, "80860223")
|
2022-11-07 09:29:39 +01:00
|
|
|
Name (_CID, EisaId ("PNP0C02"))
|
2020-05-07 08:42:03 +02:00
|
|
|
Name (_DDN, "PRM Test Device")
|
2020-09-08 08:57:18 +02:00
|
|
|
|
|
|
|
//PRM operation region format
|
|
|
|
OperationRegion (PRMR, PlatformRtMechanism, 0, 1)
|
|
|
|
Field (PRMR, BufferAcc, NoLock, Preserve) //Make it ByteAcc for parameter validation
|
2020-05-07 08:42:03 +02:00
|
|
|
{
|
2020-09-08 08:57:18 +02:00
|
|
|
PRMF, 8
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Control method to invoke PRM OperationRegion handler
|
|
|
|
* Arg0 contains a buffer representing a _DSM GUID
|
|
|
|
*/
|
|
|
|
Method (RUNS, 1)
|
2020-05-07 08:42:03 +02:00
|
|
|
{
|
2020-09-08 08:57:18 +02:00
|
|
|
/* Local0 is the PRM data buffer */
|
|
|
|
Local0 = buffer (26){}
|
|
|
|
|
|
|
|
/* Create byte fields over the buffer */
|
|
|
|
CreateByteField (Local0, 0x0, PSTA)
|
|
|
|
CreateQWordField (Local0, 0x1, USTA)
|
|
|
|
CreateByteField (Local0, 0x9, CMD)
|
|
|
|
CreateField (Local0, 0x50, 0x80, GUID)
|
|
|
|
|
|
|
|
/* Fill in the command and data fields of the data buffer */
|
|
|
|
CMD = 0 // run command
|
|
|
|
GUID = Arg0
|
|
|
|
|
|
|
|
/* Invoke PRM OperationRegion Handler and store the result into Local0 */
|
|
|
|
Local0 = (PRMF = Local0)
|
|
|
|
|
|
|
|
/* Return status */
|
|
|
|
Return (PSTA)
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Control method to lock a PRM transaction
|
|
|
|
* Arg0 contains a buffer representing a _DSM GUID
|
|
|
|
*/
|
|
|
|
Method (LCKH, 1)
|
2020-05-07 08:42:03 +02:00
|
|
|
{
|
2020-09-08 08:57:18 +02:00
|
|
|
/* Local0 is the PRM data buffer */
|
|
|
|
Local0 = buffer (26){}
|
|
|
|
|
|
|
|
/* Create byte fields over the buffer */
|
|
|
|
CreateByteField (Local0, 0x0, STAT)
|
|
|
|
CreateByteField (Local0, 0x9, CMD)
|
|
|
|
CreateField (Local0, 0x50, 0x80, GUID)
|
|
|
|
CMD = 1 // Lock command
|
|
|
|
GUID = Arg0
|
|
|
|
Local0 = (PRMF = Local0)
|
|
|
|
|
|
|
|
/* Note STAT contains the return status */
|
|
|
|
Return (STAT)
|
2020-05-07 08:42:03 +02:00
|
|
|
}
|
|
|
|
|
2020-09-08 08:57:18 +02:00
|
|
|
/*
|
|
|
|
* Control method to unlock a PRM transaction
|
|
|
|
* Arg0 contains a buffer representing a _DSM GUID
|
|
|
|
*/
|
|
|
|
Method (ULCK, 1)
|
|
|
|
{
|
|
|
|
/* Local0 is the PRM data buffer */
|
|
|
|
Local0 = buffer (26){}
|
2020-05-07 08:42:03 +02:00
|
|
|
|
2020-09-08 08:57:18 +02:00
|
|
|
/* Create byte fields over the buffer */
|
|
|
|
CreateByteField (Local0, 0x0, STAT)
|
|
|
|
CreateByteField (Local0, 0x9, CMD)
|
|
|
|
CreateField (Local0, 0x50, 0x80, GUID)
|
|
|
|
CMD = 2 // Unlock command
|
|
|
|
GUID = Arg0
|
|
|
|
Local0 = (PRMF = Local0)
|
2020-05-07 08:42:03 +02:00
|
|
|
|
2020-09-08 08:57:18 +02:00
|
|
|
/* Note STAT contains the return status */
|
|
|
|
Return (STAT)
|
|
|
|
}
|
2020-05-07 08:42:03 +02:00
|
|
|
|
2020-09-08 08:57:18 +02:00
|
|
|
/*
|
|
|
|
*Bit [0] Set if the device is present.
|
|
|
|
*Bit [1] Set if the device is enabled and decoding its resources.
|
|
|
|
*Bit [2] Set if the device should be shown in the UI.
|
|
|
|
*Bit [3] Set if the device is functioning properly (cleared if device failed its diagnostics).
|
|
|
|
*/
|
|
|
|
Method (_STA, 0, NotSerialized)
|
|
|
|
{
|
|
|
|
Return (0x0B) // Device present, but not shown
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|