2 The header file for TPM PEI driver.
4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <IndustryStandard/Tpm12.h>
19 #include <IndustryStandard/UefiTcgPlatform.h>
20 #include <Library/TpmCommLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/BaseLib.h>
23 #include <Library/BaseMemoryLib.h>
28 TPM_RQU_COMMAND_HDR Hdr
;
29 TPM_STARTUP_TYPE TpmSt
;
33 TPM_RQU_COMMAND_HDR Hdr
;
37 TPM_RQU_COMMAND_HDR Hdr
;
39 UINT32 CapabilityFlagSize
;
40 UINT32 CapabilityFlag
;
41 } TPM_CMD_GET_CAPABILITY
;
44 TPM_RQU_COMMAND_HDR Hdr
;
45 TPM_PCRINDEX PcrIndex
;
50 TPM_RQU_COMMAND_HDR Hdr
;
51 TPM_PHYSICAL_PRESENCE PhysicalPresence
;
52 } TPM_CMD_PHYSICAL_PRESENCE
;
57 Send TPM_Startup command to TPM.
59 @param[in] PeiServices Describes the list of possible PEI Services.
60 @param[in] TpmHandle TPM handle.
61 @param[in] BootMode Boot mode.
63 @retval EFI_SUCCESS Operation completed successfully.
64 @retval EFI_TIMEOUT The register can't run into the expected status in time.
65 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
66 @retval EFI_DEVICE_ERROR Unexpected device behavior.
71 IN EFI_PEI_SERVICES
**PeiServices
,
72 IN TIS_TPM_HANDLE TpmHandle
,
73 IN EFI_BOOT_MODE BootMode
77 Send TPM_ContinueSelfTest command to TPM.
79 @param[in] PeiServices Describes the list of possible PEI Services.
80 @param[in] TpmHandle TPM handle.
82 @retval EFI_SUCCESS Operation completed successfully.
83 @retval EFI_TIMEOUT The register can't run into the expected status in time.
84 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
85 @retval EFI_DEVICE_ERROR Unexpected device behavior.
89 TpmCommContinueSelfTest (
90 IN EFI_PEI_SERVICES
**PeiServices
,
91 IN TIS_TPM_HANDLE TpmHandle
95 Get TPM capability flags.
97 @param[in] PeiServices Describes the list of possible PEI Services.
98 @param[in] TpmHandle TPM handle.
99 @param[out] Deactivated Returns deactivated flag.
100 @param[out] LifetimeLock Returns physicalPresenceLifetimeLock permanent flag.
101 @param[out] CmdEnable Returns physicalPresenceCMDEnable permanent flag.
103 @retval EFI_SUCCESS Operation completed successfully.
104 @retval EFI_TIMEOUT The register can't run into the expected status in time.
105 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
106 @retval EFI_DEVICE_ERROR Unexpected device behavior.
110 TpmCommGetCapability (
111 IN EFI_PEI_SERVICES
**PeiServices
,
112 IN TIS_TPM_HANDLE TpmHandle
,
113 OUT BOOLEAN
*Deactivated
, OPTIONAL
114 OUT BOOLEAN
*LifetimeLock
, OPTIONAL
115 OUT BOOLEAN
*CmdEnable OPTIONAL
121 @param[in] PeiServices Describes the list of possible PEI Services.
122 @param[in] TpmHandle TPM handle.
123 @param[in] DigestToExtend The 160 bit value representing the event to be recorded.
124 @param[in] PcrIndex The PCR to be updated.
125 @param[out] NewPcrValue New PCR value after extend.
127 @retval EFI_SUCCESS Operation completed successfully.
128 @retval EFI_TIMEOUT The register can't run into the expected status in time.
129 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
130 @retval EFI_DEVICE_ERROR Unexpected device behavior.
135 IN EFI_PEI_SERVICES
**PeiServices
,
136 IN TIS_TPM_HANDLE TpmHandle
,
137 IN TPM_DIGEST
*DigestToExtend
,
138 IN TPM_PCRINDEX PcrIndex
,
139 OUT TPM_DIGEST
*NewPcrValue
144 Send TSC_PhysicalPresence command to TPM.
146 @param[in] PeiServices Describes the list of possible PEI Services.
147 @param[in] TpmHandle TPM handle.
148 @param[in] PhysicalPresence The state to set the TPMs Physical Presence flags.
150 @retval EFI_SUCCESS Operation completed successfully.
151 @retval EFI_TIMEOUT The register can't run into the expected status in time.
152 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
153 @retval EFI_DEVICE_ERROR Unexpected device behavior.
157 TpmCommPhysicalPresence (
158 IN EFI_PEI_SERVICES
**PeiServices
,
159 IN TIS_TPM_HANDLE TpmHandle
,
160 IN TPM_PHYSICAL_PRESENCE PhysicalPresence
163 #endif // _TPM_COMM_H_