From nobody Mon Dec 23 05:54:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152109936998762.625711450913855; Thu, 15 Mar 2018 00:36:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DA214223FCF27; Thu, 15 Mar 2018 00:29:33 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 830E322546BA0 for ; Thu, 15 Mar 2018 00:29:30 -0700 (PDT) Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 00:35:54 -0700 Received: from czhan46-mobl1.ccr.corp.intel.com ([10.239.192.117]) by orsmga007.jf.intel.com with ESMTP; 15 Mar 2018 00:35:52 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=chao.b.zhang@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,308,1517904000"; d="scan'208";a="24860157" From: "Zhang, Chao B" To: edk2-devel@lists.01.org Date: Thu, 15 Mar 2018 15:35:32 +0800 Message-Id: <20180315073537.16692-11-chao.b.zhang@intel.com> X-Mailer: git-send-email 2.11.0.windows.1 In-Reply-To: <20180315073537.16692-1-chao.b.zhang@intel.com> References: <20180315073537.16692-1-chao.b.zhang@intel.com> Subject: [edk2] [PATCH 10/15] SecurityPkg/TrEEConfig: remove TrEE. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao , Chao B Zhang MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Jiewen Yao TrEE is deprecated. We need use Tcg2. Cc: Chao B Zhang Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao --- SecurityPkg/Tcg/TrEEConfig/TpmDetection.c | 105 ------ SecurityPkg/Tcg/TrEEConfig/TrEEConfig.vfr | 68 ---- SecurityPkg/Tcg/TrEEConfig/TrEEConfigDriver.c | 216 ------------ SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxe.inf | 88 ----- SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxe.uni | 22 -- SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxeExtra.uni | 19 -- SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.c | 344 ------------------= -- SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.h | 193 ----------- SecurityPkg/Tcg/TrEEConfig/TrEEConfigNvData.h | 76 ----- SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf | 77 ----- SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.uni | 23 -- SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeiExtra.uni | 19 -- SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c | 159 --------- SecurityPkg/Tcg/TrEEConfig/TrEEConfigStrings.uni | 40 --- 14 files changed, 1449 deletions(-) diff --git a/SecurityPkg/Tcg/TrEEConfig/TpmDetection.c b/SecurityPkg/Tcg/Tr= EEConfig/TpmDetection.c deleted file mode 100644 index 4e675d3602..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TpmDetection.c +++ /dev/null @@ -1,105 +0,0 @@ -/** @file - TPM1.2/dTPM2.0 auto detection. - -Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "TrEEConfigNvData.h" - -/** - This routine check both SetupVariable and real TPM device, and return fi= nal TpmDevice configuration. - - @param SetupTpmDevice TpmDevice configuration in setup driver - - @return TpmDevice configuration -**/ -UINT8 -DetectTpmDevice ( - IN UINT8 SetupTpmDevice - ) -{ - EFI_STATUS Status; - EFI_BOOT_MODE BootMode; - TREE_DEVICE_DETECTION TrEEDeviceDetection; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariablePpi; - UINTN Size; - - Status =3D PeiServicesGetBootMode (&BootMode); - ASSERT_EFI_ERROR (Status); - - // - // In S3, we rely on normal boot Detection, because we save to ReadOnly = Variable in normal boot. - // - if (BootMode =3D=3D BOOT_ON_S3_RESUME) { - DEBUG ((EFI_D_INFO, "DetectTpmDevice: S3 mode\n")); - - Status =3D PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, = NULL, (VOID **) &VariablePpi); - ASSERT_EFI_ERROR (Status); - - Size =3D sizeof(TREE_DEVICE_DETECTION); - ZeroMem (&TrEEDeviceDetection, sizeof(TrEEDeviceDetection)); - Status =3D VariablePpi->GetVariable ( - VariablePpi, - TREE_DEVICE_DETECTION_NAME, - &gTrEEConfigFormSetGuid, - NULL, - &Size, - &TrEEDeviceDetection - ); - if (!EFI_ERROR (Status) && - (TrEEDeviceDetection.TpmDeviceDetected >=3D TPM_DEVICE_MIN) && - (TrEEDeviceDetection.TpmDeviceDetected <=3D TPM_DEVICE_MAX)) { - DEBUG ((EFI_D_ERROR, "TpmDevice from DeviceDetection: %x\n", TrEEDev= iceDetection.TpmDeviceDetected)); - return TrEEDeviceDetection.TpmDeviceDetected; - } - } - - DEBUG ((EFI_D_INFO, "DetectTpmDevice:\n")); - - // dTPM available and not disabled by setup - // We need check if it is TPM1.2 or TPM2.0 - // So try TPM1.2 command at first - - Status =3D Tpm12RequestUseTpm (); - if (EFI_ERROR (Status)) { - // - // dTPM not available - // - return TPM_DEVICE_NULL; - } - - if (BootMode =3D=3D BOOT_ON_S3_RESUME) { - Status =3D Tpm12Startup (TPM_ST_STATE); - } else { - Status =3D Tpm12Startup (TPM_ST_CLEAR); - } - if (EFI_ERROR (Status)) { - return TPM_DEVICE_2_0_DTPM; - } - - // NO initialization needed again. - Status =3D PcdSet8S (PcdTpmInitializationPolicy, 0); - ASSERT_EFI_ERROR (Status); - return TPM_DEVICE_1_2; -} diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfig.vfr b/SecurityPkg/Tcg/Tr= EEConfig/TrEEConfig.vfr deleted file mode 100644 index 84b55a9f15..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfig.vfr +++ /dev/null @@ -1,68 +0,0 @@ -/** @file - VFR file used by the TREE configuration component. - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#include "TrEEConfigNvData.h" - -formset - guid =3D TREE_CONFIG_FORM_SET_GUID, - title =3D STRING_TOKEN(STR_TREE_TITLE), - help =3D STRING_TOKEN(STR_TREE_HELP), - classguid =3D EFI_HII_PLATFORM_SETUP_FORMSET_GUID, - - efivarstore TREE_CONFIGURATION, - varid =3D TREE_CONFIGURATION_VARSTORE_ID, - attribute =3D 0x03, // EFI variable attribures EFI_VARIABLE_BOOTSERV= ICE_ACCESS | EFI_VARIABLE_NON_VOLATILE - name =3D TREE_CONFIGURATION, - guid =3D TREE_CONFIG_FORM_SET_GUID; - - form formid =3D TREE_CONFIGURATION_FORM_ID, - title =3D STRING_TOKEN(STR_TREE_TITLE); - - subtitle text =3D STRING_TOKEN(STR_NULL); - - text - help =3D STRING_TOKEN(STR_TREE_DEVICE_STATE_HELP), - text =3D STRING_TOKEN(STR_TREE_DEVICE_STATE_PROMPT), - text =3D STRING_TOKEN(STR_TREE_DEVICE_STATE_CONTENT); - - oneof varid =3D TREE_CONFIGURATION.TpmDevice, - questionid =3D KEY_TPM_DEVICE, - prompt =3D STRING_TOKEN(STR_TREE_DEVICE_PROMPT), - help =3D STRING_TOKEN(STR_TREE_DEVICE_HELP), - flags =3D INTERACTIVE, - option text =3D STRING_TOKEN(STR_TREE_TPM_1_2), value= =3D TPM_DEVICE_1_2, flags =3D DEFAULT | MANUFACTURING | RESET_REQ= UIRED; - option text =3D STRING_TOKEN(STR_TREE_TPM_2_0_DTPM), value= =3D TPM_DEVICE_2_0_DTPM, flags =3D RESET_REQUIRED; - endoneof; - - subtitle text =3D STRING_TOKEN(STR_NULL); - - suppressif ideqvallist TREE_CONFIGURATION.TpmDevice =3D=3D TPM_DEVICE_= NULL TPM_DEVICE_1_2; - - subtitle text =3D STRING_TOKEN(STR_NULL); - subtitle text =3D STRING_TOKEN(STR_TREE_PP_OPERATION); - - oneof name =3D Tpm2Operation, - questionid =3D KEY_TPM2_OPERATION, - prompt =3D STRING_TOKEN(STR_TREE_OPERATION), - help =3D STRING_TOKEN(STR_TREE_OPERATION_HELP), - flags =3D INTERACTIVE | NUMERIC_SIZE_1, - option text =3D STRING_TOKEN(STR_TREE_NO_ACTION), value =3D TR= EE_PHYSICAL_PRESENCE_NO_ACTION, flags =3D DEFAULT | MANUFACTURING | RESET_R= EQUIRED; - option text =3D STRING_TOKEN(STR_TREE_CLEAR), value =3D TREE_P= HYSICAL_PRESENCE_CLEAR_CONTROL_CLEAR, flags =3D RESET_REQUIRED; - endoneof; - - endif; - - endform; - -endformset; diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDriver.c b/SecurityPkg/Tc= g/TrEEConfig/TrEEConfigDriver.c deleted file mode 100644 index 2ad02c05a6..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDriver.c +++ /dev/null @@ -1,216 +0,0 @@ -/** @file - The module entry point for TrEE configuration module. - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#include "TrEEConfigImpl.h" - -extern TPM_INSTANCE_ID mTpmInstanceId[TPM_DEVICE_MAX + 1]; - -/** - The entry point for TrEE configuration driver. - - @param[in] ImageHandle The image handle of the driver. - @param[in] SystemTable The system table. - - @retval EFI_ALREADY_STARTED The driver already exists in system. - @retval EFI_OUT_OF_RESOURCES Fail to execute entry point due to lack o= f resources. - @retval EFI_SUCCES All the related protocols are installed o= n the driver. - @retval Others Fail to install protocols as indicated. - -**/ -EFI_STATUS -EFIAPI -TrEEConfigDriverEntryPoint ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - TREE_CONFIG_PRIVATE_DATA *PrivateData; - TREE_CONFIGURATION TrEEConfiguration; - TREE_DEVICE_DETECTION TrEEDeviceDetection; - UINTN Index; - UINTN DataSize; - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLockProtocol; - - Status =3D gBS->OpenProtocol ( - ImageHandle, - &gEfiCallerIdGuid, - NULL, - ImageHandle, - ImageHandle, - EFI_OPEN_PROTOCOL_TEST_PROTOCOL - ); - if (!EFI_ERROR (Status)) { - return EFI_ALREADY_STARTED; - } - =20 - // - // Create a private data structure. - // - PrivateData =3D AllocateCopyPool (sizeof (TREE_CONFIG_PRIVATE_DATA), &mT= rEEConfigPrivateDateTemplate); - ASSERT (PrivateData !=3D NULL); - - // - // Install private GUID. - // =20 - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &ImageHandle, - &gEfiCallerIdGuid, - PrivateData, - NULL - ); - ASSERT_EFI_ERROR (Status); - - DataSize =3D sizeof(TrEEConfiguration); - Status =3D gRT->GetVariable ( - TREE_STORAGE_NAME, - &gTrEEConfigFormSetGuid, - NULL, - &DataSize, - &TrEEConfiguration - ); - if (EFI_ERROR (Status)) { - // - // Variable not ready, set default value - // - TrEEConfiguration.TpmDevice =3D TPM_DEVICE_DEFAULT; - } - - // - // Validation - // - if ((TrEEConfiguration.TpmDevice > TPM_DEVICE_MAX) || (TrEEConfiguration= .TpmDevice < TPM_DEVICE_MIN)) { - TrEEConfiguration.TpmDevice =3D TPM_DEVICE_DEFAULT; - } - - // - // Save to variable so platform driver can get it. - // - Status =3D gRT->SetVariable ( - TREE_STORAGE_NAME, - &gTrEEConfigFormSetGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACC= ESS, - sizeof(TrEEConfiguration), - &TrEEConfiguration - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TrEEConfigDriver: Fail to set TREE_STORAGE_NAME\= n")); - } - - // - // Sync data from PCD to variable, so that we do not need detect again i= n S3 phase. - // - TrEEDeviceDetection.TpmDeviceDetected =3D TPM_DEVICE_NULL; - for (Index =3D 0; Index < sizeof(mTpmInstanceId)/sizeof(mTpmInstanceId[0= ]); Index++) { - if (CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &mTpmInstanceId[Index]= .TpmInstanceGuid)) { - TrEEDeviceDetection.TpmDeviceDetected =3D mTpmInstanceId[Index].TpmD= evice; - break; - } - } - - PrivateData->TpmDeviceDetected =3D TrEEDeviceDetection.TpmDeviceDetected; - - // - // Save to variable so platform driver can get it. - // - Status =3D gRT->SetVariable ( - TREE_DEVICE_DETECTION_NAME, - &gTrEEConfigFormSetGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACC= ESS, - sizeof(TrEEDeviceDetection), - &TrEEDeviceDetection - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "TrEEConfigDriver: Fail to set TREE_DEVICE_DETECT= ION_NAME\n")); - Status =3D gRT->SetVariable ( - TREE_DEVICE_DETECTION_NAME, - &gTrEEConfigFormSetGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, - 0, - NULL - ); - ASSERT_EFI_ERROR (Status); - } - - // - // We should lock TrEEDeviceDetection, because it contains information n= eeded at S3. - // - Status =3D gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (= VOID **)&VariableLockProtocol); - if (!EFI_ERROR (Status)) { - Status =3D VariableLockProtocol->RequestToLock ( - VariableLockProtocol, - TREE_DEVICE_DETECTION_NAME, - &gTrEEConfigFormSetGuid - ); - ASSERT_EFI_ERROR (Status); - } - =20 - // - // Install TrEE configuration form - // - Status =3D InstallTrEEConfigForm (PrivateData); - if (EFI_ERROR (Status)) { - goto ErrorExit; - } - - return EFI_SUCCESS; - -ErrorExit: - if (PrivateData !=3D NULL) { - UninstallTrEEConfigForm (PrivateData); - } =20 - =20 - return Status; -} - -/** - Unload the TrEE configuration form. - - @param[in] ImageHandle The driver's image handle. - - @retval EFI_SUCCESS The TrEE configuration form is unloaded. - @retval Others Failed to unload the form. - -**/ -EFI_STATUS -EFIAPI -TrEEConfigDriverUnload ( - IN EFI_HANDLE ImageHandle - ) -{ - EFI_STATUS Status; - TREE_CONFIG_PRIVATE_DATA *PrivateData; - - Status =3D gBS->HandleProtocol ( - ImageHandle, - &gEfiCallerIdGuid, - (VOID **) &PrivateData - ); =20 - if (EFI_ERROR (Status)) { - return Status; =20 - } - =20 - ASSERT (PrivateData->Signature =3D=3D TREE_CONFIG_PRIVATE_DATA_SIGNATURE= ); - - gBS->UninstallMultipleProtocolInterfaces ( - &ImageHandle, - &gEfiCallerIdGuid, - PrivateData, - NULL - ); - =20 - UninstallTrEEConfigForm (PrivateData); - - return EFI_SUCCESS; -} diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxe.inf b/SecurityPkg/Tcg= /TrEEConfig/TrEEConfigDxe.inf deleted file mode 100644 index 368570aea0..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxe.inf +++ /dev/null @@ -1,88 +0,0 @@ -## @file -# TPM device configuration for TPM 2.0 -# =20 -# By this module, user may select TPM device, clear TPM state, etc. -# 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.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BS= D License -# which accompanies this distribution. The full text of the license may be= found at -# http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D TrEEConfigDxe - MODULE_UNI_FILE =3D TrEEConfigDxe.uni - FILE_GUID =3D 3141FD4D-EA02-4a70-9BCE-97EE837319AC - MODULE_TYPE =3D DXE_DRIVER - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D TrEEConfigDriverEntryPoint - UNLOAD_IMAGE =3D TrEEConfigDriverUnload - -# -# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC -# - -[Sources] - TrEEConfigDriver.c - TrEEConfigImpl.c - TrEEConfigImpl.h - TrEEConfig.vfr - TrEEConfigStrings.uni - TrEEConfigNvData.h - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - SecurityPkg/SecurityPkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - MemoryAllocationLib - UefiLib - UefiBootServicesTableLib - UefiRuntimeServicesTableLib - UefiDriverEntryPoint - UefiHiiServicesLib - DebugLib - HiiLib - PcdLib - PrintLib - Tpm2DeviceLib - Tpm2CommandLib - -[Guids] - ## SOMETIMES_PRODUCES ## Variable:L"TrEEPhysicalPresence" - ## SOMETIMES_CONSUMES ## Variable:L"TrEEPhysicalPresence" - gEfiTrEEPhysicalPresenceGuid - =20 - ## PRODUCES ## HII - ## SOMETIMES_PRODUCES ## Variable:L"TREE_CONFIGURATION" - ## SOMETIMES_CONSUMES ## Variable:L"TREE_CONFIGURATION" - ## PRODUCES ## Variable:L"TREE_DEVICE_DETECTION" - ## SOMETIMES_CONSUMES ## Variable:L"TREE_DEVICE_DETECTION" - gTrEEConfigFormSetGuid - -[Protocols] - gEfiHiiConfigAccessProtocolGuid ## PRODUCES - gEfiDevicePathProtocolGuid ## PRODUCES - gEdkiiVariableLockProtocolGuid ## SOMETIMES_CONSUMES - -[Pcd] - gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## CONSUMES - -[Depex] - gEfiTrEEProtocolGuid AND - gEfiHiiConfigRoutingProtocolGuid AND - gEfiHiiDatabaseProtocolGuid AND - gEfiVariableArchProtocolGuid AND - gEfiVariableWriteArchProtocolGuid - =20 -[UserExtensions.TianoCore."ExtraFiles"] - TrEEConfigDxeExtra.uni \ No newline at end of file diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxe.uni b/SecurityPkg/Tcg= /TrEEConfig/TrEEConfigDxe.uni deleted file mode 100644 index 6b84586b2c..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxe.uni +++ /dev/null @@ -1,22 +0,0 @@ -// /** @file -// TPM device configuration for TPM 2.0 -// -// By this module, user may select TPM device, clear TPM state, etc. -// 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.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "TPM device config= uration for TPM 2.0" - -#string STR_MODULE_DESCRIPTION #language en-US "By this module, u= ser may select TPM device, clear TPM state, etc. NOTE: This module is only = for reference only, each platform should have its own setup page." - diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxeExtra.uni b/SecurityPk= g/Tcg/TrEEConfig/TrEEConfigDxeExtra.uni deleted file mode 100644 index c1b243e563..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigDxeExtra.uni +++ /dev/null @@ -1,19 +0,0 @@ -// /** @file -// TrEEConfigDxe Localized Strings and Content -// -// Copyright (c) 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - -#string STR_PROPERTIES_MODULE_NAME=20 -#language en-US=20 -"TrEE (Trusted Execution Environment) Configuration DXE" - - diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.c b/SecurityPkg/Tcg/= TrEEConfig/TrEEConfigImpl.c deleted file mode 100644 index 2f03adcc8c..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.c +++ /dev/null @@ -1,344 +0,0 @@ -/** @file - HII Config Access protocol implementation of TREE configuration module. - 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.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#include "TrEEConfigImpl.h" -#include -#include -#include - -TPM_INSTANCE_ID mTpmInstanceId[TPM_DEVICE_MAX + 1] =3D TPM_INSTANCE_ID_LI= ST; - -TREE_CONFIG_PRIVATE_DATA mTrEEConfigPrivateDateTemplate =3D { - TREE_CONFIG_PRIVATE_DATA_SIGNATURE, - { - TrEEExtractConfig, - TrEERouteConfig, - TrEECallback - } -}; - -HII_VENDOR_DEVICE_PATH mTrEEHiiVendorDevicePath =3D { - { - { - HARDWARE_DEVICE_PATH, - HW_VENDOR_DP, - { - (UINT8) (sizeof (VENDOR_DEVICE_PATH)), - (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) - } - }, - TREE_CONFIG_FORM_SET_GUID - }, - { - END_DEVICE_PATH_TYPE, - END_ENTIRE_DEVICE_PATH_SUBTYPE, - {=20 - (UINT8) (END_DEVICE_PATH_LENGTH), - (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8) - } - } -}; - -/** - This function allows a caller to extract the current configuration for o= ne - or more named elements from the target driver. - - @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. - @param[in] Request A null-terminated Unicode string in - format. - @param[out] Progress On return, points to a character in the R= equest - string. Points to the string's null termi= nator if - request was successful. Points to the mos= t recent - '&' before the first failing name/value p= air (or - the beginning of the string if the failur= e is in - the first name/value pair) if the request= was not - successful. - @param[out] Results A null-terminated Unicode string in - format which has all valu= es filled - in for the names in the Request string. S= tring to - be allocated by the called function. - - @retval EFI_SUCCESS The Results is filled with the requested = values. - @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results. - @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown nam= e. - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this - driver. - -**/ -EFI_STATUS -EFIAPI -TrEEExtractConfig ( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN CONST EFI_STRING Request, - OUT EFI_STRING *Progress, - OUT EFI_STRING *Results - ) -{ - if (Progress =3D=3D NULL || Results =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - *Progress =3D Request; - return EFI_NOT_FOUND; -} - -/** - Save TPM request to variable space. - - @param[in] PpRequest Physical Presence request command. - - @retval EFI_SUCCESS The operation is finished successfully. - @retval Others Other errors as indicated. - -**/ -EFI_STATUS -SaveTrEEPpRequest ( - IN UINT8 PpRequest - ) -{ - EFI_STATUS Status; - UINTN DataSize; - EFI_TREE_PHYSICAL_PRESENCE PpData; - - // - // Save TPM command to variable. - // - DataSize =3D sizeof (EFI_TREE_PHYSICAL_PRESENCE); - Status =3D gRT->GetVariable ( - TREE_PHYSICAL_PRESENCE_VARIABLE, - &gEfiTrEEPhysicalPresenceGuid, - NULL, - &DataSize, - &PpData - ); - if (EFI_ERROR (Status)) { - return Status; - } =20 - =20 - PpData.PPRequest =3D PpRequest; - Status =3D gRT->SetVariable ( - TREE_PHYSICAL_PRESENCE_VARIABLE, - &gEfiTrEEPhysicalPresenceGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACC= ESS | EFI_VARIABLE_RUNTIME_ACCESS, - DataSize, - &PpData - ); - if (EFI_ERROR(Status)) { - return Status; - } - - return EFI_SUCCESS; -} - -/** - This function processes the results of changes in configuration. - - @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. - @param[in] Configuration A null-terminated Unicode string in - format. - @param[out] Progress A pointer to a string filled in with the = offset of - the most recent '&' before the first fail= ing - name/value pair (or the beginning of the = string if - the failure is in the first name/value pa= ir) or - the terminating NULL if all was successfu= l. - - @retval EFI_SUCCESS The Results is processed successfully. - @retval EFI_INVALID_PARAMETER Configuration is NULL. - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this - driver. - -**/ -EFI_STATUS -EFIAPI -TrEERouteConfig ( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN CONST EFI_STRING Configuration, - OUT EFI_STRING *Progress - ) -{ - if (Configuration =3D=3D NULL || Progress =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - return EFI_NOT_FOUND; -} - -/** - This function processes the results of changes in configuration. - - @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. - @param[in] Action Specifies the type of action taken by the= browser. - @param[in] QuestionId A unique value which is sent to the origi= nal - exporting driver so that it can identify = the type - of data to expect. - @param[in] Type The type of value for the question. - @param[in] Value A pointer to the data being sent to the o= riginal - exporting driver. - @param[out] ActionRequest On return, points to the action requested= by the - callback function. - - @retval EFI_SUCCESS The callback successfully handled the act= ion. - @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold t= he - variable and its data. - @retval EFI_DEVICE_ERROR The variable could not be saved. - @retval EFI_UNSUPPORTED The specified Action is not supported by = the - callback. - -**/ -EFI_STATUS -EFIAPI -TrEECallback ( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN EFI_BROWSER_ACTION Action, - IN EFI_QUESTION_ID QuestionId, - IN UINT8 Type, - IN EFI_IFR_TYPE_VALUE *Value, - OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest - ) -{ - if ((This =3D=3D NULL) || (Value =3D=3D NULL) || (ActionRequest =3D=3D N= ULL)) { - return EFI_INVALID_PARAMETER; - } - =20 - if (Action =3D=3D EFI_BROWSER_ACTION_CHANGED) { - if (QuestionId =3D=3D KEY_TPM_DEVICE) { - return EFI_SUCCESS; - } - if (QuestionId =3D=3D KEY_TPM2_OPERATION) { - return SaveTrEEPpRequest (Value->u8); - } - } - - return EFI_UNSUPPORTED; -} - -/** - This function publish the TREE configuration Form for TPM device. - - @param[in, out] PrivateData Points to TREE configuration private data. - - @retval EFI_SUCCESS HII Form is installed for this network de= vice. - @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installa= tion. - @retval Others Other errors as indicated. - -**/ -EFI_STATUS -InstallTrEEConfigForm ( - IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData - ) -{ - EFI_STATUS Status; - EFI_HII_HANDLE HiiHandle; - EFI_HANDLE DriverHandle; - EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess; - - DriverHandle =3D NULL; - ConfigAccess =3D &PrivateData->ConfigAccess; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &DriverHandle, - &gEfiDevicePathProtocolGuid, - &mTrEEHiiVendorDevicePath, - &gEfiHiiConfigAccessProtocolGuid, - ConfigAccess, - NULL - ); - if (EFI_ERROR (Status)) { - return Status; - } - - PrivateData->DriverHandle =3D DriverHandle; - - // - // Publish the HII package list - // - HiiHandle =3D HiiAddPackages ( - &gTrEEConfigFormSetGuid, - DriverHandle, - TrEEConfigDxeStrings, - TrEEConfigBin, - NULL - ); - if (HiiHandle =3D=3D NULL) { - gBS->UninstallMultipleProtocolInterfaces ( - DriverHandle, - &gEfiDevicePathProtocolGuid, - &mTrEEHiiVendorDevicePath, - &gEfiHiiConfigAccessProtocolGuid, - ConfigAccess, - NULL - ); =20 - - return EFI_OUT_OF_RESOURCES; - } - =20 - PrivateData->HiiHandle =3D HiiHandle; - - // - // Update static data - // - switch (PrivateData->TpmDeviceDetected) { - case TPM_DEVICE_NULL: - HiiSetString (PrivateData->HiiHandle, STRING_TOKEN (STR_TREE_DEVICE_ST= ATE_CONTENT), L"Not Found", NULL); - break; - case TPM_DEVICE_1_2: - HiiSetString (PrivateData->HiiHandle, STRING_TOKEN (STR_TREE_DEVICE_ST= ATE_CONTENT), L"TPM 1.2", NULL); - break; - case TPM_DEVICE_2_0_DTPM: - HiiSetString (PrivateData->HiiHandle, STRING_TOKEN (STR_TREE_DEVICE_ST= ATE_CONTENT), L"TPM 2.0 (DTPM)", NULL); - break; - default: - HiiSetString (PrivateData->HiiHandle, STRING_TOKEN (STR_TREE_DEVICE_ST= ATE_CONTENT), L"Unknown", NULL); - break; - } - - return EFI_SUCCESS; =20 -} - -/** - This function removes TREE configuration Form. - - @param[in, out] PrivateData Points to TREE configuration private data. - -**/ -VOID -UninstallTrEEConfigForm ( - IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData - ) -{ - // - // Uninstall HII package list - // - if (PrivateData->HiiHandle !=3D NULL) { - HiiRemovePackages (PrivateData->HiiHandle); - PrivateData->HiiHandle =3D NULL; - } - - // - // Uninstall HII Config Access Protocol - // - if (PrivateData->DriverHandle !=3D NULL) { - gBS->UninstallMultipleProtocolInterfaces ( - PrivateData->DriverHandle, - &gEfiDevicePathProtocolGuid, - &mTrEEHiiVendorDevicePath, - &gEfiHiiConfigAccessProtocolGuid, - &PrivateData->ConfigAccess, - NULL - ); - PrivateData->DriverHandle =3D NULL; - } - =20 - FreePool (PrivateData); -} diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.h b/SecurityPkg/Tcg/= TrEEConfig/TrEEConfigImpl.h deleted file mode 100644 index 720c698e7a..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.h +++ /dev/null @@ -1,193 +0,0 @@ -/** @file - The header file of HII Config Access protocol implementation of TREE - configuration module. - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#ifndef __TREE_CONFIG_IMPL_H__ -#define __TREE_CONFIG_IMPL_H__ - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "TrEEConfigNvData.h" - -// -// Tool generated IFR binary data and String package data -// -extern UINT8 TrEEConfigBin[]; -extern UINT8 TrEEConfigDxeStrings[]; - -/// -/// HII specific Vendor Device Path definition. -/// -typedef struct { - VENDOR_DEVICE_PATH VendorDevicePath; - EFI_DEVICE_PATH_PROTOCOL End; -} HII_VENDOR_DEVICE_PATH; - -typedef struct { - UINTN Signature; - - EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess; - EFI_HII_HANDLE HiiHandle; - EFI_HANDLE DriverHandle; =20 - - UINT8 TpmDeviceDetected; -} TREE_CONFIG_PRIVATE_DATA; - -extern TREE_CONFIG_PRIVATE_DATA mTrEEConfigPrivateDateTemplate; - -#define TREE_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'r', 'E'= , 'D') -#define TREE_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, TREE_CONFIG_PRIVATE_= DATA, ConfigAccess, TREE_CONFIG_PRIVATE_DATA_SIGNATURE) - - -/** - This function publish the TREE configuration Form for TPM device. - - @param[in, out] PrivateData Points to TREE configuration private data. - - @retval EFI_SUCCESS HII Form is installed for this network de= vice. - @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installa= tion. - @retval Others Other errors as indicated. - -**/ -EFI_STATUS -InstallTrEEConfigForm ( - IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData - ); - -/** - This function removes TREE configuration Form. - - @param[in, out] PrivateData Points to TREE configuration private data. - -**/ -VOID -UninstallTrEEConfigForm ( - IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData - ); - -/** - This function allows a caller to extract the current configuration for o= ne - or more named elements from the target driver. - - @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. - @param[in] Request A null-terminated Unicode string in - format. - @param[out] Progress On return, points to a character in the R= equest - string. Points to the string's null termi= nator if - request was successful. Points to the mos= t recent - '&' before the first failing name/value p= air (or - the beginning of the string if the failur= e is in - the first name/value pair) if the request= was not - successful. - @param[out] Results A null-terminated Unicode string in - format which has all valu= es filled - in for the names in the Request string. S= tring to - be allocated by the called function. - - @retval EFI_SUCCESS The Results is filled with the requested = values. - @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results. - @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown nam= e. - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this - driver. - -**/ -EFI_STATUS -EFIAPI -TrEEExtractConfig ( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN CONST EFI_STRING Request, - OUT EFI_STRING *Progress, - OUT EFI_STRING *Results - ); - -/** - This function processes the results of changes in configuration. - - @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. - @param[in] Configuration A null-terminated Unicode string in - format. - @param[out] Progress A pointer to a string filled in with the = offset of - the most recent '&' before the first fail= ing - name/value pair (or the beginning of the = string if - the failure is in the first name/value pa= ir) or - the terminating NULL if all was successfu= l. - - @retval EFI_SUCCESS The Results is processed successfully. - @retval EFI_INVALID_PARAMETER Configuration is NULL. - @retval EFI_NOT_FOUND Routing data doesn't match any storage in= this - driver. - -**/ -EFI_STATUS -EFIAPI -TrEERouteConfig ( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN CONST EFI_STRING Configuration, - OUT EFI_STRING *Progress - ); - -/** - This function processes the results of changes in configuration. - - @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTO= COL. - @param[in] Action Specifies the type of action taken by the= browser. - @param[in] QuestionId A unique value which is sent to the origi= nal - exporting driver so that it can identify = the type - of data to expect. - @param[in] Type The type of value for the question. - @param[in] Value A pointer to the data being sent to the o= riginal - exporting driver. - @param[out] ActionRequest On return, points to the action requested= by the - callback function. - - @retval EFI_SUCCESS The callback successfully handled the act= ion. - @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold t= he - variable and its data. - @retval EFI_DEVICE_ERROR The variable could not be saved. - @retval EFI_UNSUPPORTED The specified Action is not supported by = the - callback. - -**/ -EFI_STATUS -EFIAPI -TrEECallback ( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN EFI_BROWSER_ACTION Action, - IN EFI_QUESTION_ID QuestionId, - IN UINT8 Type, - IN EFI_IFR_TYPE_VALUE *Value, - OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest - ); - -#endif diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigNvData.h b/SecurityPkg/Tc= g/TrEEConfig/TrEEConfigNvData.h deleted file mode 100644 index 14e5d926a1..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigNvData.h +++ /dev/null @@ -1,76 +0,0 @@ -/** @file - Header file for NV data structure definition. - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#ifndef __TREE_CONFIG_NV_DATA_H__ -#define __TREE_CONFIG_NV_DATA_H__ - -#include -#include -#include - -#define TREE_CONFIGURATION_VARSTORE_ID 0x0001 -#define TREE_CONFIGURATION_FORM_ID 0x0001 - -#define KEY_TPM_DEVICE 0x2000 -#define KEY_TPM2_OPERATION 0x2001 - -#define TPM_DEVICE_NULL 0 -#define TPM_DEVICE_1_2 1 -#define TPM_DEVICE_2_0_DTPM 2 -#define TPM_DEVICE_MIN TPM_DEVICE_1_2 -#define TPM_DEVICE_MAX TPM_DEVICE_2_0_DTPM -#define TPM_DEVICE_DEFAULT TPM_DEVICE_1_2 - -// -// Nv Data structure referenced by IFR, TPM device user desired -// -typedef struct { - UINT8 TpmDevice; -} TREE_CONFIGURATION; - -// -// Variable saved for S3, TPM detected, only valid in S3 path. -// This variable is ReadOnly. -// -typedef struct { - UINT8 TpmDeviceDetected; -} TREE_DEVICE_DETECTION; - -#define TREE_STORAGE_NAME L"TREE_CONFIGURATION" -#define TREE_DEVICE_DETECTION_NAME L"TREE_DEVICE_DETECTION" - -#define TPM_INSTANCE_ID_LIST { \ - {TPM_DEVICE_INTERFACE_NONE, TPM_DEVICE_NULL}, \ - {TPM_DEVICE_INTERFACE_TPM12, TPM_DEVICE_1_2}, \ - {TPM_DEVICE_INTERFACE_TPM20_DTPM, TPM_DEVICE_2_0_DTPM}, \ -} - -// -// BUGBUG: In order to pass VfrCompiler, we have to redefine GUID here. -// -#ifndef __BASE_H__ -typedef struct { - UINT32 Data1; - UINT16 Data2; - UINT16 Data3; - UINT8 Data4[8]; -} GUID; -#endif - -typedef struct { - GUID TpmInstanceGuid; - UINT8 TpmDevice; -} TPM_INSTANCE_ID; - -#endif diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf b/SecurityPkg/Tcg= /TrEEConfig/TrEEConfigPei.inf deleted file mode 100644 index a4d6b58c6a..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.inf +++ /dev/null @@ -1,77 +0,0 @@ -## @file -# Set TPM device type -# -# 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 - 2016, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BS= D License -# which accompanies this distribution. The full text of the license may be= found at -# http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D TrEEConfigPei - MODULE_UNI_FILE =3D TrEEConfigPei.uni - FILE_GUID =3D A5C1EF72-9379-4370-B4C7-0F5126CAC38E - MODULE_TYPE =3D PEIM - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D TrEEConfigPeimEntryPoint - -# -# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC -# -# [BootMode] -# S3_RESUME ## SOMETIMES_CONSUMES -# - -[Sources] - TrEEConfigPeim.c - TrEEConfigNvData.h - TpmDetection.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - SecurityPkg/SecurityPkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - MemoryAllocationLib - PeiServicesLib - PeimEntryPoint - DebugLib - PcdLib - TimerLib - Tpm12CommandLib - Tpm12DeviceLib - -[Guids] - ## SOMETIMES_CONSUMES ## Variable:L"TREE_CONFIGURATION" - ## 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 ## PROD= UCES - gEfiSecurityPkgTokenSpaceGuid.PcdTpmInitializationPolicy ## PROD= UCES - gEfiSecurityPkgTokenSpaceGuid.PcdTpmAutoDetection ## CONS= UMES=20 - gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## SOME= TIMES_CONSUMES - -[Depex] - gEfiPeiMasterBootModePpiGuid AND - gEfiPeiReadOnlyVariable2PpiGuid - =20 -[UserExtensions.TianoCore."ExtraFiles"] - TrEEConfigPeiExtra.uni \ No newline at end of file diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.uni b/SecurityPkg/Tcg= /TrEEConfig/TrEEConfigPei.uni deleted file mode 100644 index 7050be29a4..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPei.uni +++ /dev/null @@ -1,23 +0,0 @@ -// /** @file -// Set TPM device type -// -// 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.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Set TPM device ty= pe" - -#string STR_MODULE_DESCRIPTION #language en-US "This module initi= alizes TPM device type based on variable and detection.\n" - "NOTE: This module= is only for reference only, each platform should have its own setup page." - diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeiExtra.uni b/SecurityPk= g/Tcg/TrEEConfig/TrEEConfigPeiExtra.uni deleted file mode 100644 index 1ebef052c3..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeiExtra.uni +++ /dev/null @@ -1,19 +0,0 @@ -// /** @file -// TrEEConfigDxe Localized Strings and Content -// -// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - -#string STR_PROPERTIES_MODULE_NAME=20 -#language en-US=20 -"TrEE (Trusted Execution Environment) Configuration DXE" - - diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c b/SecurityPkg/Tcg/= TrEEConfig/TrEEConfigPeim.c deleted file mode 100644 index b4a3d52347..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigPeim.c +++ /dev/null @@ -1,159 +0,0 @@ -/** @file - The module entry point for TrEE configuration module. - -Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - - -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "TrEEConfigNvData.h" - -TPM_INSTANCE_ID mTpmInstanceId[] =3D TPM_INSTANCE_ID_LIST; - -CONST EFI_PEI_PPI_DESCRIPTOR gTpmSelectedPpi =3D { - (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), - &gEfiTpmDeviceSelectedGuid, - NULL -}; - -EFI_PEI_PPI_DESCRIPTOR mTpmInitializationDonePpiList =3D { - EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, - &gPeiTpmInitializationDonePpiGuid, - NULL -}; - -/** - This routine check both SetupVariable and real TPM device, and return fi= nal TpmDevice configuration. - - @param SetupTpmDevice TpmDevice configuration in setup driver - - @return TpmDevice configuration -**/ -UINT8 -DetectTpmDevice ( - IN UINT8 SetupTpmDevice - ); - -/** - The entry point for TrEE configuration driver. - - @param FileHandle Handle of the file being invoked. - @param PeiServices Describes the list of possible PEI Services. - - @retval EFI_SUCCES Convert variable to PCD successfully. - @retval Others Fail to convert variable to PCD. -**/ -EFI_STATUS -EFIAPI -TrEEConfigPeimEntryPoint ( - IN EFI_PEI_FILE_HANDLE FileHandle, - IN CONST EFI_PEI_SERVICES **PeiServices - ) -{ - UINTN Size; - EFI_STATUS Status; - EFI_STATUS Status2; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariablePpi; - TREE_CONFIGURATION TrEEConfiguration; - UINTN Index; - UINT8 TpmDevice; - - Status =3D PeiServicesLocatePpi (&gEfiPeiReadOnlyVariable2PpiGuid, 0, NU= LL, (VOID **) &VariablePpi); - ASSERT_EFI_ERROR (Status); - - Size =3D sizeof(TrEEConfiguration); - Status =3D VariablePpi->GetVariable ( - VariablePpi, - TREE_STORAGE_NAME, - &gTrEEConfigFormSetGuid, - NULL, - &Size, - &TrEEConfiguration - ); - if (EFI_ERROR (Status)) { - // - // Variable not ready, set default value - // - TrEEConfiguration.TpmDevice =3D TPM_DEVICE_DEFAULT; - } - - // - // Validation - // - if ((TrEEConfiguration.TpmDevice > TPM_DEVICE_MAX) || (TrEEConfiguration= .TpmDevice < TPM_DEVICE_MIN)) { - TrEEConfiguration.TpmDevice =3D TPM_DEVICE_DEFAULT; - } - - // - // Although we have SetupVariable info, we still need detect TPM device = manually. - // - DEBUG ((EFI_D_INFO, "TrEEConfiguration.TpmDevice from Setup: %x\n", TrEE= Configuration.TpmDevice)); - - if (PcdGetBool (PcdTpmAutoDetection)) { - TpmDevice =3D DetectTpmDevice (TrEEConfiguration.TpmDevice); - DEBUG ((EFI_D_INFO, "TpmDevice final: %x\n", TpmDevice)); - if (TpmDevice !=3D TPM_DEVICE_NULL) { - TrEEConfiguration.TpmDevice =3D TpmDevice; - } - } else { - TpmDevice =3D TrEEConfiguration.TpmDevice; - } - - // - // Convert variable to PCD. - // This is work-around because there is no gurantee DynamicHiiPcd can re= turn correct value in DXE phase. - // Using DynamicPcd instead. - // - // NOTE: TrEEConfiguration variable contains the desired TpmDevice type, - // while PcdTpmInstanceGuid PCD contains the real detected TpmDevice type - // - for (Index =3D 0; Index < sizeof(mTpmInstanceId)/sizeof(mTpmInstanceId[0= ]); Index++) { - if (TpmDevice =3D=3D mTpmInstanceId[Index].TpmDevice) { - Size =3D sizeof(mTpmInstanceId[Index].TpmInstanceGuid); - Status =3D PcdSetPtrS (PcdTpmInstanceGuid, &Size, &mTpmInstanceId[In= dex].TpmInstanceGuid); - ASSERT_EFI_ERROR (Status); - DEBUG ((EFI_D_INFO, "TpmDevice PCD: %g\n", &mTpmInstanceId[Index].Tp= mInstanceGuid)); - break; - } - } - - // - // Selection done - // - Status =3D PeiServicesInstallPpi (&gTpmSelectedPpi); - ASSERT_EFI_ERROR (Status); - - // - // Even if no TPM is selected or detected, we still need intall TpmIniti= alizationDonePpi. - // Because TcgPei or TrEEPei will not run, but we still need a way to no= tify other driver. - // Other driver can know TPM initialization state by TpmInitializedPpi. - // - if (CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceNo= neGuid)) { - Status2 =3D PeiServicesInstallPpi (&mTpmInitializationDonePpiList); - ASSERT_EFI_ERROR (Status2); - } - - return Status; -} diff --git a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigStrings.uni b/SecurityPkg= /Tcg/TrEEConfig/TrEEConfigStrings.uni deleted file mode 100644 index 41d6c2412f..0000000000 --- a/SecurityPkg/Tcg/TrEEConfig/TrEEConfigStrings.uni +++ /dev/null @@ -1,40 +0,0 @@ -/** @file - String definitions for TCG configuration form. - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-This program and the accompanying materials=20 -are licensed and made available under the terms and conditions of the BSD = License=20 -which accompanies this distribution. The full text of the license may be = found at=20 -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#langdef en-US "English" - -#string STR_TREE_TITLE #language en-US "TrEE Configur= ation" -#string STR_TREE_HELP #language en-US "Press = to select TrEE Setup options." - -#string STR_TREE_DEVICE_STATE_PROMPT #language en-US "Current TPM D= evice" -#string STR_TREE_DEVICE_STATE_HELP #language en-US "Current TPM D= evice: Disable, TPM1.2, or TPM2.0" -#string STR_TREE_DEVICE_STATE_CONTENT #language en-US "" - -#string STR_TREE_DEVICE_PROMPT #language en-US "Attempt TPM D= evice" -#string STR_TREE_DEVICE_HELP #language en-US "Attempt TPM D= evice: Disable, TPM1.2, or TPM2.0" -#string STR_TREE_DEVICE_CONTENT #language en-US "" - -#string STR_TREE_PP_OPERATION #language en-US "TPM2 Physical = Presence Operation" - -#string STR_TREE_OPERATION #language en-US "TPM2 Operation" -#string STR_TREE_OPERATION_HELP #language en-US "Select one of = the supported operation to change TPM2 state." - -#string STR_TREE_NO_ACTION #language en-US "No Action" -#string STR_TREE_CLEAR #language en-US "TPM2 ClearCont= rol(NO) + Clear" - -#string STR_TREE_TPM_DISABLE #language en-US "Disable" -#string STR_TREE_TPM_1_2 #language en-US "TPM 1.2" -#string STR_TREE_TPM_2_0_DTPM #language en-US "TPM 2.0 (DTPM)" - -#string STR_NULL #language en-US "" --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel