]> git.proxmox.com Git - mirror_edk2.git/blame - PrmPkg/PrmSsdtInstallDxe/Prm.asl
PrmPkg/PrmSsdtInstallDxe: Update PRMT Device CID to PNP0C02.
[mirror_edk2.git] / PrmPkg / PrmSsdtInstallDxe / Prm.asl
CommitLineData
ef059559
L
1/** @file\r
2 The definition block in ACPI table for PRM Operation Region\r
3\r
a9302b89 4 Copyright (c) 2020-2021, Intel Corporation. All rights reserved.<BR>\r
ef059559
L
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6**/\r
7\r
8DefinitionBlock (\r
9 "Prm.aml",\r
10 "SSDT",\r
50e1432a
MK
11 2,\r
12 "OEMID ",\r
ef059559 13 "PRMOPREG",\r
50e1432a 14 0x1000\r
ef059559
L
15 )\r
16{\r
17 Scope (\_SB)\r
18 {\r
ef059559
L
19 //\r
20 // PRM Test Device\r
21 //\r
ef059559
L
22 Device (PRMT)\r
23 {\r
24 Name (_HID, "80860223")\r
6032b46d 25 Name (_CID, EisaId ("PNP0C02"))\r
ef059559 26 Name (_DDN, "PRM Test Device")\r
a9302b89 27\r
a9302b89
LY
28 //PRM operation region format\r
29 OperationRegion (PRMR, PlatformRtMechanism, 0, 1)\r
30 Field (PRMR, BufferAcc, NoLock, Preserve) //Make it ByteAcc for parameter validation\r
ef059559 31 {\r
a9302b89
LY
32 PRMF, 8\r
33 }\r
34\r
35 /*\r
36 * Control method to invoke PRM OperationRegion handler\r
37 * Arg0 contains a buffer representing a _DSM GUID\r
38 */\r
39 Method (RUNS, 1)\r
ef059559 40 {\r
a9302b89
LY
41 /* Local0 is the PRM data buffer */\r
42 Local0 = buffer (26){}\r
43\r
44 /* Create byte fields over the buffer */\r
45 CreateByteField (Local0, 0x0, PSTA)\r
46 CreateQWordField (Local0, 0x1, USTA)\r
47 CreateByteField (Local0, 0x9, CMD)\r
48 CreateField (Local0, 0x50, 0x80, GUID)\r
49\r
50 /* Fill in the command and data fields of the data buffer */\r
51 CMD = 0 // run command\r
52 GUID = Arg0\r
53\r
54 /* Invoke PRM OperationRegion Handler and store the result into Local0 */\r
55 Local0 = (PRMF = Local0)\r
56\r
57 /* Return status */\r
58 Return (PSTA)\r
59 }\r
60\r
61 /*\r
62 * Control method to lock a PRM transaction\r
63 * Arg0 contains a buffer representing a _DSM GUID\r
64 */\r
65 Method (LCKH, 1)\r
ef059559 66 {\r
a9302b89
LY
67 /* Local0 is the PRM data buffer */\r
68 Local0 = buffer (26){}\r
69\r
70 /* Create byte fields over the buffer */\r
71 CreateByteField (Local0, 0x0, STAT)\r
72 CreateByteField (Local0, 0x9, CMD)\r
73 CreateField (Local0, 0x50, 0x80, GUID)\r
74 CMD = 1 // Lock command\r
75 GUID = Arg0\r
76 Local0 = (PRMF = Local0)\r
77\r
78 /* Note STAT contains the return status */\r
79 Return (STAT)\r
ef059559 80 }\r
ef059559 81\r
a9302b89
LY
82 /*\r
83 * Control method to unlock a PRM transaction\r
84 * Arg0 contains a buffer representing a _DSM GUID\r
85 */\r
86 Method (ULCK, 1)\r
87 {\r
88 /* Local0 is the PRM data buffer */\r
89 Local0 = buffer (26){}\r
ef059559 90\r
a9302b89
LY
91 /* Create byte fields over the buffer */\r
92 CreateByteField (Local0, 0x0, STAT)\r
93 CreateByteField (Local0, 0x9, CMD)\r
94 CreateField (Local0, 0x50, 0x80, GUID)\r
95 CMD = 2 // Unlock command\r
96 GUID = Arg0\r
97 Local0 = (PRMF = Local0)\r
ef059559 98\r
a9302b89
LY
99 /* Note STAT contains the return status */\r
100 Return (STAT)\r
101 }\r
ef059559 102\r
a9302b89
LY
103 /*\r
104 *Bit [0] Set if the device is present.\r
105 *Bit [1] Set if the device is enabled and decoding its resources.\r
106 *Bit [2] Set if the device should be shown in the UI.\r
107 *Bit [3] Set if the device is functioning properly (cleared if device failed its diagnostics).\r
108 */\r
109 Method (_STA, 0, NotSerialized)\r
110 {\r
111 Return (0x0B) // Device present, but not shown\r
112 }\r
113 }\r
114 }\r
115}\r