public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting
@ 2021-10-15 21:25 Oram, Isaac W
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API Oram, Isaac W
                   ` (14 more replies)
  0 siblings, 15 replies; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel
  Cc: Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong,
	Rangasai V Chaganty, Deepika Kethi Reddy, Kathappan Esakkithevar,
	Benjamin Doron, Jeremy Soller, Heng Luo, Agyeman Prince

This patch allows boards to customize the MM FV list via the ReportFvLib board instance.
The SpiFvbService driver publishes a set of FV for MM use.
This currently includes variable store and microcode region.
MinPlatformPkg contains the common instance of ReportFvLib for PEI and MM use used by most boards.
WhitleyOpenBoardPkg, PurleyOpenBoardPkg, and SimicsOpenBoardPkg have custom PEI instances of this library.
WhitleyOpenBoardPkg has a custom instance of the MM version to optionally publish WHEA region.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Jeremy Soller <jeremy@system76.com>
Cc: Heng Luo <heng.luo@intel.com>
Cc: Agyeman Prince <prince.agyeman@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>

Isaac Oram (11):
  MinPlatformPkg/ReportFvLib: Add ReportMmFv to API
  CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  KabyOpenBoardPkg/ReportFvLib: Switch to new library instances.
  TigerLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV
  PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib
  SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib
  MinPlatformPkg/SpifvbService: Publish FV based on board request
  MinPlatformPkg/SpiFvbService: Reduce duplicate code
  MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance

 Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc                                                            |  1 -
 Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc                                                         |  1 -
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc                                                                |  1 -
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc                                                              |  1 -
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c                                                        | 16 ----
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h                                                        |  7 --
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c                                                            | 83 ++++++++++++++++----
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf                                                         |  2 +-
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c                                                  | 32 --------
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf                                                |  2 +-
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c                                                 | 32 --------
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc                                                                       |  2 +
 Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc                                                                       |  1 +
 Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h                                                                    | 18 ++++-
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                                                               | 10 ++-
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.c                                                 | 53 +++++++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf                                               | 33 ++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}           |  7 +-
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf}       |  8 +-
 Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc                                                              |  1 -
 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}     | 10 ++-
 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} | 13 +--
 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc                                                              |  8 +-
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc                                                               |  2 +-
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib => ReportFvLib}/Fv.c                                                 |  0
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}                    |  0
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf}                | 10 +--
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc                                                            |  1 -
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc                                                               |  1 -
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc                                                        |  1 -
 Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.c                                                         | 61 ++++++++++++++
 Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.inf                                                       | 36 +++++++++
 Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}                   |  4 +-
 Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf}               | 12 +--
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc                                                                             |  4 +-
 35 files changed, 323 insertions(+), 151 deletions(-)
 delete mode 100644 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c
 delete mode 100644 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c
 create mode 100644 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.c
 create mode 100644 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf
 rename Platform/Intel/MinPlatformPkg/PlatformInit/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c} (92%)
 rename Platform/Intel/MinPlatformPkg/PlatformInit/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} (89%)
 rename Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c} (90%)
 rename Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} (82%)
 rename Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib => ReportFvLib}/Fv.c (100%)
 rename Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c} (100%)
 rename Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} (84%)
 create mode 100644 Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.c
 create mode 100644 Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.inf
 rename Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c} (96%)
 rename Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} (87%)

-- 
2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:30   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances Oram, Isaac W
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong

Add ReportMmFv (); API for enabling boards to publish additional
regions for MM driver use.
This results in different instances of the library for PEI and MM.
Added MinPlatformPkg library instances to the CorePeiLib.dsc and
CoreDxeLib.dsc as the default library instances.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc                          |   2 +
 Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc                          |   1 +
 Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h                       |  18 ++-
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                  |   9 +-
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.c    |  53 +++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf  |  33 +++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.c   | 146 ++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf |  50 +++++++
 8 files changed, 307 insertions(+), 5 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
index 209ccdaf54..0127ca7641 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
@@ -96,6 +96,8 @@
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
   VariableReadLib|MinPlatformPkg/Library/SmmVariableReadLib/TraditionalMmVariableReadLib.inf
   VariableWriteLib|MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLib.inf
+  ReportFvLib|MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf
+
 
 [LibraryClasses.common.SMM_CORE]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
index c12189bd9a..da4d0d6a1a 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
@@ -73,3 +73,4 @@
   PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
 !endif
   VariableReadLib|MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.inf
+  ReportFvLib|MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
index 5c40bd0e6e..ba76728add 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
@@ -4,7 +4,7 @@
 
   This library installs pre-memory and post-memory firmware volumes.
 
-Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -15,6 +15,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <PiPei.h>
 #include <Uefi.h>
 
+//
+// This is used by board code to produce a table of FV to publish for MM use.
+// The end of the table is indicated by base and size both equal to zero.
+//
+typedef struct {
+  UINT32              FvBase;
+  UINT32              FvSize;
+} FV_INFO;
+
 VOID
 ReportPreMemFv (
   VOID
@@ -25,4 +34,9 @@ ReportPostMemFv (
   VOID
   );
 
-#endif
\ No newline at end of file
+VOID
+ReportMmFv (
+  FV_INFO **FvInfoTable
+  );
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index a09f8db3ab..1dfca06a10 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -107,8 +107,10 @@
   TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointLib.inf
 
+[LibraryClasses.common.DXE_SMM_DRIVER, LibraryClasses.common.MM_STANDALONE]
+  SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
+
 [LibraryClasses.common.DXE_SMM_DRIVER]
-  SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
   TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.inf
 
@@ -117,7 +119,6 @@
   MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
   MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
   StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
   VariableReadLib|MinPlatformPkg/Library/SmmVariableReadLib/StandaloneMmVariableReadLib.inf
   VariableWriteLib|MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLib.inf
@@ -189,7 +190,9 @@
   MinPlatformPkg/PlatformInit/Library/BoardInitLibNull/BoardInitLibNull.inf
   MinPlatformPkg/PlatformInit/Library/MultiBoardInitSupportLib/PeiMultiBoardInitSupportLib.inf
   MinPlatformPkg/PlatformInit/Library/MultiBoardInitSupportLib/DxeMultiBoardInitSupportLib.inf
-  MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
+  MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf
+  MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf
+
   MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf
   MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf
   MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.c
new file mode 100644
index 0000000000..a6339d130d
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.c
@@ -0,0 +1,53 @@
+/** @file
+  Source code file for Report Firmware Volume (FV) library management mode functionality
+
+  ReportPreMemFv (); is not supported by this libary instance
+  ReportPostMemFv (); is not supported by this libary instance
+
+  Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Library/DebugLib.h>
+#include <Library/ReportFvLib.h>
+#include <Guid/FirmwareFileSystem2.h>
+#include <Ppi/FirmwareVolumeInfo.h>
+
+//
+// This platform driver knows there are multiple FVs on FD.
+//  Variable region and MicroCode region are required.
+//
+FV_INFO mBoardFvInfoTable[] = {
+  {0, 0}, // {PcdGet32 (PcdFlashNvStorageVariableBase), PcdGet32 (PcdFlashNvStorageVariableSize)},
+  {0, 0}, // {PcdGet32 (PcdFlashFvMicrocodeBase), PcdGet32 (PcdFlashFvMicrocodeSize)},
+  {0, 0}
+};
+
+/*
+  Return the firmware volumes that are needed for MM functionality.
+  NV storage and microcode FV are required.
+
+  @param FvInfoTable    Pointer to table of FV to be published
+
+  @return VOID
+*/
+VOID
+ReportMmFv (
+  FV_INFO **FvInfoTable
+  )
+{
+  mBoardFvInfoTable[0].FvBase = PcdGet32 (PcdFlashNvStorageVariableBase);
+  mBoardFvInfoTable[0].FvSize = PcdGet32 (PcdFlashNvStorageVariableSize);
+  mBoardFvInfoTable[1].FvBase = PcdGet32 (PcdFlashFvMicrocodeBase);
+  mBoardFvInfoTable[1].FvSize = PcdGet32 (PcdFlashFvMicrocodeSize);
+
+  DEBUG ((DEBUG_INFO, "MM FvInfo Table:\nNvStorageVariableBase 0x%X\nMicrocodeBase 0x%X\n", mBoardFvInfoTable[0].FvBase, mBoardFvInfoTable[1].FvBase, mBoardFvInfoTable[2].FvBase));
+  ASSERT (mBoardFvInfoTable[0].FvBase != 0);
+  ASSERT (mBoardFvInfoTable[0].FvSize != 0);
+  ASSERT (mBoardFvInfoTable[1].FvBase != 0);
+  ASSERT (mBoardFvInfoTable[1].FvSize != 0);
+
+  *FvInfoTable = &mBoardFvInfoTable[0];
+}
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf
new file mode 100644
index 0000000000..41268f179e
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf
@@ -0,0 +1,33 @@
+### @file
+# Component information file for the Report Firmware Volume (FV) library.
+#
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = ReportFvLibMm
+  FILE_GUID                      = 57c12e02-a65f-4994-bd76-bb6e3fd14df4
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = BASE
+  LIBRARY_CLASS                  = ReportFvLib | DXE_SMM_DRIVER MM_STANDALONE
+
+[LibraryClasses]
+  DebugLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[Sources]
+  ReportFvLibMm.c
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase           ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize           ## CONSUMES
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.c
new file mode 100644
index 0000000000..7fb755266d
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.c
@@ -0,0 +1,146 @@
+/** @file
+  Source code file for Report Firmware Volume (FV) library
+
+  ReportMmFv (); is not supported in this library instance
+
+  @copyright
+  Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/ReportFvLib.h>
+#include <Guid/FirmwareFileSystem2.h>
+#include <Ppi/FirmwareVolumeInfo.h>
+
+VOID
+ReportPreMemFv (
+  VOID
+  )
+{
+  ///
+  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in Dispatch mode.
+  ///
+  if (PcdGetBool(PcdFspWrapperBootMode)) {
+    DEBUG ((DEBUG_INFO, "Install FlashFvFspT - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvFspTBase), PcdGet32 (PcdFlashFvFspTSize)));
+    PeiServicesInstallFvInfo2Ppi (
+      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvFspTBase))->FileSystemGuid),
+      (VOID *) (UINTN) PcdGet32 (PcdFlashFvFspTBase),
+      PcdGet32 (PcdFlashFvFspTSize),
+      NULL,
+      NULL,
+      0
+      );
+  }
+  DEBUG ((DEBUG_INFO, "Install FlashFvSecurity - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvSecurityBase), PcdGet32 (PcdFlashFvSecuritySize)));
+  PeiServicesInstallFvInfo2Ppi (
+    &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase))->FileSystemGuid),
+    (VOID *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase),
+    PcdGet32 (PcdFlashFvSecuritySize),
+    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
+ReportPostMemFv (
+  VOID
+  )
+{
+  EFI_STATUS                    Status;
+  EFI_BOOT_MODE                 BootMode;
+
+  Status = PeiServicesGetBootMode (&BootMode);
+  ASSERT_EFI_ERROR (Status);
+
+  ///
+  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in Dispatch mode.
+  ///
+
+  ///
+  /// Build HOB for DXE
+  ///
+  if (BootMode == BOOT_IN_RECOVERY_MODE) {
+    ///
+    /// Prepare the recovery service
+    ///
+  } else {
+    DEBUG ((DEBUG_INFO, "Install FlashFvPostMemory - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvPostMemoryBase), PcdGet32 (PcdFlashFvPostMemorySize)));
+    PeiServicesInstallFvInfo2Ppi (
+      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase))->FileSystemGuid),
+      (VOID *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase),
+      PcdGet32 (PcdFlashFvPostMemorySize),
+      NULL,
+      NULL,
+      0
+      );
+    DEBUG ((DEBUG_INFO, "Install FlashFvUefiBoot - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvUefiBootBase), PcdGet32 (PcdFlashFvUefiBootSize)));
+    PeiServicesInstallFvInfo2Ppi (
+      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase))->FileSystemGuid),
+      (VOID *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase),
+      PcdGet32 (PcdFlashFvUefiBootSize),
+      NULL,
+      NULL,
+      0
+      );
+    DEBUG ((DEBUG_INFO, "Install FlashFvOsBoot - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvOsBootBase), PcdGet32 (PcdFlashFvOsBootSize)));
+    PeiServicesInstallFvInfo2Ppi (
+      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase))->FileSystemGuid),
+      (VOID *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase),
+      PcdGet32 (PcdFlashFvOsBootSize),
+      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
+        );
+    }
+  }
+
+  //
+  // Report resource HOB for flash FV
+  //
+  BuildResourceDescriptorHob (
+    EFI_RESOURCE_MEMORY_MAPPED_IO,
+    (EFI_RESOURCE_ATTRIBUTE_PRESENT    |
+    EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
+    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
+    (UINTN) PcdGet32 (PcdFlashAreaSize)
+    );
+  BuildMemoryAllocationHob (
+    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
+    (UINTN) PcdGet32 (PcdFlashAreaSize),
+    EfiMemoryMappedIO
+    );
+}
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf
new file mode 100644
index 0000000000..fdb61347c4
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf
@@ -0,0 +1,50 @@
+### @file
+# Component information file for the Report Firmware Volume (FV) library.
+#
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = ReportFvLibPei
+  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = PEIM
+  LIBRARY_CLASS                  = ReportFvLib | PEIM
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  HobLib
+  PeiServicesLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[Sources]
+  ReportFvLibPei.c
+
+[Pcd]
+  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode             ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress           ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize                  ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryBase   ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize   ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ## CONSUMES
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
                     ` (2 more replies)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: " Oram, Isaac W
                   ` (12 subsequent siblings)
  14 siblings, 3 replies; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel
  Cc: Chasel Chiu, Nate DeSimone, Rangasai V Chaganty,
	Deepika Kethi Reddy, Kathappan Esakkithevar

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
index 44a1bd54d6..3a92eb4575 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
@@ -121,7 +121,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API Oram, Isaac W
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Benjamin Doron, Jeremy Soller

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc | 1 -
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc        | 1 -
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc      | 1 -
 3 files changed, 3 deletions(-)

diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc
index 97573ab2e6..77055b489a 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc
@@ -173,7 +173,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
index 7f276d3512..75e4f3b2e9 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
@@ -119,7 +119,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
index f64555e391..50f95a1300 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
@@ -161,7 +161,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (2 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-23  1:31   ` Chaganty, Rangasai V
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
                   ` (10 subsequent siblings)
  14 siblings, 2 replies; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone, Heng Luo

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

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: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
index 1adf634034..7d6ea20986 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -67,7 +67,6 @@
 [LibraryClasses.common]
 
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
 
   PciHostBridgeLib|$(PLATFORM_PACKAGE)/Pci/Library/PciHostBridgeLibSimple/PciHostBridgeLibSimple.inf
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (3 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 06/11] WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV Oram, Isaac W
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc        | 1 -
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc | 1 -
 2 files changed, 2 deletions(-)

diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
index ee2aedd978..af5e0b2116 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
@@ -121,7 +121,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
index b69cc8deb0..11ecd6b91f 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
@@ -121,7 +121,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 06/11] WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (4 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 07/11] PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib Oram, Isaac W
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Nate DeSimone, Chasel Chiu

ReportFvLib added a new fuction for boards to communicate MM required FV
The custom instance allows Whitley boards to publish an FV for WHEA use.
Also fixed duplicate GUID library name.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.c                                           | 61 ++++++++++++++++++++
 Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.inf                                         | 36 ++++++++++++
 Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}     |  4 +-
 Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} | 12 ++--
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc                                                               |  4 +-
 5 files changed, 110 insertions(+), 7 deletions(-)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.c
new file mode 100644
index 0000000000..0cae9a7b25
--- /dev/null
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.c
@@ -0,0 +1,61 @@
+/** @file ReportFvLib.c
+  Source code file for Report Firmware Volume (FV) library management mode functionality
+
+  ReportPreMemFv (); is not supported by this libary instance
+  ReportPostMemFv (); is not supported by this libary instance
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Library/DebugLib.h>
+#include <Library/ReportFvLib.h>
+#include <Guid/FirmwareFileSystem2.h>
+#include <Ppi/FirmwareVolumeInfo2.h>
+
+//
+// This platform driver knows there are multiple FVs on FD.
+//  Variable region and MicroCode region are required.
+//  WHEA region is optional.  If size is zero this will not be published.
+//
+FV_INFO mBoardFvInfoTable[] = {
+  {0, 0}, // {PcdGet32 (PcdFlashNvStorageVariableBase), PcdGet32 (PcdFlashNvStorageVariableSize)},
+  {0, 0}, // {PcdGet32 (PcdFlashFvMicrocodeBase), PcdGet32 (PcdFlashFvMicrocodeSize)},
+  {0, 0}, // {PcdGet32 (PcdFlashFvWheaBase), PcdGet32 (PcdFlashFvWheaSize)},
+  {0, 0}
+};
+
+/*
+  Return the firmware volumes that are needed for MM functionality.
+  NV storage and microcode FV are required.
+  WHEA FV is optional and only added if Base and Size are non-zero.
+
+  @param FvInfoTable    Pointer to table of FV to be published
+
+  @return VOID
+*/
+VOID
+ReportMmFv (
+  FV_INFO **FvInfoTable
+  )
+{
+  mBoardFvInfoTable[0].FvBase = PcdGet32 (PcdFlashNvStorageVariableBase);
+  mBoardFvInfoTable[0].FvSize = PcdGet32 (PcdFlashNvStorageVariableSize);
+  mBoardFvInfoTable[1].FvBase = PcdGet32 (PcdFlashFvMicrocodeBase);
+  mBoardFvInfoTable[1].FvSize = PcdGet32 (PcdFlashFvMicrocodeSize);
+
+  if ((PcdGet32 (PcdFlashFvWheaBase) != 0) && (PcdGet32 (PcdFlashFvWheaSize) != 0)) {
+    mBoardFvInfoTable[2].FvBase = PcdGet32 (PcdFlashFvWheaBase);
+    mBoardFvInfoTable[2].FvSize = PcdGet32 (PcdFlashFvWheaSize);
+  }
+
+  DEBUG ((DEBUG_INFO, "MM FvInfo Table:\nNvStorageVariableBase 0x%X\nMicrocodeBase 0x%X\nWheaBase 0x%X\n", mBoardFvInfoTable[0].FvBase, mBoardFvInfoTable[1].FvBase, mBoardFvInfoTable[2].FvBase));
+  ASSERT (mBoardFvInfoTable[0].FvBase != 0);
+  ASSERT (mBoardFvInfoTable[0].FvSize != 0);
+  ASSERT (mBoardFvInfoTable[1].FvBase != 0);
+  ASSERT (mBoardFvInfoTable[1].FvSize != 0);
+
+  *FvInfoTable = &mBoardFvInfoTable[0];
+}
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.inf
new file mode 100644
index 0000000000..b37da2ab4b
--- /dev/null
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.inf
@@ -0,0 +1,36 @@
+### @file
+# Component information file for the Report Firmware Volume (FV) library.
+#
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = ReportFvLibMm
+  FILE_GUID                      = 0fcf4819-09e4-43fb-b597-4db80df14d88
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = BASE
+  LIBRARY_CLASS                  = ReportFvLib | DXE_SMM_DRIVER MM_STANDALONE
+
+[LibraryClasses]
+  DebugLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+  WhitleyOpenBoardPkg/PlatformPkg.dec
+
+[Sources]
+  ReportFvLibMm.c
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase           ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize           ## CONSUMES
+  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaBase                   ## CONSUMES
+  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaSize                   ## CONSUMES
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
similarity index 96%
rename from Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c
rename to Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
index f0230642d2..f916b352e5 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
@@ -1,6 +1,8 @@
-/** @file PeiReportFvLib.c
+/** @file ReportFvLib.c
   Source code file for Report Firmware Volume (FV) library
 
+  ReportMmFv (); is not supported in this library instance
+
   Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
similarity index 87%
rename from Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
rename to Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
index b02fac49cf..ae77606a54 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
@@ -9,11 +9,11 @@
 
 [Defines]
   INF_VERSION                    = 0x00010017
-  BASE_NAME                      = PeiReportFvLib
-  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
+  BASE_NAME                      = ReportFvLibPei
+  FILE_GUID                      = 8b176722-93a6-4b0a-a297-3d3b6c3c7034
   VERSION_STRING                 = 1.0
   MODULE_TYPE                    = PEIM
-  LIBRARY_CLASS                  = ReportFvLib
+  LIBRARY_CLASS                  = ReportFvLib | PEIM
 
 [LibraryClasses]
   BaseMemoryLib
@@ -28,7 +28,7 @@
   WhitleyOpenBoardPkg/PlatformPkg.dec
 
 [Sources]
-  PeiReportFvLib.c
+  ReportFvLibPei.c
 
 [Pcd]
   gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
@@ -62,4 +62,6 @@
   gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemoryOffset      ## CONSUMES
   gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspSize                 ## CONSUMES
   gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspBase                 ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspOffset               ## CONSUMES
\ No newline at end of file
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspOffset               ## CONSUMES
+  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaBase                   ## CONSUMES
+  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaSize                   ## CONSUMES
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index b3e96ecf3f..7d5f9e6883 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -596,7 +596,7 @@
   TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
 
-  ReportFvLib|$(RP_PKG)/Library/PeiReportFvLib/PeiReportFvLib.inf
+  ReportFvLib|$(RP_PKG)/Library/ReportFvLib/ReportFvLibPei.inf
 
 [LibraryClasses.Common.PEIM]
   #
@@ -632,6 +632,8 @@
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.inf
   MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
 
+  ReportFvLib|$(RP_PKG)/Library/ReportFvLib/ReportFvLibMm.inf
+
 [LibraryClasses.Common.SMM_CORE]
   S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf
 
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 07/11] PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (5 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 06/11] WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: " Oram, Isaac W
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone

Update custom ReportFvLib to match other board implementations.
Also fix duplicate GUID for libary name.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc                                                              |  1 -
 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}     | 10 +++++++---
 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} | 13 +++++++------
 Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc                                                              |  8 ++++----
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc
index 98e02f35e7..ca747737e4 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc
@@ -105,7 +105,6 @@
   PlatformBootManagerLib|$(PLATFORM_BOARD_PACKAGE)/Override/Platform/Intel/MinPlatformPkg/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
 !endif
 
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   CompressLib|$(PLATFORM_PACKAGE)/Library/CompressLib/CompressLib.inf
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/ReportFvLibPei.c
similarity index 90%
rename from Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.c
rename to Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/ReportFvLibPei.c
index ee4fce0b5c..706bcb02ff 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.c
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/ReportFvLibPei.c
@@ -1,9 +1,13 @@
 /** @file
+  Source code file for Report Firmware Volume (FV) library
 
-Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
-Copyright (c) 2021, American Megatrends International LLC.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
+  ReportMmFv (); is not supported in this library instance
 
+  @copyright
+  Copyright (c) 2018, - 2021 Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2021, American Megatrends International LLC.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
 #include <Base.h>
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/ReportFvLibPei.inf
similarity index 82%
rename from Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.inf
rename to Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/ReportFvLibPei.inf
index 1aab8ae702..adcf8d8cfd 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/ReportFvLibPei.inf
@@ -1,19 +1,20 @@
 ## @file
+# Component information file for the Report Firmware Volume (FV) library.
 #
-# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
 # Copyright (c) 2021, American Megatrends International LLC.<BR>
+#
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
 
-
 [Defines]
   INF_VERSION                    = 0x00010017
-  BASE_NAME                      = PeiReportFvLib
-  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
+  BASE_NAME                      = ReportFvLibPei
+  FILE_GUID                      = b2f52f32-9963-4f66-8cbf-ddb7a02523ac
   VERSION_STRING                 = 1.0
   MODULE_TYPE                    = PEIM
-  LIBRARY_CLASS                  = ReportFvLib
+  LIBRARY_CLASS                  = ReportFvLib | PEIM
 
 [LibraryClasses]
   BaseMemoryLib
@@ -27,7 +28,7 @@
   MinPlatformPkg/MinPlatformPkg.dec
 
 [Sources]
-  PeiReportFvLib.c
+  ReportFvLibPei.c
 
 [Pcd]
   gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode       ## CONSUMES
diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
index f2a028d183..5623cbac41 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  The main build description file for the TiogaPass board.
 #
-# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
 # Copyright (c) 2021, American Megatrends International LLC.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -89,7 +89,7 @@
 [Components.$(DXE_ARCH)]
 #TiogaPass Override START : Added Board Specific changes in core drivers
 #!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
-!include CoreDxeInclude.dsc 
+!include CoreDxeInclude.dsc
 #TiogaPass Override END
 
 #######################################
@@ -109,7 +109,7 @@
   LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
 !else
   LinuxBootLib|$(PLATFORM_BOARD_PACKAGE)/Features/LinuxBoot/LinuxBootNull.inf
-!endif 
+!endif
 
 !if gPlatformTokenSpaceGuid.PcdFastBoot == FALSE
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
@@ -117,7 +117,7 @@
   PlatformBootManagerLib|$(PLATFORM_BOARD_PACKAGE)/Override/Platform/Intel/MinPlatformPkg/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
 !endif
 
-  ReportFvLib|$(PROJECT)/Library/PeiReportFvLib/PeiReportFvLib.inf
+  ReportFvLib|$(PROJECT)/Library/ReportFvLib/ReportFvLibPei.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   CompressLib|$(PLATFORM_PACKAGE)/Library/CompressLib/CompressLib.inf
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (6 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 07/11] PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request Oram, Isaac W
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Agyeman Prince

Update file naming to match other ReportFvLib implementations.
Also fix duplicate GUID for libary name.

Cc: Agyeman Prince <prince.agyeman@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc                                                |  2 +-
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib => ReportFvLib}/Fv.c                                  |  0
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}     |  0
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} | 10 +++++-----
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index 93a7d1df55..bfd0320daf 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -117,7 +117,6 @@
   DxeLoadLinuxLib|$(BOARD_PKG)/Library/LoadLinuxLib/DxeLoadLinuxLib.inf
   LogoLib|$(BOARD_PKG)/Library/DxeLogoLib/DxeLogoLib.inf
   NvVarsFileLib|$(BOARD_PKG)/Library/NvVarsFileLib/NvVarsFileLib.inf
-  ReportFvLib|$(BOARD_PKG)/Library/PeiReportFvLib/PeiReportFvLib.inf
   SerializeVariablesLib|$(BOARD_PKG)/Library/SerializeVariablesLib/SerializeVariablesLib.inf
   SiliconPolicyInitLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyInitLib/SiliconPolicyInitLib.inf
   SiliconPolicyUpdateLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyUpdateLib/SiliconPolicyUpdateLib.inf
@@ -151,6 +150,7 @@
 !endif
   TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/PeiTestPointLib.inf
   SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
+  ReportFvLib|$(BOARD_PKG)/Library/ReportFvLib/ReportFvLibPei.inf
 
 [LibraryClasses.common.DXE_DRIVER]
 
diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/Fv.c b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/Fv.c
similarity index 100%
rename from Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/Fv.c
rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/Fv.c
diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
similarity index 100%
rename from Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c
rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
similarity index 84%
rename from Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
index 5d2e39532c..524ecf2847 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
@@ -1,7 +1,7 @@
 ### @file
 # Component information file for the Report Firmware Volume (FV) library.
 #
-# 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
 #
@@ -9,11 +9,11 @@
 
 [Defines]
   INF_VERSION                    = 0x00010017
-  BASE_NAME                      = PeiReportFvLib
-  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
+  BASE_NAME                      = ReportFvLibPei
+  FILE_GUID                      = 409fc85f-aec0-4a8f-8126-9c36d201b5c4
   VERSION_STRING                 = 1.0
   MODULE_TYPE                    = PEIM
-  LIBRARY_CLASS                  = ReportFvLib
+  LIBRARY_CLASS                  = ReportFvLib | PEIM
 
 [LibraryClasses]
   BaseMemoryLib
@@ -32,7 +32,7 @@
   SimicsIch10Pkg/Ich10Pkg.dec
 
 [Sources]
-  PeiReportFvLib.c
+  ReportFvLibPei.c
   Fv.c
 
 [Pcd]
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (7 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code Oram, Isaac W
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong

Change MM reporting to use ReportFvLib API ReportMmFv ();
This removed the hardcoded table of FV to publish.
Also removed the unused "default" table.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c         | 16 --------
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h         |  7 ----
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c             | 41 ++++++++++++--------
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf          |  1 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf |  1 +
 5 files changed, 27 insertions(+), 39 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
index 113c749d04..b8a255dbf4 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
@@ -15,22 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 FVB_GLOBAL   mFvbModuleGlobal;
 
-//
-// This platform driver knows there are multiple FVs on FD.
-// Now we only provide FVs on Variable region and MicorCode region for performance issue.
-//
-FV_INFO mPlatformFvBaseAddress[] = {
-  {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase), FixedPcdGet32(PcdFlashNvStorageVariableSize)},
-  {0, 0}, // {FixedPcdGet32(PcdFlashFvMicrocodeBase), FixedPcdGet32(PcdFlashFvMicrocodeSize)},
-  {0, 0}
-};
-
-FV_INFO mPlatformDefaultBaseAddress[] = {
-  {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase), FixedPcdGet32(PcdFlashNvStorageVariableSize)},
-  {0, 0}, // {FixedPcdGet32(PcdFlashFvMicrocodeBase), FixedPcdGet32(PcdFlashFvMicrocodeSize)},
-  {0, 0}
-};
-
 FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate = {
   {
     {
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h
index e9d69e9858..d1d61b124f 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h
@@ -71,11 +71,6 @@ typedef struct {
   EFI_DEVICE_PATH_PROTOCOL    EndDevPath;
 } FV_MEMMAP_DEVICE_PATH;
 
-typedef struct {
-  UINT32              FvBase;
-  UINT32              FvSize;
-} FV_INFO;
-
 //
 // Protocol APIs
 //
@@ -152,7 +147,5 @@ extern FVB_GLOBAL                         mFvbModuleGlobal;
 extern FV_MEMMAP_DEVICE_PATH              mFvMemmapDevicePathTemplate;
 extern FV_PIWG_DEVICE_PATH                mFvPIWGDevicePathTemplate;
 extern EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL mFvbProtocolTemplate;
-extern FV_INFO                            mPlatformFvBaseAddress[];
-extern FV_INFO                            mPlatformDefaultBaseAddress[];
 
 #endif
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
index 016f19587c..1d8d55b8f2 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
@@ -11,6 +11,7 @@
 #include "SpiFvbServiceCommon.h"
 #include <Library/MmServicesTableLib.h>
 #include <Library/UefiDriverEntryPoint.h>
+#include <Library/ReportFvLib.h>
 #include <Protocol/SmmFirmwareVolumeBlock.h>
 
 /**
@@ -97,8 +98,12 @@ InstallFvbProtocol (
   The function does the necessary initialization work for
   Firmware Volume Block Driver.
 
+  @param VOID
+
+  @retval EFI_SUCCESS             The driver initialized successfully.
+  @retval EFI_UNSUPPORTED         The driver failed to initialize properly.
 **/
-VOID
+EFI_STATUS
 FvbInitialize (
   VOID
   )
@@ -113,15 +118,17 @@ FvbInitialize (
   UINT32                                MaxLbaSize;
   UINT32                                BytesWritten;
   UINTN                                 BytesErased;
+  FV_INFO                               *BoardFvInfoTablePtr;
 
-  mPlatformFvBaseAddress[0].FvBase = PcdGet32(PcdFlashNvStorageVariableBase);
-  mPlatformFvBaseAddress[0].FvSize = PcdGet32(PcdFlashNvStorageVariableSize);
-  mPlatformFvBaseAddress[1].FvBase = PcdGet32(PcdFlashFvMicrocodeBase);
-  mPlatformFvBaseAddress[1].FvSize = PcdGet32(PcdFlashFvMicrocodeSize);
-  mPlatformDefaultBaseAddress[0].FvBase = PcdGet32(PcdFlashNvStorageVariableBase);
-  mPlatformDefaultBaseAddress[0].FvSize = PcdGet32(PcdFlashNvStorageVariableSize);
-  mPlatformDefaultBaseAddress[1].FvBase = PcdGet32(PcdFlashFvMicrocodeBase);
-  mPlatformDefaultBaseAddress[1].FvSize = PcdGet32(PcdFlashFvMicrocodeSize);
+  //
+  // Retrieve the FV Info from the board library
+  //
+  BoardFvInfoTablePtr = NULL;
+  ReportMmFv (&BoardFvInfoTablePtr);
+  if (!BoardFvInfoTablePtr) {
+    ASSERT (BoardFvInfoTablePtr != NULL);
+    return EFI_UNSUPPORTED;
+  }
 
   //
   // We will only continue with FVB installation if the
@@ -132,11 +139,11 @@ FvbInitialize (
     // Make sure all FVB are valid and/or fix if possible
     //
     for (Idx = 0;; Idx++) {
-      if (mPlatformFvBaseAddress[Idx].FvSize == 0 && mPlatformFvBaseAddress[Idx].FvBase == 0) {
+      if (BoardFvInfoTablePtr[Idx].FvSize == 0 && BoardFvInfoTablePtr[Idx].FvBase == 0) {
         break;
       }
 
-      BaseAddress = mPlatformFvBaseAddress[Idx].FvBase;
+      BaseAddress = BoardFvInfoTablePtr[Idx].FvBase;
       FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
 
       if (!IsFvHeaderValid (BaseAddress, FvHeader)) {
@@ -192,10 +199,10 @@ FvbInitialize (
     //
     BufferSize = 0;
     for (Idx = 0; ; Idx++) {
-      if (mPlatformFvBaseAddress[Idx].FvSize == 0 && mPlatformFvBaseAddress[Idx].FvBase == 0) {
+      if (BoardFvInfoTablePtr[Idx].FvSize == 0 && BoardFvInfoTablePtr[Idx].FvBase == 0) {
         break;
       }
-      BaseAddress = mPlatformFvBaseAddress[Idx].FvBase;
+      BaseAddress = BoardFvInfoTablePtr[Idx].FvBase;
       FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
 
       if (!IsFvHeaderValid (BaseAddress, FvHeader)) {
@@ -212,7 +219,7 @@ FvbInitialize (
     mFvbModuleGlobal.FvbInstance =  (EFI_FVB_INSTANCE *) AllocateRuntimeZeroPool (BufferSize);
     if (mFvbModuleGlobal.FvbInstance == NULL) {
       ASSERT (FALSE);
-      return;
+      return EFI_SUCCESS;
     }
 
     MaxLbaSize      = 0;
@@ -220,10 +227,10 @@ FvbInitialize (
     mFvbModuleGlobal.NumFv   = 0;
 
     for (Idx = 0; ; Idx++) {
-      if (mPlatformFvBaseAddress[Idx].FvSize == 0 && mPlatformFvBaseAddress[Idx].FvBase == 0) {
+      if (BoardFvInfoTablePtr[Idx].FvSize == 0 && BoardFvInfoTablePtr[Idx].FvBase == 0) {
         break;
       }
-      BaseAddress = mPlatformFvBaseAddress[Idx].FvBase;
+      BaseAddress = BoardFvInfoTablePtr[Idx].FvBase;
       FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
 
       if (!IsFvHeaderValid (BaseAddress, FvHeader)) {
@@ -268,4 +275,6 @@ FvbInitialize (
 
     }
   }
+
+  return EFI_SUCCESS;
 }
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
index 10e51e1175..7b69bedcdc 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
@@ -34,6 +34,7 @@
   UefiDriverEntryPoint
   SpiFlashCommonLib
   MmServicesTableLib
+  ReportFvLib
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
index 9f08d3673f..1dfb2520e7 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
@@ -33,6 +33,7 @@
   MmServicesTableLib
   SpiFlashCommonLib
   StandaloneMmDriverEntryPoint
+  ReportFvLib
 
 [Packages]
   MdePkg/MdePkg.dec
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (8 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:32   ` Nate DeSimone
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance Oram, Isaac W
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong

Consolidate all the entry point functions into SpiFvbServiceMm.c
This reduces the number of files and makes the code easier to understand.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c             | 42 ++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf          |  1 -
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c   | 32 ---------------
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf |  1 -
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c  | 32 ---------------
 5 files changed, 42 insertions(+), 66 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
index 1d8d55b8f2..cc9310023e 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
@@ -278,3 +278,45 @@ FvbInitialize (
 
   return EFI_SUCCESS;
 }
+
+/**
+  The driver Traditional MM entry point.
+
+  @param[in] ImageHandle          Image handle of this driver.
+  @param[in] SystemTable          A pointer to the EFI system table.
+
+  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFvbTraditionalMmInitialize (
+  IN EFI_HANDLE            ImageHandle,
+  IN EFI_SYSTEM_TABLE      *SystemTable
+  )
+{
+  FvbInitialize ();
+
+  return EFI_SUCCESS;
+}
+
+/**
+  The driver Standalone MM entry point.
+
+  @param[in] ImageHandle          Image handle of this driver.
+  @param[in] MmSystemTable        A pointer to the MM system table.
+
+  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFvbStandaloneMmInitialize (
+  IN EFI_HANDLE            ImageHandle,
+  IN EFI_MM_SYSTEM_TABLE   *MmSystemTable
+  )
+{
+  FvbInitialize ();
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
index 7b69bedcdc..600ad32d9f 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
@@ -55,7 +55,6 @@
   SpiFvbServiceCommon.c
   SpiFvbServiceMm.h
   SpiFvbServiceMm.c
-  SpiFvbServiceTraditionalMm.c
 
 [Protocols]
   gEfiDevicePathProtocolGuid                    ## PRODUCES
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c
deleted file mode 100644
index 252c818d65..0000000000
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
-  MM driver source for several Serial Flash devices
-  which are compliant with the Intel(R) Serial Flash Interface Compatibility Specification.
-
-  Copyright (c) Microsoft Corporation.<BR>
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "SpiFvbServiceCommon.h"
-#include "SpiFvbServiceMm.h"
-
-/**
-  The driver Standalone MM entry point.
-
-  @param[in] ImageHandle          Image handle of this driver.
-  @param[in] MmSystemTable        A pointer to the MM system table.
-
-  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-SpiFvbStandaloneMmInitialize (
-  IN EFI_HANDLE            ImageHandle,
-  IN EFI_MM_SYSTEM_TABLE   *MmSystemTable
-  )
-{
-  FvbInitialize ();
-
-  return EFI_SUCCESS;
-}
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
index 1dfb2520e7..4e056466a1 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
@@ -54,7 +54,6 @@
   SpiFvbServiceCommon.c
   SpiFvbServiceMm.h
   SpiFvbServiceMm.c
-  SpiFvbServiceStandaloneMm.c
 
 [Protocols]
   gEfiDevicePathProtocolGuid                    ## PRODUCES
diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c
deleted file mode 100644
index 1c2dac70e3..0000000000
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
-  MM driver source for several Serial Flash devices
-  which are compliant with the Intel(R) Serial Flash Interface Compatibility Specification.
-
-  Copyright (c) Microsoft Corporation.<BR>
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "SpiFvbServiceCommon.h"
-#include "SpiFvbServiceMm.h"
-
-/**
-  The driver Traditional MM entry point.
-
-  @param[in] ImageHandle          Image handle of this driver.
-  @param[in] SystemTable          A pointer to the EFI system table.
-
-  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-SpiFvbTraditionalMmInitialize (
-  IN EFI_HANDLE            ImageHandle,
-  IN EFI_SYSTEM_TABLE      *SystemTable
-  )
-{
-  FvbInitialize ();
-
-  return EFI_SUCCESS;
-}
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance
  2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
                   ` (9 preceding siblings ...)
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code Oram, Isaac W
@ 2021-10-15 21:25 ` Oram, Isaac W
  2021-10-23  0:32   ` Nate DeSimone
       [not found] ` <16AE5156F40A3986.24927@groups.io>
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 30+ messages in thread
From: Oram, Isaac W @ 2021-10-15 21:25 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong

All boards have been updated to use the new libraries or custom
instances.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                     |   1 -
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c   | 143 --------------------
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf |  50 -------
 3 files changed, 194 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 1dfca06a10..58415326f4 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -93,7 +93,6 @@
   # PEI phase common
   #
   FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
-  ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf
   TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
deleted file mode 100644
index 833a77c702..0000000000
--- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/** @file
-  Source code file for Report Firmware Volume (FV) library
-
-Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/HobLib.h>
-#include <Library/PeiServicesLib.h>
-#include <Library/ReportFvLib.h>
-#include <Guid/FirmwareFileSystem2.h>
-#include <Ppi/FirmwareVolumeInfo.h>
-
-VOID
-ReportPreMemFv (
-  VOID
-  )
-{
-  ///
-  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in Dispatch mode.
-  ///
-  if (PcdGetBool(PcdFspWrapperBootMode)) {
-    DEBUG ((DEBUG_INFO, "Install FlashFvFspT - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvFspTBase), PcdGet32 (PcdFlashFvFspTSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvFspTBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvFspTBase),
-      PcdGet32 (PcdFlashFvFspTSize),
-      NULL,
-      NULL,
-      0
-      );
-  }
-  DEBUG ((DEBUG_INFO, "Install FlashFvSecurity - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvSecurityBase), PcdGet32 (PcdFlashFvSecuritySize)));
-  PeiServicesInstallFvInfo2Ppi (
-    &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase))->FileSystemGuid),
-    (VOID *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase),
-    PcdGet32 (PcdFlashFvSecuritySize),
-    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
-ReportPostMemFv (
-  VOID
-  )
-{
-  EFI_STATUS                    Status;
-  EFI_BOOT_MODE                 BootMode;
-
-  Status = PeiServicesGetBootMode (&BootMode);
-  ASSERT_EFI_ERROR (Status);
-
-  ///
-  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in Dispatch mode.
-  ///
-
-  ///
-  /// Build HOB for DXE
-  ///
-  if (BootMode == BOOT_IN_RECOVERY_MODE) {
-    ///
-    /// Prepare the recovery service
-    ///
-  } else {
-    DEBUG ((DEBUG_INFO, "Install FlashFvPostMemory - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvPostMemoryBase), PcdGet32 (PcdFlashFvPostMemorySize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase),
-      PcdGet32 (PcdFlashFvPostMemorySize),
-      NULL,
-      NULL,
-      0
-      );
-    DEBUG ((DEBUG_INFO, "Install FlashFvUefiBoot - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvUefiBootBase), PcdGet32 (PcdFlashFvUefiBootSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase),
-      PcdGet32 (PcdFlashFvUefiBootSize),
-      NULL,
-      NULL,
-      0
-      );
-    DEBUG ((DEBUG_INFO, "Install FlashFvOsBoot - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvOsBootBase), PcdGet32 (PcdFlashFvOsBootSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase),
-      PcdGet32 (PcdFlashFvOsBootSize),
-      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
-        );
-    }
-  }
-
-  //
-  // Report resource HOB for flash FV
-  //
-  BuildResourceDescriptorHob (
-    EFI_RESOURCE_MEMORY_MAPPED_IO,
-    (EFI_RESOURCE_ATTRIBUTE_PRESENT    |
-    EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
-    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
-    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
-    (UINTN) PcdGet32 (PcdFlashAreaSize)
-    );
-  BuildMemoryAllocationHob (
-    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
-    (UINTN) PcdGet32 (PcdFlashAreaSize),
-    EfiMemoryMappedIO
-    );
-}
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
deleted file mode 100644
index 4258d0f2e7..0000000000
--- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-### @file
-# Component information file for the Report Firmware Volume (FV) library.
-#
-# Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-###
-
-[Defines]
-  INF_VERSION                    = 0x00010017
-  BASE_NAME                      = PeiReportFvLib
-  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
-  VERSION_STRING                 = 1.0
-  MODULE_TYPE                    = PEIM
-  LIBRARY_CLASS                  = ReportFvLib
-
-[LibraryClasses]
-  BaseMemoryLib
-  DebugLib
-  HobLib
-  PeiServicesLib
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  MinPlatformPkg/MinPlatformPkg.dec
-
-[Sources]
-  PeiReportFvLib.c
-
-[Pcd]
-  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode             ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress           ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize                  ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryBase   ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize   ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ## CONSUMES
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API Oram, Isaac W
@ 2021-10-23  0:30   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:30 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel, Liming Gao, Dong, Eric

Hi Isaac,

Please see feedback inline.

Thanks,
Nate

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 01/11]
> MinPlatformPkg/ReportFvLib: Add ReportMmFv to API
> 
> Add ReportMmFv (); API for enabling boards to publish additional regions for
> MM driver use.
> This results in different instances of the library for PEI and MM.
> Added MinPlatformPkg library instances to the CorePeiLib.dsc and
> CoreDxeLib.dsc as the default library instances.
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc                          |
> 2 +
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc                          |   1
> +
>  Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h                       |
> 18 ++-
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                  |   9 +-
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLi
> bMm.c    |  53 +++++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLi
> bMm.inf  |  33 +++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLi
> bPei.c   | 146 ++++++++++++++++++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLi
> bPei.inf |  50 +++++++
>  8 files changed, 307 insertions(+), 5 deletions(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
> index 209ccdaf54..0127ca7641 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
> @@ -96,6 +96,8 @@
>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
> 
> VariableReadLib|MinPlatformPkg/Library/SmmVariableReadLib/TraditionalM
> mVariableReadLib.inf
> 
> VariableWriteLib|MinPlatformPkg/Library/SmmVariableWriteLib/Traditional
> MmVariableWriteLib.inf
> +
> + ReportFvLib|MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLi
> + bMm.inf
> +
> 
>  [LibraryClasses.common.SMM_CORE]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> index c12189bd9a..da4d0d6a1a 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> @@ -73,3 +73,4 @@
> 
> PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanc
> eLib.inf
>  !endif
> 
> VariableReadLib|MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableRe
> adLib.inf
> +
> + ReportFvLib|MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLi
> + bPei.inf
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
> b/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
> index 5c40bd0e6e..ba76728add 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
> +++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportFvLib.h
> @@ -4,7 +4,7 @@
> 
>    This library installs pre-memory and post-memory firmware volumes.
> 
> -Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -15,6 +15,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include
> <PiPei.h>  #include <Uefi.h>
> 
> +//
> +// This is used by board code to produce a table of FV to publish for MM
> use.
> +// The end of the table is indicated by base and size both equal to zero.
> +//
> +typedef struct {
> +  UINT32              FvBase;

Please make FvBase a EFI_PHYSICAL_ADDRESS instead of a UINT32.

> +  UINT32              FvSize;

Please make FvSize a UINT64 instead of a UINT32.

> +} FV_INFO;
> +
>  VOID
>  ReportPreMemFv (
>    VOID
> @@ -25,4 +34,9 @@ ReportPostMemFv (
>    VOID
>    );
> 
> -#endif
> \ No newline at end of file

The purpose of this function is a bit different than the purpose of the other functions. The other functions in this LibraryClass are used to install FV_INFO_PPIs to inform the core of the existence of root firmware volumes. This function is used to inform the MinPlatform FVB driver of which firmware volumes should have a firmware volume block I/O instance installed. This is quite different since the main purpose of installed FVB instances is to enable a firmware volume to be written to.

In light of this, please rename this function to GetFvToFvbMap().

In addition, please document the new function. Something like this would be sufficient:

/**
  List the Firmware Volumes which the FVB driver should create SMM FVB protocol instances for.

  @param[in]  FvInfoTable   The FV Base and Size that should have Firmware Volume Block I/O enabled for
**/

> +VOID
> +ReportMmFv (
> +  FV_INFO **FvInfoTable
> +  );
> +
> +#endif
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> index a09f8db3ab..1dfca06a10 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> @@ -107,8 +107,10 @@
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTes
> tPointCheckLib.inf
> 
> TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointLib.inf
> 
> +[LibraryClasses.common.DXE_SMM_DRIVER,
> +LibraryClasses.common.MM_STANDALONE]
> +
> +SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNul
> l/Sp
> +iFlashCommonLibNull.inf
> +
>  [LibraryClasses.common.DXE_SMM_DRIVER]
> -
> SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/
> SpiFlashCommonLibNull.inf
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTe
> stPointCheckLib.inf
> 
> TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.in
> f
> 
> @@ -117,7 +119,6 @@
> 
> MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAll
> ocationLib/StandaloneMmMemoryAllocationLib.inf
> 
> MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Stan
> daloneMmServicesTableLib.inf
>    PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> -
> SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/
> SpiFlashCommonLibNull.inf
> 
> StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntry
> Point/StandaloneMmDriverEntryPoint.inf
> 
> VariableReadLib|MinPlatformPkg/Library/SmmVariableReadLib/Standalone
> MmVariableReadLib.inf
> 
> VariableWriteLib|MinPlatformPkg/Library/SmmVariableWriteLib/Standalone
> MmVariableWriteLib.inf
> @@ -189,7 +190,9 @@
>    MinPlatformPkg/PlatformInit/Library/BoardInitLibNull/BoardInitLibNull.inf
> 
> MinPlatformPkg/PlatformInit/Library/MultiBoardInitSupportLib/PeiMultiBoar
> dInitSupportLib.inf
> 
> MinPlatformPkg/PlatformInit/Library/MultiBoardInitSupportLib/DxeMultiBoa
> rdInitSupportLib.inf
> -  MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
> +  MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibPei.inf
> +  MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportFvLibMm.inf
> +
> 
> MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.in
> f
>    MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf
>    MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibMm.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibMm.c
> new file mode 100644
> index 0000000000..a6339d130d
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/Rep
> +++ ortFvLibMm.c
> @@ -0,0 +1,53 @@
> +/** @file
> +  Source code file for Report Firmware Volume (FV) library management
> +mode functionality
> +
> +  ReportPreMemFv (); is not supported by this libary instance
> + ReportPostMemFv (); is not supported by this libary instance
> +
> +  Copyright (c) 2018 - 2021, Intel Corporation. All rights
> + reserved.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> +
> +#include <Base.h>
> +#include <Library/DebugLib.h>
> +#include <Library/ReportFvLib.h>
> +#include <Guid/FirmwareFileSystem2.h>
> +#include <Ppi/FirmwareVolumeInfo.h>
> +
> +//
> +// This platform driver knows there are multiple FVs on FD.
> +//  Variable region and MicroCode region are required.
> +//
> +FV_INFO mBoardFvInfoTable[] = {
> +  {0, 0}, // {PcdGet32 (PcdFlashNvStorageVariableBase), PcdGet32
> +(PcdFlashNvStorageVariableSize)},
> +  {0, 0}, // {PcdGet32 (PcdFlashFvMicrocodeBase), PcdGet32
> +(PcdFlashFvMicrocodeSize)},
> +  {0, 0}
> +};
> +
> +/*
> +  Return the firmware volumes that are needed for MM functionality.
> +  NV storage and microcode FV are required.
> +
> +  @param FvInfoTable    Pointer to table of FV to be published
> +
> +  @return VOID
> +*/
> +VOID
> +ReportMmFv (
> +  FV_INFO **FvInfoTable
> +  )
> +{
> +  mBoardFvInfoTable[0].FvBase = PcdGet32
> +(PcdFlashNvStorageVariableBase);
> +  mBoardFvInfoTable[0].FvSize = PcdGet32
> +(PcdFlashNvStorageVariableSize);
> +  mBoardFvInfoTable[1].FvBase = PcdGet32 (PcdFlashFvMicrocodeBase);
> +  mBoardFvInfoTable[1].FvSize = PcdGet32 (PcdFlashFvMicrocodeSize);
> +
> +  DEBUG ((DEBUG_INFO, "MM FvInfo Table:\nNvStorageVariableBase
> + 0x%X\nMicrocodeBase 0x%X\n", mBoardFvInfoTable[0].FvBase,
> + mBoardFvInfoTable[1].FvBase, mBoardFvInfoTable[2].FvBase));  ASSERT
> + (mBoardFvInfoTable[0].FvBase != 0);  ASSERT
> + (mBoardFvInfoTable[0].FvSize != 0);  ASSERT
> + (mBoardFvInfoTable[1].FvBase != 0);  ASSERT
> + (mBoardFvInfoTable[1].FvSize != 0);
> +
> +  *FvInfoTable = &mBoardFvInfoTable[0]; }
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibMm.inf
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibMm.inf
> new file mode 100644
> index 0000000000..41268f179e
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/Rep
> +++ ortFvLibMm.inf
> @@ -0,0 +1,33 @@
> +### @file
> +# Component information file for the Report Firmware Volume (FV) library.
> +#
> +# Copyright (c) 2018 - 2021, Intel Corporation. All rights
> +reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010017
> +  BASE_NAME                      = ReportFvLibMm
> +  FILE_GUID                      = 57c12e02-a65f-4994-bd76-bb6e3fd14df4
> +  VERSION_STRING                 = 1.0
> +  MODULE_TYPE                    = BASE
> +  LIBRARY_CLASS                  = ReportFvLib | DXE_SMM_DRIVER
> MM_STANDALONE
> +
> +[LibraryClasses]
> +  DebugLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +
> +[Sources]
> +  ReportFvLibMm.c
> +
> +[Pcd]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase           ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize           ##
> CONSUMES
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibPei.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibPei.c
> new file mode 100644
> index 0000000000..7fb755266d
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/Rep
> +++ ortFvLibPei.c
> @@ -0,0 +1,146 @@
> +/** @file
> +  Source code file for Report Firmware Volume (FV) library
> +
> +  ReportMmFv (); is not supported in this library instance
> +
> +  @copyright
> +  Copyright (c) 2018 - 2021, Intel Corporation. All rights
> + reserved.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> +
> +#include <Base.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/HobLib.h>
> +#include <Library/PeiServicesLib.h>
> +#include <Library/ReportFvLib.h>
> +#include <Guid/FirmwareFileSystem2.h>
> +#include <Ppi/FirmwareVolumeInfo.h>
> +
> +VOID
> +ReportPreMemFv (
> +  VOID
> +  )
> +{
> +  ///
> +  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in
> Dispatch mode.
> +  ///
> +  if (PcdGetBool(PcdFspWrapperBootMode)) {
> +    DEBUG ((DEBUG_INFO, "Install FlashFvFspT - 0x%x, 0x%x\n", PcdGet32
> (PcdFlashFvFspTBase), PcdGet32 (PcdFlashFvFspTSize)));
> +    PeiServicesInstallFvInfo2Ppi (
> +      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvFspTBase))->FileSystemGuid),
> +      (VOID *) (UINTN) PcdGet32 (PcdFlashFvFspTBase),
> +      PcdGet32 (PcdFlashFvFspTSize),
> +      NULL,
> +      NULL,
> +      0
> +      );
> +  }
> +  DEBUG ((DEBUG_INFO, "Install FlashFvSecurity - 0x%x, 0x%x\n",
> +PcdGet32 (PcdFlashFvSecurityBase), PcdGet32 (PcdFlashFvSecuritySize)));
> +  PeiServicesInstallFvInfo2Ppi (
> +    &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvSecurityBase))->FileSystemGuid),
> +    (VOID *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase),
> +    PcdGet32 (PcdFlashFvSecuritySize),
> +    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
> +ReportPostMemFv (
> +  VOID
> +  )
> +{
> +  EFI_STATUS                    Status;
> +  EFI_BOOT_MODE                 BootMode;
> +
> +  Status = PeiServicesGetBootMode (&BootMode);  ASSERT_EFI_ERROR
> + (Status);
> +
> +  ///
> +  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in
> Dispatch mode.
> +  ///
> +
> +  ///
> +  /// Build HOB for DXE
> +  ///
> +  if (BootMode == BOOT_IN_RECOVERY_MODE) {
> +    ///
> +    /// Prepare the recovery service
> +    ///
> +  } else {
> +    DEBUG ((DEBUG_INFO, "Install FlashFvPostMemory - 0x%x, 0x%x\n",
> PcdGet32 (PcdFlashFvPostMemoryBase), PcdGet32
> (PcdFlashFvPostMemorySize)));
> +    PeiServicesInstallFvInfo2Ppi (
> +      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvPostMemoryBase))->FileSystemGuid),
> +      (VOID *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase),
> +      PcdGet32 (PcdFlashFvPostMemorySize),
> +      NULL,
> +      NULL,
> +      0
> +      );
> +    DEBUG ((DEBUG_INFO, "Install FlashFvUefiBoot - 0x%x, 0x%x\n",
> PcdGet32 (PcdFlashFvUefiBootBase), PcdGet32 (PcdFlashFvUefiBootSize)));
> +    PeiServicesInstallFvInfo2Ppi (
> +      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvUefiBootBase))->FileSystemGuid),
> +      (VOID *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase),
> +      PcdGet32 (PcdFlashFvUefiBootSize),
> +      NULL,
> +      NULL,
> +      0
> +      );
> +    DEBUG ((DEBUG_INFO, "Install FlashFvOsBoot - 0x%x, 0x%x\n", PcdGet32
> (PcdFlashFvOsBootBase), PcdGet32 (PcdFlashFvOsBootSize)));
> +    PeiServicesInstallFvInfo2Ppi (
> +      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvOsBootBase))->FileSystemGuid),
> +      (VOID *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase),
> +      PcdGet32 (PcdFlashFvOsBootSize),
> +      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
> +        );
> +    }
> +  }
> +
> +  //
> +  // Report resource HOB for flash FV
> +  //
> +  BuildResourceDescriptorHob (
> +    EFI_RESOURCE_MEMORY_MAPPED_IO,
> +    (EFI_RESOURCE_ATTRIBUTE_PRESENT    |
> +    EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
> +    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
> +    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
> +    (UINTN) PcdGet32 (PcdFlashAreaSize)
> +    );
> +  BuildMemoryAllocationHob (
> +    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
> +    (UINTN) PcdGet32 (PcdFlashAreaSize),
> +    EfiMemoryMappedIO
> +    );
> +}
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibPei.inf
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/ReportF
> vLibPei.inf
> new file mode 100644
> index 0000000000..fdb61347c4
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportFvLib/Rep
> +++ ortFvLibPei.inf
> @@ -0,0 +1,50 @@
> +### @file
> +# Component information file for the Report Firmware Volume (FV) library.
> +#
> +# Copyright (c) 2018 - 2021, Intel Corporation. All rights
> +reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010017
> +  BASE_NAME                      = ReportFvLibPei
> +  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
> +  VERSION_STRING                 = 1.0
> +  MODULE_TYPE                    = PEIM
> +  LIBRARY_CLASS                  = ReportFvLib | PEIM
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  DebugLib
> +  HobLib
> +  PeiServicesLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +
> +[Sources]
> +  ReportFvLibPei.c
> +
> +[Pcd]
> +  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode             ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress           ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize                  ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryBase
> ## CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize
> ## CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ##
> CONSUMES
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  2021-10-23  1:32   ` Chaganty, Rangasai V
  2021-10-25 19:32   ` Kathappan Esakkithevar
  2 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io
  Cc: Chiu, Chasel, Chaganty, Rangasai V, Kethi Reddy, Deepika,
	Esakkithevar, Kathappan

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika
> <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan
> <kathappan.esakkithevar@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 02/11]
> CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
> 
> MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
> Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
> Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
> 
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
> sc | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> index 44a1bd54d6..3a92eb4575 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> @@ -121,7 +121,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io
  Cc: Chiu, Chasel, Benjamin Doron, Jeremy Soller

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Benjamin Doron
> <benjamin.doron00@gmail.com>; Jeremy Soller <jeremy@system76.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 03/11]
> KabyOpenBoardPkg/ReportFvLib: Switch to new library instances.
> 
> MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
> Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Benjamin Doron <benjamin.doron00@gmail.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
> 
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg
> .dsc | 1 -
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> | 1 -
>  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> | 1 -
>  3 files changed, 3 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardP
> kg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardP
> kg.dsc
> index 97573ab2e6..77055b489a 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardP
> kg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardP
> kg.dsc
> @@ -173,7 +173,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index 7f276d3512..75e4f3b2e9 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -119,7 +119,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> index f64555e391..50f95a1300 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> @@ -161,7 +161,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  2021-10-23  1:31   ` Chaganty, Rangasai V
  1 sibling, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chaganty, Rangasai V, Luo, Heng

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone,
> Nathaniel L <nathaniel.l.desimone@intel.com>; Luo, Heng
> <heng.luo@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 04/11]
> TigerLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
> 
> MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
> Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc
> 
> 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: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc |
> 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> index 1adf634034..7d6ea20986 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> @@ -67,7 +67,6 @@
>  [LibraryClasses.common]
> 
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> 
> PciHostBridgeLib|$(PLATFORM_PACKAGE)/Pci/Library/PciHostBridgeLibSimpl
> e/PciHostBridgeLibSimple.inf
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:25 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 05/11]
> WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
> 
> MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
> Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> | 1 -
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
> g.dsc | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> index ee2aedd978..af5e0b2116 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> @@ -121,7 +121,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> index b69cc8deb0..11ecd6b91f 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> @@ -121,7 +121,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 06/11] WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 06/11] WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:25 PM
> To: devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 06/11]
> WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV
> 
> ReportFvLib added a new fuction for boards to communicate MM required
> FV The custom instance allows Whitley boards to publish an FV for WHEA
> use.
> Also fixed duplicate GUID library name.
> 
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
> 
> Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.
> c                                           | 61 ++++++++++++++++++++
> 
> Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibMm.i
> nf                                         | 36 ++++++++++++
> 
> Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvL
> ib.c => ReportFvLib/ReportFvLibPei.c}     |  4 +-
> 
> Platform/Intel/WhitleyOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvL
> ib.inf => ReportFvLib/ReportFvLibPei.inf} | 12 ++--
>  Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> |  4 +-
>  5 files changed, 110 insertions(+), 7 deletions(-)
> 
> diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibM
> m.c
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibM
> m.c
> new file mode 100644
> index 0000000000..0cae9a7b25
> --- /dev/null
> +++
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLib
> +++ Mm.c
> @@ -0,0 +1,61 @@
> +/** @file ReportFvLib.c
> +  Source code file for Report Firmware Volume (FV) library management
> +mode functionality
> +
> +  ReportPreMemFv (); is not supported by this libary instance
> + ReportPostMemFv (); is not supported by this libary instance
> +
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> +
> +#include <Base.h>
> +#include <Library/DebugLib.h>
> +#include <Library/ReportFvLib.h>
> +#include <Guid/FirmwareFileSystem2.h>
> +#include <Ppi/FirmwareVolumeInfo2.h>
> +
> +//
> +// This platform driver knows there are multiple FVs on FD.
> +//  Variable region and MicroCode region are required.
> +//  WHEA region is optional.  If size is zero this will not be published.
> +//
> +FV_INFO mBoardFvInfoTable[] = {
> +  {0, 0}, // {PcdGet32 (PcdFlashNvStorageVariableBase), PcdGet32
> +(PcdFlashNvStorageVariableSize)},
> +  {0, 0}, // {PcdGet32 (PcdFlashFvMicrocodeBase), PcdGet32
> +(PcdFlashFvMicrocodeSize)},
> +  {0, 0}, // {PcdGet32 (PcdFlashFvWheaBase), PcdGet32
> +(PcdFlashFvWheaSize)},
> +  {0, 0}
> +};
> +
> +/*
> +  Return the firmware volumes that are needed for MM functionality.
> +  NV storage and microcode FV are required.
> +  WHEA FV is optional and only added if Base and Size are non-zero.
> +
> +  @param FvInfoTable    Pointer to table of FV to be published
> +
> +  @return VOID
> +*/
> +VOID
> +ReportMmFv (
> +  FV_INFO **FvInfoTable
> +  )
> +{
> +  mBoardFvInfoTable[0].FvBase = PcdGet32
> +(PcdFlashNvStorageVariableBase);
> +  mBoardFvInfoTable[0].FvSize = PcdGet32
> +(PcdFlashNvStorageVariableSize);
> +  mBoardFvInfoTable[1].FvBase = PcdGet32 (PcdFlashFvMicrocodeBase);
> +  mBoardFvInfoTable[1].FvSize = PcdGet32 (PcdFlashFvMicrocodeSize);
> +
> +  if ((PcdGet32 (PcdFlashFvWheaBase) != 0) && (PcdGet32
> (PcdFlashFvWheaSize) != 0)) {
> +    mBoardFvInfoTable[2].FvBase = PcdGet32 (PcdFlashFvWheaBase);
> +    mBoardFvInfoTable[2].FvSize = PcdGet32 (PcdFlashFvWheaSize);  }
> +
> +  DEBUG ((DEBUG_INFO, "MM FvInfo Table:\nNvStorageVariableBase
> + 0x%X\nMicrocodeBase 0x%X\nWheaBase 0x%X\n",
> + mBoardFvInfoTable[0].FvBase, mBoardFvInfoTable[1].FvBase,
> + mBoardFvInfoTable[2].FvBase));  ASSERT (mBoardFvInfoTable[0].FvBase !=
> + 0);  ASSERT (mBoardFvInfoTable[0].FvSize != 0);  ASSERT
> + (mBoardFvInfoTable[1].FvBase != 0);  ASSERT
> + (mBoardFvInfoTable[1].FvSize != 0);
> +
> +  *FvInfoTable = &mBoardFvInfoTable[0]; }
> diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibM
> m.inf
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibM
> m.inf
> new file mode 100644
> index 0000000000..b37da2ab4b
> --- /dev/null
> +++
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLib
> +++ Mm.inf
> @@ -0,0 +1,36 @@
> +### @file
> +# Component information file for the Report Firmware Volume (FV) library.
> +#
> +# Copyright (c) 2018 - 2021, Intel Corporation. All rights
> +reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010017
> +  BASE_NAME                      = ReportFvLibMm
> +  FILE_GUID                      = 0fcf4819-09e4-43fb-b597-4db80df14d88
> +  VERSION_STRING                 = 1.0
> +  MODULE_TYPE                    = BASE
> +  LIBRARY_CLASS                  = ReportFvLib | DXE_SMM_DRIVER
> MM_STANDALONE
> +
> +[LibraryClasses]
> +  DebugLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +  WhitleyOpenBoardPkg/PlatformPkg.dec
> +
> +[Sources]
> +  ReportFvLibMm.c
> +
> +[Pcd]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase           ##
> CONSUMES
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize           ##
> CONSUMES
> +  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaBase                   ##
> CONSUMES
> +  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaSize                   ##
> CONSUMES
> diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportF
> vLib.c
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei
> .c
> similarity index 96%
> rename from
> Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLi
> b.c
> rename to
> Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
> index f0230642d2..f916b352e5 100644
> ---
> a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportF
> vLib.c
> +++
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLib
> +++ Pei.c
> @@ -1,6 +1,8 @@
> -/** @file PeiReportFvLib.c
> +/** @file ReportFvLib.c
>    Source code file for Report Firmware Volume (FV) library
> 
> +  ReportMmFv (); is not supported in this library instance
> +
>    Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportF
> vLib.inf
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei
> .inf
> similarity index 87%
> rename from
> Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLi
> b.inf
> rename to
> Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.i
> nf
> index b02fac49cf..ae77606a54 100644
> ---
> a/Platform/Intel/WhitleyOpenBoardPkg/Library/PeiReportFvLib/PeiReportF
> vLib.inf
> +++
> b/Platform/Intel/WhitleyOpenBoardPkg/Library/ReportFvLib/ReportFvLib
> +++ Pei.inf
> @@ -9,11 +9,11 @@
> 
>  [Defines]
>    INF_VERSION                    = 0x00010017
> -  BASE_NAME                      = PeiReportFvLib
> -  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
> +  BASE_NAME                      = ReportFvLibPei
> +  FILE_GUID                      = 8b176722-93a6-4b0a-a297-3d3b6c3c7034
>    VERSION_STRING                 = 1.0
>    MODULE_TYPE                    = PEIM
> -  LIBRARY_CLASS                  = ReportFvLib
> +  LIBRARY_CLASS                  = ReportFvLib | PEIM
> 
>  [LibraryClasses]
>    BaseMemoryLib
> @@ -28,7 +28,7 @@
>    WhitleyOpenBoardPkg/PlatformPkg.dec
> 
>  [Sources]
> -  PeiReportFvLib.c
> +  ReportFvLibPei.c
> 
>  [Pcd]
>    gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
> @@ -62,4 +62,6 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemoryOffset      ##
> CONSUMES
>    gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspSize                 ##
> CONSUMES
>    gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspBase                 ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspOffset               ##
> CONSUMES
> \ No newline at end of file
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspOffset               ##
> CONSUMES
> +  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaBase                   ##
> CONSUMES
> +  gCpPlatFlashTokenSpaceGuid.PcdFlashFvWheaSize                   ##
> CONSUMES
> diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> index b3e96ecf3f..7d5f9e6883 100644
> --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> @@ -596,7 +596,7 @@
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTest
> PointCheckLib.inf
>    TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
> 
> -  ReportFvLib|$(RP_PKG)/Library/PeiReportFvLib/PeiReportFvLib.inf
> +  ReportFvLib|$(RP_PKG)/Library/ReportFvLib/ReportFvLibPei.inf
> 
>  [LibraryClasses.Common.PEIM]
>    #
> @@ -632,6 +632,8 @@
> 
> TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.in
> f
> 
> MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTabl
> eLib.inf
> 
> +  ReportFvLib|$(RP_PKG)/Library/ReportFvLib/ReportFvLibMm.inf
> +
>  [LibraryClasses.Common.SMM_CORE]
> 
> S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptL
> ibNull.inf
> 
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 07/11] PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 07/11] PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:26 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 07/11]
> PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib
> 
> Update custom ReportFvLib to match other board implementations.
> Also fix duplicate GUID for libary name.
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.dsc
> |  1 -
> 
> Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLi
> b/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}     | 10 +++++++---
> 
> Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/{PeiReportFvLi
> b/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} | 13 +++++++------
>  Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
> |  8 ++++----
>  4 files changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git
> a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.ds
> c
> b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.ds
> c
> index 98e02f35e7..ca747737e4 100644
> ---
> a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.ds
> c
> +++
> b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/OpenBoardPkg.ds
> c
> @@ -105,7 +105,6 @@
> 
> PlatformBootManagerLib|$(PLATFORM_BOARD_PACKAGE)/Override/Platfo
> rm/Intel/MinPlatformPkg/Bds/Library/DxePlatformBootManagerLib/DxePlat
> formBootManagerLib.inf
>  !endif
> 
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
> 
> CompressLib|$(PLATFORM_PACKAGE)/Library/CompressLib/CompressLib.in
> f
> diff --git
> a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFv
> Lib/PeiReportFvLib.c
> b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib
> /ReportFvLibPei.c
> similarity index 90%
> rename from
> Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib
> /PeiReportFvLib.c
> rename to
> Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/R
> eportFvLibPei.c
> index ee4fce0b5c..706bcb02ff 100644
> ---
> a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFv
> Lib/PeiReportFvLib.c
> +++
> b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvL
> +++ ib/ReportFvLibPei.c
> @@ -1,9 +1,13 @@
>  /** @file
> +  Source code file for Report Firmware Volume (FV) library
> 
> -Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -Copyright (c)
> 2021, American Megatrends International LLC.<BR>
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> +  ReportMmFv (); is not supported in this library instance
> 
> +  @copyright
> +  Copyright (c) 2018, - 2021 Intel Corporation. All rights
> + reserved.<BR>  Copyright (c) 2021, American Megatrends International
> + LLC.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>  **/
> 
>  #include <Base.h>
> diff --git
> a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFv
> Lib/PeiReportFvLib.inf
> b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib
> /ReportFvLibPei.inf
> similarity index 82%
> rename from
> Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFvLib
> /PeiReportFvLib.inf
> rename to
> Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvLib/R
> eportFvLibPei.inf
> index 1aab8ae702..adcf8d8cfd 100644
> ---
> a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/PeiReportFv
> Lib/PeiReportFvLib.inf
> +++
> b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/ReportFvL
> +++ ib/ReportFvLibPei.inf
> @@ -1,19 +1,20 @@
>  ## @file
> +# Component information file for the Report Firmware Volume (FV) library.
>  #
> -# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2018 - 2021, Intel Corporation. All rights
> +reserved.<BR>
>  # Copyright (c) 2021, American Megatrends International LLC.<BR>
> +#
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
> 
> -
>  [Defines]
>    INF_VERSION                    = 0x00010017
> -  BASE_NAME                      = PeiReportFvLib
> -  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
> +  BASE_NAME                      = ReportFvLibPei
> +  FILE_GUID                      = b2f52f32-9963-4f66-8cbf-ddb7a02523ac
>    VERSION_STRING                 = 1.0
>    MODULE_TYPE                    = PEIM
> -  LIBRARY_CLASS                  = ReportFvLib
> +  LIBRARY_CLASS                  = ReportFvLib | PEIM
> 
>  [LibraryClasses]
>    BaseMemoryLib
> @@ -27,7 +28,7 @@
>    MinPlatformPkg/MinPlatformPkg.dec
> 
>  [Sources]
> -  PeiReportFvLib.c
> +  ReportFvLibPei.c
> 
>  [Pcd]
>    gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode       ##
> CONSUMES
> diff --git
> a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
> b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
> index f2a028d183..5623cbac41 100644
> ---
> a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/OpenBoardPkg.dsc
> @@ -1,7 +1,7 @@
>  ## @file
>  #  The main build description file for the TiogaPass board.
>  #
> -# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2018 - 2021, Intel Corporation. All rights
> +reserved.<BR>
>  # Copyright (c) 2021, American Megatrends International LLC.<BR>  # SPDX-
> License-Identifier: BSD-2-Clause-Patent  # @@ -89,7 +89,7 @@
> [Components.$(DXE_ARCH)]  #TiogaPass Override START : Added Board
> Specific changes in core drivers  #!include
> $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
> -!include CoreDxeInclude.dsc
> +!include CoreDxeInclude.dsc
>  #TiogaPass Override END
> 
>  #######################################
> @@ -109,7 +109,7 @@
>    LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
>  !else
> 
> LinuxBootLib|$(PLATFORM_BOARD_PACKAGE)/Features/LinuxBoot/LinuxBo
> otNull.inf
> -!endif
> +!endif
> 
>  !if gPlatformTokenSpaceGuid.PcdFastBoot == FALSE
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> @@ -117,7 +117,7 @@
> 
> PlatformBootManagerLib|$(PLATFORM_BOARD_PACKAGE)/Override/Platfo
> rm/Intel/MinPlatformPkg/Bds/Library/DxePlatformBootManagerLib/DxePlat
> formBootManagerLib.inf
>  !endif
> 
> -  ReportFvLib|$(PROJECT)/Library/PeiReportFvLib/PeiReportFvLib.inf
> +  ReportFvLib|$(PROJECT)/Library/ReportFvLib/ReportFvLibPei.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
> 
> CompressLib|$(PLATFORM_PACKAGE)/Library/CompressLib/CompressLib.in
> f
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: " Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: devel@edk2.groups.io, Oram, Isaac W; +Cc: Agyeman, Prince

Hi Isaac,

Unlike the other platforms, you don't have a SMM and a PEI implementation in the same directory here. Therefore, why take the "Pei" prefix off the directory name here? Since this is a PEI specific implementation of a generic LibraryClass, it is convention to keep the "Pei" prefix. For an example of this see:

https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Library/PeiReportStatusCodeLib
https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Library/DxeReportStatusCodeLib

Accordingly, the path SimicsOpenBoardPkg/Library/PeiReportFvLib should be retained.

Thanks,
Nate

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram,
> Isaac W
> Sent: Friday, October 15, 2021 2:26 PM
> To: devel@edk2.groups.io
> Cc: Agyeman, Prince <prince.agyeman@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 08/11]
> SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib
> 
> Update file naming to match other ReportFvLib implementations.
> Also fix duplicate GUID for libary name.
> 
> Cc: Agyeman Prince <prince.agyeman@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> |  2 +-
>  Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib =>
> ReportFvLib}/Fv.c                                  |  0
> 
> Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib
> .c => ReportFvLib/ReportFvLibPei.c}     |  0
> 
> Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib
> .inf => ReportFvLib/ReportFvLibPei.inf} | 10 +++++-----
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> index 93a7d1df55..bfd0320daf 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> @@ -117,7 +117,6 @@
> 
> DxeLoadLinuxLib|$(BOARD_PKG)/Library/LoadLinuxLib/DxeLoadLinuxLib.inf
>    LogoLib|$(BOARD_PKG)/Library/DxeLogoLib/DxeLogoLib.inf
>    NvVarsFileLib|$(BOARD_PKG)/Library/NvVarsFileLib/NvVarsFileLib.inf
> -  ReportFvLib|$(BOARD_PKG)/Library/PeiReportFvLib/PeiReportFvLib.inf
> 
> SerializeVariablesLib|$(BOARD_PKG)/Library/SerializeVariablesLib/SerializeV
> ariablesLib.inf
> 
> SiliconPolicyInitLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyInitLib/SiliconP
> olicyInitLib.inf
> 
> SiliconPolicyUpdateLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyUpdateLib
> /SiliconPolicyUpdateLib.inf
> @@ -151,6 +150,7 @@
>  !endif
> 
> TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/PeiTestPoi
> ntLib.inf
> 
> SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCac
> heMtrrLib.inf
> +  ReportFvLib|$(BOARD_PKG)/Library/ReportFvLib/ReportFvLibPei.inf
> 
>  [LibraryClasses.common.DXE_DRIVER]
> 
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/Fv.c
> b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/Fv.c
> similarity index 100%
> rename from
> Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/Fv.c
> rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/Fv.c
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLi
> b.c
> b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
> similarity index 100%
> rename from
> Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.
> c
> rename to
> Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLi
> b.inf
> b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.i
> nf
> similarity index 84%
> rename from
> Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.
> inf
> rename to
> Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
> index 5d2e39532c..524ecf2847 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLi
> b.inf
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibP
> +++ ei.inf
> @@ -1,7 +1,7 @@
>  ### @file
>  # Component information file for the Report Firmware Volume (FV) library.
>  #
> -# 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  # @@ -9,11 +9,11 @@
> 
>  [Defines]
>    INF_VERSION                    = 0x00010017
> -  BASE_NAME                      = PeiReportFvLib
> -  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
> +  BASE_NAME                      = ReportFvLibPei
> +  FILE_GUID                      = 409fc85f-aec0-4a8f-8126-9c36d201b5c4
>    VERSION_STRING                 = 1.0
>    MODULE_TYPE                    = PEIM
> -  LIBRARY_CLASS                  = ReportFvLib
> +  LIBRARY_CLASS                  = ReportFvLib | PEIM
> 
>  [LibraryClasses]
>    BaseMemoryLib
> @@ -32,7 +32,7 @@
>    SimicsIch10Pkg/Ich10Pkg.dec
> 
>  [Sources]
> -  PeiReportFvLib.c
> +  ReportFvLibPei.c
>    Fv.c
> 
>  [Pcd]
> --
> 2.27.0.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request Oram, Isaac W
@ 2021-10-23  0:31   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel, Liming Gao, Dong, Eric

Hi Isaac,

Please update copyright year on SpiFvbServiceCommon.h, SpiFvbServiceCommon.c, SpiFvbServiceSmm.inf, SpiFvbServiceStandaloneMm.inf, and SpiFvbServiceMm.c

Thanks,
Nate

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:26 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 09/11]
> MinPlatformPkg/SpifvbService: Publish FV based on board request
> 
> Change MM reporting to use ReportFvLib API ReportMmFv (); This removed
> the hardcoded table of FV to publish.
> Also removed the unused "default" table.
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.
> c         | 16 --------
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.
> h         |  7 ----
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> | 41 ++++++++++++--------
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
> |  1 +
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandalon
> eMm.inf |  1 +
>  5 files changed, 27 insertions(+), 39 deletions(-)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommo
> n.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceComm
> on.c
> index 113c749d04..b8a255dbf4 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommo
> n.c
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCom
> +++ mon.c
> @@ -15,22 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  //
>  FVB_GLOBAL   mFvbModuleGlobal;
> 
> -//
> -// This platform driver knows there are multiple FVs on FD.
> -// Now we only provide FVs on Variable region and MicorCode region for
> performance issue.
> -//
> -FV_INFO mPlatformFvBaseAddress[] = {
> -  {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase),
> FixedPcdGet32(PcdFlashNvStorageVariableSize)},
> -  {0, 0}, // {FixedPcdGet32(PcdFlashFvMicrocodeBase),
> FixedPcdGet32(PcdFlashFvMicrocodeSize)},
> -  {0, 0}
> -};
> -
> -FV_INFO mPlatformDefaultBaseAddress[] = {
> -  {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase),
> FixedPcdGet32(PcdFlashNvStorageVariableSize)},
> -  {0, 0}, // {FixedPcdGet32(PcdFlashFvMicrocodeBase),
> FixedPcdGet32(PcdFlashFvMicrocodeSize)},
> -  {0, 0}
> -};
> -
>  FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate = {
>    {
>      {
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommo
> n.h
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceComm
> on.h
> index e9d69e9858..d1d61b124f 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommo
> n.h
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCom
> +++ mon.h
> @@ -71,11 +71,6 @@ typedef struct {
>    EFI_DEVICE_PATH_PROTOCOL    EndDevPath;
>  } FV_MEMMAP_DEVICE_PATH;
> 
> -typedef struct {
> -  UINT32              FvBase;
> -  UINT32              FvSize;
> -} FV_INFO;
> -
>  //
>  // Protocol APIs
>  //
> @@ -152,7 +147,5 @@ extern FVB_GLOBAL                         mFvbModuleGlobal;
>  extern FV_MEMMAP_DEVICE_PATH
> mFvMemmapDevicePathTemplate;
>  extern FV_PIWG_DEVICE_PATH                mFvPIWGDevicePathTemplate;
>  extern EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
> mFvbProtocolTemplate;
> -extern FV_INFO                            mPlatformFvBaseAddress[];
> -extern FV_INFO                            mPlatformDefaultBaseAddress[];
> 
>  #endif
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> index 016f19587c..1d8d55b8f2 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.
> +++ c
> @@ -11,6 +11,7 @@
>  #include "SpiFvbServiceCommon.h"
>  #include <Library/MmServicesTableLib.h>  #include
> <Library/UefiDriverEntryPoint.h>
> +#include <Library/ReportFvLib.h>
>  #include <Protocol/SmmFirmwareVolumeBlock.h>
> 
>  /**
> @@ -97,8 +98,12 @@ InstallFvbProtocol (
>    The function does the necessary initialization work for
>    Firmware Volume Block Driver.
> 
> +  @param VOID
> +
> +  @retval EFI_SUCCESS             The driver initialized successfully.
> +  @retval EFI_UNSUPPORTED         The driver failed to initialize properly.
>  **/
> -VOID
> +EFI_STATUS
>  FvbInitialize (
>    VOID
>    )
> @@ -113,15 +118,17 @@ FvbInitialize (
>    UINT32                                MaxLbaSize;
>    UINT32                                BytesWritten;
>    UINTN                                 BytesErased;
> +  FV_INFO                               *BoardFvInfoTablePtr;
> 
> -  mPlatformFvBaseAddress[0].FvBase =
> PcdGet32(PcdFlashNvStorageVariableBase);
> -  mPlatformFvBaseAddress[0].FvSize =
> PcdGet32(PcdFlashNvStorageVariableSize);
> -  mPlatformFvBaseAddress[1].FvBase =
> PcdGet32(PcdFlashFvMicrocodeBase);
> -  mPlatformFvBaseAddress[1].FvSize =
> PcdGet32(PcdFlashFvMicrocodeSize);
> -  mPlatformDefaultBaseAddress[0].FvBase =
> PcdGet32(PcdFlashNvStorageVariableBase);
> -  mPlatformDefaultBaseAddress[0].FvSize =
> PcdGet32(PcdFlashNvStorageVariableSize);
> -  mPlatformDefaultBaseAddress[1].FvBase =
> PcdGet32(PcdFlashFvMicrocodeBase);
> -  mPlatformDefaultBaseAddress[1].FvSize =
> PcdGet32(PcdFlashFvMicrocodeSize);
> +  //
> +  // Retrieve the FV Info from the board library  //
> + BoardFvInfoTablePtr = NULL;  ReportMmFv (&BoardFvInfoTablePtr);  if
> + (!BoardFvInfoTablePtr) {
> +    ASSERT (BoardFvInfoTablePtr != NULL);
> +    return EFI_UNSUPPORTED;
> +  }
> 
>    //
>    // We will only continue with FVB installation if the @@ -132,11 +139,11 @@
> FvbInitialize (
>      // Make sure all FVB are valid and/or fix if possible
>      //
>      for (Idx = 0;; Idx++) {
> -      if (mPlatformFvBaseAddress[Idx].FvSize == 0 &&
> mPlatformFvBaseAddress[Idx].FvBase == 0) {
> +      if (BoardFvInfoTablePtr[Idx].FvSize == 0 &&
> + BoardFvInfoTablePtr[Idx].FvBase == 0) {
>          break;
>        }
> 
> -      BaseAddress = mPlatformFvBaseAddress[Idx].FvBase;
> +      BaseAddress = BoardFvInfoTablePtr[Idx].FvBase;
>        FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
> 
>        if (!IsFvHeaderValid (BaseAddress, FvHeader)) { @@ -192,10 +199,10 @@
> FvbInitialize (
>      //
>      BufferSize = 0;
>      for (Idx = 0; ; Idx++) {
> -      if (mPlatformFvBaseAddress[Idx].FvSize == 0 &&
> mPlatformFvBaseAddress[Idx].FvBase == 0) {
> +      if (BoardFvInfoTablePtr[Idx].FvSize == 0 &&
> + BoardFvInfoTablePtr[Idx].FvBase == 0) {
>          break;
>        }
> -      BaseAddress = mPlatformFvBaseAddress[Idx].FvBase;
> +      BaseAddress = BoardFvInfoTablePtr[Idx].FvBase;
>        FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
> 
>        if (!IsFvHeaderValid (BaseAddress, FvHeader)) { @@ -212,7 +219,7 @@
> FvbInitialize (
>      mFvbModuleGlobal.FvbInstance =  (EFI_FVB_INSTANCE *)
> AllocateRuntimeZeroPool (BufferSize);
>      if (mFvbModuleGlobal.FvbInstance == NULL) {
>        ASSERT (FALSE);
> -      return;
> +      return EFI_SUCCESS;
>      }
> 
>      MaxLbaSize      = 0;
> @@ -220,10 +227,10 @@ FvbInitialize (
>      mFvbModuleGlobal.NumFv   = 0;
> 
>      for (Idx = 0; ; Idx++) {
> -      if (mPlatformFvBaseAddress[Idx].FvSize == 0 &&
> mPlatformFvBaseAddress[Idx].FvBase == 0) {
> +      if (BoardFvInfoTablePtr[Idx].FvSize == 0 &&
> + BoardFvInfoTablePtr[Idx].FvBase == 0) {
>          break;
>        }
> -      BaseAddress = mPlatformFvBaseAddress[Idx].FvBase;
> +      BaseAddress = BoardFvInfoTablePtr[Idx].FvBase;
>        FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
> 
>        if (!IsFvHeaderValid (BaseAddress, FvHeader)) { @@ -268,4 +275,6 @@
> FvbInitialize (
> 
>      }
>    }
> +
> +  return EFI_SUCCESS;
>  }
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.in
> f
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.in
> f
> index 10e51e1175..7b69bedcdc 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.in
> f
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm
> +++ .inf
> @@ -34,6 +34,7 @@
>    UefiDriverEntryPoint
>    SpiFlashCommonLib
>    MmServicesTableLib
> +  ReportFvLib
> 
>  [Packages]
>    MdePkg/MdePkg.dec
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.inf
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.inf
> index 9f08d3673f..1dfb2520e7 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.inf
> +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSta
> +++ ndaloneMm.inf
> @@ -33,6 +33,7 @@
>    MmServicesTableLib
>    SpiFlashCommonLib
>    StandaloneMmDriverEntryPoint
> +  ReportFvLib
> 
>  [Packages]
>    MdePkg/MdePkg.dec
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code Oram, Isaac W
@ 2021-10-23  0:32   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:32 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel, Liming Gao, Dong, Eric

Hi Isaac,

Please see feedback inline.

Thanks,
Nate

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:26 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 10/11]
> MinPlatformPkg/SpiFvbService: Reduce duplicate code
> 
> Consolidate all the entry point functions into SpiFvbServiceMm.c This
> reduces the number of files and makes the code easier to understand.
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> | 42 ++++++++++++++++++++
>  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
> |  1 -
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandalon
> eMm.c   | 32 ---------------
> 
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandalon
> eMm.inf |  1 -
> Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditiona
> lMm.c  | 32 ---------------
>  5 files changed, 42 insertions(+), 66 deletions(-)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> index 1d8d55b8f2..cc9310023e 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.
> +++ c
> @@ -278,3 +278,45 @@ FvbInitialize (
> 
>    return EFI_SUCCESS;
>  }
> +
> +/**
> +  The driver Traditional MM entry point.
> +
> +  @param[in] ImageHandle          Image handle of this driver.
> +  @param[in] SystemTable          A pointer to the EFI system table.
> +
> +  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +SpiFvbTraditionalMmInitialize (
> +  IN EFI_HANDLE            ImageHandle,
> +  IN EFI_SYSTEM_TABLE      *SystemTable
> +  )
> +{
> +  FvbInitialize ();

Now that FvbInitialize() returns an EFI_STATUS code. It would be good to add a DEBUG print here in the case where an error is returned. I understand the hesitation to return it back to the core since this would not necessarily be a fatal error.

> +
> +  return EFI_SUCCESS;
> +}
> +
> +/**
> +  The driver Standalone MM entry point.
> +
> +  @param[in] ImageHandle          Image handle of this driver.
> +  @param[in] MmSystemTable        A pointer to the MM system table.
> +
> +  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +SpiFvbStandaloneMmInitialize (
> +  IN EFI_HANDLE            ImageHandle,
> +  IN EFI_MM_SYSTEM_TABLE   *MmSystemTable
> +  )
> +{
> +  FvbInitialize ();

Now that FvbInitialize() returns an EFI_STATUS code. It would be good to add a DEBUG print here in the case where an error is returned. I understand the hesitation to return it back to the core since this would not necessarily be a fatal error.

> +
> +  return EFI_SUCCESS;
> +}
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.in
> f
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.in
> f
> index 7b69bedcdc..600ad32d9f 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.in
> f
> +++
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm
> +++ .inf
> @@ -55,7 +55,6 @@
>    SpiFvbServiceCommon.c
>    SpiFvbServiceMm.h
>    SpiFvbServiceMm.c
> -  SpiFvbServiceTraditionalMm.c
> 
>  [Protocols]
>    gEfiDevicePathProtocolGuid                    ## PRODUCES
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.c
> deleted file mode 100644
> index 252c818d65..0000000000
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.c
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -/** @file
> -  MM driver source for several Serial Flash devices
> -  which are compliant with the Intel(R) Serial Flash Interface Compatibility
> Specification.
> -
> -  Copyright (c) Microsoft Corporation.<BR>
> -  SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#include "SpiFvbServiceCommon.h"
> -#include "SpiFvbServiceMm.h"
> -
> -/**
> -  The driver Standalone MM entry point.
> -
> -  @param[in] ImageHandle          Image handle of this driver.
> -  @param[in] MmSystemTable        A pointer to the MM system table.
> -
> -  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
> -
> -**/
> -EFI_STATUS
> -EFIAPI
> -SpiFvbStandaloneMmInitialize (
> -  IN EFI_HANDLE            ImageHandle,
> -  IN EFI_MM_SYSTEM_TABLE   *MmSystemTable
> -  )
> -{
> -  FvbInitialize ();
> -
> -  return EFI_SUCCESS;
> -}
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.inf
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.inf
> index 1dfb2520e7..4e056466a1 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandal
> oneMm.inf
> +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSta
> +++ ndaloneMm.inf
> @@ -54,7 +54,6 @@
>    SpiFvbServiceCommon.c
>    SpiFvbServiceMm.h
>    SpiFvbServiceMm.c
> -  SpiFvbServiceStandaloneMm.c
> 
>  [Protocols]
>    gEfiDevicePathProtocolGuid                    ## PRODUCES
> diff --git
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditio
> nalMm.c
> b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditio
> nalMm.c
> deleted file mode 100644
> index 1c2dac70e3..0000000000
> ---
> a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditio
> nalMm.c
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -/** @file
> -  MM driver source for several Serial Flash devices
> -  which are compliant with the Intel(R) Serial Flash Interface Compatibility
> Specification.
> -
> -  Copyright (c) Microsoft Corporation.<BR>
> -  SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#include "SpiFvbServiceCommon.h"
> -#include "SpiFvbServiceMm.h"
> -
> -/**
> -  The driver Traditional MM entry point.
> -
> -  @param[in] ImageHandle          Image handle of this driver.
> -  @param[in] SystemTable          A pointer to the EFI system table.
> -
> -  @retval EFI_SUCCESS             This function always returns EFI_SUCCESS.
> -
> -**/
> -EFI_STATUS
> -EFIAPI
> -SpiFvbTraditionalMmInitialize (
> -  IN EFI_HANDLE            ImageHandle,
> -  IN EFI_SYSTEM_TABLE      *SystemTable
> -  )
> -{
> -  FvbInitialize ();
> -
> -  return EFI_SUCCESS;
> -}
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance Oram, Isaac W
@ 2021-10-23  0:32   ` Nate DeSimone
  0 siblings, 0 replies; 30+ messages in thread
From: Nate DeSimone @ 2021-10-23  0:32 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Chiu, Chasel, Liming Gao, Dong, Eric

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, October 15, 2021 2:26 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 11/11]
> MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance
> 
> All boards have been updated to use the new libraries or custom instances.
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                     |   1 -
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiRep
> ortFvLib.c   | 143 --------------------
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiRep
> ortFvLib.inf |  50 -------
>  3 files changed, 194 deletions(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> index 1dfca06a10..58415326f4 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> @@ -93,7 +93,6 @@
>    # PEI phase common
>    #
> 
> FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapp
> erPlatformLib/PeiFspWrapperPlatformLib.inf
> -
> ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReport
> FvLib.inf
> 
> ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLi
> b.inf
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTest
> PointCheckLib.inf
>    TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiRe
> portFvLib.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiR
> eportFvLib.c
> deleted file mode 100644
> index 833a77c702..0000000000
> ---
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiRe
> portFvLib.c
> +++ /dev/null
> @@ -1,143 +0,0 @@
> -/** @file
> -  Source code file for Report Firmware Volume (FV) library
> -
> -Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR>
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#include <Base.h>
> -#include <Library/BaseMemoryLib.h>
> -#include <Library/DebugLib.h>
> -#include <Library/HobLib.h>
> -#include <Library/PeiServicesLib.h>
> -#include <Library/ReportFvLib.h>
> -#include <Guid/FirmwareFileSystem2.h>
> -#include <Ppi/FirmwareVolumeInfo.h>
> -
> -VOID
> -ReportPreMemFv (
> -  VOID
> -  )
> -{
> -  ///
> -  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in
> Dispatch mode.
> -  ///
> -  if (PcdGetBool(PcdFspWrapperBootMode)) {
> -    DEBUG ((DEBUG_INFO, "Install FlashFvFspT - 0x%x, 0x%x\n", PcdGet32
> (PcdFlashFvFspTBase), PcdGet32 (PcdFlashFvFspTSize)));
> -    PeiServicesInstallFvInfo2Ppi (
> -      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvFspTBase))->FileSystemGuid),
> -      (VOID *) (UINTN) PcdGet32 (PcdFlashFvFspTBase),
> -      PcdGet32 (PcdFlashFvFspTSize),
> -      NULL,
> -      NULL,
> -      0
> -      );
> -  }
> -  DEBUG ((DEBUG_INFO, "Install FlashFvSecurity - 0x%x, 0x%x\n", PcdGet32
> (PcdFlashFvSecurityBase), PcdGet32 (PcdFlashFvSecuritySize)));
> -  PeiServicesInstallFvInfo2Ppi (
> -    &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvSecurityBase))->FileSystemGuid),
> -    (VOID *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase),
> -    PcdGet32 (PcdFlashFvSecuritySize),
> -    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
> -ReportPostMemFv (
> -  VOID
> -  )
> -{
> -  EFI_STATUS                    Status;
> -  EFI_BOOT_MODE                 BootMode;
> -
> -  Status = PeiServicesGetBootMode (&BootMode);
> -  ASSERT_EFI_ERROR (Status);
> -
> -  ///
> -  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in
> Dispatch mode.
> -  ///
> -
> -  ///
> -  /// Build HOB for DXE
> -  ///
> -  if (BootMode == BOOT_IN_RECOVERY_MODE) {
> -    ///
> -    /// Prepare the recovery service
> -    ///
> -  } else {
> -    DEBUG ((DEBUG_INFO, "Install FlashFvPostMemory - 0x%x, 0x%x\n",
> PcdGet32 (PcdFlashFvPostMemoryBase), PcdGet32
> (PcdFlashFvPostMemorySize)));
> -    PeiServicesInstallFvInfo2Ppi (
> -      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvPostMemoryBase))->FileSystemGuid),
> -      (VOID *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase),
> -      PcdGet32 (PcdFlashFvPostMemorySize),
> -      NULL,
> -      NULL,
> -      0
> -      );
> -    DEBUG ((DEBUG_INFO, "Install FlashFvUefiBoot - 0x%x, 0x%x\n",
> PcdGet32 (PcdFlashFvUefiBootBase), PcdGet32 (PcdFlashFvUefiBootSize)));
> -    PeiServicesInstallFvInfo2Ppi (
> -      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvUefiBootBase))->FileSystemGuid),
> -      (VOID *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase),
> -      PcdGet32 (PcdFlashFvUefiBootSize),
> -      NULL,
> -      NULL,
> -      0
> -      );
> -    DEBUG ((DEBUG_INFO, "Install FlashFvOsBoot - 0x%x, 0x%x\n", PcdGet32
> (PcdFlashFvOsBootBase), PcdGet32 (PcdFlashFvOsBootSize)));
> -    PeiServicesInstallFvInfo2Ppi (
> -      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32
> (PcdFlashFvOsBootBase))->FileSystemGuid),
> -      (VOID *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase),
> -      PcdGet32 (PcdFlashFvOsBootSize),
> -      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
> -        );
> -    }
> -  }
> -
> -  //
> -  // Report resource HOB for flash FV
> -  //
> -  BuildResourceDescriptorHob (
> -    EFI_RESOURCE_MEMORY_MAPPED_IO,
> -    (EFI_RESOURCE_ATTRIBUTE_PRESENT    |
> -    EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
> -    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
> -    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
> -    (UINTN) PcdGet32 (PcdFlashAreaSize)
> -    );
> -  BuildMemoryAllocationHob (
> -    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
> -    (UINTN) PcdGet32 (PcdFlashAreaSize),
> -    EfiMemoryMappedIO
> -    );
> -}
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiRe
> portFvLib.inf
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiR
> eportFvLib.inf
> deleted file mode 100644
> index 4258d0f2e7..0000000000
> ---
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiRe
> portFvLib.inf
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -### @file
> -# Component information file for the Report Firmware Volume (FV) library.
> -#
> -# Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR> -# -#
> SPDX-License-Identifier: BSD-2-Clause-Patent -# -###
> -
> -[Defines]
> -  INF_VERSION                    = 0x00010017
> -  BASE_NAME                      = PeiReportFvLib
> -  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
> -  VERSION_STRING                 = 1.0
> -  MODULE_TYPE                    = PEIM
> -  LIBRARY_CLASS                  = ReportFvLib
> -
> -[LibraryClasses]
> -  BaseMemoryLib
> -  DebugLib
> -  HobLib
> -  PeiServicesLib
> -
> -[Packages]
> -  MdePkg/MdePkg.dec
> -  MdeModulePkg/MdeModulePkg.dec
> -  MinPlatformPkg/MinPlatformPkg.dec
> -
> -[Sources]
> -  PeiReportFvLib.c
> -
> -[Pcd]
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode             ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress           ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize                  ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryBase
> ## CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize
> ## CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ##
> CONSUMES
> -  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ##
> CONSUMES
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
@ 2021-10-23  1:31   ` Chaganty, Rangasai V
  1 sibling, 0 replies; 30+ messages in thread
From: Chaganty, Rangasai V @ 2021-10-23  1:31 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L, Luo, Heng

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> 
Sent: Friday, October 15, 2021 2:25 PM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

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: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
index 1adf634034..7d6ea20986 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -67,7 +67,6 @@
 [LibraryClasses.common]
 
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
 
   PciHostBridgeLib|$(PLATFORM_PACKAGE)/Pci/Library/PciHostBridgeLibSimple/PciHostBridgeLibSimple.inf
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
@ 2021-10-23  1:32   ` Chaganty, Rangasai V
  2021-10-25 19:32   ` Kathappan Esakkithevar
  2 siblings, 0 replies; 30+ messages in thread
From: Chaganty, Rangasai V @ 2021-10-23  1:32 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io
  Cc: Chiu, Chasel, Desimone, Nathaniel L, Kethi Reddy, Deepika,
	Esakkithevar, Kathappan

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> 
Sent: Friday, October 15, 2021 2:25 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan <kathappan.esakkithevar@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
index 44a1bd54d6..3a92eb4575 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
@@ -121,7 +121,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib
       [not found] ` <16AE5156F40A3986.24927@groups.io>
@ 2021-10-23  1:34   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 30+ messages in thread
From: Chaganty, Rangasai V @ 2021-10-23  1:34 UTC (permalink / raw)
  To: devel@edk2.groups.io, Oram, Isaac W; +Cc: Agyeman, Prince

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram, Isaac W
Sent: Friday, October 15, 2021 2:26 PM
To: devel@edk2.groups.io
Cc: Agyeman, Prince <prince.agyeman@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib

Update file naming to match other ReportFvLib implementations.
Also fix duplicate GUID for libary name.

Cc: Agyeman Prince <prince.agyeman@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc                                                |  2 +-
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib => ReportFvLib}/Fv.c                                  |  0
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.c => ReportFvLib/ReportFvLibPei.c}     |  0
 Platform/Intel/SimicsOpenBoardPkg/Library/{PeiReportFvLib/PeiReportFvLib.inf => ReportFvLib/ReportFvLibPei.inf} | 10 +++++-----
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index 93a7d1df55..bfd0320daf 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -117,7 +117,6 @@
   DxeLoadLinuxLib|$(BOARD_PKG)/Library/LoadLinuxLib/DxeLoadLinuxLib.inf
   LogoLib|$(BOARD_PKG)/Library/DxeLogoLib/DxeLogoLib.inf
   NvVarsFileLib|$(BOARD_PKG)/Library/NvVarsFileLib/NvVarsFileLib.inf
-  ReportFvLib|$(BOARD_PKG)/Library/PeiReportFvLib/PeiReportFvLib.inf
   SerializeVariablesLib|$(BOARD_PKG)/Library/SerializeVariablesLib/SerializeVariablesLib.inf
   SiliconPolicyInitLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyInitLib/SiliconPolicyInitLib.inf
   SiliconPolicyUpdateLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyUpdateLib/SiliconPolicyUpdateLib.inf
@@ -151,6 +150,7 @@
 !endif
   TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/PeiTestPointLib.inf
   SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
+  ReportFvLib|$(BOARD_PKG)/Library/ReportFvLib/ReportFvLibPei.inf
 
 [LibraryClasses.common.DXE_DRIVER]
 
diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/Fv.c b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/Fv.c
similarity index 100%
rename from Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/Fv.c
rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/Fv.c
diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
similarity index 100%
rename from Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.c
rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.c
diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
similarity index 84%
rename from Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
rename to Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibPei.inf
index 5d2e39532c..524ecf2847 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/ReportFvLib/ReportFvLibP
+++ ei.inf
@@ -1,7 +1,7 @@
 ### @file
 # Component information file for the Report Firmware Volume (FV) library.
 #
-# 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  # @@ -9,11 +9,11 @@
 
 [Defines]
   INF_VERSION                    = 0x00010017
-  BASE_NAME                      = PeiReportFvLib
-  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
+  BASE_NAME                      = ReportFvLibPei
+  FILE_GUID                      = 409fc85f-aec0-4a8f-8126-9c36d201b5c4
   VERSION_STRING                 = 1.0
   MODULE_TYPE                    = PEIM
-  LIBRARY_CLASS                  = ReportFvLib
+  LIBRARY_CLASS                  = ReportFvLib | PEIM
 
 [LibraryClasses]
   BaseMemoryLib
@@ -32,7 +32,7 @@
   SimicsIch10Pkg/Ich10Pkg.dec
 
 [Sources]
-  PeiReportFvLib.c
+  ReportFvLibPei.c
   Fv.c
 
 [Pcd]
--
2.27.0.windows.1







^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
       [not found] ` <16AE515652C6739A.24927@groups.io>
@ 2021-10-23  1:35   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 30+ messages in thread
From: Chaganty, Rangasai V @ 2021-10-23  1:35 UTC (permalink / raw)
  To: devel@edk2.groups.io, Oram, Isaac W; +Cc: Chiu, Chasel, Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram, Isaac W
Sent: Friday, October 15, 2021 2:25 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances.

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc        | 1 -
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc | 1 -
 2 files changed, 2 deletions(-)

diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
index ee2aedd978..af5e0b2116 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
@@ -121,7 +121,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
index b69cc8deb0..11ecd6b91f 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
@@ -121,7 +121,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
-- 
2.27.0.windows.1







^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: Switch to new library instances.
       [not found] ` <16AE51563C375254.13161@groups.io>
@ 2021-10-23  1:36   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 30+ messages in thread
From: Chaganty, Rangasai V @ 2021-10-23  1:36 UTC (permalink / raw)
  To: devel@edk2.groups.io, Oram, Isaac W
  Cc: Chiu, Chasel, Desimone, Nathaniel L, Benjamin Doron,
	Jeremy Soller

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram, Isaac W
Sent: Friday, October 15, 2021 2:25 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Benjamin Doron <benjamin.doron00@gmail.com>; Jeremy Soller <jeremy@system76.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: Switch to new library instances.

MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc | 1 -
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc        | 1 -
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc      | 1 -
 3 files changed, 3 deletions(-)

diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc
index 97573ab2e6..77055b489a 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc
@@ -173,7 +173,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
index 7f276d3512..75e4f3b2e9 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
@@ -119,7 +119,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
index f64555e391..50f95a1300 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
@@ -161,7 +161,6 @@
   PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
   PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
   PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
-  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
 
   #######################################
-- 
2.27.0.windows.1







^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance
       [not found] ` <16AE5156E9B772C6.11150@groups.io>
@ 2021-10-23  1:40   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 30+ messages in thread
From: Chaganty, Rangasai V @ 2021-10-23  1:40 UTC (permalink / raw)
  To: devel@edk2.groups.io, Oram, Isaac W
  Cc: Chiu, Chasel, Desimone, Nathaniel L, Liming Gao, Dong, Eric

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram, Isaac W
Sent: Friday, October 15, 2021 2:26 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance

All boards have been updated to use the new libraries or custom instances.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                     |   1 -
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c   | 143 --------------------
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf |  50 -------
 3 files changed, 194 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 1dfca06a10..58415326f4 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -93,7 +93,6 @@
   # PEI phase common
   #
   FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
-  ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
   ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.inf
   TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
deleted file mode 100644
index 833a77c702..0000000000
--- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/** @file
-  Source code file for Report Firmware Volume (FV) library
-
-Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/HobLib.h>
-#include <Library/PeiServicesLib.h>
-#include <Library/ReportFvLib.h>
-#include <Guid/FirmwareFileSystem2.h>
-#include <Ppi/FirmwareVolumeInfo.h>
-
-VOID
-ReportPreMemFv (
-  VOID
-  )
-{
-  ///
-  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in Dispatch mode.
-  ///
-  if (PcdGetBool(PcdFspWrapperBootMode)) {
-    DEBUG ((DEBUG_INFO, "Install FlashFvFspT - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvFspTBase), PcdGet32 (PcdFlashFvFspTSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvFspTBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvFspTBase),
-      PcdGet32 (PcdFlashFvFspTSize),
-      NULL,
-      NULL,
-      0
-      );
-  }
-  DEBUG ((DEBUG_INFO, "Install FlashFvSecurity - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvSecurityBase), PcdGet32 (PcdFlashFvSecuritySize)));
-  PeiServicesInstallFvInfo2Ppi (
-    &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase))->FileSystemGuid),
-    (VOID *) (UINTN) PcdGet32 (PcdFlashFvSecurityBase),
-    PcdGet32 (PcdFlashFvSecuritySize),
-    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
-ReportPostMemFv (
-  VOID
-  )
-{
-  EFI_STATUS                    Status;
-  EFI_BOOT_MODE                 BootMode;
-
-  Status = PeiServicesGetBootMode (&BootMode);
-  ASSERT_EFI_ERROR (Status);
-
-  ///
-  /// Note : FSP FVs except FSP-T FV are installed in IntelFsp2WrapperPkg in Dispatch mode.
-  ///
-
-  ///
-  /// Build HOB for DXE
-  ///
-  if (BootMode == BOOT_IN_RECOVERY_MODE) {
-    ///
-    /// Prepare the recovery service
-    ///
-  } else {
-    DEBUG ((DEBUG_INFO, "Install FlashFvPostMemory - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvPostMemoryBase), PcdGet32 (PcdFlashFvPostMemorySize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvPostMemoryBase),
-      PcdGet32 (PcdFlashFvPostMemorySize),
-      NULL,
-      NULL,
-      0
-      );
-    DEBUG ((DEBUG_INFO, "Install FlashFvUefiBoot - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvUefiBootBase), PcdGet32 (PcdFlashFvUefiBootSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvUefiBootBase),
-      PcdGet32 (PcdFlashFvUefiBootSize),
-      NULL,
-      NULL,
-      0
-      );
-    DEBUG ((DEBUG_INFO, "Install FlashFvOsBoot - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvOsBootBase), PcdGet32 (PcdFlashFvOsBootSize)));
-    PeiServicesInstallFvInfo2Ppi (
-      &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase))->FileSystemGuid),
-      (VOID *) (UINTN) PcdGet32 (PcdFlashFvOsBootBase),
-      PcdGet32 (PcdFlashFvOsBootSize),
-      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
-        );
-    }
-  }
-
-  //
-  // Report resource HOB for flash FV
-  //
-  BuildResourceDescriptorHob (
-    EFI_RESOURCE_MEMORY_MAPPED_IO,
-    (EFI_RESOURCE_ATTRIBUTE_PRESENT    |
-    EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
-    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
-    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
-    (UINTN) PcdGet32 (PcdFlashAreaSize)
-    );
-  BuildMemoryAllocationHob (
-    (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),
-    (UINTN) PcdGet32 (PcdFlashAreaSize),
-    EfiMemoryMappedIO
-    );
-}
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
deleted file mode 100644
index 4258d0f2e7..0000000000
--- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-### @file
-# Component information file for the Report Firmware Volume (FV) library.
-#
-# Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR> -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -###
-
-[Defines]
-  INF_VERSION                    = 0x00010017
-  BASE_NAME                      = PeiReportFvLib
-  FILE_GUID                      = 44328FA5-E4DD-4A15-ABDF-C6584AC363D9
-  VERSION_STRING                 = 1.0
-  MODULE_TYPE                    = PEIM
-  LIBRARY_CLASS                  = ReportFvLib
-
-[LibraryClasses]
-  BaseMemoryLib
-  DebugLib
-  HobLib
-  PeiServicesLib
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  MinPlatformPkg/MinPlatformPkg.dec
-
-[Sources]
-  PeiReportFvLib.c
-
-[Pcd]
-  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                      ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode             ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress           ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize                  ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryBase   ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize   ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ## CONSUMES
-  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ## CONSUMES
--
2.27.0.windows.1







^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
  2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances Oram, Isaac W
  2021-10-23  0:31   ` Nate DeSimone
  2021-10-23  1:32   ` Chaganty, Rangasai V
@ 2021-10-25 19:32   ` Kathappan Esakkithevar
  2 siblings, 0 replies; 30+ messages in thread
From: Kathappan Esakkithevar @ 2021-10-25 19:32 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io
  Cc: Chiu, Chasel, Desimone, Nathaniel L, Chaganty, Rangasai V,
	Kethi Reddy, Deepika

Reviewed-by: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Saturday, October 16, 2021 2:55 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika
> <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan
> <kathappan.esakkithevar@intel.com>
> Subject: [edk2-devel][edk2-platforms][PATCH V1 02/11]
> CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances.
> 
> MinPlatformPkg shared ReportFvLib has split into PEI and SMM instances.
> Default versions are already included via CorePeiLib.dsc and CoreDxeLib.dsc
> 
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
> Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
> ---
> 
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
> sc | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> index 44a1bd54d6..3a92eb4575 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> @@ -121,7 +121,6 @@
> 
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibS
> imple/PciSegmentInfoLibSimple.inf
>    PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> 
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatfor
> mBootManagerLib/DxePlatformBootManagerLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/P
> eiReportFvLib.inf
> 
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf
> 
>    #######################################
> --
> 2.27.0.windows.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2021-10-25 19:32 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-15 21:25 [edk2-devel][edk2-platforms][PATCH V1 00/11] Enable board customization of SMM FV reporting Oram, Isaac W
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 01/11] MinPlatformPkg/ReportFvLib: Add ReportMmFv to API Oram, Isaac W
2021-10-23  0:30   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 02/11] CometlakeOpenBoardPkg/ReportFvLib: Switch to new library instances Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-23  1:32   ` Chaganty, Rangasai V
2021-10-25 19:32   ` Kathappan Esakkithevar
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: " Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 04/11] TigerLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-23  1:31   ` Chaganty, Rangasai V
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: " Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 06/11] WhitleyOpenBoardPkg/ReportFvLib: Add board support for custom MM FV Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 07/11] PurleyOpenBoardPkg/ReportFvLib: Update ReportFvLib Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: " Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request Oram, Isaac W
2021-10-23  0:31   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 10/11] MinPlatformPkg/SpiFvbService: Reduce duplicate code Oram, Isaac W
2021-10-23  0:32   ` Nate DeSimone
2021-10-15 21:25 ` [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance Oram, Isaac W
2021-10-23  0:32   ` Nate DeSimone
     [not found] ` <16AE5156F40A3986.24927@groups.io>
2021-10-23  1:34   ` [edk2-devel][edk2-platforms][PATCH V1 08/11] SimicsOpenBoardPkg/ReportFvLib: Update ReportFvLib Chaganty, Rangasai V
     [not found] ` <16AE515652C6739A.24927@groups.io>
2021-10-23  1:35   ` [edk2-devel][edk2-platforms][PATCH V1 05/11] WhiskeyLakeOpenBoardPkg/ReportFvLib: Switch to new library instances Chaganty, Rangasai V
     [not found] ` <16AE51563C375254.13161@groups.io>
2021-10-23  1:36   ` [edk2-devel][edk2-platforms][PATCH V1 03/11] KabyOpenBoardPkg/ReportFvLib: " Chaganty, Rangasai V
     [not found] ` <16AE5156E9B772C6.11150@groups.io>
2021-10-23  1:40   ` [edk2-devel][edk2-platforms][PATCH V1 11/11] MinPlatformPkg/ReportFvLib: Remove obsolete PeiReportFvLib instance Chaganty, Rangasai V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox