TianoCore EDK2 master
|
#include <IndustryStandard/Tpm20.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/IoLib.h>
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#include <Library/Tpm2DeviceLib.h>
#include <Library/PcdLib.h>
#include <IndustryStandard/TpmTis.h>
Go to the source code of this file.
Macros | |
#define | TIS_TIMEOUT_MAX (90000 * 1000) |
#define | TPMCMDBUFLENGTH 0x500 |
Functions | |
BOOLEAN | TisPcPresenceCheck (IN TIS_PC_REGISTERS_PTR TisReg) |
EFI_STATUS | TisPcWaitRegisterBits (IN UINT8 *Register, IN UINT8 BitSet, IN UINT8 BitClear, IN UINT32 TimeOut) |
EFI_STATUS | TisPcReadBurstCount (IN TIS_PC_REGISTERS_PTR TisReg, OUT UINT16 *BurstCount) |
EFI_STATUS | TisPcPrepareCommand (IN TIS_PC_REGISTERS_PTR TisReg) |
EFI_STATUS | TisPcRequestUseTpm (IN TIS_PC_REGISTERS_PTR TisReg) |
EFI_STATUS | Tpm2TisTpmCommand (IN TIS_PC_REGISTERS_PTR TisReg, IN UINT8 *BufferIn, IN UINT32 SizeIn, IN OUT UINT8 *BufferOut, IN OUT UINT32 *SizeOut) |
EFI_STATUS EFIAPI | DTpm2TisSubmitCommand (IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock) |
EFI_STATUS EFIAPI | DTpm2TisRequestUseTpm (VOID) |
TIS (TPM Interface Specification) functions used by dTPM2.0 library.
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 Tpm2Tis.c.
EFI_STATUS EFIAPI DTpm2TisRequestUseTpm | ( | VOID | ) |
EFI_STATUS EFIAPI DTpm2TisSubmitCommand | ( | IN UINT32 | InputParameterBlockSize, |
IN UINT8 * | InputParameterBlock, | ||
IN OUT UINT32 * | OutputParameterBlockSize, | ||
IN UINT8 * | OutputParameterBlock | ||
) |
This service enables the sending of commands to the TPM2.
[in] | InputParameterBlockSize | Size of the TPM2 input parameter block. |
[in] | InputParameterBlock | Pointer to the TPM2 input parameter block. |
[in,out] | OutputParameterBlockSize | Size of the TPM2 output parameter block. |
[in] | OutputParameterBlock | Pointer to the TPM2 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. |
EFI_STATUS TisPcPrepareCommand | ( | 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. |
BOOLEAN TisPcPresenceCheck | ( | IN TIS_PC_REGISTERS_PTR | TisReg | ) |
EFI_STATUS TisPcReadBurstCount | ( | 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. |
EFI_STATUS TisPcRequestUseTpm | ( | 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. |
EFI_STATUS TisPcWaitRegisterBits | ( | 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. |
EFI_STATUS Tpm2TisTpmCommand | ( | 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 |