From nobody Thu Mar 28 09:26:39 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+81627+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+81627+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660765; cv=none; d=zohomail.com; s=zohoarc; b=lIpij4fBFHJvVaYEhkHLnHz4186Q+Qo7vZKOMofWxnj6ywrqE//t7XNB1sVjXRwji8s1fn/9u3hmJHzWwLe/IlDod+AxH2fsJ4081OtNZCeYhZYXVToSp3NAeveyAGxRM72M6i7suMtkmPxYjbmEmLrNzCQQd+u83Nxv6+vD6cI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660765; 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=KO/pH/OEGkjLvpaRLinngtg3T69EzgmX5eys8wWktUY=; b=AobE+6TueaszRjxWrUHhNvqxezGbQY0Afv9w0X6OoQ0bh22cco3NiRAWPpaUCm38MVlIoWAnYbZBExyx89cGB79v8ZcGo1+36K0x6kxuxltFcAZy3HFQi2w7Pi7UUYvgUG1TsDLh/78ExyLjr6fs+stxHjetIYE2Z5k1XautpAQ= 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+81627+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 1633660765782810.626976889557; Thu, 7 Oct 2021 19:39:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cZ1HYY1788612xZaJS6i9N1U; Thu, 07 Oct 2021 19:39:25 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:24 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301014" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301014" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:23 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644410" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:22 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms: PATCH 1/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Date: Fri, 8 Oct 2021 10:38:54 +0800 Message-Id: <20211008023902.1066-2-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: 7FXrRmdLmQ3RhkDd0ojs5pn3x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660765; bh=jwDpvu+4QK1K9xx74EBO9urO+ddREMmtESnxPjM4jYg=; h=Cc:Date:From:Reply-To:Subject:To; b=oqBGQId2lDZb7GKU5LzWMTHX0PQ6NGuuTNNjPfWo1IKwva3/JyZivfXn21Eb36qGzq1 ppAqx7La+rzGg6JPkllIkwvOEJa9tj/0qBIU5fAa2wyqv1m/XB2nzHTWLZbyjUpGjRfNv ouaxE6a7/hxpqrQ6o9svU9rNHsezukrBl44= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660767108100005 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 --- Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig= .c | 39 ++++++++++++++++++++++++++++----------- Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c = | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++- 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 + 6 files changed, 136 insertions(+), 15 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/Save= MemoryConfig.c b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/= SaveMemoryConfig.c index 41ed2550bd..92a0fe56f5 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 *) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHo= b)->NvsDataPtr; + DataSize =3D ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsD= ataLength; + } 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/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 (#81627): https://edk2.groups.io/g/devel/message/81627 Mute This Topic: https://groups.io/mt/86161918/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 Thu Mar 28 09:26:39 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+81628+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+81628+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660767; cv=none; d=zohomail.com; s=zohoarc; b=WNgYCsqawa3MT1zUyGj9WlYeUoUn5CWdEngRiLjymZeQ+FH77sdQSgMstHdoZSFHRHfXCRGDDylhyCIxWxb/QOQMuZS4SfsL5MNY29qAlB8SL1jJlivtnpJlV20ywzksBMiuZG97SZ5SVmxQzLFpCBnYW96A65x1E6pNO42Da3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660767; 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=/aqBdh7UsU0mT+BnPqFpBqLLkXlHe+wXIY5i41/QQBM=; b=ZI8VcGwuORz0WXT2vX858Vmr90tw8g7sjv5G1U9f+Q9WP6zd2/mZQ9XomjHKeXQnk73JanxrntT81Uc+TUgS2ite5+dx48BnI201nb9RkSHJU88AES3E4SoCy1p2EHf33QfDSdqwZmQgTDSQYKlByLQHDb4XwXimgYS7rKtWiuI= 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+81628+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 1633660767527957.028791366705; Thu, 7 Oct 2021 19:39:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id f5D4YY1788612xstTwKbY2B7; Thu, 07 Oct 2021 19:39:27 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:26 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301028" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301028" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:25 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644422" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:24 -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 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 10:38:55 +0800 Message-Id: <20211008023902.1066-3-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: mLTgPU2APdxbTFQWTZJIMFdpx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660767; bh=AqC9dsgidENt4mJkuxSFa+z1fAzJ6lPi3t4C2qagHZE=; h=Cc:Date:From:Reply-To:Subject:To; b=IpCPLRagIifrqXda1BohTCG3hnw4fOK74J9l5xt+JjX6AFbIty9xNmoDZ2h9jckqNuo W/rh/+Tu2dYS9JDzFSRAZVWELB8GmxY5WjKlV3ltOZYrMzmwz9iwi1sb39tGKNMhRyeIS myfjZlq1DVJT6+bcc7/EfnFIFh/EbtNGQh4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660769110100010 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 --- 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 (#81628): https://edk2.groups.io/g/devel/message/81628 Mute This Topic: https://groups.io/mt/86161919/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 Thu Mar 28 09:26:39 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+81629+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+81629+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660768; cv=none; d=zohomail.com; s=zohoarc; b=l7sNlZAL+gIei33EAKa2FBLXoNVLgMV4b/BcKbgN7gj8M1XTGHSoo56vmY1eRlvmOXfyR2LMYEG6EhLMujfx9zA8ph3qtKGOO1YI97vz6uxH9lXywXvjcHQQRSNrp3GJFz9V7e4r9eVloAIFe2GwYOMn+pAa9tAF38pnY5T7DcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660768; 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=LFK7HN2kRcRHyqQ3GkjzLTJBkOP/+jV5mjGKaflGI/0=; b=igpMGX9exD3TY0k03Ds3P8c0W3W6NkxxhgNm9/ziRlVWfMg/QdGpzzWaA4LmBAokrPrO7p3dLzB6TfdDNZ0/RcIP8udwleSi77dR/yO+wTAkoqy+Yd+EoMfOGgdsMnEoMGbC8k+6rdeu4h1LJOr71ZcnQfkOqS4xV/PYvos/PqM= 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+81629+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 1633660768127501.55599943425625; Thu, 7 Oct 2021 19:39:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UVNkYY1788612xqjeAecz87K; Thu, 07 Oct 2021 19:39:27 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:27 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301039" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301039" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:26 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644439" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:25 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Benjamin Doron Subject: [edk2-devel] [edk2-platforms: PATCH 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for FspNvsHob Date: Fri, 8 Oct 2021 10:38:56 +0800 Message-Id: <20211008023902.1066-4-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: u60Z5whVlY0gm30RgpGRbnqOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660767; bh=nN6ORIbNm/lVJ6nay1J6HvoqzNULNYUB+cq78/kB+GU=; h=Cc:Date:From:Reply-To:Subject:To; b=IFaUGPCAWWby/vD6tzxlzV2GhciqLOPHU8wyRa7xVf1uzCMjqTp5PGfjAggv9GbJKlL VGhJTQl+rjWoA0jAFNsqWNXJLUABOMQvMeD410o6NG0R4hgbzp4hle6Bv5Q4FHTbUYxX1 7Zw7W8SI5f5w3z0BQco8dgAQDhfYHgWeV+Q= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660769141100011 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 --- 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 (#81629): https://edk2.groups.io/g/devel/message/81629 Mute This Topic: https://groups.io/mt/86161921/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 Thu Mar 28 09:26:39 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+81630+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+81630+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660769; cv=none; d=zohomail.com; s=zohoarc; b=bYO0rwxEJdvBM6LAHaq4C4nScqDOSZD/nlZfPBLdQrKJFIJBRfXtDHeOQAepo/z6iNKizrzwG+3B3/ilgJPnBkGgQB7voCcpTz5cJqQeFJ0ebJGxt8ryiJygaquQsst+KVXKeWxM6l5Ya0inma6g9iL2QwAiWCdwJrTuuPctOUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660769; 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=KMdGmlsZQQNkmInno5iO5Xu1gIKU12o7Uto5oWiCnbw=; b=JEJ8XkVMWAHsws+CGPzFzIuaUqRNL8fKo3uBvFjEb2MZnfIrV+d44Y+qsNhJw/CRUKKLXNaZHnqRQMSlnL4sft6edbtbGO1sqKoEF2ki4pQgObd55NDR1MkOUKf57uUQpCDMKvRy6ejhOB9zt3bSk14NNW9Qy5mNaYjWWvGg/W0= 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+81630+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 1633660769392462.6569591218903; Thu, 7 Oct 2021 19:39:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qsbDYY1788612xRQzNfIe5KE; Thu, 07 Oct 2021 19:39:29 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:28 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301055" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301055" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:28 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644448" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:27 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Jeremy Soller Subject: [edk2-devel] [edk2-platforms: PATCH 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 10:38:57 +0800 Message-Id: <20211008023902.1066-5-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: kg78y8ZOd7WMjVJ3fwUs5FPfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660769; bh=H0T/FVyk2jZfX0Aj0FC+myVIx2JMiPuVSTRMK/O1cxM=; h=Cc:Date:From:Reply-To:Subject:To; b=Y2JfIQZ7KsAl4ij/PN+5GviUaQYZkA2zXL9Tp+bvyjjjG0oJjz+0u5arPWZQXtPBrZn jHMPZGe+V+luNvDaSG15DDloKNT6ky3nA0IzBjnPdImffydfyM9deJ0YwF1n30vJCAHbN sbt+ndN6yB0wOg1WrrdJyIcbSZnDaDnraoE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660771290100017 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 --- 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 (#81630): https://edk2.groups.io/g/devel/message/81630 Mute This Topic: https://groups.io/mt/86161922/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 Thu Mar 28 09:26:39 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+81631+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+81631+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660771; cv=none; d=zohomail.com; s=zohoarc; b=D1UqnZV4Ixh7GXjCdZPbHhoeu9UoB4haTkgDQrbo3cu133JFf0X6xBx1okr+Ul4sNjcif1/bzyw6+1DSsCHlYWs/sIYFboy1Inf8QQmsDTuSrzxV7th6r+mH15uFj/EB+OG5OW11GdWoTzRKmfZ2IKE1tXRGtKgCGJtFFtH193U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660771; 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=c7pjJxO4MDI411ScUYwTpoP9B0fKqQTVBizQp7CfHXs=; b=Qzmvaj2sCXbyc39+sU4YLqPcfLIIUFLOBfewZQR7sp5EqkCXHeTSpKJ0Mq6it56cFPRXZ8PEtuT9TvXaxgQ2Umzph+7UUnHd9L89nTWczpUEWnzVEhnoV5mpQq5KYxJLQMiMaE72y3ehSNX2VvlOvT6mw/8YbbWHISeDjRVjUCc= 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+81631+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 1633660771282144.20074512576105; Thu, 7 Oct 2021 19:39:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bbAiYY1788612xxTJoOX3EQc; Thu, 07 Oct 2021 19:39:30 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:30 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301070" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301070" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:29 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644463" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:28 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 10:38:58 +0800 Message-Id: <20211008023902.1066-6-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: OqTf0nYcassXer5rJMH9BZGbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660770; bh=WyLa12JzSsu80+jQeT+W3Dg5tLkUHZnj+qHXgkk4bJY=; h=Cc:Date:From:Reply-To:Subject:To; b=VsR2SSMhCtV7TPTePK+GSW26WHVl8aO5KraJaZt0iNFk0xGEoXYwyxKMBR/gXcB+IMS fz6tWR0AwhrM+l+TxlW54zYZKSjvF+i2DUXU5fSH17Dt0l5CM0UOsXAvV1GKTBpqVCO0L 04tB8xEv+TQCbY1XjisnpIk4EbPKG18Ln98= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660773303100022 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 --- 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 (#81631): https://edk2.groups.io/g/devel/message/81631 Mute This Topic: https://groups.io/mt/86161923/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 Thu Mar 28 09:26:39 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+81632+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+81632+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660772; cv=none; d=zohomail.com; s=zohoarc; b=IAWzOgGmGaEUoB4/hX0SYDYGcy2zKay2ZIp6ztJ6rjfHMuMfLA+BKQ4kH37RNISWoJ1LteXCEOJdC4z3kSrl8sE9c+akJN6gQJRjSJMu6ciRasmhfotSApKLMYDfxfEDDXqhf6mumaUvfElJ41zQ00+/y4ZXU2MXwqSu5i9UNmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660772; 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=yAGumTnwyAhI8aWx0V/+rT8h7acgcxsqYjOr3X8WjfA=; b=aP+KmzEl6Ld8H7PqOEpKvlS/9j0iX2BgpkbCNiuZS96e9wxPOAlqKI3pUUO/WOVm+kZPsdXws8QjIGceLHnBko/CtbLW2c5OEPxdcbXMJGVU6zzktkAZlXdsNA15UpOue4YhJrnWWObUMTUQhWCaSgIr4/4vv2JRLKuEFs/E9hM= 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+81632+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 1633660772014872.2716132711928; Thu, 7 Oct 2021 19:39:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Sw9RYY1788612xGwHOJxvax2; Thu, 07 Oct 2021 19:39:31 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:31 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301081" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301081" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:30 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644489" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:29 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Sai Chaganty , Nate DeSimone , Heng Luo Subject: [edk2-devel] [edk2-platforms: PATCH 6/9] TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 10:38:59 +0800 Message-Id: <20211008023902.1066-7-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: XyEq0xAAbJ06VwaVPV2Y1Y5Wx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660771; bh=XfL/VDR1b5CF6R5PVKfjPX/KmXAHTxofxAA5B6fPgmY=; h=Cc:Date:From:Reply-To:Subject:To; b=aa7NEcbqRiMNF6BFk2/SzjkSHsJ0Ig4HgEm2yOlDox/H01wu0VNTJ2tuRu8MFWdfjXl g8JcUguclnq4iVm5JC1ocfTSRZ1ysJXZW636WcK3vsV9FtK4Es60XWncvaRibNIuVOt3i ApB9yv7yRe2MhcrolRQ6emknXH6gUtXious= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660773314100023 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 --- 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 (#81632): https://edk2.groups.io/g/devel/message/81632 Mute This Topic: https://groups.io/mt/86161925/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 Thu Mar 28 09:26:39 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+81633+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+81633+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660773; cv=none; d=zohomail.com; s=zohoarc; b=IkAUQb6MJJOhthxPLDiybeHndKUBhtGRJarvi5Cf4SeOV4/kCFXhfT63x4rdHAbTZi1ht9zsP/jSI2XCvh1t/z3cej4Gp2KQEcCLihcCvbAVyg409XkZ3lbCkhENazDnXshbTaD6UmZieDfS3kT/TrVVMoY8o4EBNKhpSVLn76U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660773; 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=czP9UFtZm2E3dQo/NajrT0vcHCLYot1/SgkwIyFlwTA=; b=R4fg2XMbLzTmwHz5xtenQCRBupnj1yIS54QeGDoGgdzuDnFWwNLj7UKl9YgpSjXe5DQ+akhiS1qcCNVW7fu+iKsWadU7YY2IrLy9Wk+27CFSfF5O83bVREJGEq2eACsF4x4pcrfzltUlWf/Az7+uqh+NRnacrojuhtJAARYq1Fo= 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+81633+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 1633660773569282.8056509131534; Thu, 7 Oct 2021 19:39:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6rOZYY1788612xGwNjUkGQl2; Thu, 07 Oct 2021 19:39:33 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:32 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301099" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301099" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:32 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644503" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:31 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH 7/9] WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 10:39:00 +0800 Message-Id: <20211008023902.1066-8-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: Lbq9MVVwjyvGuMQnfkX9tqrZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660773; bh=8b2aKn2WJaP/WVX5j3Udz9z2gnqg0n/5kHfJ4dx+XvA=; h=Cc:Date:From:Reply-To:Subject:To; b=gXAc00aA7rRsYrDLLMBlk3W90MNgCFTc9VrLpGsILTgrwDgl9TAueHRgOPgs52L7Rkm 35+0GD7wtp6/Auon/LwrfiAbbIPLLyTVsD5mAhQlFacIJNjZXcyZ1OrkE7ZYtit2o5Zgi ZKzjxtx2xu8zCl0ay89TbtxTWQHJW/r8iPc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660775459100002 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 --- 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/OpenBoardPkg.dsc = | 3 +++ Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc = | 3 +++ 6 files changed, 34 insertions(+), 107 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/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 (#81633): https://edk2.groups.io/g/devel/message/81633 Mute This Topic: https://groups.io/mt/86161927/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 Thu Mar 28 09:26:39 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+81634+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+81634+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660775; cv=none; d=zohomail.com; s=zohoarc; b=kvIwsJu84McE48K+V4dqbBTqjdmdVBSDSxXfpU5zG73MH1gD9hbSWgioayNV1L+VtSuqsh/872ryitoMwWDt6SE0qRb1DT0VKD2QUiBz0NTrSxFBdhG1QTouHdPfIoEDo2zAkA0JTB2uoc4DND9xc0zMTWkspKemZfnIbImlxSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660775; 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=JEOn/IwChOs5WeElJChEH4NlufXSwhETc5GxO5F4Y3M=; b=A2yhHAvIiGS6yHjM0670arMQL8V71dmtOvZ2xkMsmm/mX1e0yXJXYJJvk1ATHNC65ZeRoSYtlh1/cpXmi4jrxkYgSKBMCvnIDC//0hPHrhJwEwhl7QUSSpuodzASTPNws1bqaCVwTQVBdHFNTyjy9Cz/9RiErWubBm2PG6G8Iaw= 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+81634+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 163366077510566.06342127307096; Thu, 7 Oct 2021 19:39:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Rk2XYY1788612xAfl0GRhPMQ; Thu, 07 Oct 2021 19:39:34 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:33 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301114" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301114" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:33 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644521" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:32 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Isaac Oram , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Date: Fri, 8 Oct 2021 10:39:01 +0800 Message-Id: <20211008023902.1066-9-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: FmKFMxQRn11aJjAd7Ky4sc6ix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660774; bh=1D/N0EDzK3/GPSZ6Qfp125C32tju7E1CI0RN9ZucSag=; h=Cc:Date:From:Reply-To:Subject:To; b=jj8x0mCM+49PhN34mTMJzTi+m4wM8pX6+mWDKvhFnlKATtAH07L0PVkqrHmkwDgqKix +9zXT6yv27JtXEewXa4iwQAPQz3UGOZ5EO+JhHFS+2SayXfQvUwHNMmuFPHNgWObqeSuB OhIbkiTZXW7VSs8cwFDNAyb7wqjM0zus7BM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660775516100004 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 --- 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..ddca492a5a 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 *) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHo= b)->NvsDataPtr; + DataSize =3D ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN) GuidHob)->NvsD= ataLength; + } 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 (#81634): https://edk2.groups.io/g/devel/message/81634 Mute This Topic: https://groups.io/mt/86161928/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 Thu Mar 28 09:26:39 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+81635+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+81635+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633660775; cv=none; d=zohomail.com; s=zohoarc; b=HuwNhGfd5BUwvDos0YsIzHB/cm1q0cOqDVtstAnVngm5qUITHu+fWP6RFw+CemutAFtK79vtywrYB3ik23KjKdKF+y0VgOLI4mkHXpSEHiN4zTM3Uiggi3JcVZbiX4KYxsLyczGsn/AERPQINbZPmsbAs7PGEfWwOffbpg2qCXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633660775; 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=rjik0wtbEHBVr0HNDMt+qk1VfZ5f7sJCL9gbVVBGq8o=; b=c4oyxFImRX06qzv1rq8J7SSPPy/HS08yRxQFFr6ikg2Q+PAtrIHppGaP4TJJsLeRGXjNkRC51MV+CWzeTimRLNxBEnErAQLKLPCKRMqdHrz87tYPwR2o/25jQBYetF059FktEYjAOg8Jn6buGHZWBhRDYqGT0q4tqefnJ3hxS9A= 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+81635+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 1633660775855825.7262611298363; Thu, 7 Oct 2021 19:39:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9F6DYY1788612xzy5Aq6GvOU; Thu, 07 Oct 2021 19:39:35 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.4072.1633660763018722729 for ; Thu, 07 Oct 2021 19:39:35 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287301122" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="287301122" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:34 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="657644529" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 19:39:33 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Isaac Oram , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 10:39:02 +0800 Message-Id: <20211008023902.1066-10-chasel.chiu@intel.com> In-Reply-To: <20211008023902.1066-1-chasel.chiu@intel.com> References: <20211008023902.1066-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: UKweGHbsxVBRdE5hscYGYARJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633660775; bh=E6oAIwjp62JW5bV8JmffGqGtFk/fC5s7/uBa++HO5F0=; h=Cc:Date:From:Reply-To:Subject:To; b=plVf2yPl/an/thBphoktkh11kiEOvkn3bgKn/n61d6B1YouJquW1Z7mD1bGQdZXCY3v F2DVbUVUquGBcecVt4tTcNg89Q1w+2LtwF8pOSyX8G7OvvNioUl9KYhpYiw2RpOvYIN86 K2HWtYhnLo74OGLuAF2dUg0az4b9jIbHMoM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633660777502100009 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 --- 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 (#81635): https://edk2.groups.io/g/devel/message/81635 Mute This Topic: https://groups.io/mt/86161929/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-