[edk2-devel] [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.

Chiu, Chasel posted 9 patches 4 years, 4 months ago
There is a newer version of this series
[edk2-devel] [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
Posted by Chiu, Chasel 4 years, 4 months ago
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: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c         | 24 ++++++++++--------------
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf |  5 ++---
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc                                                                 |  3 +++
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index 9d6c0176f6..2158eb299f 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -1,7 +1,7 @@
 /** @file
   Implementation of Fsp Misc UPD Initialization.
 
-Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <FspmUpd.h>
 #include <FspsUpd.h>
 
-#include <Library/MemoryAllocationLib.h>
 #include <Library/DebugLib.h>
 #include <Library/DebugPrintErrorLevelLib.h>
 #include <Library/PciLib.h>
@@ -38,24 +37,21 @@ PeiFspMiscUpdUpdatePreMem (
 {
   EFI_STATUS                        Status;
   UINTN                             VariableSize;
-  VOID                              *MemorySavedData;
+  VOID                              *FspNvsBufferPtr;
   UINT8                             MorControl;
   VOID                              *MorControlPtr;
 
   //
   // Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
   //
-  VariableSize = 0;
-  MemorySavedData = NULL;
-  Status = PeiGetVariable (
-             L"MemoryConfig",
-             &gFspNonVolatileStorageHobGuid,
-             &MemorySavedData,
-             &VariableSize
-             );
-  DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));
-  DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));
-  FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
+  FspNvsBufferPtr   = NULL;
+  VariableSize  = 0;
+  Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &VariableSize);
+  if (Status == EFI_SUCCESS) {
+    DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+    DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));
+    FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
+  }
 
   if (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) {
     //
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index 463455c90b..ceefe7639e 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -1,7 +1,7 @@
 ## @file
 #  FSP wrapper silicon policy update library.
 #
-# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -81,7 +81,6 @@
   PchInfoLib
   PchHsioLib
   PchPcieRpLib
-  MemoryAllocationLib
   CpuMailboxLib
   DebugPrintErrorLevelLib
   SiPolicyLib
@@ -138,7 +137,7 @@
   gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid
 
 [Guids]
-  gFspNonVolatileStorageHobGuid                 ## CONSUMES
+  gFspNvsBufferVariableGuid                     ## CONSUMES
   gTianoLogoGuid                                ## CONSUMES
   gEfiMemoryOverwriteControlDataGuid
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
index 7f276d3512..299c7f18cd 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
@@ -141,6 +141,9 @@
   PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookLib.inf
   SiliconPolicyUpdateLib|$(PROJECT)/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
 
+[LibraryClasses.Common.SEC]
+  VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
+
 [LibraryClasses.IA32.SEC]
   #######################################
   # Edk2 Packages
-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#81661): https://edk2.groups.io/g/devel/message/81661
Mute This Topic: https://groups.io/mt/86164708/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
Posted by Nate DeSimone 4 years, 4 months ago
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Jeremy Soller <jeremy@system76.com>
> Subject: [edk2-platforms: PATCH v3 4/9]
> KabylakeOpenBoardPkg/GalagoPro3: 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: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
> 
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c         | 24 ++++++++++-
> -------------
> 
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf |  5 ++---
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> |  3 +++
>  3 files changed, 15 insertions(+), 17 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index 9d6c0176f6..2158eb299f 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> +++ PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -1,7 +1,7 @@
>  /** @file   Implementation of Fsp Misc UPD Initialization. -Copyright (c) 2019,
> Intel Corporation. All rights reserved.<BR>+Copyright (c) 2019 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-
> Patent  **/@@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-
> Patent
>  #include <FspmUpd.h> #include <FspsUpd.h> -#include
> <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> #include
> <Library/DebugPrintErrorLevelLib.h> #include <Library/PciLib.h>@@ -38,24
> +37,21 @@ PeiFspMiscUpdUpdatePreMem (
>  {   EFI_STATUS                        Status;   UINTN                             VariableSize;-  VOID
> *MemorySavedData;+  VOID                              *FspNvsBufferPtr;   UINT8
> MorControl;   VOID                              *MorControlPtr;    //   // Initialize S3 Data
> variable (S3DataPtr). It may be used for warm and fast boot paths.   //-
> VariableSize = 0;-  MemorySavedData = NULL;-  Status = PeiGetVariable (-
> L"MemoryConfig",-             &gFspNonVolatileStorageHobGuid,-
> &MemorySavedData,-             &VariableSize-             );-  DEBUG ((DEBUG_INFO,
> "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));-
> DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));-
> FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;+
> FspNvsBufferPtr   = NULL;+  VariableSize  = 0;+  Status = PeiGetLargeVariable
> (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr,
> &VariableSize);+  if (Status == EFI_SUCCESS) {+    DEBUG ((DEBUG_INFO,
> "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+
> DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));+
> FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;+  }    if
> (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) {     //diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index 463455c90b..ceefe7639e 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> +++ PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -1,7 +1,7 @@
>  ## @file #  FSP wrapper silicon policy update library. #-# Copyright (c) 2019 -
> 2020 Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2019 - 2021
> Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-
> 2-Clause-Patent #@@ -81,7 +81,6 @@
>    PchInfoLib   PchHsioLib   PchPcieRpLib-  MemoryAllocationLib
> CpuMailboxLib   DebugPrintErrorLevelLib   SiPolicyLib@@ -138,7 +137,7 @@
>    gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid  [Guids]-
> gFspNonVolatileStorageHobGuid                 ## CONSUMES+
> gFspNvsBufferVariableGuid                     ## CONSUMES   gTianoLogoGuid
> ## CONSUMES   gEfiMemoryOverwriteControlDataGuid diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index 7f276d3512..299c7f18cd 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -141,6 +141,9 @@
> 
> PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHo
> okLib.inf
> SiliconPolicyUpdateLib|$(PROJECT)/FspWrapper/Library/PeiSiliconPolicyUpd
> ateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVari
> ableReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> #######################################   # Edk2 Packages--
> 2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#81771): https://edk2.groups.io/g/devel/message/81771
Mute This Topic: https://groups.io/mt/86164708/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-