Quellcode durchsuchen

TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678

To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Heng Luo <heng.luo@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Chasel Chiu vor 2 Jahren
Ursprung
Commit
6f543cdde0

+ 18 - 3
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c

@@ -9,7 +9,9 @@
 #include <Library/FspWrapperApiLib.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/MemoryAllocationLib.h>
+#include <Library/PeiLib.h>
 #include <Ppi/FspmArchConfigPpi.h>
+#include <PolicyUpdateMacro.h>
 
 VOID
 EFIAPI
@@ -70,9 +72,11 @@ SiliconPolicyDonePreMem(
 )
 {
   EFI_STATUS                   Status;
+  UINTN                        FspNvsBufferSize;
+  VOID                         *FspNvsBufferPtr;
 #if FixedPcdGet8(PcdFspModeSelection) == 0
-  FSPM_ARCH_CONFIG_PPI                  *FspmArchConfigPpi;
-  EFI_PEI_PPI_DESCRIPTOR                *FspmArchConfigPpiDesc;
+  FSPM_ARCH_CONFIG_PPI         *FspmArchConfigPpi;
+  EFI_PEI_PPI_DESCRIPTOR       *FspmArchConfigPpiDesc;
 
   FspmArchConfigPpi = (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof (FSPM_ARCH_CONFIG_PPI));
   if (FspmArchConfigPpi == NULL) {
@@ -80,7 +84,6 @@ SiliconPolicyDonePreMem(
     return EFI_OUT_OF_RESOURCES;
   }
   FspmArchConfigPpi->Revision            = 1;
-  FspmArchConfigPpi->NvsBufferPtr        = NULL;
   FspmArchConfigPpi->BootLoaderTolumSize = 0;
 
   FspmArchConfigPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
@@ -98,6 +101,18 @@ SiliconPolicyDonePreMem(
   ASSERT_EFI_ERROR (Status);
 #endif
 
+  //
+  // Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
+  //
+  FspNvsBufferPtr   = NULL;
+  FspNvsBufferSize  = 0;
+  Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+  if (Status == EFI_SUCCESS) {
+    DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+    DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));
+    UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmArchUpd.NvsBufferPtr, FspmArchConfigPpi->NvsBufferPtr, FspNvsBufferPtr);
+  }
+
   //
   // Install Policy Ready PPI
   // While installed, RC assumes the Policy is ready and finalized. So please

+ 1 - 0
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf

@@ -181,3 +181,4 @@
   gTianoLogoGuid                          ## CONSUMES
   gCnviConfigGuid                         ## CONSUMES
   gHdAudioPreMemConfigGuid                ## CONSUMES
+  gFspNvsBufferVariableGuid               ## CONSUMES