From nobody Fri Apr 19 10:44:52 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+81640+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+81640+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670135; cv=none; d=zohomail.com; s=zohoarc; b=REwqKeBwYdOfUxTZ10PTX5EsZQvZhl9sQQ4Fa9tUUx77dIJL3XFtl16jPYPF7NrGwe1Q3OMWKt+y7oo61BCckpCJANVeeegmgp4Gxr2d03I3Cag1/GE0KTt6XhmivXu9B4YcTILGE+6dfNjmFIr07AcVXX4SfUKW1AHBruUWR+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670135; 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=nCn9nWsAx/543hgXxhC66yjhMq3typ6cS56uaIWP8PU=; b=Qw254ZKBY0g/EgNYhJdFj/f+8bh0hq1tZI+k5fQ4sS3806+SBqCC//kxm3GIXmx4v2FBuEWPAqEhuwqoVRxrAUFySZFU8jwtMawdeyanYNHlL9oeCSfvljAlETII5iTB1h/dBjbRNxNju0aSt5iLmvPS594Rbdpf9nFKoXFksaY= 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+81640+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 1633670135299288.3261366749563; Thu, 7 Oct 2021 22:15:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2lZXYY1788612x5zlvpKweZ0; Thu, 07 Oct 2021 22:15:35 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web09.5182.1633670134020782646 for ; Thu, 07 Oct 2021 22:15:34 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794420" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794420" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:32 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312704" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:31 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms: PATCH v2 1/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Date: Fri, 8 Oct 2021 13:14:54 +0800 Message-Id: <20211008051502.1243-2-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: YKEnucmKP7VPhlzLmxgI4dE0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670135; bh=P8KX0o9K/SUfcxC1EgLqY6IHi9a4N24wOcL441iGzcs=; h=Cc:Date:From:Reply-To:Subject:To; b=fqezpkUEQrc+Dlu5xrWqioAskZSGTSVoVWKChXfOhaZ1S3RPOIlYBkrDZ2FSPbRb+EB XTtSN96NqpdWYQBP/KfzFTqWm4KK80M6pofFEhzvosoJO8Dd9uvtTqzxNc1aaOWfynEUk p0GSBwNA9EWKHPTrtqapvkqkEzNmU8L034o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670136189100004 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..497c2cffb8 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryC= onfig.c @@ -2,7 +2,7 @@ This is the driver that locates the MemoryConfigurationData HOB, if it exists, and saves the data to nvRAM. =20 -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include =20 /** This is the standard EFI driver point that detects whether there is a @@ -50,11 +51,27 @@ SaveMemoryConfigEntryPoint ( // // Search for the Memory Configuration GUID HOB. If it is not present, = then // there's nothing we can do. It may not exist on the update path. + // Firstly check version2 FspNvsHob. // - GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHobGuid); + GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid); if (GuidHob !=3D NULL) { - HobData =3D GET_GUID_HOB_DATA (GuidHob); - DataSize =3D GET_GUID_HOB_DATA_SIZE(GuidHob); + HobData =3D (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN= ) GuidHob)->NvsDataPtr; + DataSize =3D ((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 (#81640): https://edk2.groups.io/g/devel/message/81640 Mute This Topic: https://groups.io/mt/86163901/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81641+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+81641+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670136; cv=none; d=zohomail.com; s=zohoarc; b=Q5go6tEGAC49TnO0YzSP+KMvcI7xfceh/m32SNeTLpLsBntYaFXnuConSC3UGY0rF1Tkqff7923+hAKf0ZIX+naMAEVjUD9+nAPHaO8BLK+/mNiJMIXikNYx+uazR6djTfHaVVsrPiAjWfXFJUVHx7eIDI9Mwc2anFNtsqYBIKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670136; 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=4ks4GadOEx7wpoZhqewEK1xtpFjylG8JID0pCwIwKSU=; b=mOytIQLiUHtHoRw/rTEvOQgnhNQ1PGmqGx/J/d+Gga9IBim9DJ9R/RcrIPINwSZsiT8zqiMUGw8J3K9LdFcZUPpzRQzKIr4bpy1EPPxM7fDDfMrWRhop2ni8goN+stmGt1FrPSPWleyki0njD1XJ7eQ2t+972tuhsHd0uv+tKAQ= 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+81641+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 1633670136326557.385846691985; Thu, 7 Oct 2021 22:15:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4wMlYY1788612xchFpH1785n; Thu, 07 Oct 2021 22:15:36 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:35 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794428" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794428" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:34 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312712" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:33 -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 v2 2/9] CometlakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 13:14:55 +0800 Message-Id: <20211008051502.1243-3-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: 3x24BqSiuVVk3Lh9qVb9pWA9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670136; bh=oGOMEvm70oxeqt4uQIzOTFspCdF8hDTo5IxUm+TQAAM=; h=Cc:Date:From:Reply-To:Subject:To; b=qT2umrtxETblOtFqiKzjSczEbSNiM3d0oDqfg4yvsaqtxkEUQc/iCpsQhV9FPIWZSNO twosUU4/NMAdIh4hY0oi6E/DbzLzXlVpaDAE2RgDVPjgy4Pm1CYHQqMtnzZf4kAUGZYdP oGTexPKP4g6rJJf0leC8GbXA9poFu3RV8ZE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670138174100009 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 (#81641): https://edk2.groups.io/g/devel/message/81641 Mute This Topic: https://groups.io/mt/86163902/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81642+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+81642+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670137; cv=none; d=zohomail.com; s=zohoarc; b=KTVCcNGhCiznGK7aO9UckhWTtd5/OV556t2CAaglHVaNsU5xIr3q/+OUWodbi0OnvGQsjSukpwigfZrin5dVAkbsB4VidYtgwfluJzjLaR6n5GGqnfEG3fZLEqJi+fdbUhj2wQQcj16IkvSHu85G+d/CF9tll0k/9c3fiyAU1gY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670137; 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=pvdSzJax9DtJfBaO+xBblUQJ/xTYB/hysdIOGnTmQbY=; b=VvMZRaalVFg0JWi5f8KiRvyOIhpKQfIhtuO1ny2GBZFu7OF6YtF7sI1E/FqGYm+WEFPKE8Q6TjbCFChw++zwq9WFngNlS+K+tzLD6tdXQI/FxFexUXPIqnlld5WcIMN3uLCR+Q4b33W4FzHhd9XAmt6yVfZgdRNWYb3CblEwXUA= 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+81642+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 1633670137648174.4626401457291; Thu, 7 Oct 2021 22:15:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7TjWYY1788612xZ7FtQDKQ5f; Thu, 07 Oct 2021 22:15:37 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:36 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794450" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794450" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:36 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312726" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:34 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Benjamin Doron Subject: [edk2-devel] [edk2-platforms: PATCH v2 3/9] KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for FspNvsHob Date: Fri, 8 Oct 2021 13:14:56 +0800 Message-Id: <20211008051502.1243-4-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: GZJE1rfcEwPlxyf9FhQqIq0Mx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670137; bh=evvUK1wl2bZbWfbD8z1iEIRgE1p9OI0OugWLR+gbM6I=; h=Cc:Date:From:Reply-To:Subject:To; b=qNsJCPHGPNXOv09A+864HG8begsx7+6TwI78nTmPeSpwN1Ht2oQNiDkoyGE0CEb6go2 dcYnvrJnp/3KCIBgxXOg1ruzgWP8mLZ+5VS9qflsqchkRSai6ko5cCzRffDiPwR0sExnj /zD7eO8T2a2aYAVyrz5cRruaaujzmTjyIa4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670138254100011 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 (#81642): https://edk2.groups.io/g/devel/message/81642 Mute This Topic: https://groups.io/mt/86163903/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81643+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+81643+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670138; cv=none; d=zohomail.com; s=zohoarc; b=fZweHpXGI/+YgXL6T/JQV+EVRBHxP6xv6QQYhNAV48IuEs4w3dTJh0OKa7XBKILopE7YTOzhzn2AyL/6OIBNfyVdRqjfm0x2rY1oRCpwYISZ9DrCOL0yJMjmCxUWWkSuZmgqpSZd76Ppdghwt/bdUNcTefNCoDS1uTPLqV1c8Xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670138; 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=eH3Hmr312v3EXGqs5VRmE/mok+t3CVdzlYMjwUUXmZo=; b=bJrvUpnzT30GYThy4z0n1B6bNmgzaeFCW4BdkwwhZBC/vXzuW9Ybpb/0D4zyBTpb3W+jZz3LzzWYgaO2zvsnr1jHRNmTipn4qeSRwG8445+eEaNF2FWftzpMXjNiBZkFWZjjuVkI33M8uFqa1pZGlyDSt9+PhEl2v/amnBSrB30= 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+81643+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 1633670138722731.1402935171803; Thu, 7 Oct 2021 22:15:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id l9vPYY1788612xGeGMCRCgki; Thu, 07 Oct 2021 22:15:38 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:37 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794465" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794465" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:37 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312748" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:36 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Jeremy Soller Subject: [edk2-devel] [edk2-platforms: PATCH v2 4/9] KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 13:14:57 +0800 Message-Id: <20211008051502.1243-5-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: kgW4IOPATTqBymYe2jOHaklSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670138; bh=8MUuWHaJr8F4hCS8R237xQq2JX1j5kik/eXlib7vgNE=; h=Cc:Date:From:Reply-To:Subject:To; b=A/gaq0TZzROGM3rwQO96S1F/ehDj9HtYJDuPECjLIM+M6RIPXjeHvybKmpqtxWKypN8 bhcXyOi6u6Y1F+o4uORy1iOBL28LAYJdUo/Q0u7otd73RLOUXkhpKDy2i08F2xU5rSM81 qIUMViI23WmPDsEvSABZmLKFnweBWSw6+lQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670141479100002 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 (#81643): https://edk2.groups.io/g/devel/message/81643 Mute This Topic: https://groups.io/mt/86163904/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81644+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+81644+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670140; cv=none; d=zohomail.com; s=zohoarc; b=E9gxNMcb0Feo+Kyf9/TJS3JkIDtu0lW7XKTKfNXRpdhcVs4V14It2iCZ2LnJiOfvz1rOoEHZF3U6rSl0RRbUG4/mR7wQOhgkXGj7HF+ZIsk4hFpgzdWFsPDB1rgpbTMrnNEe4qGib6EX1LGcfQsZxMDvjHvd87shNf8oZ1mgO4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670140; 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=8kU1OmGS5pOa3mk/XV3ZqHXw4yNbNH/iA5LqlQpGVt0=; b=GBmC4StYU+UA/fMQB//fRftpQnQ+Bm83vnHlpHRTZO1JHspTYzmYRmEY93W3NxLr56FbrcBnxmvybtEsFuKkzVfH8pfwDNsk2aZbu13JMkftynhcU+sS95V4fgwbMJAR2R/oTBiXwA1ERS0lYrq28rhBorrYo1Ou3eYmUDhPM5M= 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+81644+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 1633670140029475.73020045115834; Thu, 7 Oct 2021 22:15:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id wjJAYY1788612xlB7ce3Qaiw; Thu, 07 Oct 2021 22:15:39 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:39 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794473" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794473" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:38 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312792" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:37 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v2 5/9] KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 13:14:58 +0800 Message-Id: <20211008051502.1243-6-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: vtvx9vpQr7G5W2NEXKRUGGkDx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670139; bh=UTDgaz0iyRA+BlVFYAuySnuEdgO5YUMY6WaO8m4UE8s=; h=Cc:Date:From:Reply-To:Subject:To; b=D2fFYgnnCw7KTfBVd3T0jrlbSN8yKXgPbuhzevYft/AQ2d/G8ISFr9JdK6RlFtAM6k5 1EppIgsbyji/u1nRXEo+00uw6L4QQ0vLuR2ksq6lY9/cetNcYpLAieLX5rpm5FF74n9nV Vtgvq9OQCJfcAROHTx+mMtMDjOzQqDw+9Vo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670141653100006 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 (#81644): https://edk2.groups.io/g/devel/message/81644 Mute This Topic: https://groups.io/mt/86163905/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81645+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+81645+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670141; cv=none; d=zohomail.com; s=zohoarc; b=LToxRZBbhmG5m/9iAAdu00m2G56dlIIcBclVYHf329nvJUSiQgCDcVtRr0mzK2690vz2vAYxPZ7twZLVT9j3j/8cYWDPW0VazbolIDzaIr2N0EjyQ3KiRFajxiFXPxvyyqXaghtIreM3YgL0uaPTXy8rUm+OJFYbN4EOUFaK1+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670141; 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=Ni+rBMvqkF+al9sLgL7MKOYpcwumA2TgZVGNKTjOnIM=; b=MlfC4cGHst59ZKCE57XkJu5X9gASzkw/ESyUZSUVU3Xqms8X7in4yFI5pA4XEfCjHsO9iPK31vqTkbAG1vGjd5vr6q4yVi5OcmWpeHg+j4g5F5ouwHd7VU+lfyLtQ4NPP24kH8G7mhasW9TQJ/X/YaIX3bC+rd6yYnCh2bn3Ii0= 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+81645+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 1633670141278604.3800393609748; Thu, 7 Oct 2021 22:15:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9VFCYY1788612xuZGGW0h24u; Thu, 07 Oct 2021 22:15:40 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:40 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794486" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794486" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:40 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312832" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:38 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Sai Chaganty , Nate DeSimone , Heng Luo Subject: [edk2-devel] [edk2-platforms: PATCH v2 6/9] TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 13:14:59 +0800 Message-Id: <20211008051502.1243-7-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: UbvqNQ6bGyUIsRZk1piZ3GCix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670140; bh=kwZnQFQDKWxsclLDtk3jLKJlzXqFa18CIr+aQZC4y0Y=; h=Cc:Date:From:Reply-To:Subject:To; b=SbWiQNLLSb3Ip0Qs0g+G3cjJysb7VodM+sSq126AM6/0HEajTtuA2yBZaaOsm0QrpLV Vrk3DMyOTzO6BKkWfmnRstV8lV+vK0cAQfjyft5ykHitn6BBGaNJ1Y37uIfV62tiHIAwa r4w87Te/QKQnMJQP24Hgwgs4W8n5waH9qfI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670141778100008 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 (#81645): https://edk2.groups.io/g/devel/message/81645 Mute This Topic: https://groups.io/mt/86163906/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81646+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+81646+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670143; cv=none; d=zohomail.com; s=zohoarc; b=BY/YaSK59mxg6EFSQQJL6V9hqhM5R+OYsNUit14InW+JnqhI7FsfaXZtb2KrAIvd293g0+1DISeR9PcjqL7lYSZQ456Zj4a4/lsksZ7vKP6EASVUrcr9U9R/eZEVHgJjRON1yYUs/2znn0Tl/oflDOa0SnOHn8XUPgZ3rFZ/qRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670143; 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=8YpANTZsX3yrwJS2EF5Zb/29T7EkM8ocSjtrfBhP+Y8=; b=duwn2qwKCzOGMuQhlLrssOKNOg0YN79omBVJ+cwFzj2lRVIHfT+iwEBiKMKXKCWeKHkyCdHcDisUKfR8tQi2etGf8a8s5fuwdqCeo0v3CggonzVkwyf8AJCEEgwByVdTKY/oBBVF3gJoI7Hf+qTErsKvrHpi4CAgS4PzEoovx0w= 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+81646+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 1633670143365829.6969196287263; Thu, 7 Oct 2021 22:15:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VMGuYY1788612xD1Gg2nwEiX; Thu, 07 Oct 2021 22:15:43 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:42 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794498" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794498" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:41 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312843" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:40 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v2 7/9] WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 13:15:00 +0800 Message-Id: <20211008051502.1243-8-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: 0clH3nJqIvn2dW8FFzQvpD67x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670143; bh=s4VjsR2U2NVHKXWM97ctJwCtTO48OON1JojzCwDo+8o=; h=Cc:Date:From:Reply-To:Subject:To; b=dC71U7UV1+X40fb1J1zDHuOTJmVp2Bc5PLrZhx81Y1IS0x9jK8ACwp0M2Fx1FtZ8lOY OgdNVA+N0e11buZuT5nfUL8e6M6B9fKFtgZLqC1yEq0FiSKKFPp/70BmqCokQnX4EWpNq 3klzN1Dx1OcllEm6CwZ9iOUrV4CsAKpoj7c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670144310100001 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/Include/Fdf/FlashMapInclud= e.fdf | 18 +++++++++------= --- Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc = | 3 +++ Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc = | 3 +++ 7 files changed, 43 insertions(+), 116 deletions(-) diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiS= iliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/Whiskeyl= akeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscU= pdUpdateLib.c index a341a58930..ab35bc3f8f 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -2,7 +2,7 @@ Implementation of Fsp Misc UPD Initialization. =20 =20 - Copyright (c) 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -17,11 +17,9 @@ #include #include =20 -#include #include #include #include -#include #include #include =20 @@ -44,55 +42,18 @@ PeiFspMiscUpdUpdatePreMem ( ) { EFI_STATUS Status; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - UINTN VariableSize; - VOID *MemorySavedData; - - Status =3D PeiServicesLocatePpi ( - &gEfiPeiReadOnlyVariable2PpiGuid, - 0, - NULL, - (VOID **) &VariableServices - ); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - MemorySavedData =3D AllocatePool (VariableSize); - if (MemorySavedData =3D=3D NULL) { - ASSERT (MemorySavedData !=3D NULL); - return EFI_OUT_OF_RESOURCES; - } - - DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize)); - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_SUCCESS) { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; - } else { - DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMe= moryConfigVariableGuid, Status =3D %r\n", Status)); - ASSERT_EFI_ERROR (Status); - } + UINTN FspNvsBufferSize; + VOID *FspNvsBufferPtr; + + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + FspmUpd->FspmArchUpd.NvsBufferPtr =3D FspNvsBufferPtr; + } else { + DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does = not exist (this is likely a first boot)\n")); + FspmUpd->FspmArchUpd.NvsBufferPtr =3D NULL; } - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; =20 return EFI_SUCCESS; } diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Lib= rary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel= /WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdate= LibFsp/PeiFspMiscUpdUpdateLib.c index 145deb5de3..381ef232ea 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -2,7 +2,7 @@ Implementation of Fsp Misc UPD Initialization. =20 =20 - Copyright (c) 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -18,11 +18,9 @@ #include #include =20 -#include #include #include #include -#include #include #include #include @@ -46,54 +44,17 @@ PeiFspMiscUpdUpdatePreMem ( ) { EFI_STATUS Status; - EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices; - UINTN VariableSize; - VOID *MemorySavedData; - - Status =3D PeiServicesLocatePpi ( - &gEfiPeiReadOnlyVariable2PpiGuid, - 0, - NULL, - (VOID **) &VariableServices - ); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; - } - - VariableSize =3D 0; - MemorySavedData =3D NULL; - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - MemorySavedData =3D AllocatePool (VariableSize); - if (MemorySavedData =3D=3D NULL) { - ASSERT (MemorySavedData !=3D NULL); - return EFI_OUT_OF_RESOURCES; - } - - DEBUG ((DEBUG_INFO, "VariableSize is 0x%x\n", VariableSize)); - Status =3D VariableServices->GetVariable ( - VariableServices, - L"MemoryConfig", - &gFspNonVolatileStorageHobGuid, - NULL, - &VariableSize, - MemorySavedData - ); - if (Status =3D=3D EFI_SUCCESS) { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D MemorySavedData; - } else { - FspmUpd->FspmArchUpd.NvsBufferPtr =3D NULL; - DEBUG ((DEBUG_ERROR, "Fail to retrieve Variable:\"MemoryConfig\" gMe= moryConfigVariableGuid, Status =3D %r\n", Status)); - ASSERT_EFI_ERROR (Status); - } + UINTN FspNvsBufferSize; + VOID *FspNvsBufferPtr; + + FspNvsBufferPtr =3D NULL; + FspNvsBufferSize =3D 0; + Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG= uid, &FspNvsBufferPtr, &FspNvsBufferSize); + if (Status =3D=3D EFI_SUCCESS) { + FspmUpd->FspmArchUpd.NvsBufferPtr =3D FspNvsBufferPtr; + } else { + DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does = not exist (this is likely a first boot)\n")); + FspmUpd->FspmArchUpd.NvsBufferPtr =3D NULL; } =20 FspmUpd->FspmConfig.TsegSize =3D FixedPcdGet32 (PcdTsegSize= ); diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiS= iliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platform/Intel/= WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/Pei= SiliconPolicyUpdateLibFsp.inf index 2c90d0cb94..362dc2c995 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconP= olicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -2,7 +2,7 @@ # Provide FSP wrapper platform related function. # # -# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -82,7 +82,6 @@ PchInfoLib PchHsioLib PchPcieRpLib - MemoryAllocationLib DebugPrintErrorLevelLib SiPolicyLib PchGbeLib @@ -132,7 +131,7 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdMrcSpdAddressTable3 =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Lib= rary/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf b/Platfo= rm/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPoli= cyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf index 529c2f1253..1a664b1327 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/Pe= iSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf @@ -2,7 +2,7 @@ # FSP silicon policy updates for the Up Xtreme board. # # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -136,7 +136,7 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdBoardBomId =20 [Guids] - gFspNonVolatileStorageHobGuid ## CONSUMES + gFspNvsBufferVariableGuid ## CONSUMES gTianoLogoGuid ## CONSUMES gEfiMemoryOverwriteControlDataGuid =20 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/Fl= ashMapInclude.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include= /Fdf/FlashMapInclude.fdf index f7aa730ae7..698efce248 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapI= nclude.fdf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapI= nclude.fdf @@ -2,7 +2,7 @@ # Flash map for the UpXtreme Board. # # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -35,16 +35,16 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize = =3D 0x00090000 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset =3D 0x= 00190000 # Flash addr (0xFFAE0000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize =3D 0x= 00190000 # SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset =3D 0x= 00320000 # Flash addr (0xFFC70000) -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize =3D 0x= 00170000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset =3D 0x= 00490000 # Flash addr (0xFFDE0000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize =3D 0x= 00160000 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset =3D 0x= 00480000 # Flash addr (0xFFDD0000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize =3D 0x= 00070000 # -SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset =3D 0x= 00500000 # Flash addr (0xFFE50000) +SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset =3D 0x= 004F0000 # Flash addr (0xFFE40000) SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize =3D 0x= 00050000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset =3D 0x= 00550000 # Flash addr (0xFFEA0000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset =3D 0x= 00540000 # Flash addr (0xFFE90000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize =3D 0x= 000EA000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset =3D 0x= 0063A000 # Flash addr (0xFFF8A000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset =3D 0x= 0062A000 # Flash addr (0xFFF7A000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize =3D 0x= 00006000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset =3D 0x= 00640000 # Flash addr (0xFFF90000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset =3D 0x= 00630000 # Flash addr (0xFFF80000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize =3D 0x= 00010000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset =3D 0x= 00650000 # Flash addr (0xFFFA0000) -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize =3D 0x= 00060000 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset =3D 0x= 00640000 # Flash addr (0xFFF90000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize =3D 0x= 00070000 # diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.d= sc b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc index ee2aedd978..9d08dc3fe4 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.dsc @@ -142,6 +142,9 @@ ####################################### PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookL= ib.inf =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] ####################################### # Platform Package diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoa= rdPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoar= dPkg.dsc index b69cc8deb0..8d25b818ee 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc @@ -142,6 +142,9 @@ ####################################### PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookL= ib.inf =20 +[LibraryClasses.Common.SEC] + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVaria= bleReadLibNull.inf + [LibraryClasses.IA32.SEC] ####################################### # Platform Package --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81646): https://edk2.groups.io/g/devel/message/81646 Mute This Topic: https://groups.io/mt/86163907/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81647+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+81647+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670143; cv=none; d=zohomail.com; s=zohoarc; b=f8ShbLfOp4kD/bCSQaJUBaWRNY3N80JYP/H1skeq3/+hhw18+qcJK4VdB5UVG6F1gOqTPH/vqrNCe/0iDGqW9ZdaAcpn5ep8iui7I8YAWbgwXFmqLyaXy34T4VToe9rGcMP8fNpYwmHZ+vBy0axBADW5HFn/aXVYOnHfQGeBDOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670143; 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=y6wJjrgusw25sMCKhRyjnRjCTEIeR/bLWPR2y0G2wBw=; b=Kulm6Nx+3TjHW8UISOK1Mq7XAnUs7oyjdKPo/Efth1LVZAQspt7m3cUyRzof05SfIMYLydWjKjO4b8HtOTED/IcLbQAzmtqhdXyLfcJRBZkig9nHCm/F6LQBWOt2tfvti1ciN4R+jh5cY8Q1VeY0/rTiSEO+9ljr76OfK48/hCA= 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+81647+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 1633670143889776.7035372466348; Thu, 7 Oct 2021 22:15:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DDVCYY1788612xiZdAtMethI; Thu, 07 Oct 2021 22:15:43 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:42 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794504" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794504" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:42 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312870" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:41 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Isaac Oram , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v2 8/9] WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2. Date: Fri, 8 Oct 2021 13:15:01 +0800 Message-Id: <20211008051502.1243-9-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: S1PSu6rXtCAVodSxhlJVZ5Mgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670143; bh=2OXlqMTYUSN2LWBYg9D44ZBageugqPBhPGOrINegCJs=; h=Cc:Date:From:Reply-To:Subject:To; b=ijMjKD/KVd/UxBr7XDMiClUegUTO+LQvGlB7tnVIQyjPZMiSu+s/GXlWxe9ltQXvZEL QK+T35xrWtpB6MAjlzJ4/bBTajC4ANrGpFpvMKawaCOoVvQ4wgUEKBBoiqeNILKZJfHZ5 OSRnr9r95uNoCJSPUSizvpk/us7t8fUgyAE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670146153100006 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..f86615591c 100644 --- a/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSa= ve.c +++ b/Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSa= ve.c @@ -7,6 +7,7 @@ **/ =20 #include "S3NvramSave.h" +#include #include #include #include @@ -80,21 +81,37 @@ SaveFspNonVolatileStorageHob ( Status =3D EFI_SUCCESS; =20 DEBUG ((DEBUG_INFO, "Saving FSP / MRC Training Data\n")); - GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHobGuid); + // + // Firstly check version2 FspNvsHob. + // + GuidHob =3D GetFirstGuidHob (&gFspNonVolatileStorageHob2Guid); if (GuidHob !=3D NULL) { - HobData =3D GET_GUID_HOB_DATA (GuidHob); - DataSize =3D GET_GUID_HOB_DATA_SIZE (GuidHob); + HobData =3D (VOID *) (UINTN) ((FSP_NON_VOLATILE_STORAGE_HOB2 *) (UINTN= ) GuidHob)->NvsDataPtr; + DataSize =3D ((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 (#81647): https://edk2.groups.io/g/devel/message/81647 Mute This Topic: https://groups.io/mt/86163908/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 10:44:52 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+81648+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+81648+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633670144; cv=none; d=zohomail.com; s=zohoarc; b=dwPBtp7NH0oT1tHhFilUrvzPiTMdCmqjj1ySNHIAWXytFNcN0CwrR/EOZAe8w6aKsnTqNpeXBoUHkzgWb+0IQCMRDUlgL2R4F8f5cYAX9vHjM+RX++iDp0So9wasN4srPhXRe90WbJ6kkA5gIOjU2iKRUrjs7HzBXt5zhfSSdrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633670144; 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=1wT7fuhs+W8bu+8yV+SS9Pdie1ELe9+t7Y1biVH4/O4=; b=fSTl3nSaibGjAhaHQP+iZnrflMA/1rBOeYcA5clKBti0Ul26Ko3lqy+gad4UzpaF/fxQZoZDz2k8osvn8AAmcD+yqUc10sVd8HBXCuXo8tHx/YCUUueF9olF0FT76VrmjlW/NZvnKojDLaAOC4388fYJCSJa6lxIRVQLamaD6BQ= 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+81648+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 163367014494498.53863919122011; Thu, 7 Oct 2021 22:15:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id QxGqYY1788612xv2iJdnbYZe; Thu, 07 Oct 2021 22:15:44 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.5209.1633670134884967157 for ; Thu, 07 Oct 2021 22:15:44 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249794518" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="249794518" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:43 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489312876" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.188.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 22:15:42 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Isaac Oram , Nate DeSimone Subject: [edk2-devel] [edk2-platforms: PATCH v2 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob. Date: Fri, 8 Oct 2021 13:15:02 +0800 Message-Id: <20211008051502.1243-10-chasel.chiu@intel.com> In-Reply-To: <20211008051502.1243-1-chasel.chiu@intel.com> References: <20211008051502.1243-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: XoicLc1xM10VIQqI4B1HENTfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633670144; bh=4CX/VfoBN/+vnzUEAXjUJeYakUKFZAgO0ZtC5Dz0c44=; h=Cc:Date:From:Reply-To:Subject:To; b=oEK6IpJaFekvIFmhLarj1R+9Ja2n7Ng4f8bI13dK3OgUtRa7nuGg7vdoyHsXnR6KqVo ad/p55YMrdaAkoj7V/4dcnBEQJBi/hkSjP2FoiJHjHM/fGujrY/Cp36wzMXzFTkL/UCmH TsFJ4h1yS0v9MK1irak+ShUKwpdEZVicAfY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633670146222100008 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 (#81648): https://edk2.groups.io/g/devel/message/81648 Mute This Topic: https://groups.io/mt/86163909/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-