2 The TPM definition block in ACPI table for physical presence
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
30 // Define _HID, "PNP0C31" is defined in
31 // "Secure Startup-FVE and TPM Admin BIOS and Platform Requirements"
33 Name (_HID, EISAID ("PNP0C31"))
36 // Readable name of this device, don't know if this way is correct yet
38 Name (_STR, Unicode ("TPM 1.2 Device"))
41 // Return the resource consumed by TPM device
43 Name (_CRS, ResourceTemplate () {
44 Memory32Fixed (ReadWrite, 0xfed40000, 0x5000)
48 // Operational region for Smi port access
50 OperationRegion (SMIP, SystemIO, 0xB2, 1)
51 Field (SMIP, ByteAcc, NoLock, Preserve)
57 // Operational region for TPM access
59 OperationRegion (TPMR, SystemMemory, 0xfed40000, 0x5000)
60 Field (TPMR, AnyAcc, NoLock, Preserve)
66 // Operational region for TPM support, TPM Physical Presence and TPM Memory Clear
67 // Region Offset 0xFFFF0000 and Length 0xF0 will be fixed in C code.
69 OperationRegion (TNVS, SystemMemory, 0xFFFF0000, 0xF0)
70 Field (TNVS, AnyAcc, NoLock, Preserve)
72 PPIN, 8, // Software SMI for Physical Presence Interface
73 PPIP, 32, // Used for save physical presence paramter
74 PPRP, 32, // Physical Presence request operation response
75 PPRQ, 32, // Physical Presence request operation
76 LPPR, 32, // Last Physical Presence request operation
77 FRET, 32, // Physical Presence function return code
78 MCIN, 8, // Software SMI for Memory Clear Interface
79 MCIP, 32, // Used for save the Mor paramter
80 MORD, 32, // Memory Overwrite Request Data
81 MRET, 32, // Memory Overwrite function return code
82 UCRQ, 32 // Phyical Presence request operation to Get User Confirmation Status
85 Method (PTS, 1, Serialized)
88 // Detect Sx state for MOR, only S4, S5 need to handle
90 If (LAnd (LLess (Arg0, 6), LGreater (Arg0, 3)))
93 // Bit4 -- DisableAutoDetect. 0 -- Firmware MAY autodetect.
95 If (LNot (And (MORD, 0x10)))
98 // Triggle the SMI through ACPI _PTS method.
103 // Triggle the SMI interrupt
113 if (LEqual (ACC0, 0xff))
121 // TCG Hardware Information
123 Method (HINF, 3, Serialized, 0, {BuffObj, PkgObj}, {UnknownObj, UnknownObj, UnknownObj}) // IntObj, IntObj, PkgObj
126 // Switch by function index
128 Switch (ToInteger(Arg1))
135 Return (Buffer () {0x03})
140 // Return failure if no TPM present
142 Name(TPMV, Package () {0x01, Package () {0x1, 0x20}})
143 if (LEqual (_STA (), 0x00))
145 Return (Package () {0x00})
149 // Return TPM version
155 Return (Buffer () {0})
158 Name(TPM2, Package (0x02){
163 Name(TPM3, Package (0x03){
170 // TCG Physical Presence Interface
172 Method (TPPI, 3, Serialized, 0, {BuffObj, PkgObj, IntObj, StrObj}, {UnknownObj, UnknownObj, UnknownObj}) // IntObj, IntObj, PkgObj
175 // Switch by function index
177 Switch (ToInteger(Arg1))
182 // Standard query, supports function 1-8
184 Return (Buffer () {0xFF, 0x01})
189 // a) Get Physical Presence Interface Version
196 // b) Submit TPM Operation Request to Pre-OS Environment
199 Store (DerefOf (Index (Arg2, 0x00)), PPRQ)
203 // Triggle the SMI interrupt
213 // c) Get Pending TPM Operation Requested By the OS
216 Store (PPRQ, Index (TPM2, 0x01))
222 // d) Get Platform-Specific Action to Transition to Pre-OS Environment
229 // e) Return TPM Operation Response to OS Environment
234 // Triggle the SMI interrupt
238 Store (LPPR, Index (TPM3, 0x01))
239 Store (PPRP, Index (TPM3, 0x02))
247 // f) Submit preferred user language (Not implemented)
256 // g) Submit TPM Operation Request to Pre-OS Environment 2
259 Store (DerefOf (Index (Arg2, 0x00)), PPRQ)
262 // Triggle the SMI interrupt
270 // e) Get User Confirmation Status for Operation
273 Store (DerefOf (Index (Arg2, 0x00)), UCRQ)
276 // Triggle the SMI interrupt
288 Method (TMCI, 3, Serialized, 0, IntObj, {UnknownObj, UnknownObj, UnknownObj}) // IntObj, IntObj, PkgObj
291 // Switch by function index
293 Switch (ToInteger (Arg1))
298 // Standard query, supports function 1-1
300 Return (Buffer () {0x03})
305 // Save the Operation Value of the Request to MORD (reserved memory)
307 Store (DerefOf (Index (Arg2, 0x00)), MORD)
310 // Triggle the SMI through ACPI _DSM method.
315 // Triggle the SMI interrupt
325 Method (_DSM, 4, Serialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj})
329 // TCG Hardware Information
331 If(LEqual(Arg0, ToUUID ("cf8e16a5-c1e8-4e25-b712-4f54a96702c8")))
333 Return (HINF (Arg1, Arg2, Arg3))
337 // TCG Physical Presence Interface
339 If(LEqual(Arg0, ToUUID ("3dddfaa6-361b-4eb4-a424-8d10089d1653")))
341 Return (TPPI (Arg1, Arg2, Arg3))
345 // TCG Memory Clear Interface
347 If(LEqual(Arg0, ToUUID ("376054ed-cc13-4675-901c-4756d7f2d45d")))
349 Return (TMCI (Arg1, Arg2, Arg3))
352 Return (Buffer () {0})