TianoCore EDK2 master
|
#include <Uefi.h>
#include <IndustryStandard/Tpm12.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/IoLib.h>
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#include <Library/Tpm12CommandLib.h>
#include <Library/PcdLib.h>
#include <IndustryStandard/TpmPtp.h>
#include <IndustryStandard/TpmTis.h>
Go to the source code of this file.
Macros | |
#define | TPMCMDBUFLENGTH 1024 |
Enumerations | |
enum | PTP_INTERFACE_TYPE { PtpInterfaceTis , PtpInterfaceFifo , PtpInterfaceCrb , PtpInterfaceMax } |
TIS (TPM Interface Specification) functions used by TPM1.2.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Tpm12Tis.c.
#define TPMCMDBUFLENGTH 1024 |
Definition at line 33 of file Tpm12Tis.c.
enum PTP_INTERFACE_TYPE |
Definition at line 23 of file Tpm12Tis.c.
PTP_INTERFACE_TYPE Tpm12GetPtpInterface | ( | IN VOID * | Register | ) |
Return PTP interface type.
[in] | Register | Pointer to PTP register. |
Definition at line 62 of file Tpm12Tis.c.
EFI_STATUS Tpm12PtpCrbRequestUseTpm | ( | IN PTP_CRB_REGISTERS_PTR | CrbReg | ) |
Get the control of TPM chip.
[in] | CrbReg | Pointer to CRB register. |
EFI_SUCCESS | Get the control of TPM chip. |
EFI_INVALID_PARAMETER | CrbReg is NULL. |
EFI_NOT_FOUND | TPM chip doesn't exit. |
EFI_TIMEOUT | Can't get the TPM control in time. |
Definition at line 530 of file Tpm12Tis.c.
EFI_STATUS Tpm12PtpCrbWaitRegisterBits | ( | IN UINT32 * | Register, |
IN UINT32 | BitSet, | ||
IN UINT32 | BitClear, | ||
IN UINT32 | TimeOut | ||
) |
Check whether the value of a TPM chip register satisfies the input BIT setting.
[in] | Register | Address port of register to be checked. |
[in] | BitSet | Check these data bits are set. |
[in] | BitClear | Check these data bits are clear. |
[in] | TimeOut | The max wait time (unit MicroSecond) when checking register. |
EFI_SUCCESS | The register satisfies the check bit. |
EFI_TIMEOUT | The register can't run into the expected status in time. |
Definition at line 497 of file Tpm12Tis.c.
EFI_STATUS EFIAPI Tpm12RequestUseTpm | ( | VOID | ) |
This service requests use TPM12.
EFI_SUCCESS | Get the control of TPM12 chip. |
EFI_NOT_FOUND | TPM12 not found. |
EFI_DEVICE_ERROR | Unexpected device behavior. |
Definition at line 555 of file Tpm12Tis.c.
EFI_STATUS EFIAPI Tpm12SubmitCommand | ( | IN UINT32 | InputParameterBlockSize, |
IN UINT8 * | InputParameterBlock, | ||
IN OUT UINT32 * | OutputParameterBlockSize, | ||
IN UINT8 * | OutputParameterBlock | ||
) |
This service enables the sending of commands to the TPM12.
[in] | InputParameterBlockSize | Size of the TPM12 input parameter block. |
[in] | InputParameterBlock | Pointer to the TPM12 input parameter block. |
[in,out] | OutputParameterBlockSize | Size of the TPM12 output parameter block. |
[in] | OutputParameterBlock | Pointer to the TPM12 output parameter block. |
EFI_SUCCESS | The command byte stream was successfully sent to the device and a response was successfully received. |
EFI_DEVICE_ERROR | The command was not successfully sent to the device or a response was not successfully received from the device. |
EFI_BUFFER_TOO_SMALL | The output parameter block is too small. |
Definition at line 453 of file Tpm12Tis.c.
EFI_STATUS Tpm12TisPcPrepareCommand | ( | IN TIS_PC_REGISTERS_PTR | TisReg | ) |
Set TPM chip to ready state by sending ready command TIS_PC_STS_READY to Status Register in time.
[in] | TisReg | Pointer to TIS register. |
EFI_SUCCESS | TPM chip enters into ready state. |
EFI_INVALID_PARAMETER | TisReg is NULL. |
EFI_TIMEOUT | TPM chip can't be set to ready state in time. |
Definition at line 191 of file Tpm12Tis.c.
BOOLEAN Tpm12TisPcPresenceCheck | ( | IN TIS_PC_REGISTERS_PTR | TisReg | ) |
Check whether TPM chip exist.
[in] | TisReg | Pointer to TIS register. |
TRUE | TPM chip exists. |
FALSE | TPM chip is not found. |
Definition at line 44 of file Tpm12Tis.c.
EFI_STATUS Tpm12TisPcReadBurstCount | ( | IN TIS_PC_REGISTERS_PTR | TisReg, |
OUT UINT16 * | BurstCount | ||
) |
Get BurstCount by reading the burstCount field of a TIS register in the time of default TIS_TIMEOUT_D.
[in] | TisReg | Pointer to TIS register. |
[out] | BurstCount | Pointer to a buffer to store the got BurstCount. |
EFI_SUCCESS | Get BurstCount. |
EFI_INVALID_PARAMETER | TisReg is NULL or BurstCount is NULL. |
EFI_TIMEOUT | BurstCount can't be got in time. |
Definition at line 147 of file Tpm12Tis.c.
EFI_STATUS Tpm12TisPcRequestUseTpm | ( | IN TIS_PC_REGISTERS_PTR | TisReg | ) |
Get the control of TPM chip by sending requestUse command TIS_PC_ACC_RQUUSE to ACCESS Register in the time of default TIS_TIMEOUT_A.
[in] | TisReg | Pointer to TIS register. |
EFI_SUCCESS | Get the control of TPM chip. |
EFI_INVALID_PARAMETER | TisReg is NULL. |
EFI_NOT_FOUND | TPM chip doesn't exit. |
EFI_TIMEOUT | Can't get the TPM control in time. |
Definition at line 223 of file Tpm12Tis.c.
EFI_STATUS Tpm12TisPcWaitRegisterBits | ( | IN UINT8 * | Register, |
IN UINT8 | BitSet, | ||
IN UINT8 | BitClear, | ||
IN UINT32 | TimeOut | ||
) |
Check whether the value of a TPM chip register satisfies the input BIT setting.
[in] | Register | Address port of register to be checked. |
[in] | BitSet | Check these data bits are set. |
[in] | BitClear | Check these data bits are clear. |
[in] | TimeOut | The max wait time (unit MicroSecond) when checking register. |
EFI_SUCCESS | The register satisfies the check bit. |
EFI_TIMEOUT | The register can't run into the expected status in time. |
Definition at line 113 of file Tpm12Tis.c.
EFI_STATUS Tpm12TisTpmCommand | ( | 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.
[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. |
EFI_SUCCESS | Operation completed successfully. |
EFI_BUFFER_TOO_SMALL | Response data buffer is too small. |
EFI_DEVICE_ERROR | Unexpected device behavior. |
EFI_UNSUPPORTED | Unsupported TPM version |
Definition at line 263 of file Tpm12Tis.c.