* [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
@ 2021-10-08 6:43 Chiu, Chasel
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 1/9] " Chiu, Chasel
` (12 more replies)
0 siblings, 13 replies; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel
Cc: Chasel Chiu, Isaac Oram, Nate DeSimone, Heng Luo, Jeremy Soller,
Benjamin Doron, Rangasai V Chaganty, Deepika Kethi Reddy,
Kathappan Esakkithevar, Liming Gao, Eric Dong
V3:
Fix another GCC build failure.
V2:
Fix GCC build failures.
V1:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is not found.
Also added PeiGetLargeVariable () to support the scenarios where the
variable data size is bigger than a single variable size limit.
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.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: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Chasel Chiu (9):
MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
FspNvsHob
KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
FspNvsHob.
TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
WhitleySiliconPkg: Use same variable name for FspNvsHob.
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++-------------------------------------------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 ++++++++++---------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c | 39 ++++++++++++++++++++++++++++-----------
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c | 4 ++--
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c | 29 +++++++++++++++++++++++------
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c | 35 +++++++++--------------------------
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7 ++++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 3 +++
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf | 5 ++++-
Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h | 33 ++++++++++++++++++++++++++++++++-
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf | 4 +++-
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 +
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf | 1 +
Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf | 18 +++++++++---------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf | 4 +++-
Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 +
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf | 3 ++-
36 files changed, 321 insertions(+), 304 deletions(-)
--
2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 1/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob Chiu, Chasel
` (11 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is not found.
Also added PeiGetLargeVariable () to support the scenarios where the
variable data size is bigger than a single variable size limit.
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: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c | 39 ++++++++++++++++++++++++++++-----------
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c | 4 ++--
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf | 5 ++++-
Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h | 33 ++++++++++++++++++++++++++++++++-
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf | 4 +++-
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 +
7 files changed, 138 insertions(+), 17 deletions(-)
diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
index 41ed2550bd..401e02a7a9 100644
--- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
@@ -2,7 +2,7 @@
This is the driver that locates the MemoryConfigurationData HOB, if it
exists, and saves the data to nvRAM.
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Protocol/VariableLock.h>
+#include <Guid/FspNonVolatileStorageHob2.h>
/**
This is the standard EFI driver point that detects whether there is a
@@ -50,11 +51,27 @@ SaveMemoryConfigEntryPoint (
//
// Search for the Memory Configuration GUID HOB. If it is not present, then
// there's nothing we can do. It may not exist on the update path.
+ // Firstly check version2 FspNvsHob.
//
- GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHobGuid);
+ GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid);
if (GuidHob != NULL) {
- HobData = GET_GUID_HOB_DATA (GuidHob);
- DataSize = GET_GUID_HOB_DATA_SIZE(GuidHob);
+ HobData = (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataPtr;
+ DataSize = (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataLength;
+ } else {
+ //
+ // Fall back to version1 FspNvsHob
+ //
+ GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHobGuid);
+ if (GuidHob != NULL) {
+ HobData = GET_GUID_HOB_DATA (GuidHob);
+ DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
+ }
+ }
+
+ if (HobData != NULL) {
+ DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataLength:%d\n", DataSize));
+ DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataPtr : 0x%x\n", HobData));
+
if (DataSize > 0) {
//
// Use the HOB to save Memory Configuration Data
@@ -65,8 +82,8 @@ SaveMemoryConfigEntryPoint (
return EFI_UNSUPPORTED;
}
Status = gRT->GetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
+ L"FspNvsBuffer",
+ &gFspNvsBufferVariableGuid,
NULL,
&BufferSize,
VariableData
@@ -80,8 +97,8 @@ SaveMemoryConfigEntryPoint (
}
Status = gRT->GetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
+ L"FspNvsBuffer",
+ &gFspNvsBufferVariableGuid,
NULL,
&BufferSize,
VariableData
@@ -90,8 +107,8 @@ SaveMemoryConfigEntryPoint (
if ( (EFI_ERROR(Status)) || BufferSize != DataSize || 0 != CompareMem (HobData, VariableData, DataSize)) {
Status = gRT->SetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
+ L"FspNvsBuffer",
+ &gFspNvsBufferVariableGuid,
(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS),
DataSize,
HobData
@@ -106,7 +123,7 @@ SaveMemoryConfigEntryPoint (
//
Status = gBS->LocateProtocol(&gEdkiiVariableLockProtocolGuid, NULL, (VOID **)&VariableLock);
if (!EFI_ERROR(Status)) {
- Status = VariableLock->RequestToLock(VariableLock, L"MemoryConfig", &gFspNonVolatileStorageHobGuid);
+ Status = VariableLock->RequestToLock(VariableLock, L"FspNvsBuffer", &gFspNvsBufferVariableGuid);
ASSERT_EFI_ERROR(Status);
}
diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
index 96dfd588dc..9e92387761 100644
--- a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
+++ b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/DebugLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/LargeVariableReadLib.h>
#include <Ppi/ReadOnlyVariable2.h>
/**
@@ -108,6 +109,72 @@ PeiGetVariable (
return Status;
}
+/**
+ Returns the status whether get the large variable success. When variable size
+ is bigger than single UEFI variable size limit, The variable will be saved in
+ multiple UEFI variables. This function retrieves such large variable through the
+ ReadOnlyVariable2 PPI GetVariable().
+ The returned buffer is allocated using AllocatePage() to support > 64KB and this
+ buffer cannot be Free().
+
+ If Name is NULL, then ASSERT().
+ If Guid is NULL, then ASSERT().
+ If Value is NULL, then ASSERT().
+
+ @param[in] Name The pointer to a Null-terminated Unicode string.
+ @param[in] Guid The pointer to an EFI_GUID structure
+ @param[out] Value The buffer point saved the variable info.
+ @param[out] Size The buffer size of the variable.
+
+ @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
+ @return EFI_SUCCESS Find the specified variable.
+ @return Others Errors Return errors from call to gRT->GetVariable.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiGetLargeVariable (
+ IN CHAR16 *Name,
+ IN EFI_GUID *Guid,
+ OUT VOID **Value,
+ OUT UINTN *Size OPTIONAL
+ )
+{
+ EFI_STATUS Status;
+ UINTN VariableSize;
+ VOID *VariableData;
+
+ ASSERT (Name != NULL);
+ ASSERT (Guid != NULL);
+ ASSERT (Value != NULL);
+
+ VariableSize = 0;
+ VariableData = NULL;
+ Status = GetLargeVariable (Name, Guid, &VariableSize, NULL);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ VariableData = AllocatePages (EFI_SIZE_TO_PAGES (VariableSize));
+ if (VariableData == NULL) {
+ DEBUG ((DEBUG_ERROR, "Error: Cannot create VariableData, out of memory!\n"));
+ ASSERT (FALSE);
+ return EFI_OUT_OF_RESOURCES;
+ }
+ Status = GetLargeVariable (Name, Guid, &VariableSize, VariableData);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Error: Unable to read UEFI variable Status: %r\n", Status));
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+ }
+ if (Value != NULL) {
+ *Value = VariableData;
+ }
+ if (Size != NULL) {
+ *Size = VariableSize;
+ }
+ return EFI_SUCCESS;
+ }
+ return Status;
+}
+
EFI_PEI_FILE_HANDLE
InternalGetFfsHandleFromAnyFv (
IN CONST EFI_GUID *NameGuid
diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c b/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c
index 5eeee12a3c..b7885dd6c2 100644
--- a/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c
+++ b/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c
@@ -67,7 +67,7 @@ VarLibGetVariable (
&gEfiPeiReadOnlyVariable2PpiGuid,
0,
NULL,
- &VariablePpi
+ (VOID **) &VariablePpi
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
@@ -134,7 +134,7 @@ VarLibGetNextVariableName (
&gEfiPeiReadOnlyVariable2PpiGuid,
0,
NULL,
- &VariablePpi
+ (VOID **) &VariablePpi
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
index 0c8689a6f6..eac0880504 100644
--- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
@@ -1,7 +1,7 @@
### @file
# Component information file for SaveMemoryConfig module
#
-# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -28,6 +28,7 @@
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFsp2Pkg/IntelFsp2Pkg.dec
+ MinPlatformPkg/MinPlatformPkg.dec
[Sources]
SaveMemoryConfig.c
@@ -39,6 +40,8 @@
[Guids]
gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNonVolatileStorageHob2Guid ## CONSUMES
+ gFspNvsBufferVariableGuid ## PRODUCES
[Depex]
gEfiVariableArchProtocolGuid AND
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
index d8b1a47c58..86ffb378ec 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -38,6 +38,37 @@ PeiGetVariable (
OUT UINTN *Size
);
+/**
+ Returns the status whether get the large variable success. When variable size
+ is bigger than single UEFI variable size limit, The variable will be saved in
+ multiple UEFI variables. This function retrieves such large variable through the
+ ReadOnlyVariable2 PPI GetVariable().
+ The returned buffer is allocated using AllocatePage() to support > 64KB and this
+ buffer cannot be Free().
+
+ If Name is NULL, then ASSERT().
+ If Guid is NULL, then ASSERT().
+ If Value is NULL, then ASSERT().
+
+ @param[in] Name The pointer to a Null-terminated Unicode string.
+ @param[in] Guid The pointer to an EFI_GUID structure
+ @param[out] Value The buffer point saved the variable info.
+ @param[out] Size The buffer size of the variable.
+
+ @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
+ @return EFI_SUCCESS Find the specified variable.
+ @return Others Errors Return errors from call to gRT->GetVariable.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiGetLargeVariable (
+ IN CHAR16 *Name,
+ IN EFI_GUID *Guid,
+ OUT VOID **Value,
+ OUT UINTN *Size OPTIONAL
+ );
+
/**
Finds the file in any FV and gets file Address and Size
diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
index 7e740172a0..bd57cf7870 100644
--- a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
+++ b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
@@ -1,7 +1,7 @@
## @file
# Component information file for Board Init Test Library
#
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -20,9 +20,11 @@
PeiServicesLib
MemoryAllocationLib
DebugLib
+ LargeVariableReadLib
[Packages]
MdePkg/MdePkg.dec
+ MinPlatformPkg/MinPlatformPkg.dec
[Sources]
PeiLib.c
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index bcb42f0ef9..d6e80a66ce 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -50,6 +50,7 @@
gBdsEventBeforeConsoleAfterTrustedConsoleGuid = {0x51e49ff5, 0x28a9, 0x4159, { 0xac, 0x8a, 0xb8, 0xc4, 0x88, 0xa7, 0xfd, 0xee}}
gBdsEventBeforeConsoleBeforeEndOfDxeGuid = {0xfcf26e41, 0xbda6, 0x4633, { 0xb5, 0x73, 0xd4, 0xb8, 0x0e, 0x6d, 0xd0, 0x78}}
gBdsEventAfterConsoleReadyBeforeBootOptionGuid = {0x8eb3d5dc, 0xf4e7, 0x4b57, { 0xa9, 0xe7, 0x27, 0x39, 0x10, 0xf2, 0x18, 0x9f}}
+ gFspNvsBufferVariableGuid = {0x9c7715cd, 0x8d66, 0x4d2a, { 0x90, 0x0d, 0x01, 0x45, 0x9a, 0x57, 0x59, 0x6b}}
[LibraryClasses]
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 1/9] " Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-08 13:43 ` Kathappan Esakkithevar
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use " Chiu, Chasel
` (10 subsequent siblings)
12 siblings, 2 replies; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel
Cc: Chasel Chiu, Nate DeSimone, Rangasai V Chaganty,
Deepika Kethi Reddy, Kathappan Esakkithevar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: 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: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++-------------------------------------------------
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
3 files changed, 19 insertions(+), 52 deletions(-)
diff --git a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index 7dbdfa7c16..9e8606ada9 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -2,7 +2,7 @@
Implementation of Fsp Misc UPD Initialization.
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -17,7 +17,6 @@
#include <FspmUpd.h>
#include <FspsUpd.h>
-#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/DebugPrintErrorLevelLib.h>
#include <Library/PciLib.h>
@@ -44,55 +43,21 @@ PeiFspMiscUpdUpdatePreMem (
)
{
EFI_STATUS Status;
- EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
- UINTN VariableSize;
- VOID *MemorySavedData;
-
- Status = PeiServicesLocatePpi (
- &gEfiPeiReadOnlyVariable2PpiGuid,
- 0,
- NULL,
- (VOID **) &VariableServices
- );
- if (EFI_ERROR (Status)) {
- ASSERT_EFI_ERROR (Status);
- return Status;
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
+
+ //
+ // Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
+ //
+ FspNvsBufferPtr = NULL;
+ FspNvsBufferSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));
+ FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
}
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = VariableServices->GetVariable (
- VariableServices,
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- NULL,
- &VariableSize,
- MemorySavedData
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- MemorySavedData = AllocatePool (VariableSize);
- if (MemorySavedData == NULL) {
- ASSERT (MemorySavedData != NULL);
- return EFI_OUT_OF_RESOURCES;
- }
-
- DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));
- Status = VariableServices->GetVariable (
- VariableServices,
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- NULL,
- &VariableSize,
- MemorySavedData
- );
- if (Status == EFI_SUCCESS) {
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
- } else {
- DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMemoryConfigVariableGuid, Status = %r\n", Status));
- ASSERT_EFI_ERROR (Status);
- }
- }
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
return EFI_SUCCESS;
}
diff --git a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
index 44a1bd54d6..d63ff263c1 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
@@ -142,6 +142,9 @@
#######################################
PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookLib.inf
+[LibraryClasses.Common.SEC]
+ VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
+
[LibraryClasses.IA32.SEC]
#######################################
# Platform Package
diff --git a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index c842b7eef6..94776603c4 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -2,7 +2,7 @@
# Provide FSP wrapper platform related function.
#
#
-# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -82,7 +82,6 @@
PchInfoLib
PchHsioLib
PchPcieRpLib
- MemoryAllocationLib
DebugPrintErrorLevelLib
SiPolicyLib
PchGbeLib
@@ -132,7 +131,7 @@
gCometlakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3
[Guids]
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gTianoLogoGuid ## CONSUMES
gEfiMemoryOverwriteControlDataGuid
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for FspNvsHob
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 1/9] " Chiu, Chasel
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use " Chiu, Chasel
` (9 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone, Benjamin Doron
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7 ++++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
4 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index d8413d284e..a9b7e446c8 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -1,7 +1,7 @@
/** @file
Implementation of Fsp Misc UPD Initialization.
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -11,7 +11,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/DebugLib.h>
#include <Library/PciLib.h>
#include <Library/PeiLib.h>
-
#include <FspEas.h>
#include <FspmUpd.h>
#include <FspsUpd.h>
@@ -34,24 +33,21 @@ PeiFspMiscUpdUpdatePreMem (
{
EFI_STATUS Status;
UINTN VariableSize;
- VOID *MemorySavedData;
+ VOID *FspNvsBufferPtr;
UINT8 MorControl;
VOID *MorControlPtr;
//
// Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
//
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = PeiGetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- &MemorySavedData,
- &VariableSize
- );
- DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));
- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
+ FspNvsBufferPtr = NULL;
+ VariableSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &VariableSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));
+ FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
+ }
if (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) {
//
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
index c9dfb17e0a..3764f7c3ac 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
@@ -431,8 +431,8 @@ SiliconPolicyUpdatePreMem (
SA_MISC_PEI_PREMEM_CONFIG *MiscPeiPreMemConfig;
MEMORY_CONFIG_NO_CRC *MemConfigNoCrc;
VOID *Buffer;
- UINTN VariableSize;
- VOID *MemorySavedData;
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
UINT8 SpdAddressTable[4];
DEBUG((DEBUG_INFO, "\nUpdating Policy in Pre-Mem\n"));
@@ -463,18 +463,13 @@ SiliconPolicyUpdatePreMem (
// Note: AmberLake FSP does not implement the FSPM_ARCH_CONFIG_PPI added in FSP 2.1, hence
// the platform specific S3DataPtr must be used instead.
//
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = PeiGetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- &MemorySavedData,
- &VariableSize
- );
- DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));
- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));
- if (!EFI_ERROR (Status)) {
- MiscPeiPreMemConfig->S3DataPtr = MemorySavedData;
+ FspNvsBufferPtr = NULL;
+ FspNvsBufferSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));
+ MiscPeiPreMemConfig->S3DataPtr = FspNvsBufferPtr;
}
//
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index e4a657c5f1..eac9344b0a 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -1,7 +1,7 @@
## @file
# Provide FSP wrapper platform related function.
#
-# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -74,7 +74,6 @@
PchInfoLib
PchHsioLib
PchPcieRpLib
- MemoryAllocationLib
SiPolicyLib
PeiLib
@@ -134,9 +133,11 @@
gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAudioConnector
gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid
+ gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress
+ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdRootPort4ClkInfo
[Guids]
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gTianoLogoGuid ## CONSUMES
gEfiMemoryOverwriteControlDataGuid
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
index 0a8cf91b07..4dcc000186 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
@@ -52,7 +52,7 @@
gHsioPciePreMemConfigGuid ## CONSUMES
gHsioSataPreMemConfigGuid ## CONSUMES
gSaMiscPeiPreMemConfigGuid ## CONSUMES
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gIoApicConfigGuid ## CONSUMES
gHpetPreMemConfigGuid ## CONSUMES
gLockDownConfigGuid
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (2 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use " Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: " Chiu, Chasel
` (8 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone, Jeremy Soller
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 3 +++
3 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index 9d6c0176f6..2158eb299f 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -1,7 +1,7 @@
/** @file
Implementation of Fsp Misc UPD Initialization.
-Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <FspmUpd.h>
#include <FspsUpd.h>
-#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/DebugPrintErrorLevelLib.h>
#include <Library/PciLib.h>
@@ -38,24 +37,21 @@ PeiFspMiscUpdUpdatePreMem (
{
EFI_STATUS Status;
UINTN VariableSize;
- VOID *MemorySavedData;
+ VOID *FspNvsBufferPtr;
UINT8 MorControl;
VOID *MorControlPtr;
//
// Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
//
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = PeiGetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- &MemorySavedData,
- &VariableSize
- );
- DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));
- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
+ FspNvsBufferPtr = NULL;
+ VariableSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &VariableSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));
+ FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
+ }
if (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) {
//
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index 463455c90b..ceefe7639e 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -1,7 +1,7 @@
## @file
# FSP wrapper silicon policy update library.
#
-# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -81,7 +81,6 @@
PchInfoLib
PchHsioLib
PchPcieRpLib
- MemoryAllocationLib
CpuMailboxLib
DebugPrintErrorLevelLib
SiPolicyLib
@@ -138,7 +137,7 @@
gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid
[Guids]
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gTianoLogoGuid ## CONSUMES
gEfiMemoryOverwriteControlDataGuid
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
index 7f276d3512..299c7f18cd 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
@@ -141,6 +141,9 @@
PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookLib.inf
SiliconPolicyUpdateLib|$(PROJECT)/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+[LibraryClasses.Common.SEC]
+ VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
+
[LibraryClasses.IA32.SEC]
#######################################
# Edk2 Packages
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for FspNvsHob.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (3 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use " Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: " Chiu, Chasel
` (7 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 ++++++++++---------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
4 files changed, 22 insertions(+), 33 deletions(-)
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index d8aff1960f..699f4297fa 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -1,7 +1,7 @@
/** @file
Implementation of Fsp Misc UPD Initialization.
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <FspmUpd.h>
#include <FspsUpd.h>
-#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/DebugPrintErrorLevelLib.h>
#include <Library/PciLib.h>
@@ -38,25 +37,21 @@ PeiFspMiscUpdUpdatePreMem (
{
EFI_STATUS Status;
UINTN VariableSize;
- VOID *MemorySavedData;
+ VOID *FspNvsBufferPtr;
UINT8 MorControl;
VOID *MorControlPtr;
//
// Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
//
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = PeiGetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- &MemorySavedData,
- &VariableSize
- );
- DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));
- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
-
+ FspNvsBufferPtr = NULL;
+ VariableSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &VariableSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));
+ FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
+ }
if (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) {
//
// Set the DISB bit in PCH (DRAM Initialization Scratchpad Bit - GEN_PMCON_A[23]),
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
index 2dce9be63c..22aadc0221 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
@@ -398,8 +398,8 @@ SiliconPolicyUpdatePreMem (
SA_MISC_PEI_PREMEM_CONFIG *MiscPeiPreMemConfig;
MEMORY_CONFIG_NO_CRC *MemConfigNoCrc;
VOID *Buffer;
- UINTN VariableSize;
- VOID *MemorySavedData;
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
UINT8 SpdAddressTable[4];
DEBUG((DEBUG_INFO, "\nUpdating Policy in Pre-Mem\n"));
@@ -430,18 +430,13 @@ SiliconPolicyUpdatePreMem (
// Note: AmberLake FSP does not implement the FSPM_ARCH_CONFIG_PPI added in FSP 2.1, hence
// the platform specific S3DataPtr must be used instead.
//
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = PeiGetVariable (
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- &MemorySavedData,
- &VariableSize
- );
- DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));
- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));
- if (!EFI_ERROR (Status)) {
- MiscPeiPreMemConfig->S3DataPtr = MemorySavedData;
+ FspNvsBufferPtr = NULL;
+ FspNvsBufferSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));
+ MiscPeiPreMemConfig->S3DataPtr = FspNvsBufferPtr;
}
//
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index f8bec0c852..dacec18cd9 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -1,7 +1,7 @@
## @file
# Provide FSP wrapper platform related function.
#
-# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -80,7 +80,6 @@
PchInfoLib
PchHsioLib
PchPcieRpLib
- MemoryAllocationLib
CpuMailboxLib
DebugPrintErrorLevelLib
SiPolicyLib
@@ -141,7 +140,7 @@
gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid
[Guids]
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gTianoLogoGuid ## CONSUMES
gEfiMemoryOverwriteControlDataGuid
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
index 5c2da68bf9..4b30ba02ea 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
@@ -50,7 +50,7 @@
gHsioPciePreMemConfigGuid ## CONSUMES
gHsioSataPreMemConfigGuid ## CONSUMES
gSaMiscPeiPreMemConfigGuid ## CONSUMES
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
[Pcd]
gSiPkgTokenSpaceGuid.PcdPeiMinMemorySize
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (4 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: " Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-12 1:33 ` Heng Luo
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: " Chiu, Chasel
` (6 subsequent siblings)
12 siblings, 2 replies; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Sai Chaganty, Nate DeSimone, Heng Luo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf | 1 +
Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 3 +++
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
index fc523e93d1..938b74e5d8 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
@@ -9,7 +9,9 @@
#include <Library/FspWrapperApiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/PeiLib.h>
#include <Ppi/FspmArchConfigPpi.h>
+#include <PolicyUpdateMacro.h>
VOID
EFIAPI
@@ -70,9 +72,11 @@ SiliconPolicyDonePreMem(
)
{
EFI_STATUS Status;
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
#if FixedPcdGet8(PcdFspModeSelection) == 0
- FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi;
- EFI_PEI_PPI_DESCRIPTOR *FspmArchConfigPpiDesc;
+ FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi;
+ EFI_PEI_PPI_DESCRIPTOR *FspmArchConfigPpiDesc;
FspmArchConfigPpi = (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof (FSPM_ARCH_CONFIG_PPI));
if (FspmArchConfigPpi == NULL) {
@@ -80,7 +84,6 @@ SiliconPolicyDonePreMem(
return EFI_OUT_OF_RESOURCES;
}
FspmArchConfigPpi->Revision = 1;
- FspmArchConfigPpi->NvsBufferPtr = NULL;
FspmArchConfigPpi->BootLoaderTolumSize = 0;
FspmArchConfigPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
@@ -98,6 +101,18 @@ SiliconPolicyDonePreMem(
ASSERT_EFI_ERROR (Status);
#endif
+ //
+ // Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast boot paths.
+ //
+ FspNvsBufferPtr = NULL;
+ FspNvsBufferSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));
+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));
+ UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmArchUpd.NvsBufferPtr, FspmArchConfigPpi->NvsBufferPtr, FspNvsBufferPtr);
+ }
+
//
// Install Policy Ready PPI
// While installed, RC assumes the Policy is ready and finalized. So please
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
index 708fbac08f..0236ae45ae 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
@@ -181,3 +181,4 @@
gTianoLogoGuid ## CONSUMES
gCnviConfigGuid ## CONSUMES
gHdAudioPreMemConfigGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
index 1adf634034..451492f984 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -142,6 +142,9 @@
GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/BaseGpioCheckConflictLibNull/BaseGpioCheckConflictLibNull.inf
!endif
+[LibraryClasses.Common.SEC]
+ VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
+
[LibraryClasses.IA32.SEC]
TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SecTestPointCheckLib.inf
TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (5 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: " Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (5 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf | 18 +++++++++---------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc | 3 +++
7 files changed, 43 insertions(+), 116 deletions(-)
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index a341a58930..ab35bc3f8f 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -2,7 +2,7 @@
Implementation of Fsp Misc UPD Initialization.
- Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -17,11 +17,9 @@
#include <FspmUpd.h>
#include <FspsUpd.h>
-#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/DebugPrintErrorLevelLib.h>
#include <Library/PciLib.h>
-#include <Ppi/ReadOnlyVariable2.h>
#include <Guid/MemoryOverwriteControl.h>
#include <PchAccess.h>
@@ -44,55 +42,18 @@ PeiFspMiscUpdUpdatePreMem (
)
{
EFI_STATUS Status;
- EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
- UINTN VariableSize;
- VOID *MemorySavedData;
-
- Status = PeiServicesLocatePpi (
- &gEfiPeiReadOnlyVariable2PpiGuid,
- 0,
- NULL,
- (VOID **) &VariableServices
- );
- if (EFI_ERROR (Status)) {
- ASSERT_EFI_ERROR (Status);
- return Status;
- }
-
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = VariableServices->GetVariable (
- VariableServices,
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- NULL,
- &VariableSize,
- MemorySavedData
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- MemorySavedData = AllocatePool (VariableSize);
- if (MemorySavedData == NULL) {
- ASSERT (MemorySavedData != NULL);
- return EFI_OUT_OF_RESOURCES;
- }
-
- DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));
- Status = VariableServices->GetVariable (
- VariableServices,
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- NULL,
- &VariableSize,
- MemorySavedData
- );
- if (Status == EFI_SUCCESS) {
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
- } else {
- DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMemoryConfigVariableGuid, Status = %r\n", Status));
- ASSERT_EFI_ERROR (Status);
- }
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
+
+ FspNvsBufferPtr = NULL;
+ FspNvsBufferSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
+ FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
+ } else {
+ DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does not exist (this is likely a first boot)\n"));
+ FspmUpd->FspmArchUpd.NvsBufferPtr = NULL;
}
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
return EFI_SUCCESS;
}
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index 145deb5de3..381ef232ea 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
@@ -2,7 +2,7 @@
Implementation of Fsp Misc UPD Initialization.
- Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -18,11 +18,9 @@
#include <FspmUpd.h>
#include <FspsUpd.h>
-#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/DebugPrintErrorLevelLib.h>
#include <Library/PciLib.h>
-#include <Ppi/ReadOnlyVariable2.h>
#include <Guid/MemoryOverwriteControl.h>
#include <PchAccess.h>
#include <Platform.h>
@@ -46,54 +44,17 @@ PeiFspMiscUpdUpdatePreMem (
)
{
EFI_STATUS Status;
- EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
- UINTN VariableSize;
- VOID *MemorySavedData;
-
- Status = PeiServicesLocatePpi (
- &gEfiPeiReadOnlyVariable2PpiGuid,
- 0,
- NULL,
- (VOID **) &VariableServices
- );
- if (EFI_ERROR (Status)) {
- ASSERT_EFI_ERROR (Status);
- return Status;
- }
-
- VariableSize = 0;
- MemorySavedData = NULL;
- Status = VariableServices->GetVariable (
- VariableServices,
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- NULL,
- &VariableSize,
- MemorySavedData
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- MemorySavedData = AllocatePool (VariableSize);
- if (MemorySavedData == NULL) {
- ASSERT (MemorySavedData != NULL);
- return EFI_OUT_OF_RESOURCES;
- }
-
- DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));
- Status = VariableServices->GetVariable (
- VariableServices,
- L"MemoryConfig",
- &gFspNonVolatileStorageHobGuid,
- NULL,
- &VariableSize,
- MemorySavedData
- );
- if (Status == EFI_SUCCESS) {
- FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
- } else {
- FspmUpd->FspmArchUpd.NvsBufferPtr = NULL;
- DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMemoryConfigVariableGuid, Status = %r\n", Status));
- ASSERT_EFI_ERROR (Status);
- }
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
+
+ FspNvsBufferPtr = NULL;
+ FspNvsBufferSize = 0;
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
+ FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
+ } else {
+ DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does not exist (this is likely a first boot)\n"));
+ FspmUpd->FspmArchUpd.NvsBufferPtr = NULL;
}
FspmUpd->FspmConfig.TsegSize = FixedPcdGet32 (PcdTsegSize);
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index 2c90d0cb94..362dc2c995 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -2,7 +2,7 @@
# Provide FSP wrapper platform related function.
#
#
-# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -82,7 +82,6 @@
PchInfoLib
PchHsioLib
PchPcieRpLib
- MemoryAllocationLib
DebugPrintErrorLevelLib
SiPolicyLib
PchGbeLib
@@ -132,7 +131,7 @@
gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3
[Guids]
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gTianoLogoGuid ## CONSUMES
gEfiMemoryOverwriteControlDataGuid
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index 529c2f1253..1a664b1327 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -2,7 +2,7 @@
# FSP silicon policy updates for the Up Xtreme board.
#
#
-# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -136,7 +136,7 @@
gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdBoardBomId
[Guids]
- gFspNonVolatileStorageHobGuid ## CONSUMES
+ gFspNvsBufferVariableGuid ## CONSUMES
gTianoLogoGuid ## CONSUMES
gEfiMemoryOverwriteControlDataGuid
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf
index f7aa730ae7..698efce248 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf
@@ -2,7 +2,7 @@
# Flash map for the UpXtreme Board.
#
#
-# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -35,16 +35,16 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize = 0x00090000
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset = 0x00190000 # Flash addr (0xFFAE0000)
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize = 0x00190000 #
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset = 0x00320000 # Flash addr (0xFFC70000)
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize = 0x00170000 #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset = 0x00490000 # Flash addr (0xFFDE0000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize = 0x00160000 #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset = 0x00480000 # Flash addr (0xFFDD0000)
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize = 0x00070000 #
-SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x00500000 # Flash addr (0xFFE50000)
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x004F0000 # Flash addr (0xFFE40000)
SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize = 0x00050000 #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset = 0x00550000 # Flash addr (0xFFEA0000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset = 0x00540000 # Flash addr (0xFFE90000)
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize = 0x000EA000 #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset = 0x0063A000 # Flash addr (0xFFF8A000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset = 0x0062A000 # Flash addr (0xFFF7A000)
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize = 0x00006000 #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset = 0x00640000 # Flash addr (0xFFF90000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset = 0x00630000 # Flash addr (0xFFF80000)
SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize = 0x00010000 #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset = 0x00650000 # Flash addr (0xFFFA0000)
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize = 0x00060000 #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset = 0x00640000 # Flash addr (0xFFF90000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize = 0x00070000 #
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
index ee2aedd978..9d08dc3fe4 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
@@ -142,6 +142,9 @@
#######################################
PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookLib.inf
+[LibraryClasses.Common.SEC]
+ VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
+
[LibraryClasses.IA32.SEC]
#######################################
# Platform Package
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
index b69cc8deb0..8d25b818ee 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc
@@ -142,6 +142,9 @@
#######################################
PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookLib.inf
+[LibraryClasses.Common.SEC]
+ VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull.inf
+
[LibraryClasses.IA32.SEC]
#######################################
# Platform Package
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (6 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: " Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob Chiu, Chasel
` (4 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Isaac Oram, Nate DeSimone
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is not found.
Also added PeiGetLargeVariable () to support the scenarios where the
variable data size is bigger than a single variable size limit.
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c | 29 +++++++++++++++++++++++------
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf | 4 +++-
Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 +
3 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c
index 709c7ad479..01e36cda27 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c
@@ -7,6 +7,7 @@
**/
#include "S3NvramSave.h"
+#include <Guid/FspNonVolatileStorageHob2.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/LargeVariableReadLib.h>
#include <Library/LargeVariableWriteLib.h>
@@ -80,21 +81,37 @@ SaveFspNonVolatileStorageHob (
Status = EFI_SUCCESS;
DEBUG ((DEBUG_INFO, "Saving FSP / MRC Training Data\n"));
- GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHobGuid);
+ //
+ // Firstly check version2 FspNvsHob.
+ //
+ GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid);
if (GuidHob != NULL) {
- HobData = GET_GUID_HOB_DATA (GuidHob);
- DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
+ HobData = (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataPtr;
+ DataSize = (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataLength;
+ } else {
+ //
+ // Fall back to version1 FspNvsHob
+ //
+ GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHobGuid);
+ if (GuidHob != NULL) {
+ HobData = GET_GUID_HOB_DATA (GuidHob);
+ DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
+ }
+ }
+ if (HobData != NULL) {
+ DEBUG ((DEBUG_INFO, "FspNvsHob.Size: %d\n", DataSize));
+ DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataPtr: 0x%x\n", HobData));
if (DataSize > 0) {
//
// Check if the presently saved data is identical to the data given by MRC/FSP
//
- Status = GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, NULL);
+ Status = GetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferSize, NULL);
if (Status == EFI_BUFFER_TOO_SMALL) {
if (FspNvsBufferSize == DataSize) {
VariableData = AllocatePool (FspNvsBufferSize);
if (VariableData != NULL) {
- Status = GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, VariableData);
+ Status = GetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferSize, VariableData);
if (!EFI_ERROR (Status) && (FspNvsBufferSize == DataSize) && (0 == CompareMem (HobData, VariableData, DataSize))) {
DataIsIdentical = TRUE;
}
@@ -105,7 +122,7 @@ SaveFspNonVolatileStorageHob (
Status = EFI_SUCCESS;
if (!DataIsIdentical) {
- Status = SetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, TRUE, DataSize, HobData);
+ Status = SetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, TRUE, DataSize, HobData);
ASSERT_EFI_ERROR (Status);
DEBUG ((DEBUG_INFO, "Saved size of FSP / MRC Training Data: 0x%x\n", DataSize));
} else {
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf
index e62baa24c4..a77125cf44 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf
@@ -43,7 +43,9 @@
LargeVariableWriteLib
[Guids]
- gFspNonVolatileStorageHobGuid # CONSUMES
+ gFspNonVolatileStorageHobGuid # CONSUMES
+ gFspNonVolatileStorageHob2Guid # CONSUMES
+ gFspNvsBufferVariableGuid # PRODUCES
[Pcd]
gEfiCpRcPkgTokenSpaceGuid.PcdPeiSyshostMemorySize
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index dc3dd0e026..87165103bf 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -637,6 +637,7 @@
[LibraryClasses.Common]
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+ PeiLib|MinPlatformPkg/Library/PeiLib/PeiLib.inf
[Components.IA32]
UefiCpuPkg/SecCore/SecCore.inf
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (7 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
@ 2021-10-08 6:43 ` Chiu, Chasel
2021-10-11 21:47 ` Nate DeSimone
2021-10-08 13:44 ` [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Kathappan Esakkithevar
` (3 subsequent siblings)
12 siblings, 1 reply; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-08 6:43 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Isaac Oram, Nate DeSimone
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c | 35 +++++++++--------------------------
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf | 3 ++-
2 files changed, 11 insertions(+), 27 deletions(-)
diff --git a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c
index a6196a78b0..95a1f2a33c 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c
+++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c
@@ -13,7 +13,7 @@
#include <Library/HobLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/LargeVariableReadLib.h>
-
+#include <Library/PeiLib.h>
#include <FspmUpd.h>
#include <Guid/PlatformInfo.h>
#include <Ppi/UpiPolicyPpi.h>
@@ -24,39 +24,22 @@ GetFspNvsBuffer (
)
{
EFI_STATUS Status;
- UINTN FspNvsBufferSize;
- VOID *FspNvsBufferPtr;
+ UINTN FspNvsBufferSize;
+ VOID *FspNvsBufferPtr;
FspNvsBufferPtr = NULL;
FspNvsBufferSize = 0;
- Status = GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, NULL);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- DEBUG ((DEBUG_INFO, "FspNvsBuffer Size = %d\n", FspNvsBufferSize));
- FspNvsBufferPtr = AllocateZeroPool (FspNvsBufferSize);
- if (FspNvsBufferPtr == NULL) {
- DEBUG ((DEBUG_ERROR, "Error: Cannot create FspNvsBuffer, out of memory!\n"));
- ASSERT (FALSE);
- return NULL;
- }
- Status = GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, FspNvsBufferPtr);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "Error: Unable to read FspNvsBuffer UEFI variable Status: %r\n", Status));
- ASSERT_EFI_ERROR (Status);
- return NULL;
- }
-
+ Status = PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
+ if (Status == EFI_SUCCESS) {
return FspNvsBufferPtr;
-
- } else if (Status == EFI_NOT_FOUND) {
- DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does not exist (this is likely a first boot)\n"));
} else {
- DEBUG ((DEBUG_ERROR, "Error: Unable to read FspNvsBuffer UEFI variable Status: %r\n", Status));
- ASSERT_EFI_ERROR (Status);
- }
-
+ DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does not exist (this is likely a first boot)\n"));
return NULL;
}
+
+}
+
VOID
EFIAPI
UpdateFspmUpdData (
diff --git a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf
index 3e80ea670c..6ee15ea55f 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf
+++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf
@@ -58,11 +58,12 @@
[Guids]
gEfiPlatformInfoGuid
- gFspNonVolatileStorageHobGuid
+ gFspNvsBufferVariableGuid # CONSUMES
[LibraryClasses]
PeiServicesLib
LargeVariableReadLib
+ PeiLib
[Pcd]
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase ## CONSUMES
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob Chiu, Chasel
@ 2021-10-08 13:43 ` Kathappan Esakkithevar
2021-10-11 21:46 ` Nate DeSimone
1 sibling, 0 replies; 25+ messages in thread
From: Kathappan Esakkithevar @ 2021-10-08 13:43 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io, Esakkithevar, Kathappan
Cc: Desimone, Nathaniel L, Chaganty, Rangasai V, Kethi Reddy, Deepika
Reviewed-by: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Friday, October 8, 2021 12:13 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-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use
> same variable name for FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: 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: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++--------
> -----------------------------------------
>
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
> sc | 3 +++
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
> 3 files changed, 19 insertions(+), 52 deletions(-)
>
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index 7dbdfa7c16..9e8606ada9 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> +++ PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -2,7 +2,7 @@
> Implementation of Fsp Misc UPD Initialization.
>
>
>
>
>
> - Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
>
> + Copyright (c) 2020 - 2021, Intel Corporation. All rights
> + reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
>
>
> @@ -17,7 +17,6 @@
> #include <FspmUpd.h>
>
> #include <FspsUpd.h>
>
>
>
> -#include <Library/MemoryAllocationLib.h>
>
> #include <Library/DebugLib.h>
>
> #include <Library/DebugPrintErrorLevelLib.h>
>
> #include <Library/PciLib.h>
>
> @@ -44,55 +43,21 @@ PeiFspMiscUpdUpdatePreMem (
> )
>
> {
>
> EFI_STATUS Status;
>
> - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
>
> - UINTN VariableSize;
>
> - VOID *MemorySavedData;
>
> -
>
> - Status = PeiServicesLocatePpi (
>
> - &gEfiPeiReadOnlyVariable2PpiGuid,
>
> - 0,
>
> - NULL,
>
> - (VOID **) &VariableServices
>
> - );
>
> - if (EFI_ERROR (Status)) {
>
> - ASSERT_EFI_ERROR (Status);
>
> - return Status;
>
> + UINTN FspNvsBufferSize;
>
> + VOID *FspNvsBufferPtr;
>
> +
>
> + //
>
> + // Initialize S3 Data variable (S3DataPtr). It may be used for warm and fast
> boot paths.
>
> + //
>
> + FspNvsBufferPtr = NULL;
>
> + FspNvsBufferSize = 0;
>
> + Status = PeiGetLargeVariable (L"FspNvsBuffer",
> + &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);
>
> + if (Status == EFI_SUCCESS) {
>
> + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\"
> + gFspNvsBufferVariableGuid - %r\n", Status));
>
> + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n",
> + FspNvsBufferSize));
>
> + FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;
>
> }
>
>
>
> - VariableSize = 0;
>
> - MemorySavedData = NULL;
>
> - Status = VariableServices->GetVariable (
>
> - VariableServices,
>
> - L"MemoryConfig",
>
> - &gFspNonVolatileStorageHobGuid,
>
> - NULL,
>
> - &VariableSize,
>
> - MemorySavedData
>
> - );
>
> - if (Status == EFI_BUFFER_TOO_SMALL) {
>
> - MemorySavedData = AllocatePool (VariableSize);
>
> - if (MemorySavedData == NULL) {
>
> - ASSERT (MemorySavedData != NULL);
>
> - return EFI_OUT_OF_RESOURCES;
>
> - }
>
> -
>
> - DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));
>
> - Status = VariableServices->GetVariable (
>
> - VariableServices,
>
> - L"MemoryConfig",
>
> - &gFspNonVolatileStorageHobGuid,
>
> - NULL,
>
> - &VariableSize,
>
> - MemorySavedData
>
> - );
>
> - if (Status == EFI_SUCCESS) {
>
> - FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
>
> - } else {
>
> - DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\"
> gMemoryConfigVariableGuid, Status = %r\n", Status));
>
> - ASSERT_EFI_ERROR (Status);
>
> - }
>
> - }
>
> - FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;
>
>
>
> return EFI_SUCCESS;
>
> }
>
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> index 44a1bd54d6..d63ff263c1 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .ds
> +++ c
> @@ -142,6 +142,9 @@
> #######################################
>
>
> PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHo
> okLib.inf
>
>
>
> +[LibraryClasses.Common.SEC]
>
> +
> +
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVar
> + iableReadLibNull.inf
>
> +
>
> [LibraryClasses.IA32.SEC]
>
> #######################################
>
> # Platform Package
>
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index c842b7eef6..94776603c4 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> +++ PolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -2,7 +2,7 @@
> # Provide FSP wrapper platform related function.
>
> #
>
> #
>
> -# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
>
> +# Copyright (c) 2020 - 2021, Intel Corporation. All rights
> +reserved.<BR>
>
> #
>
> # SPDX-License-Identifier: BSD-2-Clause-Patent
>
> #
>
> @@ -82,7 +82,6 @@
> PchInfoLib
>
> PchHsioLib
>
> PchPcieRpLib
>
> - MemoryAllocationLib
>
> DebugPrintErrorLevelLib
>
> SiPolicyLib
>
> PchGbeLib
>
> @@ -132,7 +131,7 @@
> gCometlakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3
>
>
>
> [Guids]
>
> - gFspNonVolatileStorageHobGuid ## CONSUMES
>
> + gFspNvsBufferVariableGuid ## CONSUMES
>
> gTianoLogoGuid ## CONSUMES
>
> gEfiMemoryOverwriteControlDataGuid
>
>
>
> --
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (8 preceding siblings ...)
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob Chiu, Chasel
@ 2021-10-08 13:44 ` Kathappan Esakkithevar
2021-10-11 21:46 ` Nate DeSimone
` (2 subsequent siblings)
12 siblings, 0 replies; 25+ messages in thread
From: Kathappan Esakkithevar @ 2021-10-08 13:44 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Cc: Oram, Isaac W, Desimone, Nathaniel L, Luo, Heng, Jeremy Soller,
Benjamin Doron, Chaganty, Rangasai V, Kethi Reddy, Deepika,
Liming Gao, Dong, Eric
Reviewed-by: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Friday, October 8, 2021 12:13 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>;
> Jeremy Soller <jeremy@system76.com>; Benjamin Doron
> <benjamin.doron00@gmail.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika
> <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan
> <kathappan.esakkithevar@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3
> FSP_NON_VOLATILE_STORAGE_HOB2.
>
> V3:
> Fix another GCC build failure.
>
> V2:
> Fix GCC build failures.
>
> V1:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
> and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is
> not found.
>
> Also added PeiGetLargeVariable () to support the scenarios where the
> variable data size is bigger than a single variable size limit.
>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Heng Luo <heng.luo@intel.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Cc: Benjamin Doron <benjamin.doron00@gmail.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: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
>
> Chasel Chiu (9):
> MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
> CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
> KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
> FspNvsHob
> KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for
> FspNvsHob.
> KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
> FspNvsHob.
> TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
> WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
> WhitleyOpenBoardPkg: Support FSP 2.3
> FSP_NON_VOLATILE_STORAGE_HOB2.
> WhitleySiliconPkg: Use same variable name for FspNvsHob.
>
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++++-------------------------------------------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Li
> brary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24
> ++++++++++--------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/
> PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++-
> -------------
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24
> ++++++++++--------------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25
> ++++++++++---------------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
> onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++------
> --------
>
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMem
> oryConfig.c | 39
> ++++++++++++++++++++++++++++-----------
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
> | 69
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++-
>
> Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableRead
> Lib.c | 4 ++--
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInit
> Lib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPo
> licyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++---------------------------------------------------
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++---------------------------------------------------
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra
> mSave.c | 29 +++++++++++++++++++++++----
> --
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapper
> PlatformLib.c | 35 +++++++++--------------------------
>
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
> sc | 3 +++
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Li
> brary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7
> ++++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/
> PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
> onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
>
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMem
> oryConfig.inf | 5 ++++-
> Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
> | 33 ++++++++++++++++++++++++++++++++-
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
> | 4 +++-
> Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> | 1 +
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInit
> Lib/PeiFspPolicyInitLib.inf | 1 +
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPo
> licyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMa
> pInclude.fdf | 18 +++++++++---------
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
> g.dsc | 3 +++
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra
> mSave.inf | 4 +++-
> Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> | 1 +
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapper
> PlatformLib.inf | 3 ++-
> 36 files changed, 321 insertions(+), 304 deletions(-)
>
> --
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (9 preceding siblings ...)
2021-10-08 13:44 ` [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Kathappan Esakkithevar
@ 2021-10-11 21:46 ` Nate DeSimone
2021-10-12 1:43 ` Oram, Isaac W
2021-10-14 6:11 ` Chiu, Chasel
12 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Cc: Oram, Isaac W, Luo, Heng, Jeremy Soller, Benjamin Doron,
Chaganty, Rangasai V, Kethi Reddy, Deepika,
Esakkithevar, Kathappan, Liming Gao, Dong, Eric
Hi Chasel,
There is one minor thing I found, MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c needs to be updated to use LargeVariableLib as well since the PEI code is now using it. Other than that the change look's good!
Thanks,
Nate
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>;
> Jeremy Soller <jeremy@system76.com>; Benjamin Doron
> <benjamin.doron00@gmail.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika
> <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan
> <kathappan.esakkithevar@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3
> FSP_NON_VOLATILE_STORAGE_HOB2.
>
> V3:
> Fix another GCC build failure.
>
> V2:
> Fix GCC build failures.
>
> V1:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
> and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is
> not found.
>
> Also added PeiGetLargeVariable () to support the scenarios where the
> variable data size is bigger than a single variable size limit.
>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Heng Luo <heng.luo@intel.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Cc: Benjamin Doron <benjamin.doron00@gmail.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: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
>
> Chasel Chiu (9):
> MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
> CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
> KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
> FspNvsHob
> KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for
> FspNvsHob.
> KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
> FspNvsHob.
> TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
> WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
> WhitleyOpenBoardPkg: Support FSP 2.3
> FSP_NON_VOLATILE_STORAGE_HOB2.
> WhitleySiliconPkg: Use same variable name for FspNvsHob.
>
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++++-------------------------------------------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Li
> brary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24
> ++++++++++--------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/
> PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++-
> -------------
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24
> ++++++++++--------------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25
> ++++++++++---------------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
> onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++------
> --------
>
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMem
> oryConfig.c | 39
> ++++++++++++++++++++++++++++-----------
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
> | 69
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++-
>
> Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableRead
> Lib.c | 4 ++--
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInit
> Lib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPo
> licyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++---------------------------------------------------
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++---------------------------------------------------
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra
> mSave.c | 29 +++++++++++++++++++++++----
> --
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapper
> PlatformLib.c | 35 +++++++++--------------------------
>
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
> sc | 3 +++
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Li
> brary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7
> ++++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/
> PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
> onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
>
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMem
> oryConfig.inf | 5 ++++-
> Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
> | 33 ++++++++++++++++++++++++++++++++-
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
> | 4 +++-
> Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> | 1 +
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInit
> Lib/PeiFspPolicyInitLib.inf | 1 +
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPo
> licyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMa
> pInclude.fdf | 18 +++++++++---------
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
> g.dsc | 3 +++
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra
> mSave.inf | 4 +++-
> Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> | 1 +
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapper
> PlatformLib.inf | 3 ++-
> 36 files changed, 321 insertions(+), 304 deletions(-)
>
> --
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 1/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 1/9] " Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Liming Gao, Dong, Eric
Hi Chasel,
Please see feedback inline.
Thanks,
Nate
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-platforms: PATCH v3 1/9] MinPlatformPkg: Support FSP 2.3
> FSP_NON_VOLATILE_STORAGE_HOB2.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
> and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is
> not found.
>
> Also added PeiGetLargeVariable () to support the scenarios where the
> variable data size is bigger than a single variable size limit.
>
> 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: Chasel Chiu <chasel.chiu@intel.com>
> ---
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c | 39 ++++++++++++++++++++++++++++-----------
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c | 4 ++--
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf | 5 ++++-
> Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h | 33 ++++++++++++++++++++++++++++++++-
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf | 4 +++-
> Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 +
> 7 files changed, 138 insertions(+), 17 deletions(-)
>
> diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
> index 41ed2550bd..401e02a7a9 100644
> --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
> +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
> @@ -2,7 +2,7 @@
> This is the driver that locates the MemoryConfigurationData HOB, if it
> exists, and saves the data to nvRAM.
>
> -Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #include <Library/MemoryAllocationLib.h>
> #include <Library/BaseMemoryLib.h>
> #include <Protocol/VariableLock.h>
> +#include <Guid/FspNonVolatileStorageHob2.h>
>
> /**
> This is the standard EFI driver point that detects whether there is a
> @@ -50,11 +51,27 @@ SaveMemoryConfigEntryPoint (
> //
> // Search for the Memory Configuration GUID HOB. If it is not present, then
> // there's nothing we can do. It may not exist on the update path.
> + // Firstly check version2 FspNvsHob.
> //
> - GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHobGuid);
> + GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid);
> if (GuidHob != NULL) {
> - HobData = GET_GUID_HOB_DATA (GuidHob);
> - DataSize = GET_GUID_HOB_DATA_SIZE(GuidHob);
> + HobData = (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataPtr;
> + DataSize = (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataLength;
> + } else {
> + //
> + // Fall back to version1 FspNvsHob
> + //
> + GuidHob = GetFirstGuidHob (&gFspNonVolatileStorageHobGuid);
> + if (GuidHob != NULL) {
> + HobData = GET_GUID_HOB_DATA (GuidHob);
> + DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
> + }
> + }
> +
> + if (HobData != NULL) {
> + DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataLength:%d\n", DataSize));
> + DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataPtr : 0x%x\n", HobData));
> +
> if (DataSize > 0) {
> //
> // Use the HOB to save Memory Configuration Data
> @@ -65,8 +82,8 @@ SaveMemoryConfigEntryPoint (
> return EFI_UNSUPPORTED;
> }
> Status = gRT->GetVariable (
> - L"MemoryConfig",
> - &gFspNonVolatileStorageHobGuid,
> + L"FspNvsBuffer",
> + &gFspNvsBufferVariableGuid,
This needs to be updated to use LargeVariableLib as well.
> NULL,
> &BufferSize,
> VariableData
> @@ -80,8 +97,8 @@ SaveMemoryConfigEntryPoint (
> }
>
> Status = gRT->GetVariable (
> - L"MemoryConfig",
> - &gFspNonVolatileStorageHobGuid,
> + L"FspNvsBuffer",
> + &gFspNvsBufferVariableGuid,
> NULL,
> &BufferSize,
> VariableData
> @@ -90,8 +107,8 @@ SaveMemoryConfigEntryPoint (
>
> if ( (EFI_ERROR(Status)) || BufferSize != DataSize || 0 != CompareMem (HobData, VariableData, DataSize)) {
> Status = gRT->SetVariable (
> - L"MemoryConfig",
> - &gFspNonVolatileStorageHobGuid,
> + L"FspNvsBuffer",
> + &gFspNvsBufferVariableGuid,
> (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS),
> DataSize,
> HobData
> @@ -106,7 +123,7 @@ SaveMemoryConfigEntryPoint (
> //
> Status = gBS->LocateProtocol(&gEdkiiVariableLockProtocolGuid, NULL, (VOID **)&VariableLock);
> if (!EFI_ERROR(Status)) {
> - Status = VariableLock->RequestToLock(VariableLock, L"MemoryConfig", &gFspNonVolatileStorageHobGuid);
> + Status = VariableLock->RequestToLock(VariableLock, L"FspNvsBuffer", &gFspNvsBufferVariableGuid);
> ASSERT_EFI_ERROR(Status);
> }
>
> diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
> index 96dfd588dc..9e92387761 100644
> --- a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
> +++ b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
> @@ -1,6 +1,6 @@
> /** @file
>
> -Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> #include <Library/DebugLib.h>
> #include <Library/PeiServicesLib.h>
> #include <Library/MemoryAllocationLib.h>
> +#include <Library/LargeVariableReadLib.h>
> #include <Ppi/ReadOnlyVariable2.h>
>
> /**
> @@ -108,6 +109,72 @@ PeiGetVariable (
> return Status;
> }
>
> +/**
> + Returns the status whether get the large variable success. When variable size
> + is bigger than single UEFI variable size limit, The variable will be saved in
> + multiple UEFI variables. This function retrieves such large variable through the
> + ReadOnlyVariable2 PPI GetVariable().
> + The returned buffer is allocated using AllocatePage() to support > 64KB and this
> + buffer cannot be Free().
> +
> + If Name is NULL, then ASSERT().
> + If Guid is NULL, then ASSERT().
> + If Value is NULL, then ASSERT().
> +
> + @param[in] Name The pointer to a Null-terminated Unicode string.
> + @param[in] Guid The pointer to an EFI_GUID structure
> + @param[out] Value The buffer point saved the variable info.
> + @param[out] Size The buffer size of the variable.
> +
> + @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
> + @return EFI_SUCCESS Find the specified variable.
> + @return Others Errors Return errors from call to gRT->GetVariable.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +PeiGetLargeVariable (
> + IN CHAR16 *Name,
> + IN EFI_GUID *Guid,
> + OUT VOID **Value,
> + OUT UINTN *Size OPTIONAL
> + )
> +{
> + EFI_STATUS Status;
> + UINTN VariableSize;
> + VOID *VariableData;
> +
> + ASSERT (Name != NULL);
> + ASSERT (Guid != NULL);
> + ASSERT (Value != NULL);
> +
> + VariableSize = 0;
> + VariableData = NULL;
> + Status = GetLargeVariable (Name, Guid, &VariableSize, NULL);
> + if (Status == EFI_BUFFER_TOO_SMALL) {
> + VariableData = AllocatePages (EFI_SIZE_TO_PAGES (VariableSize));
> + if (VariableData == NULL) {
> + DEBUG ((DEBUG_ERROR, "Error: Cannot create VariableData, out of memory!\n"));
> + ASSERT (FALSE);
> + return EFI_OUT_OF_RESOURCES;
> + }
> + Status = GetLargeVariable (Name, Guid, &VariableSize, VariableData);
> + if (EFI_ERROR (Status)) {
> + DEBUG ((DEBUG_ERROR, "Error: Unable to read UEFI variable Status: %r\n", Status));
> + ASSERT_EFI_ERROR (Status);
> + return Status;
> + }
> + if (Value != NULL) {
> + *Value = VariableData;
> + }
> + if (Size != NULL) {
> + *Size = VariableSize;
> + }
> + return EFI_SUCCESS;
> + }
> + return Status;
> +}
> +
> EFI_PEI_FILE_HANDLE
> InternalGetFfsHandleFromAnyFv (
> IN CONST EFI_GUID *NameGuid
> diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c b/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c
> index 5eeee12a3c..b7885dd6c2 100644
> --- a/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c
> +++ b/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c
> @@ -67,7 +67,7 @@ VarLibGetVariable (
> &gEfiPeiReadOnlyVariable2PpiGuid,
> 0,
> NULL,
> - &VariablePpi
> + (VOID **) &VariablePpi
> );
> ASSERT_EFI_ERROR (Status);
> if (EFI_ERROR (Status)) {
> @@ -134,7 +134,7 @@ VarLibGetNextVariableName (
> &gEfiPeiReadOnlyVariable2PpiGuid,
> 0,
> NULL,
> - &VariablePpi
> + (VOID **) &VariablePpi
> );
> ASSERT_EFI_ERROR (Status);
> if (EFI_ERROR (Status)) {
> diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
> index 0c8689a6f6..eac0880504 100644
> --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
> +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
> @@ -1,7 +1,7 @@
> ### @file
> # Component information file for SaveMemoryConfig module
> #
> -# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> @@ -28,6 +28,7 @@
> MdePkg/MdePkg.dec
> MdeModulePkg/MdeModulePkg.dec
> IntelFsp2Pkg/IntelFsp2Pkg.dec
> + MinPlatformPkg/MinPlatformPkg.dec
>
> [Sources]
> SaveMemoryConfig.c
> @@ -39,6 +40,8 @@
>
> [Guids]
> gFspNonVolatileStorageHobGuid ## CONSUMES
> + gFspNonVolatileStorageHob2Guid ## CONSUMES
> + gFspNvsBufferVariableGuid ## PRODUCES
>
> [Depex]
> gEfiVariableArchProtocolGuid AND
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
> index d8b1a47c58..86ffb378ec 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
> +++ b/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
> @@ -1,6 +1,6 @@
> /** @file
>
> -Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -38,6 +38,37 @@ PeiGetVariable (
> OUT UINTN *Size
> );
>
> +/**
> + Returns the status whether get the large variable success. When variable size
> + is bigger than single UEFI variable size limit, The variable will be saved in
> + multiple UEFI variables. This function retrieves such large variable through the
> + ReadOnlyVariable2 PPI GetVariable().
> + The returned buffer is allocated using AllocatePage() to support > 64KB and this
> + buffer cannot be Free().
> +
> + If Name is NULL, then ASSERT().
> + If Guid is NULL, then ASSERT().
> + If Value is NULL, then ASSERT().
> +
> + @param[in] Name The pointer to a Null-terminated Unicode string.
> + @param[in] Guid The pointer to an EFI_GUID structure
> + @param[out] Value The buffer point saved the variable info.
> + @param[out] Size The buffer size of the variable.
> +
> + @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
> + @return EFI_SUCCESS Find the specified variable.
> + @return Others Errors Return errors from call to gRT->GetVariable.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +PeiGetLargeVariable (
> + IN CHAR16 *Name,
> + IN EFI_GUID *Guid,
> + OUT VOID **Value,
> + OUT UINTN *Size OPTIONAL
> + );
> +
> /**
> Finds the file in any FV and gets file Address and Size
>
> diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
> index 7e740172a0..bd57cf7870 100644
> --- a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
> +++ b/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
> @@ -1,7 +1,7 @@
> ## @file
> # Component information file for Board Init Test Library
> #
> -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> @@ -20,9 +20,11 @@
> PeiServicesLib
> MemoryAllocationLib
> DebugLib
> + LargeVariableReadLib
>
> [Packages]
> MdePkg/MdePkg.dec
> + MinPlatformPkg/MinPlatformPkg.dec
>
> [Sources]
> PeiLib.c
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> index bcb42f0ef9..d6e80a66ce 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> @@ -50,6 +50,7 @@
> gBdsEventBeforeConsoleAfterTrustedConsoleGuid = {0x51e49ff5, 0x28a9, 0x4159, { 0xac, 0x8a, 0xb8, 0xc4, 0x88, 0xa7, 0xfd, 0xee}}
> gBdsEventBeforeConsoleBeforeEndOfDxeGuid = {0xfcf26e41, 0xbda6, 0x4633, { 0xb5, 0x73, 0xd4, 0xb8, 0x0e, 0x6d, 0xd0, 0x78}}
> gBdsEventAfterConsoleReadyBeforeBootOptionGuid = {0x8eb3d5dc, 0xf4e7, 0x4b57, { 0xa9, 0xe7, 0x27, 0x39, 0x10, 0xf2, 0x18, 0x9f}}
> + gFspNvsBufferVariableGuid = {0x9c7715cd, 0x8d66, 0x4d2a, { 0x90, 0x0d, 0x01, 0x45, 0x9a, 0x57, 0x59, 0x6b}}
>
> [LibraryClasses]
>
> --
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob Chiu, Chasel
2021-10-08 13:43 ` Kathappan Esakkithevar
@ 2021-10-11 21:46 ` Nate DeSimone
1 sibling, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Cc: Chaganty, Rangasai V, Kethi Reddy, Deepika,
Esakkithevar, Kathappan
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika
> <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan
> <kathappan.esakkithevar@intel.com>
> Subject: [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use
> same variable name for FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: 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: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++--------
> -----------------------------------------
>
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
> sc | 3 +++
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
> 3 files changed, 19 insertions(+), 52 deletions(-)
>
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index 7dbdfa7c16..9e8606ada9 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> +++ PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -2,7 +2,7 @@
> Implementation of Fsp Misc UPD Initialization. - Copyright (c) 2020, Intel
> Corporation. All rights reserved.<BR>+ Copyright (c) 2020 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-
> Clause-Patent **/ @@ -17,7 +17,6 @@
> #include <FspmUpd.h> #include <FspsUpd.h> -#include
> <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> #include
> <Library/DebugPrintErrorLevelLib.h> #include <Library/PciLib.h>@@ -44,55
> +43,21 @@ PeiFspMiscUpdUpdatePreMem (
> ) { EFI_STATUS Status;- EFI_PEI_READ_ONLY_VARIABLE2_PPI
> *VariableServices;- UINTN VariableSize;- VOID
> *MemorySavedData;-- Status = PeiServicesLocatePpi (-
> &gEfiPeiReadOnlyVariable2PpiGuid,- 0,- NULL,- (VOID **)
> &VariableServices- );- if (EFI_ERROR (Status)) {- ASSERT_EFI_ERROR
> (Status);- return Status;+ UINTN FspNvsBufferSize;+ VOID
> *FspNvsBufferPtr;++ //+ // Initialize S3 Data variable (S3DataPtr). It may be
> used for warm and fast boot paths.+ //+ FspNvsBufferPtr = NULL;+
> FspNvsBufferSize = 0;+ Status = PeiGetLargeVariable (L"FspNvsBuffer",
> &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);+ if
> (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\"
> gFspNvsBufferVariableGuid - %r\n", Status));+ DEBUG ((DEBUG_INFO,
> "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));+ FspmUpd-
> >FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr; } - VariableSize = 0;-
> MemorySavedData = NULL;- Status = VariableServices->GetVariable (-
> VariableServices,- L"MemoryConfig",-
> &gFspNonVolatileStorageHobGuid,- NULL,-
> &VariableSize,- MemorySavedData- );- if
> (Status == EFI_BUFFER_TOO_SMALL) {- MemorySavedData = AllocatePool
> (VariableSize);- if (MemorySavedData == NULL) {- ASSERT
> (MemorySavedData != NULL);- return EFI_OUT_OF_RESOURCES;- }--
> DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));- Status =
> VariableServices->GetVariable (- VariableServices,-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> NULL,- &VariableSize,- MemorySavedData-
> );- if (Status == EFI_SUCCESS) {- FspmUpd->FspmArchUpd.NvsBufferPtr
> = MemorySavedData;- } else {- DEBUG ((DEBUG_ERROR, "Fail to retrieve
> Variable:\"MemoryConfig\" gMemoryConfigVariableGuid, Status = %r\n",
> Status));- ASSERT_EFI_ERROR (Status);- }- }- FspmUpd-
> >FspmArchUpd.NvsBufferPtr = MemorySavedData; return EFI_SUCCESS;
> }diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> index 44a1bd54d6..d63ff263c1 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .dsc
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
> .ds
> +++ c
> @@ -142,6 +142,9 @@
> #######################################
> PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHo
> okLib.inf +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVari
> ableReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> ####################################### # Platform Packagediff -
> -git
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index c842b7eef6..94776603c4 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP
> olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> +++ PolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -2,7 +2,7 @@
> # Provide FSP wrapper platform related function. # #-# Copyright (c) 2020,
> Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2020 - 2021, Intel
> Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-
> Clause-Patent #@@ -82,7 +82,6 @@
> PchInfoLib PchHsioLib PchPcieRpLib- MemoryAllocationLib
> DebugPrintErrorLevelLib SiPolicyLib PchGbeLib@@ -132,7 +131,7 @@
> gCometlakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3
> [Guids]- gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid
> ## CONSUMES gEfiMemoryOverwriteControlDataGuid --
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for FspNvsHob
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use " Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Benjamin Doron
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Benjamin Doron
> <benjamin.doron00@gmail.com>
> Subject: [edk2-platforms: PATCH v3 3/9]
> KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
> FspNvsHob
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Benjamin Doron <benjamin.doron00@gmail.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Li
> brary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24
> ++++++++++--------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/
> PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++-
> -------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Li
> brary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7
> ++++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/
> PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
> 4 files changed, 24 insertions(+), 32 deletions(-)
>
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/
> Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper
> /Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index d8413d284e..a9b7e446c8 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/
> Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper
> /L
> +++ ibrary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -1,7 +1,7 @@
> /** @file Implementation of Fsp Misc UPD Initialization. -Copyright (c) 2017,
> Intel Corporation. All rights reserved.<BR>+Copyright (c) 2017 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-
> Patent **/@@ -11,7 +11,6 @@ SPDX-License-Identifier: BSD-2-Clause-
> Patent
> #include <Library/DebugLib.h> #include <Library/PciLib.h> #include
> <Library/PeiLib.h>- #include <FspEas.h> #include <FspmUpd.h> #include
> <FspsUpd.h>@@ -34,24 +33,21 @@ PeiFspMiscUpdUpdatePreMem (
> { EFI_STATUS Status; UINTN VariableSize;- VOID
> *MemorySavedData;+ VOID *FspNvsBufferPtr; UINT8
> MorControl; VOID *MorControlPtr; // // Initialize S3 Data
> variable (S3DataPtr). It may be used for warm and fast boot paths. //-
> VariableSize = 0;- MemorySavedData = NULL;- Status = PeiGetVariable (-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> &MemorySavedData,- &VariableSize- );- DEBUG ((DEBUG_INFO,
> "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));-
> DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));-
> FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;+
> FspNvsBufferPtr = NULL;+ VariableSize = 0;+ Status = PeiGetLargeVariable
> (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr,
> &VariableSize);+ if (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO,
> "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+
> DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));+
> FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;+ } if
> (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) { //diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Librar
> y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Librar
> y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> index c9dfb17e0a..3764f7c3ac 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Librar
> y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Libra
> +++ ry/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> @@ -431,8 +431,8 @@ SiliconPolicyUpdatePreMem (
> SA_MISC_PEI_PREMEM_CONFIG *MiscPeiPreMemConfig;
> MEMORY_CONFIG_NO_CRC *MemConfigNoCrc; VOID
> *Buffer;- UINTN VariableSize;- VOID
> *MemorySavedData;+ UINTN FspNvsBufferSize;+ VOID
> *FspNvsBufferPtr; UINT8 SpdAddressTable[4];
> DEBUG((DEBUG_INFO, "\nUpdating Policy in Pre-Mem\n"));@@ -463,18
> +463,13 @@ SiliconPolicyUpdatePreMem (
> // Note: AmberLake FSP does not implement the
> FSPM_ARCH_CONFIG_PPI added in FSP 2.1, hence // the platform specific
> S3DataPtr must be used instead. //- VariableSize = 0;-
> MemorySavedData = NULL;- Status = PeiGetVariable (-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> &MemorySavedData,- &VariableSize- );- DEBUG
> ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid -
> %r\n", Status));- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n",
> VariableSize));- if (!EFI_ERROR (Status)) {- MiscPeiPreMemConfig-
> >S3DataPtr = MemorySavedData;+ FspNvsBufferPtr = NULL;+
> FspNvsBufferSize = 0;+ Status = PeiGetLargeVariable (L"FspNvsBuffer",
> &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);+ if
> (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO, "Get
> L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+ DEBUG
> ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));+
> MiscPeiPreMemConfig->S3DataPtr = FspNvsBufferPtr; } //diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/
> Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper
> /Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index e4a657c5f1..eac9344b0a 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/
> Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper
> /L
> +++ ibrary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -1,7 +1,7 @@
> ## @file # Provide FSP wrapper platform related function. #-# Copyright (c)
> 2017 - 2020 Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2017 -
> 2021 Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier:
> BSD-2-Clause-Patent #@@ -74,7 +74,6 @@
> PchInfoLib PchHsioLib PchPcieRpLib- MemoryAllocationLib SiPolicyLib
> PeiLib @@ -134,9 +133,11 @@
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAudioConnector
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid+
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress+
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdRootPort4ClkInfo [Guids]-
> gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid
> ## CONSUMES gEfiMemoryOverwriteControlDataGuid diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Librar
> y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Librar
> y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> index 0a8cf91b07..4dcc000186 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Librar
> y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Libra
> +++ ry/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> @@ -52,7 +52,7 @@
> gHsioPciePreMemConfigGuid ## CONSUMES
> gHsioSataPreMemConfigGuid ## CONSUMES
> gSaMiscPeiPreMemConfigGuid ## CONSUMES-
> gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gIoApicConfigGuid
> ## CONSUMES gHpetPreMemConfigGuid ## CONSUMES
> gLockDownConfigGuid--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use " Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Jeremy Soller
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Jeremy Soller <jeremy@system76.com>
> Subject: [edk2-platforms: PATCH v3 4/9]
> KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for
> FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++-
> -------------
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei
> SiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> | 3 +++
> 3 files changed, 15 insertions(+), 17 deletions(-)
>
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index 9d6c0176f6..2158eb299f 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> +++ PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -1,7 +1,7 @@
> /** @file Implementation of Fsp Misc UPD Initialization. -Copyright (c) 2019,
> Intel Corporation. All rights reserved.<BR>+Copyright (c) 2019 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-
> Patent **/@@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-
> Patent
> #include <FspmUpd.h> #include <FspsUpd.h> -#include
> <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> #include
> <Library/DebugPrintErrorLevelLib.h> #include <Library/PciLib.h>@@ -38,24
> +37,21 @@ PeiFspMiscUpdUpdatePreMem (
> { EFI_STATUS Status; UINTN VariableSize;- VOID
> *MemorySavedData;+ VOID *FspNvsBufferPtr; UINT8
> MorControl; VOID *MorControlPtr; // // Initialize S3 Data
> variable (S3DataPtr). It may be used for warm and fast boot paths. //-
> VariableSize = 0;- MemorySavedData = NULL;- Status = PeiGetVariable (-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> &MemorySavedData,- &VariableSize- );- DEBUG ((DEBUG_INFO,
> "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));-
> DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));-
> FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;+
> FspNvsBufferPtr = NULL;+ VariableSize = 0;+ Status = PeiGetLargeVariable
> (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr,
> &VariableSize);+ if (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO,
> "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+
> DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));+
> FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;+ } if
> (FspmUpd->FspmArchUpd.NvsBufferPtr != NULL) { //diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index 463455c90b..ceefe7639e 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/
> +++ PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -1,7 +1,7 @@
> ## @file # FSP wrapper silicon policy update library. #-# Copyright (c) 2019 -
> 2020 Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2019 - 2021
> Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-
> 2-Clause-Patent #@@ -81,7 +81,6 @@
> PchInfoLib PchHsioLib PchPcieRpLib- MemoryAllocationLib
> CpuMailboxLib DebugPrintErrorLevelLib SiPolicyLib@@ -138,7 +137,7 @@
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid [Guids]-
> gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid
> ## CONSUMES gEfiMemoryOverwriteControlDataGuid diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index 7f276d3512..299c7f18cd 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -141,6 +141,9 @@
>
> PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHo
> okLib.inf
> SiliconPolicyUpdateLib|$(PROJECT)/FspWrapper/Library/PeiSiliconPolicyUpd
> ateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVari
> ableReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> ####################################### # Edk2 Packages--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: " Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms: PATCH v3 5/9]
> KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
> FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25
> ++++++++++---------------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
> onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++---------
> -----
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
> onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
> 4 files changed, 22 insertions(+), 33 deletions(-)
>
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index d8aff1960f..699f4297fa 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> +++ y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -1,7 +1,7 @@
> /** @file Implementation of Fsp Misc UPD Initialization. -Copyright (c) 2017,
> Intel Corporation. All rights reserved.<BR>+Copyright (c) 2017 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-
> Patent **/@@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-
> Patent
> #include <FspmUpd.h> #include <FspsUpd.h> -#include
> <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> #include
> <Library/DebugPrintErrorLevelLib.h> #include <Library/PciLib.h>@@ -38,25
> +37,21 @@ PeiFspMiscUpdUpdatePreMem (
> { EFI_STATUS Status; UINTN VariableSize;- VOID
> *MemorySavedData;+ VOID *FspNvsBufferPtr; UINT8
> MorControl; VOID *MorControlPtr; // // Initialize S3 Data
> variable (S3DataPtr). It may be used for warm and fast boot paths. //-
> VariableSize = 0;- MemorySavedData = NULL;- Status = PeiGetVariable (-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> &MemorySavedData,- &VariableSize- );- DEBUG ((DEBUG_INFO,
> "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid - %r\n", Status));-
> DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize));-
> FspmUpd->FspmArchUpd.NvsBufferPtr = MemorySavedData;-+
> FspNvsBufferPtr = NULL;+ VariableSize = 0;+ Status = PeiGetLargeVariable
> (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr,
> &VariableSize);+ if (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO,
> "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+
> DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize));+
> FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;+ } if (FspmUpd-
> >FspmArchUpd.NvsBufferPtr != NULL) { // // Set the DISB bit in PCH
> (DRAM Initialization Scratchpad Bit - GEN_PMCON_A[23]),diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSil
> iconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi
> liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> index 2dce9be63c..22aadc0221 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSil
> iconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/Pe
> +++ iSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c
> @@ -398,8 +398,8 @@ SiliconPolicyUpdatePreMem (
> SA_MISC_PEI_PREMEM_CONFIG *MiscPeiPreMemConfig;
> MEMORY_CONFIG_NO_CRC *MemConfigNoCrc; VOID
> *Buffer;- UINTN VariableSize;- VOID
> *MemorySavedData;+ UINTN FspNvsBufferSize;+ VOID
> *FspNvsBufferPtr; UINT8 SpdAddressTable[4];
> DEBUG((DEBUG_INFO, "\nUpdating Policy in Pre-Mem\n"));@@ -430,18
> +430,13 @@ SiliconPolicyUpdatePreMem (
> // Note: AmberLake FSP does not implement the
> FSPM_ARCH_CONFIG_PPI added in FSP 2.1, hence // the platform specific
> S3DataPtr must be used instead. //- VariableSize = 0;-
> MemorySavedData = NULL;- Status = PeiGetVariable (-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> &MemorySavedData,- &VariableSize- );- DEBUG
> ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHobGuid -
> %r\n", Status));- DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n",
> VariableSize));- if (!EFI_ERROR (Status)) {- MiscPeiPreMemConfig-
> >S3DataPtr = MemorySavedData;+ FspNvsBufferPtr = NULL;+
> FspNvsBufferSize = 0;+ Status = PeiGetLargeVariable (L"FspNvsBuffer",
> &gFspNvsBufferVariableGuid, &FspNvsBufferPtr, &FspNvsBufferSize);+ if
> (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO, "Get
> L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+ DEBUG
> ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));+
> MiscPeiPreMemConfig->S3DataPtr = FspNvsBufferPtr; } //diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index f8bec0c852..dacec18cd9 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Librar
> +++ y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -1,7 +1,7 @@
> ## @file # Provide FSP wrapper platform related function. #-# Copyright (c)
> 2017 - 2020 Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2017 -
> 2021 Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier:
> BSD-2-Clause-Patent #@@ -80,7 +80,6 @@
> PchInfoLib PchHsioLib PchPcieRpLib- MemoryAllocationLib
> CpuMailboxLib DebugPrintErrorLevelLib SiPolicyLib@@ -141,7 +140,7 @@
> gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid [Guids]-
> gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid
> ## CONSUMES gEfiMemoryOverwriteControlDataGuid diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSil
> iconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi
> liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> index 5c2da68bf9..4b30ba02ea 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSil
> iconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/Pe
> +++ iSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
> @@ -50,7 +50,7 @@
> gHsioPciePreMemConfigGuid ## CONSUMES
> gHsioSataPreMemConfigGuid ## CONSUMES
> gSaMiscPeiPreMemConfigGuid ## CONSUMES-
> gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES [Pcd]
> gSiPkgTokenSpaceGuid.PcdPeiMinMemorySize--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: " Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
2021-10-12 1:33 ` Heng Luo
1 sibling, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Chaganty, Rangasai V, Luo, Heng
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>
> Subject: [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: Use same
> variable name for FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Heng Luo <heng.luo@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInit
> Lib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInit
> Lib/PeiFspPolicyInitLib.inf | 1 +
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> | 3 +++
> 3 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI
> nitLib/PeiFspPolicyInitLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI
> nitLib/PeiFspPolicyInitLib.c
> index fc523e93d1..938b74e5d8 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI
> nitLib/PeiFspPolicyInitLib.c
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPoli
> +++ cyInitLib/PeiFspPolicyInitLib.c
> @@ -9,7 +9,9 @@
> #include <Library/FspWrapperApiLib.h> #include
> <Library/BaseMemoryLib.h> #include
> <Library/MemoryAllocationLib.h>+#include <Library/PeiLib.h> #include
> <Ppi/FspmArchConfigPpi.h>+#include <PolicyUpdateMacro.h> VOID
> EFIAPI@@ -70,9 +72,11 @@ SiliconPolicyDonePreMem(
> ) { EFI_STATUS Status;+ UINTN FspNvsBufferSize;+
> VOID *FspNvsBufferPtr; #if
> FixedPcdGet8(PcdFspModeSelection) == 0- FSPM_ARCH_CONFIG_PPI
> *FspmArchConfigPpi;- EFI_PEI_PPI_DESCRIPTOR
> *FspmArchConfigPpiDesc;+ FSPM_ARCH_CONFIG_PPI
> *FspmArchConfigPpi;+ EFI_PEI_PPI_DESCRIPTOR
> *FspmArchConfigPpiDesc; FspmArchConfigPpi =
> (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof
> (FSPM_ARCH_CONFIG_PPI)); if (FspmArchConfigPpi == NULL) {@@ -80,7
> +84,6 @@ SiliconPolicyDonePreMem(
> return EFI_OUT_OF_RESOURCES; } FspmArchConfigPpi->Revision =
> 1;- FspmArchConfigPpi->NvsBufferPtr = NULL; FspmArchConfigPpi-
> >BootLoaderTolumSize = 0; FspmArchConfigPpiDesc =
> (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof
> (EFI_PEI_PPI_DESCRIPTOR));@@ -98,6 +101,18 @@
> SiliconPolicyDonePreMem(
> ASSERT_EFI_ERROR (Status); #endif + //+ // Initialize S3 Data variable
> (S3DataPtr). It may be used for warm and fast boot paths.+ //+
> FspNvsBufferPtr = NULL;+ FspNvsBufferSize = 0;+ Status =
> PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid,
> &FspNvsBufferPtr, &FspNvsBufferSize);+ if (Status == EFI_SUCCESS) {+
> DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid
> - %r\n", Status));+ DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n",
> FspNvsBufferSize));+ UPDATE_POLICY (((FSPM_UPD *) FspmUpd)-
> >FspmArchUpd.NvsBufferPtr, FspmArchConfigPpi->NvsBufferPtr,
> FspNvsBufferPtr);+ }+ // // Install Policy Ready PPI // While installed, RC
> assumes the Policy is ready and finalized. So pleasediff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI
> nitLib/PeiFspPolicyInitLib.inf
> b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI
> nitLib/PeiFspPolicyInitLib.inf
> index 708fbac08f..0236ae45ae 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI
> nitLib/PeiFspPolicyInitLib.inf
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPoli
> +++ cyInitLib/PeiFspPolicyInitLib.inf
> @@ -181,3 +181,4 @@
> gTianoLogoGuid ## CONSUMES gCnviConfigGuid
> ## CONSUMES gHdAudioPreMemConfigGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMESdiff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> index 1adf634034..451492f984 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.ds
> +++ c
> @@ -142,6 +142,9 @@
>
> GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/Bas
> eGpioCheckConflictLibNull/BaseGpioCheckConflictLibNull.inf !endif
> +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVari
> ableReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> /SecTestPointCheckLib.inf
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib
> Null/TestPointCheckLibNull.inf--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: " Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: Use
> same variable name for FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPo
> licyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---
> ------------------------------------------------
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++---------------------------------------------------
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPo
> licyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/
> PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMa
> pInclude.fdf | 18 +++++++++---------
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
> g.dsc | 3 +++
> 7 files changed, 43 insertions(+), 116 deletions(-)
>
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index a341a58930..ab35bc3f8f 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilic
> +++ onPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -2,7 +2,7 @@
> Implementation of Fsp Misc UPD Initialization. - Copyright (c) 2019, Intel
> Corporation. All rights reserved.<BR>+ Copyright (c) 2019 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-
> Clause-Patent **/ @@ -17,11 +17,9 @@
> #include <FspmUpd.h> #include <FspsUpd.h> -#include
> <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> #include
> <Library/DebugPrintErrorLevelLib.h> #include <Library/PciLib.h>-#include
> <Ppi/ReadOnlyVariable2.h> #include <Guid/MemoryOverwriteControl.h>
> #include <PchAccess.h> @@ -44,55 +42,18 @@
> PeiFspMiscUpdUpdatePreMem (
> ) { EFI_STATUS Status;- EFI_PEI_READ_ONLY_VARIABLE2_PPI
> *VariableServices;- UINTN VariableSize;- VOID
> *MemorySavedData;-- Status = PeiServicesLocatePpi (-
> &gEfiPeiReadOnlyVariable2PpiGuid,- 0,- NULL,- (VOID **)
> &VariableServices- );- if (EFI_ERROR (Status)) {- ASSERT_EFI_ERROR
> (Status);- return Status;- }-- VariableSize = 0;- MemorySavedData = NULL;-
> Status = VariableServices->GetVariable (- VariableServices,-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> NULL,- &VariableSize,- MemorySavedData-
> );- if (Status == EFI_BUFFER_TOO_SMALL) {- MemorySavedData =
> AllocatePool (VariableSize);- if (MemorySavedData == NULL) {- ASSERT
> (MemorySavedData != NULL);- return EFI_OUT_OF_RESOURCES;- }--
> DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));- Status =
> VariableServices->GetVariable (- VariableServices,-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> NULL,- &VariableSize,- MemorySavedData-
> );- if (Status == EFI_SUCCESS) {- FspmUpd->FspmArchUpd.NvsBufferPtr
> = MemorySavedData;- } else {- DEBUG ((DEBUG_ERROR, "Fail to retrieve
> Variable:\"MemoryConfig\" gMemoryConfigVariableGuid, Status = %r\n",
> Status));- ASSERT_EFI_ERROR (Status);- }+ UINTN
> FspNvsBufferSize;+ VOID *FspNvsBufferPtr;++
> FspNvsBufferPtr = NULL;+ FspNvsBufferSize = 0;+ Status =
> PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid,
> &FspNvsBufferPtr, &FspNvsBufferSize);+ if (Status == EFI_SUCCESS) {+
> FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;+ } else {+
> DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does
> not exist (this is likely a first boot)\n"));+ FspmUpd-
> >FspmArchUpd.NvsBufferPtr = NULL; }- FspmUpd-
> >FspmArchUpd.NvsBufferPtr = MemorySavedData; return EFI_SUCCESS;
> }diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> index 145deb5de3..381ef232ea 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y
> +++ /PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
> @@ -2,7 +2,7 @@
> Implementation of Fsp Misc UPD Initialization. - Copyright (c) 2020, Intel
> Corporation. All rights reserved.<BR>+ Copyright (c) 2020 - 2021, Intel
> Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-
> Clause-Patent **/ @@ -18,11 +18,9 @@
> #include <FspmUpd.h> #include <FspsUpd.h> -#include
> <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> #include
> <Library/DebugPrintErrorLevelLib.h> #include <Library/PciLib.h>-#include
> <Ppi/ReadOnlyVariable2.h> #include <Guid/MemoryOverwriteControl.h>
> #include <PchAccess.h> #include <Platform.h>@@ -46,54 +44,17 @@
> PeiFspMiscUpdUpdatePreMem (
> ) { EFI_STATUS Status;- EFI_PEI_READ_ONLY_VARIABLE2_PPI
> *VariableServices;- UINTN VariableSize;- VOID
> *MemorySavedData;-- Status = PeiServicesLocatePpi (-
> &gEfiPeiReadOnlyVariable2PpiGuid,- 0,- NULL,- (VOID **)
> &VariableServices- );- if (EFI_ERROR (Status)) {- ASSERT_EFI_ERROR
> (Status);- return Status;- }-- VariableSize = 0;- MemorySavedData = NULL;-
> Status = VariableServices->GetVariable (- VariableServices,-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> NULL,- &VariableSize,- MemorySavedData-
> );- if (Status == EFI_BUFFER_TOO_SMALL) {- MemorySavedData =
> AllocatePool (VariableSize);- if (MemorySavedData == NULL) {- ASSERT
> (MemorySavedData != NULL);- return EFI_OUT_OF_RESOURCES;- }--
> DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize));- Status =
> VariableServices->GetVariable (- VariableServices,-
> L"MemoryConfig",- &gFspNonVolatileStorageHobGuid,-
> NULL,- &VariableSize,- MemorySavedData-
> );- if (Status == EFI_SUCCESS) {- FspmUpd->FspmArchUpd.NvsBufferPtr
> = MemorySavedData;- } else {- FspmUpd->FspmArchUpd.NvsBufferPtr =
> NULL;- DEBUG ((DEBUG_ERROR, "Fail to retrieve
> Variable:\"MemoryConfig\" gMemoryConfigVariableGuid, Status = %r\n",
> Status));- ASSERT_EFI_ERROR (Status);- }+ UINTN
> FspNvsBufferSize;+ VOID *FspNvsBufferPtr;++
> FspNvsBufferPtr = NULL;+ FspNvsBufferSize = 0;+ Status =
> PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid,
> &FspNvsBufferPtr, &FspNvsBufferSize);+ if (Status == EFI_SUCCESS) {+
> FspmUpd->FspmArchUpd.NvsBufferPtr = FspNvsBufferPtr;+ } else {+
> DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does
> not exist (this is likely a first boot)\n"));+ FspmUpd-
> >FspmArchUpd.NvsBufferPtr = NULL; } FspmUpd->FspmConfig.TsegSize
> = FixedPcdGet32 (PcdTsegSize);diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> PolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> PolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index 2c90d0cb94..362dc2c995 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilicon
> PolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSilic
> +++ onPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -2,7 +2,7 @@
> # Provide FSP wrapper platform related function. # #-# Copyright (c) 2019 -
> 2020 Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2019 - 2021
> Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-
> 2-Clause-Patent #@@ -82,7 +82,6 @@
> PchInfoLib PchHsioLib PchPcieRpLib- MemoryAllocationLib
> DebugPrintErrorLevelLib SiPolicyLib PchGbeLib@@ -132,7 +131,7 @@
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3
> [Guids]- gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid
> ## CONSUMES gEfiMemoryOverwriteControlDataGuid diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> index 529c2f1253..1a664b1327 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Librar
> y
> +++ /PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
> @@ -2,7 +2,7 @@
> # FSP silicon policy updates for the Up Xtreme board. # #-# Copyright (c)
> 2020, Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2020 - 2021,
> Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-
> 2-Clause-Patent #@@ -136,7 +136,7 @@
> gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdBoardBomId [Guids]-
> gFspNonVolatileStorageHobGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid
> ## CONSUMES gEfiMemoryOverwriteControlDataGuid diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/Flash
> MapInclude.fdf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/Flash
> MapInclude.fdf
> index f7aa730ae7..698efce248 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/Flash
> MapInclude.fdf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/Flash
> M
> +++ apInclude.fdf
> @@ -2,7 +2,7 @@
> # Flash map for the UpXtreme Board. # #-# Copyright (c) 2020, Intel
> Corporation. All rights reserved.<BR>+# Copyright (c) 2020 - 2021, Intel
> Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-
> Clause-Patent #@@ -35,16 +35,16 @@ SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize =
> 0x00090000
> SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset =
> 0x00190000 # Flash addr (0xFFAE0000) SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize =
> 0x00190000 # SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset =
> 0x00320000 # Flash addr (0xFFC70000)-SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize =
> 0x00170000 #-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset
> = 0x00490000 # Flash addr (0xFFDE0000)+SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize =
> 0x00160000 #+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset
> = 0x00480000 # Flash addr (0xFFDD0000) SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize = 0x00070000
> #-SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset =
> 0x00500000 # Flash addr (0xFFE50000)+SET
> gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x004F0000 #
> Flash addr (0xFFE40000) SET
> gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize = 0x00050000 #-
> SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset =
> 0x00550000 # Flash addr (0xFFEA0000)+SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset =
> 0x00540000 # Flash addr (0xFFE90000) SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize = 0x000EA000
> #-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset =
> 0x0063A000 # Flash addr (0xFFF8A000)+SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset =
> 0x0062A000 # Flash addr (0xFFF7A000) SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize = 0x00006000
> #-SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset =
> 0x00640000 # Flash addr (0xFFF90000)+SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset =
> 0x00630000 # Flash addr (0xFFF80000) SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize =
> 0x00010000 #-SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset =
> 0x00650000 # Flash addr (0xFFFA0000)-SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize =
> 0x00060000 #+SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset =
> 0x00640000 # Flash addr (0xFFF90000)+SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize =
> 0x00070000 #diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> index ee2aedd978..9d08dc3fe4 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> @@ -142,6 +142,9 @@
> #######################################
> PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHo
> okLib.inf +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVari
> ableReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> ####################################### # Platform Packagediff -
> -git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> index b69cc8deb0..8d25b818ee 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pkg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
> Pk
> +++ g.dsc
> @@ -142,6 +142,9 @@
> #######################################
> PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHo
> okLib.inf +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVari
> ableReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> ####################################### # Platform Package--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
@ 2021-10-11 21:46 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:46 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Oram, Isaac W
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP
> 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly
> and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is
> not found.
>
> Also added PeiGetLargeVariable () to support the scenarios where the
> variable data size is bigger than a single variable size limit.
>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra
> mSave.c | 29 +++++++++++++++++++++++------
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvra
> mSave.inf | 4 +++-
> Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 +
> 3 files changed, 27 insertions(+), 7 deletions(-)
>
> diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> amSave.c
> b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> amSave.c
> index 709c7ad479..01e36cda27 100644
> ---
> a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> amSave.c
> +++
> b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> a
> +++ mSave.c
> @@ -7,6 +7,7 @@
> **/ #include "S3NvramSave.h"+#include
> <Guid/FspNonVolatileStorageHob2.h> #include
> <Library/MemoryAllocationLib.h> #include <Library/LargeVariableReadLib.h>
> #include <Library/LargeVariableWriteLib.h>@@ -80,21 +81,37 @@
> SaveFspNonVolatileStorageHob (
> Status = EFI_SUCCESS; DEBUG ((DEBUG_INFO, "Saving FSP / MRC
> Training Data\n"));- GuidHob = GetFirstGuidHob
> (&gFspNonVolatileStorageHobGuid);+ //+ // Firstly check version2
> FspNvsHob.+ //+ GuidHob = GetFirstGuidHob
> (&gFspNonVolatileStorageHob2Guid); if (GuidHob != NULL) {- HobData =
> GET_GUID_HOB_DATA (GuidHob);- DataSize =
> GET_GUID_HOB_DATA_SIZE (GuidHob);+ HobData = (VOID *) (UINTN)
> ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsDataPtr;+
> DataSize = (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN)
> GuidHob)->NvsDataLength;+ } else {+ //+ // Fall back to version1
> FspNvsHob+ //+ GuidHob = GetFirstGuidHob
> (&gFspNonVolatileStorageHobGuid);+ if (GuidHob != NULL) {+ HobData
> = GET_GUID_HOB_DATA (GuidHob);+ DataSize =
> GET_GUID_HOB_DATA_SIZE (GuidHob);+ }+ }+ if (HobData != NULL) {+
> DEBUG ((DEBUG_INFO, "FspNvsHob.Size: %d\n", DataSize));+ DEBUG
> ((DEBUG_INFO, "FspNvsHob.NvsDataPtr: 0x%x\n", HobData)); if (DataSize
> > 0) { // // Check if the presently saved data is identical to the data
> given by MRC/FSP //- Status = GetLargeVariable (L"FspNvsBuffer",
> &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, NULL);+ Status =
> GetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid,
> &FspNvsBufferSize, NULL); if (Status == EFI_BUFFER_TOO_SMALL) { if
> (FspNvsBufferSize == DataSize) { VariableData = AllocatePool
> (FspNvsBufferSize); if (VariableData != NULL) {- Status =
> GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid,
> &FspNvsBufferSize, VariableData);+ Status = GetLargeVariable
> (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferSize,
> VariableData); if (!EFI_ERROR (Status) && (FspNvsBufferSize ==
> DataSize) && (0 == CompareMem (HobData, VariableData, DataSize))) {
> DataIsIdentical = TRUE; }@@ -105,7 +122,7 @@
> SaveFspNonVolatileStorageHob (
> Status = EFI_SUCCESS; if (!DataIsIdentical) {- Status =
> SetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid,
> TRUE, DataSize, HobData);+ Status = SetLargeVariable (L"FspNvsBuffer",
> &gFspNvsBufferVariableGuid, TRUE, DataSize, HobData);
> ASSERT_EFI_ERROR (Status); DEBUG ((DEBUG_INFO, "Saved size of FSP /
> MRC Training Data: 0x%x\n", DataSize)); } else {diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> amSave.inf
> b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> amSave.inf
> index e62baa24c4..a77125cf44 100644
> ---
> a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> amSave.inf
> +++
> b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3Nvr
> a
> +++ mSave.inf
> @@ -43,7 +43,9 @@
> LargeVariableWriteLib [Guids]- gFspNonVolatileStorageHobGuid #
> CONSUMES+ gFspNonVolatileStorageHobGuid # CONSUMES+
> gFspNonVolatileStorageHob2Guid # CONSUMES+
> gFspNvsBufferVariableGuid # PRODUCES [Pcd]
> gEfiCpRcPkgTokenSpaceGuid.PcdPeiSyshostMemorySizediff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> index dc3dd0e026..87165103bf 100644
> --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> @@ -637,6 +637,7 @@
> [LibraryClasses.Common]
> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.
> inf+ PeiLib|MinPlatformPkg/Library/PeiLib/PeiLib.inf [Components.IA32]
> UefiCpuPkg/SecCore/SecCore.inf--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob Chiu, Chasel
@ 2021-10-11 21:47 ` Nate DeSimone
0 siblings, 0 replies; 25+ messages in thread
From: Nate DeSimone @ 2021-10-11 21:47 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Oram, Isaac W
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Thursday, October 7, 2021 11:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same
> variable name for FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed
> to "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the
> data from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapper
> PlatformLib.c | 35 +++++++++--------------------------
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapper
> PlatformLib.inf | 3 ++-
> 2 files changed, 11 insertions(+), 27 deletions(-)
>
> diff --git
> a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapp
> erPlatformLib.c
> b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapp
> erPlatformLib.c
> index a6196a78b0..95a1f2a33c 100644
> ---
> a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapp
> erPlatformLib.c
> +++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspW
> +++ rapperPlatformLib.c
> @@ -13,7 +13,7 @@
> #include <Library/HobLib.h> #include <Library/MemoryAllocationLib.h>
> #include <Library/LargeVariableReadLib.h>-+#include <Library/PeiLib.h>
> #include <FspmUpd.h> #include <Guid/PlatformInfo.h> #include
> <Ppi/UpiPolicyPpi.h>@@ -24,39 +24,22 @@ GetFspNvsBuffer (
> ) { EFI_STATUS Status;- UINTN FspNvsBufferSize;- VOID
> *FspNvsBufferPtr;+ UINTN FspNvsBufferSize;+ VOID
> *FspNvsBufferPtr; FspNvsBufferPtr = NULL; FspNvsBufferSize = 0;-
> Status = GetLargeVariable (L"FspNvsBuffer",
> &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize, NULL);- if (Status ==
> EFI_BUFFER_TOO_SMALL) {- DEBUG ((DEBUG_INFO, "FspNvsBuffer Size =
> %d\n", FspNvsBufferSize));- FspNvsBufferPtr = AllocateZeroPool
> (FspNvsBufferSize);- if (FspNvsBufferPtr == NULL) {- DEBUG
> ((DEBUG_ERROR, "Error: Cannot create FspNvsBuffer, out of memory!\n"));-
> ASSERT (FALSE);- return NULL;- }- Status = GetLargeVariable
> (L"FspNvsBuffer", &gFspNonVolatileStorageHobGuid, &FspNvsBufferSize,
> FspNvsBufferPtr);- if (EFI_ERROR (Status)) {- DEBUG ((DEBUG_ERROR,
> "Error: Unable to read FspNvsBuffer UEFI variable Status: %r\n", Status));-
> ASSERT_EFI_ERROR (Status);- return NULL;- }-+ Status =
> PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableGuid,
> &FspNvsBufferPtr, &FspNvsBufferSize);+ if (Status == EFI_SUCCESS) {
> return FspNvsBufferPtr;-- } else if (Status == EFI_NOT_FOUND) {- DEBUG
> ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does not exist
> (this is likely a first boot)\n")); } else {- DEBUG ((DEBUG_ERROR, "Error:
> Unable to read FspNvsBuffer UEFI variable Status: %r\n", Status));-
> ASSERT_EFI_ERROR (Status);- }-+ DEBUG ((DEBUG_INFO, "Cannot create
> FSP NVS Buffer, UEFI variable does not exist (this is likely a first boot)\n"));
> return NULL; } ++}+ VOID EFIAPI UpdateFspmUpdData (diff --git
> a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapp
> erPlatformLib.inf
> b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapp
> erPlatformLib.inf
> index 3e80ea670c..6ee15ea55f 100644
> ---
> a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapp
> erPlatformLib.inf
> +++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspW
> +++ rapperPlatformLib.inf
> @@ -58,11 +58,12 @@
> [Guids] gEfiPlatformInfoGuid- gFspNonVolatileStorageHobGuid+
> gFspNvsBufferVariableGuid # CONSUMES [LibraryClasses] PeiServicesLib
> LargeVariableReadLib+ PeiLib [Pcd]
> gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase ## CONSUMES--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
@ 2021-10-12 1:33 ` Heng Luo
1 sibling, 0 replies; 25+ messages in thread
From: Heng Luo @ 2021-10-12 1:33 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Cc: Chaganty, Rangasai V, Desimone, Nathaniel L
Reviewed-by: Heng Luo <heng.luo@intel.com>
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Friday, October 8, 2021 2:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>
> Subject: [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: Use same
> variable name for FspNvsHob.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> To simplify the implementation the variable Name/GUID has been changed to
> "FspNvsBuffer" and gFspNvsBufferVariableGuid regardless it stores the data
> from FSP_NON_VOLATILE_STORAGE_HOB2 or
> FSP_NON_VOLATILE_STORAGE_HOB.
>
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Heng Luo <heng.luo@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/
> PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/
> PeiFspPolicyInitLib.inf | 1 +
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> | 3 +++
> 3 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi
> b/PeiFspPolicyInitLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi
> b/PeiFspPolicyInitLib.c
> index fc523e93d1..938b74e5d8 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi
> b/PeiFspPolicyInitLib.c
> +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPoli
> +++ cyInitLib/PeiFspPolicyInitLib.c
> @@ -9,7 +9,9 @@
> #include <Library/FspWrapperApiLib.h> #include <Library/BaseMemoryLib.h>
> #include <Library/MemoryAllocationLib.h>+#include <Library/PeiLib.h> #include
> <Ppi/FspmArchConfigPpi.h>+#include <PolicyUpdateMacro.h> VOID EFIAPI@@
> -70,9 +72,11 @@ SiliconPolicyDonePreMem(
> ) { EFI_STATUS Status;+ UINTN FspNvsBufferSize;+
> VOID *FspNvsBufferPtr; #if FixedPcdGet8(PcdFspModeSelection) ==
> 0- FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi;-
> EFI_PEI_PPI_DESCRIPTOR *FspmArchConfigPpiDesc;+
> FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi;+ EFI_PEI_PPI_DESCRIPTOR
> *FspmArchConfigPpiDesc; FspmArchConfigPpi = (FSPM_ARCH_CONFIG_PPI *)
> AllocateZeroPool (sizeof (FSPM_ARCH_CONFIG_PPI)); if (FspmArchConfigPpi ==
> NULL) {@@ -80,7 +84,6 @@ SiliconPolicyDonePreMem(
> return EFI_OUT_OF_RESOURCES; } FspmArchConfigPpi->Revision =
> 1;- FspmArchConfigPpi->NvsBufferPtr = NULL; FspmArchConfigPpi-
> >BootLoaderTolumSize = 0; FspmArchConfigPpiDesc =
> (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof
> (EFI_PEI_PPI_DESCRIPTOR));@@ -98,6 +101,18 @@ SiliconPolicyDonePreMem(
> ASSERT_EFI_ERROR (Status); #endif + //+ // Initialize S3 Data variable
> (S3DataPtr). It may be used for warm and fast boot paths.+ //+ FspNvsBufferPtr
> = NULL;+ FspNvsBufferSize = 0;+ Status = PeiGetLargeVariable
> (L"FspNvsBuffer", &gFspNvsBufferVariableGuid, &FspNvsBufferPtr,
> &FspNvsBufferSize);+ if (Status == EFI_SUCCESS) {+ DEBUG ((DEBUG_INFO,
> "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid - %r\n", Status));+ DEBUG
> ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize));+
> UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmArchUpd.NvsBufferPtr,
> FspmArchConfigPpi->NvsBufferPtr, FspNvsBufferPtr);+ }+ // // Install Policy
> Ready PPI // While installed, RC assumes the Policy is ready and finalized. So
> pleasediff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi
> b/PeiFspPolicyInitLib.inf
> b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi
> b/PeiFspPolicyInitLib.inf
> index 708fbac08f..0236ae45ae 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi
> b/PeiFspPolicyInitLib.inf
> +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPoli
> +++ cyInitLib/PeiFspPolicyInitLib.inf
> @@ -181,3 +181,4 @@
> gTianoLogoGuid ## CONSUMES gCnviConfigGuid
> ## CONSUMES gHdAudioPreMemConfigGuid ## CONSUMES+
> gFspNvsBufferVariableGuid ## CONSUMESdiff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> index 1adf634034..451492f984 100644
> --- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> +++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.ds
> +++ c
> @@ -142,6 +142,9 @@
>
> GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/BaseGpi
> oCheckConflictLibNull/BaseGpioCheckConflictLibNull.inf !endif
> +[LibraryClasses.Common.SEC]+
> VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariabl
> eReadLibNull.inf+ [LibraryClasses.IA32.SEC]
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/Sec
> TestPointCheckLib.inf
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull
> /TestPointCheckLibNull.inf--
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (10 preceding siblings ...)
2021-10-11 21:46 ` Nate DeSimone
@ 2021-10-12 1:43 ` Oram, Isaac W
2021-10-14 6:11 ` Chiu, Chasel
12 siblings, 0 replies; 25+ messages in thread
From: Oram, Isaac W @ 2021-10-12 1:43 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io
Cc: Desimone, Nathaniel L, Luo, Heng, Jeremy Soller, Benjamin Doron,
Chaganty, Rangasai V, Kethi Reddy, Deepika,
Esakkithevar, Kathappan, Liming Gao, Dong, Eric
The "VariableReadLib.*BaseVariableReadLibNull.inf" belongs in edk2-platforms\Platform\Intel\MinPlatformPkg\Include\Dsc\CorePeiLib.dsc. The purpose of the common include is so we can make the same change in one place, not every board port DSC file. Board ports should be exceptions to the basic single default answer.
Note it might be nice to split SEC content into separate files. But for now, CorePeiLib.dsc is where this default library class instances for SEC belongs.
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c, lines 47 and 48.
There is a strange whitespace use here. Better to vertically align initialization and add a newline to separate init and use.
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c and PeiLib.h seem to have some trailing whitespace issues. With existing code, not added code, but still, nice to clean up while you are here.
I also found the function description a bit confusing. I would suggest:
/**
This function returns a "large variable". A large variable is stored across multiple
UEFI Variables. This function retrieves the multiple UEFI Variables using
ReadOnlyVariable2 PPI GetVariable().
The function uses AllocatePages () to allocate the buffer.
The buffer is not expected to be freed, as PEI does not support a FreePages ()
functionality.
If Name is NULL, then ASSERT ().
If Guid is NULL, then ASSERT ().
If Value is NULL, then ASSERT ().
@param[in] Name The Unicode UEFI Variable name used to store the large variable.
@param[in] Guid The GUID used to store the large variable
@param[out] Value The buffer point saved the variable info.
@param[out] Size The buffer size of the variable.
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
@return EFI_SUCCESS Found the specified variable.
@return Others Errors Return errors from call to gRT->GetVariable.
**/
I am not sure I like the PeiLib design, but as that is existing, I think that this is a fair extension.
Regards,
Isaac
-----Original Message-----
From: Chiu, Chasel <chasel.chiu@intel.com>
Sent: Thursday, October 7, 2021 11:43 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>; Jeremy Soller <jeremy@system76.com>; Benjamin Doron <benjamin.doron00@gmail.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan <kathappan.esakkithevar@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
V3:
Fix another GCC build failure.
V2:
Fix GCC build failures.
V1:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is not found.
Also added PeiGetLargeVariable () to support the scenarios where the variable data size is bigger than a single variable size limit.
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.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: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Chasel Chiu (9):
MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
FspNvsHob
KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
FspNvsHob.
TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
WhitleySiliconPkg: Use same variable name for FspNvsHob.
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++-------------------------------------------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 ++++++++++---------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c | 39 ++++++++++++++++++++++++++++-----------
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c | 4 ++--
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c | 29 +++++++++++++++++++++++------
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c | 35 +++++++++--------------------------
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7 ++++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 3 +++
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf | 5 ++++-
Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h | 33 ++++++++++++++++++++++++++++++++-
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf | 4 +++-
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 +
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf | 1 +
Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf | 18 +++++++++---------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc | 3 +++
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf | 4 +++-
Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 +
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf | 3 ++-
36 files changed, 321 insertions(+), 304 deletions(-)
--
2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
` (11 preceding siblings ...)
2021-10-12 1:43 ` Oram, Isaac W
@ 2021-10-14 6:11 ` Chiu, Chasel
12 siblings, 0 replies; 25+ messages in thread
From: Chiu, Chasel @ 2021-10-14 6:11 UTC (permalink / raw)
To: devel@edk2.groups.io
Cc: Oram, Isaac W, Desimone, Nathaniel L, Luo, Heng, Jeremy Soller,
Benjamin Doron, Chaganty, Rangasai V, Kethi Reddy, Deepika,
Esakkithevar, Kathappan, Liming Gao, Dong, Eric
Hello,
Thanks for all your valuable feedbacks, I have sent V4 to incorporate all of them, please help to review.
Thanks,
Chasel
> -----Original Message-----
> From: Chiu, Chasel <chasel.chiu@intel.com>
> Sent: Friday, October 8, 2021 2:43 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>; Jeremy
> Soller <jeremy@system76.com>; Benjamin Doron
> <benjamin.doron00@gmail.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Kethi Reddy, Deepika
> <deepika.kethi.reddy@intel.com>; Esakkithevar, Kathappan
> <kathappan.esakkithevar@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
> Subject: [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3
> FSP_NON_VOLATILE_STORAGE_HOB2.
>
> V3:
> Fix another GCC build failure.
>
> V2:
> Fix GCC build failures.
>
> V1:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3678
>
> Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly and
> only search FSP_NON_VOLATILE_STORAGE_HOB when former one is not found.
>
> Also added PeiGetLargeVariable () to support the scenarios where the variable
> data size is bigger than a single variable size limit.
>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Heng Luo <heng.luo@intel.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Cc: Benjamin Doron <benjamin.doron00@gmail.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: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Eric Dong <eric.dong@intel.com>
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
>
> Chasel Chiu (9):
> MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
> CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
> KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
> FspNvsHob
> KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
> KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
> FspNvsHob.
> TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
> WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
> WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
> WhitleySiliconPkg: Use same variable name for FspNvsHob.
>
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyU
> pdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++-----
> --------------------------------------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24
> ++++++++++--------------
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSi
> liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++----------
> ----
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSilic
> onPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++-----
> ---------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSi
> liconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 ++++++++++----
> -----------
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconP
> olicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
>
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC
> onfig.c | 39 ++++++++++++++++++++++++++++--
> ---------
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c
> | 69
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++-
>
> Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.
> c | 4 ++--
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/
> PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy
> UpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++-------
> --------------------------------------------
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSi
> liconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63
> ++++++++++++---------------------------------------------------
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSav
> e.c | 29 +++++++++++++++++++++++------
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlat
> formLib.c | 35 +++++++++--------------------------
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyU
> pdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Librar
> y/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7 ++++---
>
> Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSi
> liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
>
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSilic
> onPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSi
> liconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconP
> olicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
>
> Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC
> onfig.inf | 5 ++++-
> Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h
> | 33 ++++++++++++++++++++++++++++++++-
> Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf
> | 4 +++-
> Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> | 1 +
>
> Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/
> PeiFspPolicyInitLib.inf | 1 +
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy
> UpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSi
> liconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapIncl
> ude.fdf | 18 +++++++++---------
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc
> | 3 +++
>
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.ds
> c | 3 +++
>
> Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSav
> e.inf | 4 +++-
> Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> | 1 +
>
> Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlat
> formLib.inf | 3 ++-
> 36 files changed, 321 insertions(+), 304 deletions(-)
>
> --
> 2.28.0.windows.1
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2021-10-14 6:11 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-08 6:43 [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 1/9] " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob Chiu, Chasel
2021-10-08 13:43 ` Kathappan Esakkithevar
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-12 1:33 ` Heng Luo
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: " Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Chiu, Chasel
2021-10-11 21:46 ` Nate DeSimone
2021-10-08 6:43 ` [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob Chiu, Chasel
2021-10-11 21:47 ` Nate DeSimone
2021-10-08 13:44 ` [edk2-platforms: PATCH v3 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2 Kathappan Esakkithevar
2021-10-11 21:46 ` Nate DeSimone
2021-10-12 1:43 ` Oram, Isaac W
2021-10-14 6:11 ` Chiu, Chasel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox