From nobody Sun Feb 8 14:41:48 2026 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+80925+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+80925+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1632205622; cv=none; d=zohomail.com; s=zohoarc; b=O2UjFlsRcpwAJQDmkbzyxmT69kV9u8RzcFhFb53e7U6+wM91P5TON/tAv37djnld1wN1mhLzteZ0ZYclqS0SqNpTg8Arh11h7m+J9qkTkUhVyRK615yOozPvZ3/Cwac5gshcwIfmO9vmx2ExisEE5f2MFlo9RZgueFBjXn3wKzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632205622; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=2ttPOAlGTOS/lBZZAyxs3GUZ/aM3PFvxsCyIMoQfJMM=; b=nXy6BkL4PGi6b2IDqTxLkoI0Umj4pQ8MG1a2+I4osTAdzWh6e77akJn3KWDhxzO10CUbo8/LcZB10XUYGswMy993kajQ58Dw0yrv5tsD+CdVidEDdu71f947qmtgwxeF58Q4GOAggeytNw3sAUKX9HZo1tPoyKk0QGXgHeO2gP0= 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+80925+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 1632205622281552.6761436127387; Mon, 20 Sep 2021 23:27:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RXcQYY1788612xbHe5KGXk8B; Mon, 20 Sep 2021 23:27:01 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.4059.1632205620409112109 for ; Mon, 20 Sep 2021 23:27:01 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10113"; a="308845141" X-IronPort-AV: E=Sophos;i="5.85,310,1624345200"; d="scan'208";a="308845141" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 23:26:59 -0700 X-IronPort-AV: E=Sophos;i="5.85,310,1624345200"; d="scan'208";a="549330675" X-Received: from basfe004.gar.corp.intel.com ([10.66.129.57]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 23:26:56 -0700 From: "Ashraf Ali S" To: devel@edk2.groups.io Cc: Ashraf Ali S , Chasel Chiu , Nate DeSimone , Star Zeng , Kuo Ted , Duggapu Chinni B , Rangasai V Chaganty , Digant H Solanki , Sangeetha V , Ray Ni Subject: [edk2-devel] [PATCH] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type Date: Tue, 21 Sep 2021 11:56:44 +0530 Message-Id: <997eabd98a3318d5e4fbc9c4e4ba689eb9dc6140.1632205562.git.ashraf.ali.s@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,ashraf.ali.s@intel.com X-Gm-Message-State: 0r6XM8BHywAr902uD0Xo0Db7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1632205621; bh=8B9xUlgY2SuGLxJkjMK3QfNoRdyObOXW3GaWabpSfSw=; h=Cc:Date:From:Reply-To:Subject:To; b=XXw72DRy5bI5hF0gGrCtzZXNQzXMkT09VE4kCmEuevsCljmkgn6Mtt4wNncYuBqaxmh 4kvWFy590QWpJsZ0lhbMEfIdQ54hjDv7a/+luZYjHOWDNIY/wUrWy2rWIpPC7oEk7nAQP PBa1ZU9ty8gwth7Ou8GMj8osSRuy3fouQ7A= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1632205623508100002 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3642 when the module is not building in IA32 mode which will lead to building error. when a module built-in X64 function pointer will be the size of 64bit width which cannot be fit in 32bit address which will lead to error. to overcome this issue introducing the 2 new PCD's for the 64bit modules can consume it. Creating the API's to support different architecture Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng Cc: Kuo Ted Cc: Duggapu Chinni B Cc: Rangasai V Chaganty Cc: Digant H Solanki Cc: Sangeetha V Cc: Ray Ni Signed-off-by: Ashraf Ali S --- .../FspmWrapperPeim/FspmWrapperPeim.c | 6 +-- .../FspmWrapperPeim/FspmWrapperPeim.inf | 3 +- .../FspsWrapperPeim/FspsWrapperPeim.c | 6 +-- .../FspsWrapperPeim/FspsWrapperPeim.inf | 1 - .../Include/Library/FspWrapperPlatformLib.h | 24 ++++++++++- IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 2 + .../BaseFspWrapperPlatformLibSample.inf | 17 +++++++- .../IA32/FspHelper.c | 40 +++++++++++++++++++ .../X64/FspHelper.c | 40 +++++++++++++++++++ 9 files changed, 128 insertions(+), 11 deletions(-) create mode 100644 IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSa= mple/IA32/FspHelper.c create mode 100644 IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSa= mple/X64/FspHelper.c diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelF= sp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c index 24ab534620..77e172e459 100644 --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c @@ -3,7 +3,7 @@ register TemporaryRamDonePpi to call TempRamExit API, and register Memor= yDiscoveredPpi notify to call FspSiliconInit API. =20 - Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -68,7 +68,7 @@ PeiFspMemoryInit ( return EFI_DEVICE_ERROR; } =20 - if (PcdGet32 (PcdFspmUpdDataAddress) =3D=3D 0 && (FspmHeaderPtr->CfgRegi= onSize !=3D 0) && (FspmHeaderPtr->CfgRegionOffset !=3D 0)) { + if (GetFspmUpdDataAddress () =3D=3D 0 && (FspmHeaderPtr->CfgRegionSize != =3D 0) && (FspmHeaderPtr->CfgRegionOffset !=3D 0)) { // // Copy default FSP-M UPD data from Flash // @@ -80,7 +80,7 @@ PeiFspMemoryInit ( // // External UPD is ready, get the buffer from PCD pointer. // - FspmUpdDataPtr =3D (FSPM_UPD_COMMON *)PcdGet32 (PcdFspmUpdDataAddress); + FspmUpdDataPtr =3D (FSPM_UPD_COMMON *) GetFspmUpdDataAddress (); ASSERT (FspmUpdDataPtr !=3D NULL); } =20 diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf b/Inte= lFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf index 00166e56a0..95317fb70d 100644 --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf @@ -6,7 +6,7 @@ # register TemporaryRamDonePpi to call TempRamExit API, and register Memor= yDiscoveredPpi # notify to call FspSiliconInit API. # -# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -56,7 +56,6 @@ =20 [Pcd] gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES - gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ## CONSUMES diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelF= sp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c index 9d4f279e81..5875cc0fdc 100644 --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c @@ -3,7 +3,7 @@ register TemporaryRamDonePpi to call TempRamExit API, and register Memor= yDiscoveredPpi notify to call FspSiliconInit API. =20 - Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -283,7 +283,7 @@ PeiMemoryDiscoveredNotify ( return EFI_DEVICE_ERROR; } =20 - if (PcdGet32 (PcdFspsUpdDataAddress) =3D=3D 0 && (FspsHeaderPtr->CfgRegi= onSize !=3D 0) && (FspsHeaderPtr->CfgRegionOffset !=3D 0)) { + if (GetFspsUpdDataAddress () =3D=3D 0 && (FspsHeaderPtr->CfgRegionSize != =3D 0) && (FspsHeaderPtr->CfgRegionOffset !=3D 0)) { // // Copy default FSP-S UPD data from Flash // @@ -292,7 +292,7 @@ PeiMemoryDiscoveredNotify ( SourceData =3D (UINTN *)((UINTN)FspsHeaderPtr->ImageBase + (UINTN)Fsps= HeaderPtr->CfgRegionOffset); CopyMem (FspsUpdDataPtr, SourceData, (UINTN)FspsHeaderPtr->CfgRegionSi= ze); } else { - FspsUpdDataPtr =3D (FSPS_UPD_COMMON *)PcdGet32 (PcdFspsUpdDataAddress); + FspsUpdDataPtr =3D (FSPS_UPD_COMMON *) GetFspsUpdDataAddress (); ASSERT (FspsUpdDataPtr !=3D NULL); } =20 diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf b/Inte= lFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf index aeeca58d6d..32e58845bf 100644 --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf @@ -65,7 +65,6 @@ =20 [Pcd] gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES - gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ## CONSUMES =20 diff --git a/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h b/= IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h index 2aa14c92fd..4a06505531 100644 --- a/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h +++ b/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h @@ -1,7 +1,7 @@ /** @file Provide FSP wrapper platform related function. =20 - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -77,4 +77,26 @@ CallFspWrapperResetSystem ( IN UINT32 FspStatusResetType ); =20 +/** + Get the Fspm Upd Data Address from the PCD + + @return FSPM UPD Data Address +**/ +UINTN +EFIAPI +GetFspmUpdDataAddress ( + VOID + ); + +/** + Get the Fsps Upd Data Address from the PCD + + @return FSPS UPD Data Address +**/ +UINTN +EFIAPI +GetFspsUpdDataAddress ( + VOID + ); + #endif diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2Wrapper= Pkg/IntelFsp2WrapperPkg.dec index a3b9363779..8c98dbd55d 100644 --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec @@ -121,3 +121,5 @@ # gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress|0x00000000|UINT32|= 0x50000000 gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress|0x00000000|UINT32|= 0x50000001 + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64|0x00000000|UINT6= 4|0x50000002 + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress64|0x00000000|UINT6= 4|0x50000003 diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/Ba= seFspWrapperPlatformLibSample.inf b/IntelFsp2WrapperPkg/Library/BaseFspWrap= perPlatformLibSample/BaseFspWrapperPlatformLibSample.inf index a3d23f6d55..54f7c10cc4 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWr= apperPlatformLibSample.inf +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWr= apperPlatformLibSample.inf @@ -1,7 +1,7 @@ ## @file # Sample to provide FSP wrapper platform related function. # -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -35,6 +35,12 @@ [Sources] FspWrapperPlatformLibSample.c =20 +[Sources.IA32] + IA32/FspHelper.c + +[Sources.X64] + IA32/FspHelper.c + =20 ##########################################################################= ###### # @@ -48,5 +54,14 @@ IntelFsp2Pkg/IntelFsp2Pkg.dec IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec =20 +[Pcd.IA32] + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## CONSUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES + +[Pcd.X64] + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64 ## CONSUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress64 ## CONSUMES + [LibraryClasses] + PcdLib =20 diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/IA= 32/FspHelper.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSampl= e/IA32/FspHelper.c new file mode 100644 index 0000000000..8eccd7777d --- /dev/null +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/IA32/FspH= elper.c @@ -0,0 +1,40 @@ +/** @file + Sample to provide FSP wrapper related function. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#include +#include +#include + +/** + Get the Fspm Upd Data Address from the PCD + + @return FSPM UPD Data Address +**/ +UINTN +EFIAPI +GetFspmUpdDataAddress ( + VOID + ) +{ + return PcdGet32 (PcdFspmUpdDataAddress); +} + +/** + Get the Fsps Upd Data Address from the PCD + + @return FSPS UPD Data Address +**/ +UINTN +EFIAPI +GetFspsUpdDataAddress ( + VOID + ) +{ + return PcdGet32 (PcdFspsUpdDataAddress); +} diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/X6= 4/FspHelper.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample= /X64/FspHelper.c new file mode 100644 index 0000000000..17b795aa4f --- /dev/null +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/X64/FspHe= lper.c @@ -0,0 +1,40 @@ +/** @file + Sample to provide FSP wrapper related function. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#include +#include +#include + +/** + Get the Fspm Upd Data Address from the PCD + + @return FSPM UPD Data Address +**/ +UINTN +EFIAPI +GetFspmUpdDataAddress ( + VOID + ) +{ + return PcdGet64 (PcdFspmUpdDataAddress64); +} + +/** + Get the Fsps Upd Data Address from the PCD + + @return FSPS UPD Data Address +**/ +UINTN +EFIAPI +GetFspsUpdDataAddress ( + VOID + ) +{ + return PcdGet64 (PcdFspsUpdDataAddress64); +} --=20 2.30.2.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 (#80925): https://edk2.groups.io/g/devel/message/80925 Mute This Topic: https://groups.io/mt/85760481/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-