]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtQemu: add ResetSystem PEIM for upcoming TPM2 support
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 26 Feb 2020 19:05:10 +0000 (20:05 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 4 Mar 2020 08:48:09 +0000 (08:48 +0000)
As a first step in gradually adding TPM2 support to ArmVirtQemu, add
the TPM2_ENABLE configurable to the [Defines] section, and if it is
set, add the ResetSystem PEIM to the build, along with the library
class references that we will need to support it:
- wire ArmVirtPsciResetSystemPeiLib into the ResetSystem PEIM itself,
  which will be in charge of performing the actual reset
- add PeiResetSystemLib as the common ResetSystemLib resolution for
  PEIM class modules, so that other PEIMs will invoke the PPI
  published by the ResetSystem PEIM.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2560
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/ArmVirtQemu.fdf

index 7d05415d0f93a473cc5a4e6903d0abdc04b6023e..d1757cdba6718b435a9f400b4f8e7f14484527fa 100644 (file)
@@ -29,6 +29,7 @@
   #\r
   DEFINE TTY_TERMINAL            = FALSE\r
   DEFINE SECURE_BOOT_ENABLE      = FALSE\r
+  DEFINE TPM2_ENABLE             = FALSE\r
 \r
   #\r
   # Network definition\r
 [LibraryClasses.common.PEIM]\r
   ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf\r
 \r
+!if $(TPM2_ENABLE) == TRUE\r
+  ResetSystemLib|MdeModulePkg/Library/PeiResetSystemLib/PeiResetSystemLib.inf\r
+!endif\r
+\r
 [LibraryClasses.common.DXE_DRIVER]\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 \r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE\r
 \r
+  gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)\r
+\r
 [PcdsFixedAtBuild.common]\r
 !if $(ARCH) == AARCH64\r
   gArmTokenSpaceGuid.PcdVFPEnabled|1\r
 \r
   MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
 \r
+!if $(TPM2_ENABLE) == TRUE\r
+  MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf {\r
+    <LibraryClasses>\r
+      ResetSystemLib|ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVirtPsciResetSystemPeiLib.inf\r
+  }\r
+!endif\r
+\r
   MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {\r
     <LibraryClasses>\r
       NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
index 2c8936a1ae15bd02996d3001727e843ef65a9805..f55918d26b06deeba9cc0f6e43dd375005f911d4 100644 (file)
@@ -113,6 +113,10 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
   INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
 \r
+!if $(TPM2_ENABLE) == TRUE\r
+  INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf\r
+!endif\r
+\r
   FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
     SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
       SECTION FV_IMAGE = FVMAIN\r