mirror of https://github.com/acidanthera/audk.git
PrmPkg: Update PRM OpRegion
1. Enable new PRM OpRegion structure 2. Add PRM Handler Update Lock/Unlock support Cc: Andrew Fish <afish@apple.com> Cc: Kang Gao <kang.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Liu Yun <yun.y.liu@intel.com> Cc: Ankit Sinha <ankit.sinha@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Signed-off-by: Liu Yun <yun.y.liu@intel.com> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
This commit is contained in:
parent
c040831cf9
commit
a9302b89a9
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
The definition block in ACPI table for PRM Operation Region
|
The definition block in ACPI table for PRM Operation Region
|
||||||
|
|
||||||
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2020-2021, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@ -16,60 +16,105 @@ DefinitionBlock (
|
||||||
{
|
{
|
||||||
Scope (\_SB)
|
Scope (\_SB)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// PRM Bridge Device
|
|
||||||
//
|
|
||||||
|
|
||||||
Device (PRMB)
|
|
||||||
{
|
|
||||||
Name (_HID, "80860222")
|
|
||||||
Name (_CID, "80860222")
|
|
||||||
Name (_DDN, "PRM Bridge Device")
|
|
||||||
Name (_STA, 0xF)
|
|
||||||
OperationRegion (OPR1, 0x80, 0, 16)
|
|
||||||
Field (OPR1, DWordAcc, NoLock, Preserve) //Make it ByteAcc for parameter validation
|
|
||||||
{
|
|
||||||
Var0, 128
|
|
||||||
}
|
|
||||||
Method (SETV, 1, Serialized)
|
|
||||||
{
|
|
||||||
CopyObject (Arg0, \_SB.PRMB.Var0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// PRM Test Device
|
// PRM Test Device
|
||||||
//
|
//
|
||||||
|
|
||||||
Device (PRMT)
|
Device (PRMT)
|
||||||
{
|
{
|
||||||
Name (_HID, "80860223")
|
Name (_HID, "80860223")
|
||||||
Name (_CID, "80860223")
|
Name (_CID, "80860223")
|
||||||
Name (_DDN, "PRM Test Device")
|
Name (_DDN, "PRM Test Device")
|
||||||
Name (_STA, 0xF)
|
|
||||||
Name (BUF1, Buffer(16)
|
// PrmSamplePrintModule handler GUIDs
|
||||||
|
Name (BUF1, ToUUID("d5f2ad5f-a347-4d3e-87bc-c2ce63029cc8"))
|
||||||
|
Name (BUF2, ToUUID("a9e7adc3-8cd0-429a-8915-10946ebde318"))
|
||||||
|
Name (BUFN, ToUUID("b688c214-4081-4eeb-8d26-1eb5a3bcf11a"))
|
||||||
|
|
||||||
|
//PRM operation region format
|
||||||
|
OperationRegion (PRMR, PlatformRtMechanism, 0, 1)
|
||||||
|
Field (PRMR, BufferAcc, NoLock, Preserve) //Make it ByteAcc for parameter validation
|
||||||
{
|
{
|
||||||
0x5F, 0xAD, 0xF2, 0xD5, 0x47, 0xA3, 0x3E, 0x4D, //Guid_0
|
PRMF, 8
|
||||||
0x87, 0xBC, 0xC2, 0xCE, 0x63, 0x02, 0x9C, 0xC8, //Guid_1
|
}
|
||||||
})
|
|
||||||
Name (BUF2, Buffer(16)
|
/*
|
||||||
|
* Control method to invoke PRM OperationRegion handler
|
||||||
|
* Arg0 contains a buffer representing a _DSM GUID
|
||||||
|
*/
|
||||||
|
Method (RUNS, 1)
|
||||||
{
|
{
|
||||||
0xC3, 0xAD, 0xE7, 0xA9, 0xD0, 0x8C, 0x9A, 0x42, //Guid_0
|
/* Local0 is the PRM data buffer */
|
||||||
0x89, 0x15, 0x10, 0x94, 0x6E, 0xBD, 0xE3, 0x18, //Guid_1
|
Local0 = buffer (26){}
|
||||||
})
|
|
||||||
Name (BUF3, Buffer(16)
|
/* 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)
|
||||||
{
|
{
|
||||||
0x14, 0xC2, 0x88, 0xB6, 0x81, 0x40, 0xEB, 0x4E, //Guid_0
|
/* Local0 is the PRM data buffer */
|
||||||
0x8D, 0x26, 0x1E, 0xB5, 0xA3, 0xBC, 0xF1, 0x1A, //Guid_1
|
Local0 = buffer (26){}
|
||||||
})
|
|
||||||
Method (NTST)
|
/* 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Control method to unlock a PRM transaction
|
||||||
|
* Arg0 contains a buffer representing a _DSM GUID
|
||||||
|
*/
|
||||||
|
Method (ULCK, 1)
|
||||||
{
|
{
|
||||||
\_SB.PRMB.SETV (BUF1)
|
/* 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 = 2 // Unlock command
|
||||||
|
GUID = Arg0
|
||||||
|
Local0 = (PRMF = Local0)
|
||||||
|
|
||||||
|
/* Note STAT contains the return status */
|
||||||
|
Return (STAT)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} // End of Definition Block
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue