SecurityPkg/Tcg/TcgPei/TpmComm.c File Reference


Functions

EFI_STATUS TisTpmCommand (IN EFI_PEI_SERVICES **PeiServices, IN TIS_PC_REGISTERS_PTR TisReg, IN UINT8 *BufferIn, IN UINT32 SizeIn, IN OUT UINT8 *BufferOut, IN OUT UINT32 *SizeOut)
EFI_STATUS TpmCommStartup (IN EFI_PEI_SERVICES **PeiServices, IN TIS_TPM_HANDLE TpmHandle, IN EFI_BOOT_MODE BootMode)
EFI_STATUS TpmCommContinueSelfTest (IN EFI_PEI_SERVICES **PeiServices, IN TIS_TPM_HANDLE TpmHandle)
EFI_STATUS TpmCommGetCapability (IN EFI_PEI_SERVICES **PeiServices, IN TIS_TPM_HANDLE TpmHandle, OUT BOOLEAN *Deactivated, OUT BOOLEAN *LifetimeLock, OUT BOOLEAN *CmdEnable)
EFI_STATUS TpmCommExtend (IN EFI_PEI_SERVICES **PeiServices, IN TIS_TPM_HANDLE TpmHandle, IN TPM_DIGEST *DigestToExtend, IN TPM_PCRINDEX PcrIndex, OUT TPM_DIGEST *NewPcrValue)
EFI_STATUS TpmCommPhysicalPresence (IN EFI_PEI_SERVICES **PeiServices, IN TIS_TPM_HANDLE TpmHandle, IN TPM_PHYSICAL_PRESENCE PhysicalPresence)

Detailed Description

Utility functions used by TPM PEI driver.

Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

EFI_STATUS TisTpmCommand ( IN EFI_PEI_SERVICES **  PeiServices,
IN TIS_PC_REGISTERS_PTR  TisReg,
IN UINT8 *  BufferIn,
IN UINT32  SizeIn,
IN OUT UINT8 *  BufferOut,
IN OUT UINT32 *  SizeOut 
)

Send a command to TPM for execution and return response data.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TisReg TPM register space base address.
[in] BufferIn Buffer for command data.
[in] SizeIn Size of command data.
[in,out] BufferOut Buffer for response data.
[in,out] SizeOut size of response data.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.
Send a command to TPM for execution and return response data.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TisReg TPM register space base address.
[in] BufferIn Buffer for command data.
[in] SizeIn Size of command data.
[in,out] BufferOut Buffer for response data.
[in,out] SizeOut Size of response data.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.

References EFI_STATUS(), TIS_PC_STS_DATA, TIS_PC_STS_EXPECT, TIS_PC_STS_GO, TIS_PC_STS_READY, TIS_PC_VALID, TIS_TIMEOUT_B, TIS_TIMEOUT_C, TisPcPrepareCommand(), TisPcReadBurstCount(), TisPcWaitRegisterBits(), and UINTN().

EFI_STATUS TpmCommContinueSelfTest ( IN EFI_PEI_SERVICES **  PeiServices,
IN TIS_TPM_HANDLE  TpmHandle 
)

Send TPM_ContinueSelfTest command to TPM.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TpmHandle TPM handle.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.

References EFI_STATUS(), TPM_CMD_SELF_TEST::Hdr, and TisTpmCommand().

Referenced by PeimEntryMA().

EFI_STATUS TpmCommExtend ( IN EFI_PEI_SERVICES **  PeiServices,
IN TIS_TPM_HANDLE  TpmHandle,
IN TPM_DIGEST *  DigestToExtend,
IN TPM_PCRINDEX  PcrIndex,
OUT TPM_DIGEST *  NewPcrValue 
)

Extend a TPM PCR.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TpmHandle TPM handle.
[in] DigestToExtend The 160 bit value representing the event to be recorded.
[in] PcrIndex The PCR to be updated.
[out] NewPcrValue New PCR value after extend.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.

References EFI_STATUS(), TPM_CMD_EXTEND::Hdr, TPM_CMD_EXTEND::PcrIndex, TisTpmCommand(), and TPM_CMD_EXTEND::TpmDigest.

EFI_STATUS TpmCommGetCapability ( IN EFI_PEI_SERVICES **  PeiServices,
IN TIS_TPM_HANDLE  TpmHandle,
OUT BOOLEAN *  Deactivated,
OUT BOOLEAN *  LifetimeLock,
OUT BOOLEAN *  CmdEnable 
)

Get TPM capability flags.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TpmHandle TPM handle.
[out] Deactivated Returns deactivated flag.
[out] LifetimeLock Returns physicalPresenceLifetimeLock permanent flag.
[out] CmdEnable Returns physicalPresenceCMDEnable permanent flag.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.

References TPM_CMD_GET_CAPABILITY::Capability, TPM_CMD_GET_CAPABILITY::CapabilityFlag, TPM_CMD_GET_CAPABILITY::CapabilityFlagSize, EFI_STATUS(), TPM_CMD_GET_CAPABILITY::Hdr, and TisTpmCommand().

Referenced by IsTpmUsable(), and PhysicalPresencePpiNotifyCallback().

EFI_STATUS TpmCommPhysicalPresence ( IN EFI_PEI_SERVICES **  PeiServices,
IN TIS_TPM_HANDLE  TpmHandle,
IN TPM_PHYSICAL_PRESENCE  PhysicalPresence 
)

Send TSC_PhysicalPresence command to TPM.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TpmHandle TPM handle.
[in] PhysicalPresence The state to set the TPMs Physical Presence flags.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.

References EFI_STATUS(), TPM_CMD_PHYSICAL_PRESENCE::Hdr, TPM_CMD_PHYSICAL_PRESENCE::PhysicalPresence, and TisTpmCommand().

Referenced by PhysicalPresencePpiNotifyCallback().

EFI_STATUS TpmCommStartup ( IN EFI_PEI_SERVICES **  PeiServices,
IN TIS_TPM_HANDLE  TpmHandle,
IN EFI_BOOT_MODE  BootMode 
)

Send TPM_Startup command to TPM.

Parameters:
[in] PeiServices Describes the list of possible PEI Services.
[in] TpmHandle TPM handle.
[in] BootMode Boot mode.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_TIMEOUT The register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALL Response data buffer is too small.
EFI_DEVICE_ERROR Unexpected device behavior.

References EFI_STATUS(), and TisTpmCommand().

Referenced by PeimEntryMA().


Generated on Thu Sep 24 23:44:24 2015 for SecurityPkg[ALL] by  doxygen 1.5.7.1