From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.12147.1647966172888983959 for ; Tue, 22 Mar 2022 09:22:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=sKQBLwQ2; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.202.59.224]) by linux.microsoft.com (Postfix) with ESMTPSA id 9746420B4783; Tue, 22 Mar 2022 09:22:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9746420B4783 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1647966172; bh=tdSAAzBn274dVQxkRx7Zg1XkcmYglD6b4Jpxibkq2YA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKQBLwQ24phnRa9FvZDEVxOYZFeORx+mhO67Mph4QQvWp5xDKS4+GCzodyd1A+wBp rVqomeYXUEMCk8wT9Vt34lk+WFzd12OvtiZeid9zLZsGRqj03n975e/TA8lqd7+/o+ adJ0dmTUqPpbtZDD32HYJTQnk8+N9E8SxxlCgm44= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Andrew Fish , Kang Gao , Michael D Kinney , Michael Kubacki , Leif Lindholm , Benjamin You , Liu Yun , Ankit Sinha , Nate DeSimone Subject: [PATCH v1 33/41] PrmPkg: Update PRM OpRegion Date: Tue, 22 Mar 2022 12:19:39 -0400 Message-Id: <20220322161947.9319-34-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220322161947.9319-1-mikuback@linux.microsoft.com> References: <20220322161947.9319-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Liu Yun Y 1. Enable new PRM OpRegion structure 2. Add PRM Handler Update Lock/Unlock support Cc: Andrew Fish Cc: Kang Gao Cc: Michael D Kinney Cc: Michael Kubacki Cc: Leif Lindholm Cc: Benjamin You Cc: Liu Yun Cc: Ankit Sinha Cc: Nate DeSimone Signed-off-by: Liu Yun --- PrmPkg/PrmSsdtInstallDxe/Prm.asl | 131 +++++++++++++------- 1 file changed, 88 insertions(+), 43 deletions(-) diff --git a/PrmPkg/PrmSsdtInstallDxe/Prm.asl b/PrmPkg/PrmSsdtInstallDxe/= Prm.asl index 0457d09e6954..20a6fef9be7b 100644 --- a/PrmPkg/PrmSsdtInstallDxe/Prm.asl +++ b/PrmPkg/PrmSsdtInstallDxe/Prm.asl @@ -1,7 +1,7 @@ /** @file The definition block in ACPI table for PRM Operation Region =20 - Copyright (c) 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020-2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -16,60 +16,105 @@ DefinitionBlock ( { 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 f= or parameter validation - { - Var0, 128 - } - Method (SETV, 1, Serialized) - { - CopyObject (Arg0, \_SB.PRMB.Var0) - } - } - // // PRM Test Device // - Device (PRMT) { Name (_HID, "80860223") Name (_CID, "80860223") 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 - 0x87, 0xBC, 0xC2, 0xCE, 0x63, 0x02, 0x9C, 0xC8, //Guid_1 - }) - Name (BUF2, Buffer(16) + PRMF, 8 + } + + /* + * 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 - 0x89, 0x15, 0x10, 0x94, 0x6E, 0xBD, 0xE3, 0x18, //Guid_1 - }) - Name (BUF3, Buffer(16) + /* Local0 is the PRM data buffer */ + Local0 =3D 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 buffe= r */ + CMD =3D 0 // run command + GUID =3D Arg0 + + /* Invoke PRM OperationRegion Handler and store the resu= lt into Local0 */ + Local0 =3D (PRMF =3D 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 - 0x8D, 0x26, 0x1E, 0xB5, 0xA3, 0xBC, 0xF1, 0x1A, //Guid_1 - }) - Method (NTST) + /* Local0 is the PRM data buffer */ + Local0 =3D buffer (26){} + + /* Create byte fields over the buffer */ + CreateByteField (Local0, 0x0, STAT) + CreateByteField (Local0, 0x9, CMD) + CreateField (Local0, 0x50, 0x80, GUID) + CMD =3D 1 // Lock command + GUID =3D Arg0 + Local0 =3D (PRMF =3D 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 =3D buffer (26){} + + /* Create byte fields over the buffer */ + CreateByteField (Local0, 0x0, STAT) + CreateByteField (Local0, 0x9, CMD) + CreateField (Local0, 0x50, 0x80, GUID) + CMD =3D 2 // Unlock command + GUID =3D Arg0 + Local0 =3D (PRMF =3D 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 resou= rces. + *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 - - - +} --=20 2.28.0.windows.1