Add TPM2 implementation.

signed off by: jiewen.yao@intel.com
reviewed by: guo.dong@intel.com

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14687 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jyao1
2013-09-18 05:31:18 +00:00
committed by jyao1
parent 2e61fb38b6
commit c1d932429e
98 changed files with 17387 additions and 49 deletions

View File

@@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/PeImage.h>
#include <IndustryStandard/SmBios.h>
#include <IndustryStandard/TcpaAcpi.h>
#include <Guid/GlobalVariable.h>
#include <Guid/SmBios.h>
@@ -31,6 +32,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/TcgEventHob.h>
#include <Guid/EventGroup.h>
#include <Guid/EventExitBootServiceFailed.h>
#include <Guid/TpmInstance.h>
#include <Protocol/DevicePath.h>
#include <Protocol/TcgService.h>
#include <Protocol/AcpiTable.h>
@@ -53,38 +56,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EFI_TCG_LOG_AREA_SIZE 0x10000
#pragma pack (1)
typedef struct _EFI_TCG_CLIENT_ACPI_TABLE {
EFI_ACPI_DESCRIPTION_HEADER Header;
UINT16 PlatformClass;
UINT32 Laml;
EFI_PHYSICAL_ADDRESS Lasa;
} EFI_TCG_CLIENT_ACPI_TABLE;
typedef struct _EFI_TCG_SERVER_ACPI_TABLE {
EFI_ACPI_DESCRIPTION_HEADER Header;
UINT16 PlatformClass;
UINT16 Reserved0;
UINT64 Laml;
EFI_PHYSICAL_ADDRESS Lasa;
UINT16 SpecRev;
UINT8 DeviceFlags;
UINT8 InterruptFlags;
UINT8 Gpe;
UINT8 Reserved1[3];
UINT32 GlobalSysInt;
EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE BaseAddress;
UINT32 Reserved2;
EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE ConfigAddress;
UINT8 PciSegNum;
UINT8 PciBusNum;
UINT8 PciDevNum;
UINT8 PciFuncNum;
} EFI_TCG_SERVER_ACPI_TABLE;
#pragma pack ()
#define TCG_DXE_DATA_FROM_THIS(this) \
BASE_CR (this, TCG_DXE_DATA, TcgProtocol)
@@ -1344,6 +1315,11 @@ DriverEntry (
EFI_EVENT Event;
VOID *Registration;
if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){
DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n"));
return EFI_UNSUPPORTED;
}
mTcgDxeData.TpmHandle = (TIS_TPM_HANDLE)(UINTN)TPM_BASE_ADDRESS;
Status = TisPcRequestUseTpm (mTcgDxeData.TpmHandle);
if (EFI_ERROR (Status)) {