2 The TPM definition block in ACPI table for physical presence
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
24 // Define _HID, "PNP0C31" is defined in
25 // "Secure Startup-FVE and TPM Admin BIOS and Platform Requirements"
27 Name (_HID, EISAID ("PNP0C31"))
30 // Readable name of this device, don't know if this way is correct yet
32 Name (_STR, Unicode ("TPM 1.2 Device"))
35 // Return the resource consumed by TPM device
37 Name (_CRS, ResourceTemplate () {
38 Memory32Fixed (ReadWrite, 0xfed40000, 0x5000)
42 // Operational region for Smi port access
44 OperationRegion (SMIP, SystemIO, 0xB2, 1)
45 Field (SMIP, ByteAcc, NoLock, Preserve)
51 // Operational region for TPM access
53 OperationRegion (TPMR, SystemMemory, 0xfed40000, 0x5000)
54 Field (TPMR, AnyAcc, NoLock, Preserve)
60 // Operational region for TPM support, TPM Physical Presence and TPM Memory Clear
61 // Region Offset 0xFFFF0000 and Length 0xF0 will be fixed in C code.
63 OperationRegion (TNVS, SystemMemory, 0xFFFF0000, 0xF0)
64 Field (TNVS, AnyAcc, NoLock, Preserve)
66 PPIN, 8, // Software SMI for Physical Presence Interface
67 PPIP, 32, // Used for save physical presence paramter
68 PPRP, 32, // Physical Presence request operation response
69 PPRQ, 32, // Physical Presence request operation
70 LPPR, 32, // Last Physical Presence request operation
71 FRET, 32, // Physical Presence function return code
72 MCIN, 8, // Software SMI for Memory Clear Interface
73 MCIP, 32, // Used for save the Mor paramter
74 MORD, 32, // Memory Overwrite Request Data
75 MRET, 32, // Memory Overwrite function return code
76 UCRQ, 32 // Phyical Presence request operation to Get User Confirmation Status
79 Method (PTS, 1, Serialized)
82 // Detect Sx state for MOR, only S4, S5 need to handle
84 If (LAnd (LLess (Arg0, 6), LGreater (Arg0, 3)))
87 // Bit4 -- DisableAutoDetect. 0 -- Firmware MAY autodetect.
89 If (LNot (And (MORD, 0x10)))
92 // Trigger the SMI through ACPI _PTS method.
97 // Trigger the SMI interrupt
107 if (LEqual (ACC0, 0xff))
115 // TCG Hardware Information
117 Method (HINF, 1, Serialized, 0, {BuffObj, PkgObj}, {UnknownObj}) // IntObj
120 // Switch by function index
122 Switch (ToInteger(Arg0))
129 Return (Buffer () {0x03})
134 // Return failure if no TPM present
136 Name(TPMV, Package () {0x01, Package () {0x1, 0x20}})
137 if (LEqual (_STA (), 0x00))
139 Return (Package () {0x00})
143 // Return TPM version
149 Return (Buffer () {0})
152 Name(TPM2, Package (0x02){
157 Name(TPM3, Package (0x03){
164 // TCG Physical Presence Interface
166 Method (TPPI, 2, Serialized, 0, {BuffObj, PkgObj, IntObj, StrObj}, {UnknownObj, UnknownObj}) // IntObj, PkgObj
169 // Switch by function index
171 Switch (ToInteger(Arg0))
176 // Standard query, supports function 1-8
178 Return (Buffer () {0xFF, 0x01})
183 // a) Get Physical Presence Interface Version
190 // b) Submit TPM Operation Request to Pre-OS Environment
193 Store (DerefOf (Index (Arg1, 0x00)), PPRQ)
197 // Trigger the SMI interrupt
207 // c) Get Pending TPM Operation Requested By the OS
210 Store (PPRQ, Index (TPM2, 0x01))
216 // d) Get Platform-Specific Action to Transition to Pre-OS Environment
223 // e) Return TPM Operation Response to OS Environment
228 // Trigger the SMI interrupt
232 Store (LPPR, Index (TPM3, 0x01))
233 Store (PPRP, Index (TPM3, 0x02))
241 // f) Submit preferred user language (Not implemented)
250 // g) Submit TPM Operation Request to Pre-OS Environment 2
253 Store (DerefOf (Index (Arg1, 0x00)), PPRQ)
256 // Trigger the SMI interrupt
264 // e) Get User Confirmation Status for Operation
267 Store (DerefOf (Index (Arg1, 0x00)), UCRQ)
270 // Trigger the SMI interrupt
282 Method (TMCI, 2, Serialized, 0, IntObj, {UnknownObj, UnknownObj}) // IntObj, PkgObj
285 // Switch by function index
287 Switch (ToInteger (Arg0))
292 // Standard query, supports function 1-1
294 Return (Buffer () {0x03})
299 // Save the Operation Value of the Request to MORD (reserved memory)
301 Store (DerefOf (Index (Arg1, 0x00)), MORD)
304 // Trigger the SMI through ACPI _DSM method.
309 // Trigger the SMI interrupt
319 Method (_DSM, 4, Serialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj})
323 // TCG Hardware Information
325 If(LEqual(Arg0, ToUUID ("cf8e16a5-c1e8-4e25-b712-4f54a96702c8")))
331 // TCG Physical Presence Interface
333 If(LEqual(Arg0, ToUUID ("3dddfaa6-361b-4eb4-a424-8d10089d1653")))
335 Return (TPPI (Arg2, Arg3))
339 // TCG Memory Clear Interface
341 If(LEqual(Arg0, ToUUID ("376054ed-cc13-4675-901c-4756d7f2d45d")))
343 Return (TMCI (Arg2, Arg3))
346 Return (Buffer () {0})