From 8b00a77adb74eb40e2bde556c7105a75f8ae9a2b Mon Sep 17 00:00:00 2001 From: lsubash Date: Tue, 30 Jul 2019 16:42:24 -0700 Subject: [PATCH] Update TPM Type to Loader Platform info HOB TPM type as dTPM and fTPM is utilized in UEFI payload to update TPM instance Signed-off-by: Subash Lakkimsetti --- BootloaderCommonPkg/Include/Guid/LoaderPlatformInfoGuid.h | 6 ++++++ .../Library/Stage2BoardInitLib/Stage2BoardInitLib.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/BootloaderCommonPkg/Include/Guid/LoaderPlatformInfoGuid.h b/BootloaderCommonPkg/Include/Guid/LoaderPlatformInfoGuid.h index 0b180421..9b088d6c 100644 --- a/BootloaderCommonPkg/Include/Guid/LoaderPlatformInfoGuid.h +++ b/BootloaderCommonPkg/Include/Guid/LoaderPlatformInfoGuid.h @@ -45,6 +45,12 @@ extern EFI_GUID gLoaderPlatformInfoGuid; //Secure debug (0 - disabled, 1 - enabled) #define HWSTATE_SECURE_DEBUG BIT3 +//Tpm Type dTPM 2.0 (0 - Not Availble, 1 - detected) +#define HWSTATE_DTPM_20 BIT4 + +//Tpm Type TPM 2.0 PTT (0 - Not Availble, 1 - detected) +#define HWSTATE_TPM_PTT BIT5 + //Definition for LOADER_PLATFORM_INFO.Flags // diff --git a/Platform/CoffeelakeBoardPkg/Library/Stage2BoardInitLib/Stage2BoardInitLib.c b/Platform/CoffeelakeBoardPkg/Library/Stage2BoardInitLib/Stage2BoardInitLib.c index f6485a1e..a51ae125 100644 --- a/Platform/CoffeelakeBoardPkg/Library/Stage2BoardInitLib/Stage2BoardInitLib.c +++ b/Platform/CoffeelakeBoardPkg/Library/Stage2BoardInitLib/Stage2BoardInitLib.c @@ -1787,9 +1787,14 @@ UpdateLoaderPlatformInfo ( if(PlatformData != NULL) { LoaderPlatformInfo->HwState = PlatformData->BtGuardInfo.VerifiedBoot | (PlatformData->BtGuardInfo.MeasuredBoot << 1); LoaderPlatformInfo->Flags = FLAGS_SPI_DISABLE_SMM_WRITE_PROTECT; + + if (PlatformData->BtGuardInfo.TpmType == dTpm20) + LoaderPlatformInfo->HwState |= HWSTATE_DTPM_20; + else if (PlatformData->BtGuardInfo.TpmType == Ptt) + LoaderPlatformInfo->HwState |= HWSTATE_TPM_PTT; + DEBUG ((EFI_D_INFO, "Stage2: HwState 0x%x\n", LoaderPlatformInfo->HwState)); } - } /**