summaryrefslogtreecommitdiff
path: root/SecurityPkg/Tcg/TrEEConfig
diff options
context:
space:
mode:
authorYao, Jiewen <jiewen.yao@intel.com>2015-01-22 05:14:23 +0000
committerjyao1 <jyao1@Edk2>2015-01-22 05:14:23 +0000
commit83a276f61342d0b0d94e96f7d0636bf9474b5ed1 (patch)
treef53880d73526be46d42e2c2c068e79c18951147c /SecurityPkg/Tcg/TrEEConfig
parent57ce74ac5ff4950b4bebd5bb1d8fa2024ecc1010 (diff)
downloadedk2-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/TrEEConfig')
-rw-r--r--SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf4
-rw-r--r--SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c20
2 files changed, 22 insertions, 2 deletions
diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf b/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf
index 31807cb06e..e8de529f8b 100644
--- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf
+++ b/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf
@@ -4,7 +4,7 @@
# This module initializes TPM device type based on variable and detection.
# NOTE: This module is only for reference only, each platform should have its own setup page.
#
-# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -58,9 +58,11 @@
## SOMETIMES_CONSUMES ## Variable:L"TREE_DEVICE_DETECTION"
gTrEEConfigFormSetGuid
gEfiTpmDeviceSelectedGuid ## PRODUCES ## GUID # Used as a PPI GUID
+ gEfiTpmDeviceInstanceNoneGuid ## SOMETIMES_CONSUMES ## GUID # TPM device identifier
[Ppis]
gEfiPeiReadOnlyVariable2PpiGuid ## CONSUMES
+ gPeiTpmInitializationDonePpiGuid ## SOMETIMES_PRODUCES
[Pcd]
gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## PRODUCES
diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c b/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c
index 579d096be5..efe40bc3ce 100644
--- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c
+++ b/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c
@@ -1,7 +1,7 @@
/** @file
The module entry point for TrEE configuration module.
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -25,6 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h>
#include <Ppi/ReadOnlyVariable2.h>
+#include <Ppi/TpmInitialized.h>
#include <Protocol/TrEEProtocol.h>
#include "TrEEConfigNvData.h"
@@ -37,6 +38,12 @@ CONST EFI_PEI_PPI_DESCRIPTOR gTpmSelectedPpi = {
NULL
};
+EFI_PEI_PPI_DESCRIPTOR mTpmInitializationDonePpiList = {
+ EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
+ &gPeiTpmInitializationDonePpiGuid,
+ NULL
+};
+
/**
This routine check both SetupVariable and real TPM device, and return final TpmDevice configuration.
@@ -67,6 +74,7 @@ TrEEConfigPeimEntryPoint (
{
UINTN Size;
EFI_STATUS Status;
+ EFI_STATUS Status2;
EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariablePpi;
TREE_CONFIGURATION TrEEConfiguration;
UINTN Index;
@@ -136,5 +144,15 @@ TrEEConfigPeimEntryPoint (
Status = PeiServicesInstallPpi (&gTpmSelectedPpi);
ASSERT_EFI_ERROR (Status);
+ //
+ // Even if no TPM is selected or detected, we still need intall TpmInitializationDonePpi.
+ // Because TcgPei or TrEEPei will not run, but we still need a way to notify other driver.
+ // Other driver can know TPM initialization state by TpmInitializedPpi.
+ //
+ if (CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceNoneGuid)) {
+ Status2 = PeiServicesInstallPpi (&mTpmInitializationDonePpiList);
+ ASSERT_EFI_ERROR (Status2);
+ }
+
return Status;
}