blob: 3e61daa677ad7cff5b501954c55c91abc64e592c [file]
/** @file
This library provides an implementation of Tpm2DeviceLib
using ARM64 SMC calls to request TPM service.
The implementation is only supporting the Command Response Buffer (CRB)
for sharing data with the TPM.
Copyright (c), Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Library/BaseLib.h>
#include <Library/Tpm2DeviceLib.h>
#include "Tpm2DeviceLibFfa.h"
/**
Return cached PTP CRB interface IdleByPass state.
@return Cached PTP CRB interface IdleByPass state.
**/
UINT8
GetCachedIdleByPass (
VOID
)
{
return Tpm2GetIdleByPass ((VOID *)(UINTN)PcdGet64 (PcdTpmBaseAddress));
}
/**
Check that we have an address for the CRB
@retval EFI_SUCCESS The entry point is executed successfully.
@retval EFI_NO_MAPPING The TPM base address is not set up.
@retval EFI_UNSUPPORTED The TPM interface type is not supported.
**/
EFI_STATUS
EFIAPI
InternalTpm2DeviceLibFfaConstructor (
VOID
)
{
if (PcdGet64 (PcdTpmBaseAddress) == 0) {
return EFI_NO_MAPPING;
}
return ValidateTpmInterfaceType ();
}