From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81658+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81658+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675414; cv=none; d=zohomail.com; s=zohoarc; b=OSQ4lCAves77VLxU89eERK3uG+5IzQJTVM/ogj8aw+UQB4Rw2mwWLguNEk+4Gz8WwFNbqnzNjC5PkJXIOWm5qayXiEjeaFHdsa2lD9X+CBHnaZykBz3I05oP3mMF9tw/5zchi/5Jye8FUOuVUOt7LvyKLF1yAr2jAe5LoePqazM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675414; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Opo5AS1Tl/OZDxrBAGMONJW90M9ngFkwSh/xBfKq+yI=; b=hc9GX4Kn4F6oxkASdBFIlP6ZClpOVPm9xuO28K0qUvzvXtGqgtNIiUFBu2S3RztWA45nLMEiHYP64/UbfqVxBwGzfUHchuxTErKtWuHioZYodXFmQGofWloIj4GY6AfX/JzsSdK41dVQtgdtRdFK1oXXbJ69hSDHUps9usdBLIE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81658+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675414430860.6030157031929; Thu, 7 Oct 2021 23:43:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DS77YY1788612xH1H7UzSRs3; Thu, 07 Oct 2021 23:43:34 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.5750.1633675412715734944 for ; Thu, 07 Oct 2021 23:43:33 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945134" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945134" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:32 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544906" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:31 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms: PATCH v3 1/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Date: Fri, 8 Oct 2021 14:43:09 +0800 Message-Id: <20211008064317.1371-2-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: uzzR0jEw6E5fRSOfF6ZWWtQCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675414; bh=5sQ1tkRtRZODNo22+QidwKIdlMCKgmUD/5Img2p2654=; h=Cc:Date:From:Reply-To:Subject:To; b=PNvTZ8nfT3fmRsWbCXN4LEroQ8yN7OGIV4Yyq0INlRNhO14FNBPCDhtoY71NejdV9ot r4blPZPy5bdjNt+J+a/YVv82/Z/gVmuoJCAvrf4T/1y1nxghaIgy6Z1+ZABx5gUazCKCd B8TiEEQ3/KcLiA92rTlU4aB3bFcFRS0jheg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675415246100003 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Liming Gao Cc: Eric Dong Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 --- Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig= .c | 39 ++++++++++++++++++++++++++++----------- Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c = | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++- Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLi= b.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/Save= MemoryConfig.c b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/= SaveMemoryConfig.c index 41ed2550bd..401e02a7a9 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.c @@ -2,7 +2,7 @@ This is the driver that locates the MemoryConfigurationData HOB, if it exists, and saves the data to nvRAM. =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include =20 /** 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 =3D GetFirstGuidHob (&gFspNonVolatileStorageHobGuid); + GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid); if (GuidHob !=3D NULL) { - HobData =3D GET_GUID_HOB_DATA (GuidHob); - DataSize =3D GET_GUID_HOB_DATA_SIZE(GuidHob); + HobData =3D (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN= ) GuidHob)->NvsDataPtr; + DataSize =3D (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHo= b)->NvsDataLength; + } else { + // + // Fall back to version1 FspNvsHob + // + GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHobGuid); + if (GuidHob !=3D NULL) { + HobData =3D GET_GUID_HOB_DATA (GuidHob); + DataSize =3D GET_GUID_HOB_DATA_SIZE (GuidHob); + } + } + + if (HobData !=3D 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 =3D gRT->GetVariable ( - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, + L"FspNvsBuffer", + &gFspNvsBufferVariableGuid, NULL, &BufferSize, VariableData @@ -80,8 +97,8 @@ SaveMemoryConfigEntryPoint ( } =20 Status =3D gRT->GetVariable ( - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, + L"FspNvsBuffer", + &gFspNvsBufferVariableGuid, NULL, &BufferSize, VariableData @@ -90,8 +107,8 @@ SaveMemoryConfigEntryPoint ( =20 if ( (EFI_ERROR(Status)) || BufferSize !=3D DataSize || 0 !=3D Compa= reMem (HobData, VariableData, DataSize)) { Status =3D gRT->SetVariable ( - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, + L"FspNvsBuffer", + &gFspNvsBufferVariableGuid, (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERV= ICE_ACCESS), DataSize, HobData @@ -106,7 +123,7 @@ SaveMemoryConfigEntryPoint ( // Status =3D gBS->LocateProtocol(&gEdkiiVariableLockProtocolGuid, NULL= , (VOID **)&VariableLock); if (!EFI_ERROR(Status)) { - Status =3D VariableLock->RequestToLock(VariableLock, L"MemoryConfi= g", &gFspNonVolatileStorageHobGuid); + Status =3D VariableLock->RequestToLock(VariableLock, L"FspNvsBuffe= r", &gFspNvsBufferVariableGuid); ASSERT_EFI_ERROR(Status); } =20 diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c b/Platfo= rm/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 =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include =20 /** @@ -108,6 +109,72 @@ PeiGetVariable ( return Status; } =20 +/** + Returns the status whether get the large variable success. When variable= size + is bigger than single UEFI variable size limit, The variable will be sav= ed in + multiple UEFI variables. This function retrieves such large variable thr= ough 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->GetVar= iable. + +**/ +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 !=3D NULL); + ASSERT (Guid !=3D NULL); + ASSERT (Value !=3D NULL); + + VariableSize =3D 0; + VariableData =3D NULL; + Status =3D GetLargeVariable (Name, Guid, &VariableSize, NULL); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + VariableData =3D AllocatePages (EFI_SIZE_TO_PAGES (VariableSize)); + if (VariableData =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "Error: Cannot create VariableData, out of memo= ry!\n")); + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } + Status =3D 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 !=3D NULL) { + *Value =3D VariableData; + } + if (Size !=3D NULL) { + *Size =3D VariableSize; + } + return EFI_SUCCESS; + } + return Status; +} + EFI_PEI_FILE_HANDLE InternalGetFfsHandleFromAnyFv ( IN CONST EFI_GUID *NameGuid diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVa= riableReadLib.c b/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/= PeiVariableReadLib.c index 5eeee12a3c..b7885dd6c2 100644 --- a/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableR= eadLib.c +++ b/Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableR= eadLib.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/Save= MemoryConfig.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfi= g/SaveMemoryConfig.inf index 0c8689a6f6..eac0880504 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.inf +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.inf @@ -1,7 +1,7 @@ ### @file # Component information file for SaveMemoryConfig module # -# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -28,6 +28,7 @@ MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFsp2Pkg/IntelFsp2Pkg.dec + MinPlatformPkg/MinPlatformPkg.dec =20 [Sources] SaveMemoryConfig.c @@ -39,6 +40,8 @@ =20 [Guids] gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNonVolatileStorageHob2Guid ## CONSUMES + gFspNvsBufferVariableGuid ## PRODUCES =20 [Depex] gEfiVariableArchProtocolGuid AND diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h b/Platf= orm/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 =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -38,6 +38,37 @@ PeiGetVariable ( OUT UINTN *Size ); =20 +/** + Returns the status whether get the large variable success. When variable= size + is bigger than single UEFI variable size limit, The variable will be sav= ed in + multiple UEFI variables. This function retrieves such large variable thr= ough 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->GetVar= iable. + +**/ +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 =20 diff --git a/Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf b/Plat= form/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.
+# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -20,9 +20,11 @@ PeiServicesLib MemoryAllocationLib DebugLib + LargeVariableReadLib =20 [Packages] MdePkg/MdePkg.dec + MinPlatformPkg/MinPlatformPkg.dec =20 [Sources] PeiLib.c diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/In= tel/MinPlatformPkg/MinPlatformPkg.dec index bcb42f0ef9..d6e80a66ce 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -50,6 +50,7 @@ gBdsEventBeforeConsoleAfterTrustedConsoleGuid =3D {0x51e49ff5, 0x28a9, = 0x4159, { 0xac, 0x8a, 0xb8, 0xc4, 0x88, 0xa7, 0xfd, 0xee}} gBdsEventBeforeConsoleBeforeEndOfDxeGuid =3D {0xfcf26e41, 0xbda6, = 0x4633, { 0xb5, 0x73, 0xd4, 0xb8, 0x0e, 0x6d, 0xd0, 0x78}} gBdsEventAfterConsoleReadyBeforeBootOptionGuid =3D {0x8eb3d5dc, 0xf4e7, = 0x4b57, { 0xa9, 0xe7, 0x27, 0x39, 0x10, 0xf2, 0x18, 0x9f}} + gFspNvsBufferVariableGuid =3D {0x9c7715cd, 0x8d66, = 0x4d2a, { 0x90, 0x0d, 0x01, 0x45, 0x9a, 0x57, 0x59, 0x6b}} =20 [LibraryClasses] =20 --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81658): https://edk2.groups.io/g/devel/message/81658 Mute This Topic: https://groups.io/mt/86164705/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81659+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81659+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675415; cv=none; d=zohomail.com; s=zohoarc; b=bB5SP4MmyFKZu1p262755Kzb9Sp7LkGAQDvYRTCz98VlbHtcNBU/BBRjzAASnBTrknhB/S+a9PAhxqN/xmj4A0tPCVt17m6IDe0reYghp1IgRRA5Y3jt5QiBKRee1vORLINM8A5mhMfcBEqOaPOsmBLpgbrUvAuv6qka2v4Ymbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675415; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wyHXV+9CzuBw+57UmPxsKnmatfdK2aq498AFBF+N2I8=; b=nGEZqxUc2ax/zAhJ5GW/OLfxQXE0gvQEauDWP9SkiOXq9/dkQnAmQDAyC6CxFpBfBPdGdvkMr91ujU7EBpfu6zmQjPsF34+Koa/+6CYbOfJtqwqEmqEnQ83cspyExNqA8sLy8DTT/4ZYrxwdpEKJqqwwY7kT3FwapHKIWxGIPvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81659+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675415234295.6499637326284; Thu, 7 Oct 2021 23:43:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id EKazYY1788612xM4sDptCRW1; Thu, 07 Oct 2021 23:43:34 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.5706.1633675414240225705 for ; Thu, 07 Oct 2021 23:43:34 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945145" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945145" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:33 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544910" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:32 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Rangasai V Chaganty , Deepika Kethi Reddy , Kathappan Esakkithevar Subject: [edk2-devel] [edk2-platforms: PATCH v3 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 14:43:10 +0800 Message-Id: <20211008064317.1371-3-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: AEiu37MEBamyZBqdbgByJxt2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675414; bh=3bkiJvr8QKLgRXiUZy8h+MDoiPVsHxKLYcBP7SyHgbo=; h=Cc:Date:From:Reply-To:Subject:To; b=AYJXL7eiAWI5+6kPWKlixgFhlJG88mVbsjFnaJnaukZCyNkUWcwx1046jtKwddqA2uN AmezUEX+IxAkC7Aew+HjidgslTVL3bEtohr3oToSSxTSVENEgh8t1R5dI4EnnX6TQ/Da6 6jrjGCpGPPGzWurbkG3E1F/EqrPlE0PLbfM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675417323100009 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Rangasai V Chaganty Cc: Deepika Kethi Reddy Cc: Kathappan Esakkithevar Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUp= dateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++------------= ------------------------------------- Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.dsc = | 3 +++ Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUp= dateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++--- 3 files changed, 19 insertions(+), 52 deletions(-) diff --git a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSil= iconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/CometlakeO= penBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUp= dateLib.c index 7dbdfa7c16..9e8606ada9 100644 --- a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPol= icyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPol= icyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -2,7 +2,7 @@ Implementation of Fsp Misc UPD Initialization. =20 =20 - Copyright (c) 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -17,7 +17,6 @@ #include #include =20 -#include #include #include #include @@ -44,55 +43,21 @@ PeiFspMiscUpdUpdatePreMem ( ) { EFI_STATUS Status; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - UINTN VariableSize; - VOID *MemorySavedData; - - Status =3D 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 =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid -= %r\n", Status)); + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize)); + FspmUpd->FspmArchUpd.NvsBufferPtr =3D FspNvsBufferPtr; } =20 - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - MemorySavedData =3D AllocatePool (VariableSize); - if (MemorySavedData =3D=3D NULL) { - ASSERT (MemorySavedData !=3D NULL); - return EFI_OUT_OF_RESOURCES; - } - - DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize)); - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_SUCCESS) { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; - } else { - DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMe= moryConfigVariableGuid, Status =3D %r\n", Status)); - ASSERT_EFI_ERROR (Status); - } - } - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; =20 return EFI_SUCCESS; } diff --git a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPk= g.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/BasePlatformHookL= ib.inf =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] ####################################### # Platform Package diff --git a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSil= iconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/Co= metlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSili= conPolicyUpdateLibFsp.inf index c842b7eef6..94776603c4 100644 --- a/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPol= icyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPol= icyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -2,7 +2,7 @@ # Provide FSP wrapper platform related function. # # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -82,7 +82,6 @@ PchInfoLib PchHsioLib PchPcieRpLib - MemoryAllocationLib DebugPrintErrorLevelLib SiPolicyLib PchGbeLib @@ -132,7 +131,7 @@ gCometlakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3 =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81659): https://edk2.groups.io/g/devel/message/81659 Mute This Topic: https://groups.io/mt/86164706/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81660+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81660+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675416; cv=none; d=zohomail.com; s=zohoarc; b=I9oKsczucPfiunZcpbYqEJKjjv0jSUu7Oo5fZqM4AdMJOtKTFR7W8FkH6dxH0XhZh94z4jpV8zU0TSwATgTjkfhUN35jA79x5ldywNeXa/10tCRYXt0DTwmx/Q7hn0QmwXANmZhCcqF81ABxocMjVbvlcsiEfgYtsJnQwUkRroo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675416; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=XltIIP/eus97hHOwIKM42P/7EzCPW+Vje4RklAG16RE=; b=jx059UTYWhhUQoRGX7nNfF84ucKnlqPfnIfdXj9OkMguzaFKHRDUQz0NkKbT2GIUTzZYhwUbfnyOOvMhERW1YYvDZKiWpMfLOd8CIKtgb/2dK0X5nXJSshXdjBbVj5rsm1kww94Qp+UeUavfMjy5qqabObvaUEZoIFFVhOIczVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81660+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675416546921.9683915256355; Thu, 7 Oct 2021 23:43:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PkyyYY1788612xUCK8bwm5yi; Thu, 07 Oct 2021 23:43:36 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.5706.1633675414240225705 for ; Thu, 07 Oct 2021 23:43:35 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945159" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945159" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:35 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544914" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:33 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Benjamin Doron Subject: [edk2-devel] [edk2-platforms: PATCH v3 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for FspNvsHob Date: Fri, 8 Oct 2021 14:43:11 +0800 Message-Id: <20211008064317.1371-4-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: VFglzAFfdR3KpohHukX5fV5cx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675416; bh=sllOLx+5YaUphTBOpX584ll/VONrF1+9IQefqffd6w8=; h=Cc:Date:From:Reply-To:Subject:To; b=IhBqlNhqtzl0o0Kfov+ev7Y9X/w6LImTswbq1MzTivgvzGx8p42NOpwPuIE2itvLxJP t0oFv/iZ1rm8loMfGh7QQMAfev5CuqcQT12Z1ULeCW+i8wtiMorJs4bvY6A+azKMxuRu8 4pWnzQPeJK/y2YufMaXxjctwnodTQnUI1jU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675417413100013 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Benjamin Doron Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 +++++++++= +-------------- Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++= -------------- Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7 ++++--- Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapp= er/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform= /Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSilicon= PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c index d8413d284e..a9b7e446c8 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -1,7 +1,7 @@ /** @file Implementation of Fsp Misc UPD Initialization. =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -11,7 +11,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include - #include #include #include @@ -34,24 +33,21 @@ PeiFspMiscUpdUpdatePreMem ( { EFI_STATUS Status; UINTN VariableSize; - VOID *MemorySavedData; + VOID *FspNvsBufferPtr; UINT8 MorControl; VOID *MorControlPtr; =20 // // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths. // - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D 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 =3D MemorySavedData; + FspNvsBufferPtr =3D NULL; + VariableSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &VariableSize); + if (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid -= %r\n", Status)); + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize)); + FspmUpd->FspmArchUpd.NvsBufferPtr =3D FspNvsBufferPtr; + } =20 if (FspmUpd->FspmArchUpd.NvsBufferPtr !=3D NULL) { // diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/L= ibrary/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c b/Platform/Int= el/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUp= dateLib/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]; =20 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 a= dded in FSP 2.1, hence // the platform specific S3DataPtr must be used instead. // - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D PeiGetVariable ( - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - &MemorySavedData, - &VariableSize - ); - DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHob= Guid - %r\n", Status)); - DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize)); - if (!EFI_ERROR (Status)) { - MiscPeiPreMemConfig->S3DataPtr =3D MemorySavedData; + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVaria= bleGuid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGu= id - %r\n", Status)); + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize= )); + MiscPeiPreMemConfig->S3DataPtr =3D FspNvsBufferPtr; } =20 // diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapp= er/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/= Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf index e4a657c5f1..eac9344b0a 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -1,7 +1,7 @@ ## @file # Provide FSP wrapper platform related function. # -# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -74,7 +74,6 @@ PchInfoLib PchHsioLib PchPcieRpLib - MemoryAllocationLib SiPolicyLib PeiLib =20 @@ -134,9 +133,11 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdAudioConnector =20 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress + gKabylakeOpenBoardPkgTokenSpaceGuid.PcdRootPort4ClkInfo =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/L= ibrary/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf b/Platform/I= ntel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicy= UpdateLib/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 --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81660): https://edk2.groups.io/g/devel/message/81660 Mute This Topic: https://groups.io/mt/86164707/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81661+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81661+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675418; cv=none; d=zohomail.com; s=zohoarc; b=nJOaDILDoJ1nMxLOw8hqt1u70I9EYEMKEZmsAUGGdm/DdsSo8xLgcTnRktdsIAPgE4kEa1FF8inBLr5Vtsi3XigI838yKgOEKSYufrZLzGOkFK1cA9VVmuQ/VBNEZrKQzcas47PGYTw1I/Og27FZ+M6YtS7CgFwBitEYPuxpCMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675418; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9L9dLpjQPEPCbKMp5fqRIematGOiDuJVNUc/svQnXlw=; b=fwRb/pPKAjNMWI4yNb/ud4IBo1KeyyKGCVUzkzc9X8AO1+S4PACjMaRtHFvDKp0/OCNiirYp8n+XqVEWR6dIsqHemDTTrblT+lrfv+p4X5sQmnb0JHUq+kQusPZl5APf41oLj8+z1FytVuQqrQg+gyOh5UVbYXNB02DoTBYJ2l8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81661+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675418640399.99395705201755; Thu, 7 Oct 2021 23:43:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4EZSYY1788612xFb5qR6HcJn; Thu, 07 Oct 2021 23:43:38 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.5706.1633675414240225705 for ; Thu, 07 Oct 2021 23:43:37 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945177" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945177" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:36 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544923" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:35 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Jeremy Soller Subject: [edk2-devel] [edk2-platforms: PATCH v3 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 14:43:12 +0800 Message-Id: <20211008064317.1371-5-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: J0jQRsf6JygvuJFscoaE5eCyx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675418; bh=x0+cIAuIzf8EQjqDNiGiwd1l/tIm5Q6s1gOCMfHThrw=; h=Cc:Date:From:Reply-To:Subject:To; b=Qn8dCOoc/VQDAIUVqKilOHygoKXwd0TpoxvQmpu/YYtLYPWVRfFWcTyEwOjWBM5KZNG ngpx5Ycy3FZ1GJZvpR4/HBvg3TvlHVaoMulG+3iWxy2EWxn+t1VI0W696IVkPCZNLeoh4 RH90lt3IslCTm6Ae1uYZteWfEnu4bz0OMlM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675419575100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Jeremy Soller Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSilic= onPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++------= -------- Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSilic= onPolicyUpdateLibFsp/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/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/= KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLi= bFsp/PeiFspMiscUpdUpdateLib.c index 9d6c0176f6..2158eb299f 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -1,7 +1,7 @@ /** @file Implementation of Fsp Misc UPD Initialization. =20 -Copyright (c) 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include =20 -#include #include #include #include @@ -38,24 +37,21 @@ PeiFspMiscUpdUpdatePreMem ( { EFI_STATUS Status; UINTN VariableSize; - VOID *MemorySavedData; + VOID *FspNvsBufferPtr; UINT8 MorControl; VOID *MorControlPtr; =20 // // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths. // - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D 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 =3D MemorySavedData; + FspNvsBufferPtr =3D NULL; + VariableSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &VariableSize); + if (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid -= %r\n", Status)); + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize)); + FspmUpd->FspmArchUpd.NvsBufferPtr =3D FspNvsBufferPtr; + } =20 if (FspmUpd->FspmArchUpd.NvsBufferPtr !=3D NULL) { // diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platfor= m/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicy= UpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf index 463455c90b..ceefe7639e 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -1,7 +1,7 @@ ## @file # FSP wrapper silicon policy update library. # -# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -81,7 +81,6 @@ PchInfoLib PchHsioLib PchPcieRpLib - MemoryAllocationLib CpuMailboxLib DebugPrintErrorLevelLib SiPolicyLib @@ -138,7 +137,7 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.ds= c 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/BasePlatformHookL= ib.inf SiliconPolicyUpdateLib|$(PROJECT)/FspWrapper/Library/PeiSiliconPolicyUpd= ateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] ####################################### # Edk2 Packages --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81661): https://edk2.groups.io/g/devel/message/81661 Mute This Topic: https://groups.io/mt/86164708/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81662+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81662+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675419; cv=none; d=zohomail.com; s=zohoarc; b=ShkCmNnAZ9WsCOULVIWJV9u7liqy6r/OT5QRWFJdYaUErRtZUihD6htyj+sDIr1OHWh0PoBSq4ZyIaSzOdgoCLWHFOZu7hZa2tw1K9+NfgcHxvYhgHI+prC4DnCrLKWpWNlJ1g+KCnJrsg4sNq6EPL6i8YqIdP0uEeOOcl9wazw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675419; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mhns86vT9zqBnPdYqnMFyQURpbubX+0yNq7i17FvU5o=; b=ZuPyAUxypyY1V1gEbtAzkshXv7V0QzxnVXTOWZf5ucBcmmyiB3vGJz4GyRwZYqZis2vzdZHdm6E/IjDSS+OwMuVc2CCJPFn8lCRkVcLjMOU/Ucd0gOU/nDLOvDmEm5CNDhG1JKJItj1p95PLTN8jrNrZBxJL7S7HDCjBp/Sbtf4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81662+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675419181106.18531681488173; Thu, 7 Oct 2021 23:43:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id q5z0YY1788612xsjzOvxvDhG; Thu, 07 Oct 2021 23:43:38 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.5516.1633675418339342607 for ; Thu, 07 Oct 2021 23:43:38 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945189" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945189" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:37 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544933" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:36 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v3 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 14:43:13 +0800 Message-Id: <20211008064317.1371-6-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: AiuQaJowGRigwXcDFAKPXbl0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675418; bh=AdlbOReHxB5YNDIBDKvL11RbdxDHACuSCuO4sPsC+b8=; h=Cc:Date:From:Reply-To:Subject:To; b=xBARJgNEhw0n1xHrx+gGj7kQIqGfi9c+5Cqoj2qLFiYUfKaEcOnnJqxYPfz3oaUFFqJ 1lcnf7iz/t8kbJPXfNihxEy8/r7xqLhi2clhjtNGHXe/v7wy/heXwBmtQDlghNax7+LAM v0OrnTazN4DGQ2+1NbVLDoD/aFtxqzWc7wk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675419611100003 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSil= iconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 ++++++++++----= ----------- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilicon= PolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++-----= --------- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSil= iconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++--- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilicon= PolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +- 4 files changed, 22 insertions(+), 33 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Li= brary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Inte= l/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpda= teLibFsp/PeiFspMiscUpdUpdateLib.c index d8aff1960f..699f4297fa 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -1,7 +1,7 @@ /** @file Implementation of Fsp Misc UPD Initialization. =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -16,7 +16,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include =20 -#include #include #include #include @@ -38,25 +37,21 @@ PeiFspMiscUpdUpdatePreMem ( { EFI_STATUS Status; UINTN VariableSize; - VOID *MemorySavedData; + VOID *FspNvsBufferPtr; UINT8 MorControl; VOID *MorControlPtr; =20 // // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths. // - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D 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 =3D MemorySavedData; - + FspNvsBufferPtr =3D NULL; + VariableSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &VariableSize); + if (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGuid -= %r\n", Status)); + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", VariableSize)); + FspmUpd->FspmArchUpd.NvsBufferPtr =3D FspNvsBufferPtr; + } if (FspmUpd->FspmArchUpd.NvsBufferPtr !=3D NULL) { // // Set the DISB bit in PCH (DRAM Initialization Scratchpad Bit - GEN_P= MCON_A[23]), diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Librar= y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c b/Platform/Intel/Ka= bylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/Pe= iSiliconPolicyUpdateLib.c index 2dce9be63c..22aadc0221 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/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]; =20 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 a= dded in FSP 2.1, hence // the platform specific S3DataPtr must be used instead. // - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D PeiGetVariable ( - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - &MemorySavedData, - &VariableSize - ); - DEBUG ((DEBUG_INFO, "Get L\"MemoryConfig\" gFspNonVolatileStorageHob= Guid - %r\n", Status)); - DEBUG ((DEBUG_INFO, "MemoryConfig Size - 0x%x\n", VariableSize)); - if (!EFI_ERROR (Status)) { - MiscPeiPreMemConfig->S3DataPtr =3D MemorySavedData; + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVaria= bleGuid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, "Get L\"FspNvsBuffer\" gFspNvsBufferVariableGu= id - %r\n", Status)); + DEBUG ((DEBUG_INFO, "FspNvsBuffer Size - 0x%x\n", FspNvsBufferSize= )); + MiscPeiPreMemConfig->S3DataPtr =3D FspNvsBufferPtr; } =20 // diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Li= brary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platf= orm/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPo= licyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf index f8bec0c852..dacec18cd9 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -1,7 +1,7 @@ ## @file # Provide FSP wrapper platform related function. # -# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -80,7 +80,6 @@ PchInfoLib PchHsioLib PchPcieRpLib - MemoryAllocationLib CpuMailboxLib DebugPrintErrorLevelLib SiPolicyLib @@ -141,7 +140,7 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGraphicsVbtGuid =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Librar= y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf b/Platform/Intel/= KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/= PeiSiliconPolicyUpdateLib.inf index 5c2da68bf9..4b30ba02ea 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf @@ -50,7 +50,7 @@ gHsioPciePreMemConfigGuid ## CONSUMES gHsioSataPreMemConfigGuid ## CONSUMES gSaMiscPeiPreMemConfigGuid ## CONSUMES - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES =20 [Pcd] gSiPkgTokenSpaceGuid.PcdPeiMinMemorySize --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81662): https://edk2.groups.io/g/devel/message/81662 Mute This Topic: https://groups.io/mt/86164709/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81663+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81663+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675421; cv=none; d=zohomail.com; s=zohoarc; b=A/2VIFsYPoE04wNpxKKt3FoOWHbtl/nz9on/E8LXOyLk4MoLR74q0neEJ6T0vidrl2G+XoapTq24i9+dIY3iw+cngm+MbLA4eUzPYk4wVj1KkaLH5zciFFOSUz6VVESjNBM5jmnRIIKVeIXvWzpDkR/uVkj0+r763nsBVevpPlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675421; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=khFiU5m06fBpZPyftrznWXxZXpcjxa19vTQ3pliutRA=; b=JMt9D5aSqzU7TtCpoBe5SLzHctDDXnfEDPkeR0IDc0vhA09ePDH+kt9UcP1SpkahS3X9zMPkNyJZJw63+UKPtDJufaKkzTxKH57v9UuTzo9LUozWJ9zcKDzRqYrcQ7spDZU06Sa1uzyjbJu+MFWfUwe5F37EnFL2wVumCdpUk58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81663+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675421176151.55102265217693; Thu, 7 Oct 2021 23:43:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id grIpYY1788612xo77RPDSnDW; Thu, 07 Oct 2021 23:43:40 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.5603.1633675420050669559 for ; Thu, 07 Oct 2021 23:43:40 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945199" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945199" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:39 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544937" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:37 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Sai Chaganty , Nate DeSimone , Heng Luo Subject: [edk2-devel] [edk2-platforms: PATCH v3 6/9] TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 14:43:14 +0800 Message-Id: <20211008064317.1371-7-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: DNFIOAcsOdotoqOnVzg5WrQKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675420; bh=Qg3ETfwmA7Bva72DleVgcagnF0R92pOh54nAXldqG9c=; h=Cc:Date:From:Reply-To:Subject:To; b=I9oSHu+rJAImtVgo/cKYUVtG+aqC9W07zpErYkknWNwp7WUMqkHXwySHqVmdzIxWVkI 1+w6VJlik0l+1ozPNG8MI+ldkH/BsnbxB2wesdgO0lnNBVJxaf0qC3KAhr3E/x0mHt7rE LAlTiZ7MsJp/YM3SVY7WqweMTYqm0sTnmlg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675421811100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Nate DeSimone Cc: Heng Luo Signed-off-by: Chasel Chiu Reviewed-by: Heng Luo Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++--- Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLi= b/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/PeiFsp= PolicyInitLib/PeiFspPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/= FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c index fc523e93d1..938b74e5d8 100644 --- a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.c +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.c @@ -9,7 +9,9 @@ #include #include #include +#include #include +#include =20 VOID EFIAPI @@ -70,9 +72,11 @@ SiliconPolicyDonePreMem( ) { EFI_STATUS Status; + UINTN FspNvsBufferSize; + VOID *FspNvsBufferPtr; #if FixedPcdGet8(PcdFspModeSelection) =3D=3D 0 - FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi; - EFI_PEI_PPI_DESCRIPTOR *FspmArchConfigPpiDesc; + FSPM_ARCH_CONFIG_PPI *FspmArchConfigPpi; + EFI_PEI_PPI_DESCRIPTOR *FspmArchConfigPpiDesc; =20 FspmArchConfigPpi =3D (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof = (FSPM_ARCH_CONFIG_PPI)); if (FspmArchConfigPpi =3D=3D NULL) { @@ -80,7 +84,6 @@ SiliconPolicyDonePreMem( return EFI_OUT_OF_RESOURCES; } FspmArchConfigPpi->Revision =3D 1; - FspmArchConfigPpi->NvsBufferPtr =3D NULL; FspmArchConfigPpi->BootLoaderTolumSize =3D 0; =20 FspmArchConfigPpiDesc =3D (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (s= izeof (EFI_PEI_PPI_DESCRIPTOR)); @@ -98,6 +101,18 @@ SiliconPolicyDonePreMem( ASSERT_EFI_ERROR (Status); #endif =20 + // + // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths. + // + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D 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, FspmA= rchConfigPpi->NvsBufferPtr, FspNvsBufferPtr); + } + // // Install Policy Ready PPI // While installed, RC assumes the Policy is ready and finalized. So ple= ase diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFsp= PolicyInitLib/PeiFspPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPk= g/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf index 708fbac08f..0236ae45ae 100644 --- a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.inf +++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyI= nitLib/PeiFspPolicyInitLib.inf @@ -181,3 +181,4 @@ gTianoLogoGuid ## CONSUMES gCnviConfigGuid ## CONSUMES gHdAudioPreMemConfigGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPk= g.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/BaseGpi= oCheckConflictLibNull/BaseGpioCheckConflictLibNull.inf !endif =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/Sec= TestPointCheckLib.inf TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull= /TestPointCheckLibNull.inf --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81663): https://edk2.groups.io/g/devel/message/81663 Mute This Topic: https://groups.io/mt/86164710/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81664+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81664+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675421; cv=none; d=zohomail.com; s=zohoarc; b=Q/NNQOZqSPDqbzfxa0a9iehtOYAfbbMTlcC+RnofQryr6f7opZWvyq9T1GKLPZh8Z+As4eZocYcQcSzwYVUZBRT5PIlMP60DalDU1QqPyx2VVXxRyHSXTnTej1/zpZL6ulKhjmj+E6TrVP1+ZS/68/ilSL2iW/GQQfQ98QZKYX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675421; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=JC1rDEZg9M6TRKWYCk7LadUYMEIiHlasrajKvQ1iOvQ=; b=EuMtIaF+rqWp/gj6irajuZQATKVizdnwuXbfFjyg5fDU0vKG8Q8/hjl0cIK+RnGml3uhee0bd9giTJ5CqEzutaU9OUUq5P7ClW0bPCZmciTSCP+a+E5HOKZSCQUdN5xLbksVjMIU6K0gDoPjqhEUX/kXDn5bhxhUrv5/SqD5FsU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81664+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16336754216911007.6187509873338; Thu, 7 Oct 2021 23:43:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id q5rHYY1788612xCC9QdFhUJ4; Thu, 07 Oct 2021 23:43:41 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.5603.1633675420050669559 for ; Thu, 07 Oct 2021 23:43:40 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945211" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945211" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:39 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544942" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:38 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v3 7/9] WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 14:43:15 +0800 Message-Id: <20211008064317.1371-8-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: y98D4SLDoLdftMU89cXjoAU8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675421; bh=5oSbkbsaDhOj8Oay7zgoWXU6Bz06OfpbGhrbtBdxA3s=; h=Cc:Date:From:Reply-To:Subject:To; b=ZvOLU7k9T0gbx9YV4YryOsDEGmjNHUBA4vNsKqpRJSyOmjonC3gWkDiF9CEsnCKU8u3 scDrCG8dx59gh492iAdOPoWVAaTjJo4/uCEzX34hEZ8TbLMbypd7JXS88NlbWlnSdvRk7 qY8mSQnCPwFfsSuoWjSIHISWb/oEnCbJmsY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675423963100005 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy= UpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---= ------------------------------------------------ Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSili= conPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---= ------------------------------------------------ Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicy= UpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++--- Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSili= conPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++-- Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclud= e.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/PeiS= iliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/Whiskeyl= akeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscU= pdUpdateLib.c index a341a58930..ab35bc3f8f 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -2,7 +2,7 @@ Implementation of Fsp Misc UPD Initialization. =20 =20 - Copyright (c) 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -17,11 +17,9 @@ #include #include =20 -#include #include #include #include -#include #include #include =20 @@ -44,55 +42,18 @@ PeiFspMiscUpdUpdatePreMem ( ) { EFI_STATUS Status; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - UINTN VariableSize; - VOID *MemorySavedData; - - Status =3D PeiServicesLocatePpi ( - &gEfiPeiReadOnlyVariable2PpiGuid, - 0, - NULL, - (VOID **) &VariableServices - ); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - MemorySavedData =3D AllocatePool (VariableSize); - if (MemorySavedData =3D=3D NULL) { - ASSERT (MemorySavedData !=3D NULL); - return EFI_OUT_OF_RESOURCES; - } - - DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize)); - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_SUCCESS) { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; - } else { - DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMe= moryConfigVariableGuid, Status =3D %r\n", Status)); - ASSERT_EFI_ERROR (Status); - } + UINTN FspNvsBufferSize; + VOID *FspNvsBufferPtr; + + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + FspmUpd->FspmArchUpd.NvsBufferPtr =3D 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 =3D NULL; } - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; =20 return EFI_SUCCESS; } diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Lib= rary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel= /WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdate= LibFsp/PeiFspMiscUpdUpdateLib.c index 145deb5de3..381ef232ea 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -2,7 +2,7 @@ Implementation of Fsp Misc UPD Initialization. =20 =20 - Copyright (c) 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -18,11 +18,9 @@ #include #include =20 -#include #include #include #include -#include #include #include #include @@ -46,54 +44,17 @@ PeiFspMiscUpdUpdatePreMem ( ) { EFI_STATUS Status; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - UINTN VariableSize; - VOID *MemorySavedData; - - Status =3D PeiServicesLocatePpi ( - &gEfiPeiReadOnlyVariable2PpiGuid, - 0, - NULL, - (VOID **) &VariableServices - ); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - MemorySavedData =3D AllocatePool (VariableSize); - if (MemorySavedData =3D=3D NULL) { - ASSERT (MemorySavedData !=3D NULL); - return EFI_OUT_OF_RESOURCES; - } - - DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize)); - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_SUCCESS) { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; - } else { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D NULL; - DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMe= moryConfigVariableGuid, Status =3D %r\n", Status)); - ASSERT_EFI_ERROR (Status); - } + UINTN FspNvsBufferSize; + VOID *FspNvsBufferPtr; + + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + FspmUpd->FspmArchUpd.NvsBufferPtr =3D 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 =3D NULL; } =20 FspmUpd->FspmConfig.TsegSize =3D FixedPcdGet32 (PcdTsegSize= ); diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiS= iliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/= WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/Pei= SiliconPolicyUpdateLibFsp.inf index 2c90d0cb94..362dc2c995 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -2,7 +2,7 @@ # Provide FSP wrapper platform related function. # # -# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -82,7 +82,6 @@ PchInfoLib PchHsioLib PchPcieRpLib - MemoryAllocationLib DebugPrintErrorLevelLib SiPolicyLib PchGbeLib @@ -132,7 +131,7 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3 =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Lib= rary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platfo= rm/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPoli= cyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf index 529c2f1253..1a664b1327 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -2,7 +2,7 @@ # FSP silicon policy updates for the Up Xtreme board. # # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -136,7 +136,7 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdBoardBomId =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/Fl= ashMapInclude.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include= /Fdf/FlashMapInclude.fdf index f7aa730ae7..698efce248 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapI= nclude.fdf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapI= nclude.fdf @@ -2,7 +2,7 @@ # Flash map for the UpXtreme Board. # # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -35,16 +35,16 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize = =3D 0x00090000 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset =3D 0x= 00190000 # Flash addr (0xFFAE0000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize =3D 0x= 00190000 # SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset =3D 0x= 00320000 # Flash addr (0xFFC70000) -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize =3D 0x= 00170000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset =3D 0x= 00490000 # Flash addr (0xFFDE0000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize =3D 0x= 00160000 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset =3D 0x= 00480000 # Flash addr (0xFFDD0000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize =3D 0x= 00070000 # -SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset =3D 0x= 00500000 # Flash addr (0xFFE50000) +SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset =3D 0x= 004F0000 # Flash addr (0xFFE40000) SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize =3D 0x= 00050000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset =3D 0x= 00550000 # Flash addr (0xFFEA0000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset =3D 0x= 00540000 # Flash addr (0xFFE90000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize =3D 0x= 000EA000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset =3D 0x= 0063A000 # Flash addr (0xFFF8A000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset =3D 0x= 0062A000 # Flash addr (0xFFF7A000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize =3D 0x= 00006000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset =3D 0x= 00640000 # Flash addr (0xFFF90000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset =3D 0x= 00630000 # Flash addr (0xFFF80000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize =3D 0x= 00010000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset =3D 0x= 00650000 # Flash addr (0xFFFA0000) -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize =3D 0x= 00060000 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset =3D 0x= 00640000 # Flash addr (0xFFF90000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize =3D 0x= 00070000 # diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.d= sc 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/BasePlatformHookL= ib.inf =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] ####################################### # Platform Package diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoa= rdPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoar= dPkg.dsc index b69cc8deb0..8d25b818ee 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc @@ -142,6 +142,9 @@ ####################################### PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookL= ib.inf =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] ####################################### # Platform Package --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81664): https://edk2.groups.io/g/devel/message/81664 Mute This Topic: https://groups.io/mt/86164711/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81665+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81665+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675422; cv=none; d=zohomail.com; s=zohoarc; b=X2cOG8cXSU6Isen89KaZrhDduHGiwTaiodIDs7vkyq3RRfEcbBRbu+XDmrZOTIbT29iclRAzSJ4+LY0/nc6EMjJuYE7Zxl/bhAWahyy+TTssXpaIvZ9oVL2Jt98dM7+eTrVEwi+j+yE9w3kdNFQcqGN+QjLRiQ6ONxf4H4iS7Go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675422; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=L7Ug6MUniMXE/CLyO5Y3Gk87ohcMF/gn8Syc2XwcoEg=; b=Ev1hzS48nFn4MMxZ1RyCl60yXL1fkctMfd5JYlHG71JecZ5AHuqDxOmUcKMyaeXKd72Ql40P/kuII0BgpqX+6RnLrb27jJg07lT66faGvlupoa1852V2/Ksnb5lsyli9JSAsv3CPd1/9peibAgW8PExEE/BEnj4qqgmgN4ckYPs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81665+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675422623691.7992554318862; Thu, 7 Oct 2021 23:43:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id sHRpYY1788612xUiyMDK5et0; Thu, 07 Oct 2021 23:43:42 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.5603.1633675420050669559 for ; Thu, 07 Oct 2021 23:43:41 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945220" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945220" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:41 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544950" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:39 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Isaac Oram , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v3 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Date: Fri, 8 Oct 2021 14:43:16 +0800 Message-Id: <20211008064317.1371-9-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: TjFYY3zZM944cstSLrVRQVOGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675422; bh=QWkBA/2lbrVkrRVnZtNOin66Yu0/fKOsl6B5LL5u3Oc=; h=Cc:Date:From:Reply-To:Subject:To; b=LD9VP2NbPI1AoWSz1R/uJoljfwS4NE7kzaN1BPADqILiMAM4/HC6EYjTS7yysRasyWd aNuc1Mon8mjJCiWnXsE8F5YOTXxzjw0RKwSfxW4FjyXA7tK39Fhg6J8oz6DVjc1XniVfG /T6Mfu2qiAUsTfWSJZrW5lUdQwpE/+wsyrY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675424000100008 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Nate DeSimone Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c = | 29 +++++++++++++++++++++++------ Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.in= f | 4 +++- Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc = | 1 + 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3= NvramSave.c b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S= 3NvramSave.c index 709c7ad479..01e36cda27 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSa= ve.c +++ b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSa= ve.c @@ -7,6 +7,7 @@ **/ =20 #include "S3NvramSave.h" +#include #include #include #include @@ -80,21 +81,37 @@ SaveFspNonVolatileStorageHob ( Status =3D EFI_SUCCESS; =20 DEBUG ((DEBUG_INFO, "Saving FSP / MRC Training Data\n")); - GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHobGuid); + // + // Firstly check version2 FspNvsHob. + // + GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid); if (GuidHob !=3D NULL) { - HobData =3D GET_GUID_HOB_DATA (GuidHob); - DataSize =3D GET_GUID_HOB_DATA_SIZE (GuidHob); + HobData =3D (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN= ) GuidHob)->NvsDataPtr; + DataSize =3D (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHo= b)->NvsDataLength; + } else { + // + // Fall back to version1 FspNvsHob + // + GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHobGuid); + if (GuidHob !=3D NULL) { + HobData =3D GET_GUID_HOB_DATA (GuidHob); + DataSize =3D GET_GUID_HOB_DATA_SIZE (GuidHob); + } + } + if (HobData !=3D NULL) { + DEBUG ((DEBUG_INFO, "FspNvsHob.Size: %d\n", DataSize)); + DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataPtr: 0x%x\n", HobData)); if (DataSize > 0) { =20 // // Check if the presently saved data is identical to the data given = by MRC/FSP // - Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorag= eHobGuid, &FspNvsBufferSize, NULL); + Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariable= Guid, &FspNvsBufferSize, NULL); if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { if (FspNvsBufferSize =3D=3D DataSize) { VariableData =3D AllocatePool (FspNvsBufferSize); if (VariableData !=3D NULL) { - Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatile= StorageHobGuid, &FspNvsBufferSize, VariableData); + Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVa= riableGuid, &FspNvsBufferSize, VariableData); if (!EFI_ERROR (Status) && (FspNvsBufferSize =3D=3D DataSize) = && (0 =3D=3D CompareMem (HobData, VariableData, DataSize))) { DataIsIdentical =3D TRUE; } @@ -105,7 +122,7 @@ SaveFspNonVolatileStorageHob ( Status =3D EFI_SUCCESS; =20 if (!DataIsIdentical) { - Status =3D SetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStor= ageHobGuid, TRUE, DataSize, HobData); + Status =3D SetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariab= leGuid, 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/S3= NvramSave.inf b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave= /S3NvramSave.inf index e62baa24c4..a77125cf44 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSa= ve.inf +++ b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSa= ve.inf @@ -43,7 +43,9 @@ LargeVariableWriteLib =20 [Guids] - gFspNonVolatileStorageHobGuid # CONSUMES + gFspNonVolatileStorageHobGuid # CONSUMES + gFspNonVolatileStorageHob2Guid # CONSUMES + gFspNvsBufferVariableGuid # PRODUCES =20 [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 @@ =20 [LibraryClasses.Common] DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + PeiLib|MinPlatformPkg/Library/PeiLib/PeiLib.inf =20 [Components.IA32] UefiCpuPkg/SecCore/SecCore.inf --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81665): https://edk2.groups.io/g/devel/message/81665 Mute This Topic: https://groups.io/mt/86164712/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 09:40:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81666+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81666+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633675424; cv=none; d=zohomail.com; s=zohoarc; b=MkOIYker3mKBfk32ojljHmStDX4+pL7JjrcWVOTSuOn9QPwu+9aLsTib2XdH9gwyS3OmkTrdfDziBrKTyToPTkoH1FAhqM8KlupoQplglNYaqQFd3siAakyBuCAZDRRPLFX3ipXPWCCuka+yXE8gIyPo1O9F8lY4zbkr8NJoQoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633675424; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=dGUoPiBthzUKb9Lbt/Z1zMm3m07lhwHGNfapkg2Iolw=; b=UswUSzzlMHrxwzUQqsGZwOGxUyBBwhvBXvp2X92pZVBOdUgwW/Ysu7wR7uQmIOJli0PSsQK56DRg7sxDrXgnCAPybzrzJp7Y9xMrNfu1YptjMN22ldYukgJl7fgEVUbcOYBF4ECESS4ZLpdr3MZ2xBg1mtUBw1kk3xn1aG/WPv0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81666+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633675424544710.2503866968848; Thu, 7 Oct 2021 23:43:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6kq6YY1788612xOLNzzgqDTR; Thu, 07 Oct 2021 23:43:44 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.5603.1633675420050669559 for ; Thu, 07 Oct 2021 23:43:43 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289945240" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="289945240" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:42 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="440544956" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:43:41 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Isaac Oram , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v3 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 14:43:17 +0800 Message-Id: <20211008064317.1371-10-chasel.chiu@intel.com> In-Reply-To: <20211008064317.1371-1-chasel.chiu@intel.com> References: <20211008064317.1371-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: NCSfS38vnLNVuEKg70rM4y7Hx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633675424; bh=HfQJvD/vAv4s1YtKclSgq88ouu7k0abAlXTfgjZy2C0=; h=Cc:Date:From:Reply-To:Subject:To; b=lbTXsOBL+WyOgk4wrFsflht+tFioY0yLLBZs7lURj+gpkyFguz6d6rI1VguuNgkoJ6i 4Mg9+2NIaJ1h0RBIPMsWhLfaqt8tGdKfmGgw0dLuvHoCSHM0+r0skqc5frOpJgwsy7dDt FPG8n71nokGmzjzOEDQ56SxC2bvVU0G3tEo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633675426230100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3678 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 Cc: Nate DeSimone Signed-off-by: Chasel Chiu Reviewed-by: Kathappan Esakkithevar =20 Reviewed-by: Nate DeSimone --- Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPl= atformLib.c | 35 +++++++++-------------------------- Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPl= atformLib.inf | 3 ++- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/= FspWrapperPlatformLib.c b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrappe= rPlatformLib/FspWrapperPlatformLib.c index a6196a78b0..95a1f2a33c 100644 --- a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap= perPlatformLib.c +++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap= perPlatformLib.c @@ -13,7 +13,7 @@ #include #include #include - +#include #include #include #include @@ -24,39 +24,22 @@ GetFspNvsBuffer ( ) { EFI_STATUS Status; - UINTN FspNvsBufferSize; - VOID *FspNvsBufferPtr; + UINTN FspNvsBufferSize; + VOID *FspNvsBufferPtr; =20 FspNvsBufferPtr =3D NULL; FspNvsBufferSize =3D 0; - Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHob= Guid, &FspNvsBufferSize, NULL); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - DEBUG ((DEBUG_INFO, "FspNvsBuffer Size =3D %d\n", FspNvsBufferSize)); - FspNvsBufferPtr =3D AllocateZeroPool (FspNvsBufferSize); - if (FspNvsBufferPtr =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "Error: Cannot create FspNvsBuffer, out of memo= ry!\n")); - ASSERT (FALSE); - return NULL; - } - Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageH= obGuid, &FspNvsBufferSize, FspNvsBufferPtr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Error: Unable to read FspNvsBuffer UEFI variab= le Status: %r\n", Status)); - ASSERT_EFI_ERROR (Status); - return NULL; - } - + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { return FspNvsBufferPtr; - - } else if (Status =3D=3D 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; } =20 + +} + VOID EFIAPI UpdateFspmUpdData ( diff --git a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/= FspWrapperPlatformLib.inf b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrap= perPlatformLib/FspWrapperPlatformLib.inf index 3e80ea670c..6ee15ea55f 100644 --- a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap= perPlatformLib.inf +++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap= perPlatformLib.inf @@ -58,11 +58,12 @@ =20 [Guids] gEfiPlatformInfoGuid - gFspNonVolatileStorageHobGuid + gFspNvsBufferVariableGuid # CONSUMES =20 [LibraryClasses] PeiServicesLib LargeVariableReadLib + PeiLib =20 [Pcd] gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase ## CONSUMES --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81666): https://edk2.groups.io/g/devel/message/81666 Mute This Topic: https://groups.io/mt/86164713/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-