From 518b6f6565095f328bd90589874fb1abfee27afd Mon Sep 17 00:00:00 2001 From: "Yao, Jiewen" Date: Tue, 26 Jan 2016 01:30:55 +0000 Subject: SecurityPkg: Add TPM PTP support in TCG2 Config. This patch add PTP CRB support in BIOS Setup. It can: 1) Display the PTP capability (TIS/FIFO/CRB) 2) Display the PTP current interface (TIS/FIFO/CRB) 3) Let user select CRB/FIFO, if supported. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" Reviewed-by: "Zhang, Chao B" git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19743 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c | 31 ++++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c') diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c index 8813683..968670f 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDriver.c @@ -1,7 +1,7 @@ /** @file The module entry point for Tcg2 configuration module. -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
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 @@ -159,20 +159,6 @@ Tcg2ConfigDriverEntryPoint ( UpdateDefaultPCRBanks (Tcg2ConfigBin + sizeof(UINT32), ReadUnaligned32((UINT32 *)Tcg2ConfigBin) - sizeof(UINT32), CurrentActivePCRBanks); // - // Save to variable so platform driver can get it. - // - Status = gRT->SetVariable ( - TCG2_STORAGE_NAME, - &gTcg2ConfigFormSetGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, - sizeof(Tcg2Configuration), - &Tcg2Configuration - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n")); - } - - // // Sync data from PCD to variable, so that we do not need detect again in S3 phase. // Tcg2DeviceDetection.TpmDeviceDetected = TPM_DEVICE_NULL; @@ -184,6 +170,7 @@ Tcg2ConfigDriverEntryPoint ( } PrivateData->TpmDeviceDetected = Tcg2DeviceDetection.TpmDeviceDetected; + Tcg2Configuration.TpmDevice = Tcg2DeviceDetection.TpmDeviceDetected; // // Save to variable so platform driver can get it. @@ -208,6 +195,20 @@ Tcg2ConfigDriverEntryPoint ( } // + // Save to variable so platform driver can get it. + // + Status = gRT->SetVariable ( + TCG2_STORAGE_NAME, + &gTcg2ConfigFormSetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof(Tcg2Configuration), + &Tcg2Configuration + ); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Tcg2ConfigDriver: Fail to set TCG2_STORAGE_NAME\n")); + } + + // // We should lock Tcg2DeviceDetection, because it contains information needed at S3. // Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **)&VariableLockProtocol); -- cgit v1.1