diff options
author | Yao, Jiewen <jiewen.yao@intel.com> | 2015-01-22 05:14:23 +0000 |
---|---|---|
committer | jyao1 <jyao1@Edk2> | 2015-01-22 05:14:23 +0000 |
commit | 83a276f61342d0b0d94e96f7d0636bf9474b5ed1 (patch) | |
tree | f53880d73526be46d42e2c2c068e79c18951147c /SecurityPkg/Tcg/TcgPei/TcgPei.c | |
parent | 57ce74ac5ff4950b4bebd5bb1d8fa2024ecc1010 (diff) | |
download | edk2-platforms-83a276f61342d0b0d94e96f7d0636bf9474b5ed1.tar.xz |
Add TpmInitializationDonePpi to TPM PEI module.
This PPI will always be installed to notify other drivers that TPM initialization action is done. TPM initialization may success or fail, or even not present.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Dong, Guo" <guo.dong@intel.com>
Reviewed-by: "Chiu, Chasel" <chasel.chiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16638 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/TcgPei/TcgPei.c')
-rw-r--r-- | SecurityPkg/Tcg/TcgPei/TcgPei.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.c b/SecurityPkg/Tcg/TcgPei/TcgPei.c index dcf4b0bbbd..466caf66c2 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.c +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.c @@ -50,6 +50,12 @@ EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList = { NULL
};
+EFI_PEI_PPI_DESCRIPTOR mTpmInitializationDonePpiList = {
+ EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
+ &gPeiTpmInitializationDonePpiGuid,
+ NULL
+};
+
EFI_PLATFORM_FIRMWARE_BLOB *mMeasuredBaseFvInfo;
UINT32 mMeasuredBaseFvIndex = 0;
@@ -737,6 +743,7 @@ PeimEntryMA ( )
{
EFI_STATUS Status;
+ EFI_STATUS Status2;
EFI_BOOT_MODE BootMode;
TIS_TPM_HANDLE TpmHandle;
@@ -768,13 +775,13 @@ PeimEntryMA ( Status = TisPcRequestUseTpm ((TIS_PC_REGISTERS_PTR)TpmHandle);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "TPM not detected!\n"));
- return Status;
+ goto Done;
}
if (PcdGet8 (PcdTpmInitializationPolicy) == 1) {
Status = TpmCommStartup ((EFI_PEI_SERVICES**)PeiServices, TpmHandle, BootMode);
if (EFI_ERROR (Status) ) {
- return Status;
+ goto Done;
}
}
@@ -784,20 +791,29 @@ PeimEntryMA ( if (BootMode != BOOT_ON_S3_RESUME) {
Status = TpmCommContinueSelfTest ((EFI_PEI_SERVICES**)PeiServices, TpmHandle);
if (EFI_ERROR (Status)) {
- return Status;
+ goto Done;
}
}
+ //
+ // Only intall TpmInitializedPpi on success
+ //
Status = PeiServicesInstallPpi (&mTpmInitializedPpiList);
ASSERT_EFI_ERROR (Status);
}
if (mImageInMemory) {
Status = PeimEntryMP ((EFI_PEI_SERVICES**)PeiServices);
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ return Status;
}
+Done:
+ //
+ // Always intall TpmInitializationDonePpi no matter success or fail.
+ // Other driver can know TPM initialization state by TpmInitializedPpi.
+ //
+ Status2 = PeiServicesInstallPpi (&mTpmInitializationDonePpiList);
+ ASSERT_EFI_ERROR (Status2);
+
return Status;
}
|