2 The TPM definition block in ACPI table for physical presence
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) Microsoft Corporation.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
25 // Define _HID, "PNP0C31" is defined in
26 // "Secure Startup-FVE and TPM Admin BIOS and Platform Requirements"
28 Name (_HID, EISAID ("PNP0C31"))
31 // Readable name of this device, don't know if this way is correct yet
33 Name (_STR, Unicode ("TPM 1.2 Device"))
36 // Return the resource consumed by TPM device
38 Name (_CRS, ResourceTemplate () {
39 Memory32Fixed (ReadWrite, 0xfed40000, 0x5000)
43 // Operational region for Smi port access
45 OperationRegion (SMIP, SystemIO, FixedPcdGet16 (PcdSmiCommandIoPort), 1)
46 Field (SMIP, ByteAcc, NoLock, Preserve)
52 // Operational region for TPM access
54 OperationRegion (TPMR, SystemMemory, 0xfed40000, 0x5000)
55 Field (TPMR, AnyAcc, NoLock, Preserve)
61 // Operational region for TPM support, TPM Physical Presence and TPM Memory Clear
62 // Region Offset 0xFFFF0000 and Length 0xF0 will be fixed in C code.
64 OperationRegion (TNVS, SystemMemory, 0xFFFF0000, 0xF0)
65 Field (TNVS, AnyAcc, NoLock, Preserve)
67 PPIN, 8, // Software SMI for Physical Presence Interface
68 PPIP, 32, // Used for save physical presence parameter
69 PPRP, 32, // Physical Presence request operation response
70 PPRQ, 32, // Physical Presence request operation
71 LPPR, 32, // Last Physical Presence request operation
72 FRET, 32, // Physical Presence function return code
73 MCIN, 8, // Software SMI for Memory Clear Interface
74 MCIP, 32, // Used for save the Mor parameter
75 MORD, 32, // Memory Overwrite Request Data
76 MRET, 32, // Memory Overwrite function return code
77 UCRQ, 32 // Physical Presence request operation to Get User Confirmation Status
80 Method (PTS, 1, Serialized)
83 // Detect Sx state for MOR, only S4, S5 need to handle
85 If (LAnd (LLess (Arg0, 6), LGreater (Arg0, 3)))
88 // Bit4 -- DisableAutoDetect. 0 -- Firmware MAY autodetect.
90 If (LNot (And (MORD, 0x10)))
93 // Trigger the SMI through ACPI _PTS method.
98 // Trigger the SMI interrupt
108 if (LEqual (ACC0, 0xff))
116 // TCG Hardware Information
118 Method (HINF, 1, Serialized, 0, {BuffObj, PkgObj}, {UnknownObj}) // IntObj
121 // Switch by function index
123 Switch (ToInteger(Arg0))
130 Return (Buffer () {0x03})
135 // Return failure if no TPM present
137 Name(TPMV, Package () {0x01, Package () {0x1, 0x20}})
138 if (LEqual (_STA (), 0x00))
140 Return (Package () {0x00})
144 // Return TPM version
150 Return (Buffer () {0})
153 Name(TPM2, Package (0x02){
158 Name(TPM3, Package (0x03){
165 // TCG Physical Presence Interface
167 Method (TPPI, 2, Serialized, 0, {BuffObj, PkgObj, IntObj, StrObj}, {UnknownObj, UnknownObj}) // IntObj, PkgObj
170 // Switch by function index
172 Switch (ToInteger(Arg0))
177 // Standard query, supports function 1-8
179 Return (Buffer () {0xFF, 0x01})
184 // a) Get Physical Presence Interface Version
191 // b) Submit TPM Operation Request to Pre-OS Environment
194 Store (DerefOf (Index (Arg1, 0x00)), PPRQ)
198 // Trigger the SMI interrupt
208 // c) Get Pending TPM Operation Requested By the OS
211 Store (PPRQ, Index (TPM2, 0x01))
217 // d) Get Platform-Specific Action to Transition to Pre-OS Environment
224 // e) Return TPM Operation Response to OS Environment
229 // Trigger the SMI interrupt
233 Store (LPPR, Index (TPM3, 0x01))
234 Store (PPRP, Index (TPM3, 0x02))
242 // f) Submit preferred user language (Not implemented)
251 // g) Submit TPM Operation Request to Pre-OS Environment 2
254 Store (DerefOf (Index (Arg1, 0x00)), PPRQ)
257 // Trigger the SMI interrupt
265 // e) Get User Confirmation Status for Operation
268 Store (DerefOf (Index (Arg1, 0x00)), UCRQ)
271 // Trigger the SMI interrupt
283 Method (TMCI, 2, Serialized, 0, IntObj, {UnknownObj, UnknownObj}) // IntObj, PkgObj
286 // Switch by function index
288 Switch (ToInteger (Arg0))
293 // Standard query, supports function 1-1
295 Return (Buffer () {0x03})
300 // Save the Operation Value of the Request to MORD (reserved memory)
302 Store (DerefOf (Index (Arg1, 0x00)), MORD)
305 // Trigger the SMI through ACPI _DSM method.
310 // Trigger the SMI interrupt
320 Method (_DSM, 4, Serialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj})
324 // TCG Hardware Information
326 If(LEqual(Arg0, ToUUID ("cf8e16a5-c1e8-4e25-b712-4f54a96702c8")))
332 // TCG Physical Presence Interface
334 If(LEqual(Arg0, ToUUID ("3dddfaa6-361b-4eb4-a424-8d10089d1653")))
336 Return (TPPI (Arg2, Arg3))
340 // TCG Memory Clear Interface
342 If(LEqual(Arg0, ToUUID ("376054ed-cc13-4675-901c-4756d7f2d45d")))
344 Return (TMCI (Arg2, Arg3))
347 Return (Buffer () {0})