2 The TPM2 definition block in ACPI table for TCG2 physical presence
5 Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
6 (c)Copyright 2016 HP Development Company, L.P.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
35 // TAG for patching TPM2.0 _HID
37 Name (_HID, "NNNN0000")
39 Name (_CID, "MSFT0101")
42 // Readable name of this device, don't know if this way is correct yet
44 Name (_STR, Unicode ("TPM 2.0 Device"))
47 // Return the resource consumed by TPM device
49 Name (_CRS, ResourceTemplate () {
50 Memory32Fixed (ReadWrite, 0xfed40000, 0x5000)
54 // Operational region for Smi port access
56 OperationRegion (SMIP, SystemIO, 0xB2, 1)
57 Field (SMIP, ByteAcc, NoLock, Preserve)
63 // Operational region for TPM access
65 OperationRegion (TPMR, SystemMemory, 0xfed40000, 0x5000)
66 Field (TPMR, AnyAcc, NoLock, Preserve)
72 // Operational region for TPM support, TPM Physical Presence and TPM Memory Clear
73 // Region Offset 0xFFFF0000 and Length 0xF0 will be fixed in C code.
75 OperationRegion (TNVS, SystemMemory, 0xFFFF0000, 0xF0)
76 Field (TNVS, AnyAcc, NoLock, Preserve)
78 PPIN, 8, // Software SMI for Physical Presence Interface
79 PPIP, 32, // Used for save physical presence paramter
80 PPRP, 32, // Physical Presence request operation response
81 PPRQ, 32, // Physical Presence request operation
82 PPRM, 32, // Physical Presence request operation parameter
83 LPPR, 32, // Last Physical Presence request operation
84 FRET, 32, // Physical Presence function return code
85 MCIN, 8, // Software SMI for Memory Clear Interface
86 MCIP, 32, // Used for save the Mor paramter
87 MORD, 32, // Memory Overwrite Request Data
88 MRET, 32, // Memory Overwrite function return code
89 UCRQ, 32 // Phyical Presence request operation to Get User Confirmation Status
92 Method (PTS, 1, Serialized)
95 // Detect Sx state for MOR, only S4, S5 need to handle
97 If (LAnd (LLess (Arg0, 6), LGreater (Arg0, 3)))
100 // Bit4 -- DisableAutoDetect. 0 -- Firmware MAY autodetect.
102 If (LNot (And (MORD, 0x10)))
105 // Triggle the SMI through ACPI _PTS method.
110 // Triggle the SMI interrupt
120 if (LEqual (ACC0, 0xff))
128 // TCG Hardware Information
130 Method (HINF, 3, Serialized, 0, {BuffObj, PkgObj}, {UnknownObj, UnknownObj, UnknownObj}) // IntObj, IntObj, PkgObj
133 // Switch by function index
135 Switch (ToInteger(Arg1))
142 Return (Buffer () {0x03})
147 // Return failure if no TPM present
149 Name(TPMV, Package () {0x01, Package () {0x2, 0x0}})
150 if (LEqual (_STA (), 0x00))
152 Return (Package () {0x00})
156 // Return TPM version
162 Return (Buffer () {0})
165 Name(TPM2, Package (0x02){
170 Name(TPM3, Package (0x03){
177 // TCG Physical Presence Interface
179 Method (TPPI, 3, Serialized, 0, {BuffObj, PkgObj, IntObj, StrObj}, {UnknownObj, UnknownObj, UnknownObj}) // IntObj, IntObj, PkgObj
182 // Switch by function index
184 Switch (ToInteger(Arg1))
189 // Standard query, supports function 1-8
191 Return (Buffer () {0xFF, 0x01})
196 // a) Get Physical Presence Interface Version
203 // b) Submit TPM Operation Request to Pre-OS Environment
206 Store (DerefOf (Index (Arg2, 0x00)), PPRQ)
211 // Triggle the SMI interrupt
221 // c) Get Pending TPM Operation Requested By the OS
224 Store (PPRQ, Index (TPM2, 0x01))
230 // d) Get Platform-Specific Action to Transition to Pre-OS Environment
237 // e) Return TPM Operation Response to OS Environment
242 // Triggle the SMI interrupt
246 Store (LPPR, Index (TPM3, 0x01))
247 Store (PPRP, Index (TPM3, 0x02))
255 // f) Submit preferred user language (Not implemented)
264 // g) Submit TPM Operation Request to Pre-OS Environment 2
267 Store (DerefOf (Index (Arg2, 0x00)), PPRQ)
269 If (LEqual (PPRQ, 23)) {
270 Store (DerefOf (Index (Arg2, 0x01)), PPRM)
274 // Triggle the SMI interrupt
282 // e) Get User Confirmation Status for Operation
285 Store (DerefOf (Index (Arg2, 0x00)), UCRQ)
288 // Triggle the SMI interrupt
300 Method (TMCI, 3, Serialized, 0, IntObj, {UnknownObj, UnknownObj, UnknownObj}) // IntObj, IntObj, PkgObj
303 // Switch by function index
305 Switch (ToInteger (Arg1))
310 // Standard query, supports function 1-1
312 Return (Buffer () {0x03})
317 // Save the Operation Value of the Request to MORD (reserved memory)
319 Store (DerefOf (Index (Arg2, 0x00)), MORD)
322 // Triggle the SMI through ACPI _DSM method.
327 // Triggle the SMI interrupt
337 Method (_DSM, 4, Serialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj})
341 // TCG Hardware Information
343 If(LEqual(Arg0, ToUUID ("cf8e16a5-c1e8-4e25-b712-4f54a96702c8")))
345 Return (HINF (Arg1, Arg2, Arg3))
349 // TCG Physical Presence Interface
351 If(LEqual(Arg0, ToUUID ("3dddfaa6-361b-4eb4-a424-8d10089d1653")))
353 Return (TPPI (Arg1, Arg2, Arg3))
357 // TCG Memory Clear Interface
359 If(LEqual(Arg0, ToUUID ("376054ed-cc13-4675-901c-4756d7f2d45d")))
361 Return (TMCI (Arg1, Arg2, Arg3))
364 Return (Buffer () {0})