microsoft/mu_feature_ffa
Publicmirrored fromhttps://github.com/microsoft/mu_feature_ffaAvailable
FfaFeaturePkg/Include/Library/TpmServiceStateTranslationLib.h
111lines · modecode
| 1 | /** @file |
| 2 | Definitions for the TPM Service State Translation Library. This library's |
| 3 | main purpose is to translate the states of the TPM service's CRB states to |
| 4 | the main TPM's interface states. (i.e. TPM PC CRB -> TPM FIFO) A user of the |
| 5 | TPM service should only need to update this library with the proper TPM |
| 6 | interface type for their device. |
| 7 | |
| 8 | Copyright (c), Microsoft Corporation. |
| 9 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 10 | |
| 11 | **/ |
| 12 | |
| 13 | #ifndef TPM_SST_LIB_H_ |
| 14 | #define TPM_SST_LIB_H_ |
| 15 | |
| 16 | #include <IndustryStandard/TpmPtp.h> |
| 17 | |
| 18 | /** |
| 19 | Initiates the transition to the Idle state |
| 20 | |
| 21 | @param Locality The locality of the TPM to set into Idle |
| 22 | |
| 23 | @retval EFI_SUCCESS Success |
| 24 | @retval EFI_TIMEOUT Timeout |
| 25 | |
| 26 | **/ |
| 27 | EFI_STATUS |
| 28 | TpmSstGoIdle ( |
| 29 | UINT8 Locality |
| 30 | ); |
| 31 | |
| 32 | /** |
| 33 | Initiates the transition to the commandReady state |
| 34 | |
| 35 | @param Locality The locality of the TPM to set to commandReady |
| 36 | |
| 37 | @retval EFI_SUCCESS Success |
| 38 | @retval EFI_TIMEOUT Timeout |
| 39 | |
| 40 | **/ |
| 41 | EFI_STATUS |
| 42 | TpmSstCmdReady ( |
| 43 | UINT8 Locality |
| 44 | ); |
| 45 | |
| 46 | /** |
| 47 | Initiates command execution |
| 48 | |
| 49 | @param Locality The locality of the TPM to initiate the command on |
| 50 | @param InternalTpmCrb The internal CRB to copy command data from |
| 51 | |
| 52 | @retval EFI_SUCCESS Success |
| 53 | @retval EFI_TIMEOUT Timeout |
| 54 | |
| 55 | **/ |
| 56 | EFI_STATUS |
| 57 | TpmSstStart ( |
| 58 | UINT8 Locality, |
| 59 | PTP_CRB_REGISTERS_PTR InternalTpmCrb |
| 60 | ); |
| 61 | |
| 62 | /** |
| 63 | Requests access to the given locality |
| 64 | |
| 65 | @param Locality The locality to request access to |
| 66 | |
| 67 | @retval EFI_SUCCESS Success |
| 68 | @retval EFI_TIMEOUT Timeout |
| 69 | |
| 70 | **/ |
| 71 | EFI_STATUS |
| 72 | TpmSstLocalityRequest ( |
| 73 | UINT8 Locality |
| 74 | ); |
| 75 | |
| 76 | /** |
| 77 | Relinquish access to the given locality |
| 78 | |
| 79 | @param Locality The locality to relinquish access to |
| 80 | |
| 81 | @retval EFI_SUCCESS Success |
| 82 | @retval EFI_TIMEOUT Timeout |
| 83 | |
| 84 | **/ |
| 85 | EFI_STATUS |
| 86 | TpmSstLocalityRelinquish ( |
| 87 | UINT8 Locality |
| 88 | ); |
| 89 | |
| 90 | /** |
| 91 | Returns if IdleBypass is supported |
| 92 | |
| 93 | @retval TRUE Supported |
| 94 | @retval FALSE Unsupported |
| 95 | |
| 96 | **/ |
| 97 | BOOLEAN |
| 98 | TpmSstIsIdleBypassSupported ( |
| 99 | VOID |
| 100 | ); |
| 101 | |
| 102 | /** |
| 103 | Initializes the TPM Service State Translation Library |
| 104 | |
| 105 | **/ |
| 106 | VOID |
| 107 | TpmSstInit ( |
| 108 | VOID |
| 109 | ); |
| 110 | |
| 111 | #endif /* TPM_SST_LIB_H_ */ |
| 112 | |