4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Ihis library is only intended to be used by TPM modules.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It provides basic TPM Interface Specification (TIS) and Command functions.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncCopyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncThis program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncare licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncwhich accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// TPM register base address.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Set structure alignment to 1-byte
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Register set map as specified in TIS specification Chapter 10
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Used to gain ownership for this particular port.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Controls interrupts.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// SIRQ vector to be used by the TPM.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// What caused interrupt.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Shows which interrupts are supported by that particular TPM.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Status Register. Provides status of the TPM.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Number of consecutive writes that can be done to the TPM.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Read or write FIFO, depending on transaction.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Vendor ID
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Device ID
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Revision ID
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// TCG defined configuration registers.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Alias to I/O legacy space.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Additional 8 bits for I/O legacy space extension.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Alias to second I/O legacy space.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Additional 8 bits for second I/O legacy space extension.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync /// Vendor-defined configuration registers.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Restore original structure alignment
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Define pointer types used to access TIS registers on PC
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// TCG Platform Type based on TCG ACPI Specification Version 1.00
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Define bits of ACCESS and STATUS registers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// This bit is a 1 to indicate that the other bits in this register are valid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Indicate that this locality is active.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Set to 1 to indicate that this locality had the TPM taken away while
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// this locality had the TIS_PC_ACC_ACTIVE bit set.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Set to 1 to indicate that TPM MUST reset the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// TIS_PC_ACC_ACTIVE bit and remove ownership for localities less than the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// locality that is writing this bit.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// When this bit is 1, another locality is requesting usage of the TPM.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Set to 1 to indicate that this locality is requesting to use TPM.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// A value of 1 indicates that a T/OS has not been established on the platform
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// When this bit is 1, TPM is in the Ready state,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// indicating it is ready to receive a new command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Write a 1 to this bit to cause the TPM to execute that command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// This bit indicates that the TPM has data available as a response.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// The TPM sets this bit to a value of 1 when it expects another byte of data for a command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Writes a 1 to this bit to force the TPM to re-send the response.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Default TimeOut value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Max TPM command/reponse length
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Check whether the value of a TPM chip register satisfies the input BIT setting.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Register Address port of register to be checked.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] BitSet Check these data bits are set.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] BitClear Check these data bits are clear.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TimeOut The max wait time (unit MicroSecond) when checking register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The register satisfies the check bit.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT The register can't run into the expected status in time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Get BurstCount by reading the burstCount field of a TIS regiger
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync in the time of default TIS_TIMEOUT_D.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TisReg Pointer to TIS register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] BurstCount Pointer to a buffer to store the got BurstConut.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Get BurstCount.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER TisReg is NULL or BurstCount is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT BurstCount can't be got in time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Set TPM chip to ready state by sending ready command TIS_PC_STS_READY
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to Status Register in time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TisReg Pointer to TIS register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS TPM chip enters into ready state.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER TisReg is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT TPM chip can't be set to ready state in time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Get the control of TPM chip by sending requestUse command TIS_PC_ACC_RQUUSE
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to ACCESS Register in the time of default TIS_TIMEOUT_D.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TisReg Pointer to TIS register.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Get the control of TPM chip.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER TisReg is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND TPM chip doesn't exit.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Can't get the TPM control in time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Single function calculates SHA1 digest value for all raw data. It
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync combines Sha1Init(), Sha1Update() and Sha1Final().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Data Raw data to be digested.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DataLen Size of the raw data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] Digest Pointer to a buffer that stores the final digest.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Always successfully calculate the final digest.