2 This library abstract how to access TPM2 hardware device.
4 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _TPM2_DEVICE_LIB_H_
10 #define _TPM2_DEVICE_LIB_H_
15 // Used in PcdActiveTpmInterfaceType to identify TPM interface type
22 } TPM2_PTP_INTERFACE_TYPE
;
25 This service enables the sending of commands to the TPM2.
27 @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
28 @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.
29 @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.
30 @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.
32 @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
33 @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
34 @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
39 IN UINT32 InputParameterBlockSize
,
40 IN UINT8
*InputParameterBlock
,
41 IN OUT UINT32
*OutputParameterBlockSize
,
42 IN UINT8
*OutputParameterBlock
46 This service requests use TPM2.
48 @retval EFI_SUCCESS Get the control of TPM2 chip.
49 @retval EFI_NOT_FOUND TPM2 not found.
50 @retval EFI_DEVICE_ERROR Unexpected device behavior.
59 This service enables the sending of commands to the TPM2.
61 @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
62 @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.
63 @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.
64 @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.
66 @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
67 @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
68 @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
72 (EFIAPI
*TPM2_SUBMIT_COMMAND
) (
73 IN UINT32 InputParameterBlockSize
,
74 IN UINT8
*InputParameterBlock
,
75 IN OUT UINT32
*OutputParameterBlockSize
,
76 IN UINT8
*OutputParameterBlock
80 This service requests use TPM2.
82 @retval EFI_SUCCESS Get the control of TPM2 chip.
83 @retval EFI_NOT_FOUND TPM2 not found.
84 @retval EFI_DEVICE_ERROR Unexpected device behavior.
88 (EFIAPI
*TPM2_REQUEST_USE_TPM
) (
93 EFI_GUID ProviderGuid
;
94 TPM2_SUBMIT_COMMAND Tpm2SubmitCommand
;
95 TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm
;
96 } TPM2_DEVICE_INTERFACE
;
99 This service register TPM2 device.
101 @param Tpm2Device TPM2 device
103 @retval EFI_SUCCESS This TPM2 device is registered successfully.
104 @retval EFI_UNSUPPORTED System does not support register this TPM2 device.
105 @retval EFI_ALREADY_STARTED System already register this TPM2 device.
109 Tpm2RegisterTpm2DeviceLib (
110 IN TPM2_DEVICE_INTERFACE
*Tpm2Device