Reviewed-by: Nate DeSimone <[email protected]>

-----Original Message-----
From: Kubacki, Michael A <[email protected]> 
Sent: Tuesday, November 12, 2019 8:38 PM
To: [email protected]
Cc: Chiu, Chasel <[email protected]>; Desimone, Nathaniel L 
<[email protected]>; Gao, Liming <[email protected]>
Subject: [edk2-platforms][PATCH V1 48/49] MinPlatformPkg: Install advanced 
feature FVs by stage enabled

This change updates the FvReportLib instance in MinPlatformPkg to only install 
advanced feature firmware volumes if the advanced feature stage should be 
active.

Cc: Chasel Chiu <[email protected]>
Cc: Nate DeSimone <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael Kubacki <[email protected]>
---
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec                               
      |  1 +
 
Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
 |  1 +
 
Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
   | 50 +++++++++++---------
 3 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec 
b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 28713108ed..cbbe3b2005 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -272,6 +272,7 @@ 
gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x90000019
   # Stage 3 - boot to shell only
   # Stage 4 - boot to OS
   # Stage 5 - boot to OS with security boot enabled
+  # Stage 6 - boot with advanced features enabled
   #
   gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4|UINT8|0xF00000A0
 
diff --git 
a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
 
b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
index 1ce3034fcc..ef03e110bd 100644
--- 
a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/
+++ PeiReportFvLib.inf
@@ -30,6 +30,7 @@
   PeiReportFvLib.c
 
 [Pcd]
+  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
   gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode             ## CONSUMES
   gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress           ## CONSUMES
   gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize                  ## CONSUMES
diff --git 
a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
 
b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
index b61587f6e3..0d805d6fe7 100644
--- 
a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/
+++ PeiReportFvLib.c
@@ -40,20 +40,22 @@ ReportPreMemFv (
     NULL,
     0
     );
-  DEBUG ((
-    DEBUG_INFO,
-    "Install FlashFvAdvancedPreMemory - 0x%x, 0x%x\n",
-    PcdGet32 (PcdFlashFvAdvancedPreMemoryBase),
-    PcdGet32 (PcdFlashFvAdvancedPreMemorySize)
-    ));
-  PeiServicesInstallFvInfo2Ppi (
-    &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFlashFvAdvancedPreMemoryBase))->FileSystemGuid),
-    (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase),
-    PcdGet32 (PcdFlashFvAdvancedPreMemorySize),
-    NULL,
-    NULL,
-    0
-    );
+  if (PcdGet8 (PcdBootStage) >= 6) {
+    DEBUG ((
+      DEBUG_INFO,
+      "Install FlashFvAdvancedPreMemory - 0x%x, 0x%x\n",
+      PcdGet32 (PcdFlashFvAdvancedPreMemoryBase),
+      PcdGet32 (PcdFlashFvAdvancedPreMemorySize)
+      ));
+    PeiServicesInstallFvInfo2Ppi (
+      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFlashFvAdvancedPreMemoryBase))->FileSystemGuid),
+      (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase),
+      PcdGet32 (PcdFlashFvAdvancedPreMemorySize),
+      NULL,
+      NULL,
+      0
+      );
+  }
 }
 
 VOID
@@ -122,15 +124,17 @@ ReportPostMemFv (
       NULL,
       0
       );
-    DEBUG ((DEBUG_INFO, "Install FlashFvAdvanced - 0x%x, 0x%x\n", PcdGet32 
(PcdFlashFvAdvancedBase), PcdGet32 (PcdFlashFvAdvancedSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFlashFvAdvancedBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase),
-      PcdGet32 (PcdFlashFvAdvancedSize),
-      NULL,
-      NULL,
-      0
-      );
+    if (PcdGet8 (PcdBootStage) >= 6) {
+      DEBUG ((DEBUG_INFO, "Install FlashFvAdvanced - 0x%x, 0x%x\n", PcdGet32 
(PcdFlashFvAdvancedBase), PcdGet32 (PcdFlashFvAdvancedSize)));
+      PeiServicesInstallFvInfo2Ppi (
+        &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFlashFvAdvancedBase))->FileSystemGuid),
+        (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase),
+        PcdGet32 (PcdFlashFvAdvancedSize),
+        NULL,
+        NULL,
+        0
+        );
+    }
   }
 
   //
--
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#50801): https://edk2.groups.io/g/devel/message/50801
Mute This Topic: https://groups.io/mt/55240956/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to