From nobody Fri May 3 07:58:44 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+84968+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+84968+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639642247; cv=none; d=zohomail.com; s=zohoarc; b=ENFyXNTJi12/JWXWZkDZ1vQpz5AfWfZORdZr+JXzvWqzuWfwxrUGX6ofqVIrL9q5zwGE00CvlEtLHaHnZgJiDsqWd/hBeOPOvfYqS8ZkBsAB30d+8Ix2FpAYIiDP8f7W1tlnd+fFnUlAYVOOIP1MzRenSZSCUJcd1tQ54StSVcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639642247; 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=TqdAzXxxMqZ+Xe5rNGR+/zdMbxm3ULTf9MM3XoZ4r3w=; b=FiEtGHblSaSztLC9TiGJmP28NJggiAMDh3mCeJE/EzRbC5stc3XwQncw2lOndSVllaqA3n/x1g8ckq2QklkYnhAdQd6eT4ToqH55YjLj+JV/lgrIxJDq68pDDaB2bEVChCdH9e/672DN3cV4f7Aikq12aUoihTkVT+OtYihvEfs= 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+84968+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 1639642247695817.6426463252292; Thu, 16 Dec 2021 00:10:47 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id o5XxYY1788612x3nYvKULM7r; Thu, 16 Dec 2021 00:10:47 -0800 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.7401.1639642245924576476 for ; Thu, 16 Dec 2021 00:10:46 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="239243507" X-IronPort-AV: E=Sophos;i="5.88,210,1635231600"; d="scan'208";a="239243507" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 00:10:45 -0800 X-IronPort-AV: E=Sophos;i="5.88,210,1635231600"; d="scan'208";a="465946597" X-Received: from basfe004.gar.corp.intel.com ([10.66.129.57]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 00:10:38 -0800 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 v8] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type Date: Thu, 16 Dec 2021 13:40:20 +0530 Message-Id: <7886ad065bf2cb1b513300da04db32a698d4b590.1639642126.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: Sh3Xmun5SXwJIO3BYCXfPxKPx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639642247; bh=2bGggEbIKuegpGL4nsxOoZV1SQ46gDBc31DRCE37cmk=; h=Cc:Date:From:Reply-To:Subject:To; b=px5PHc4dYDOJ3WYNa2PA3dL4C4eeW3x02Dql1sZ4GJkrpNQi8aVwKXae0CQAsJep7ad aKVJRR+GYaDDRn3jwejtLZ9Nid7UCclkQj9kYP+TyS7N4yP9IXmzm1E80zshiYhpJZdNS pXC3RxgYYvkhtNUSQZIxRUXTZ2drtlqXh4c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639642250116100002 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. based on the which pcd platform set, use that. 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 Reviewed-by: Chasel Chiu --- .../FspmWrapperPeim/FspmWrapperPeim.c | 25 ++++++++++++++++--- .../FspmWrapperPeim/FspmWrapperPeim.inf | 3 ++- .../FspsWrapperPeim/FspsWrapperPeim.c | 25 ++++++++++++++++--- .../FspsWrapperPeim/FspsWrapperPeim.inf | 3 ++- IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 2 ++ 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelF= sp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c index 287e7f9159..49fbb27eca 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 **/ @@ -38,6 +38,25 @@ =20 extern EFI_GUID gFspHobGuid; =20 +/** + Get the FSP M UPD Data address + + @return FSP-M UPD Data Address +**/ + +UINTN +EFIAPI +GetFspmUpdDataAddress ( + VOID + ) +{ + if (PcdGet64 (PcdFspmUpdDataAddress64) !=3D 0) { + return (UINTN) PcdGet64 (PcdFspmUpdDataAddress64); + } else { + return (UINTN) PcdGet32 (PcdFspmUpdDataAddress); + } +} + /** Call FspMemoryInit API. =20 @@ -67,7 +86,7 @@ PeiFspMemoryInit ( return EFI_DEVICE_ERROR; } =20 - if ((PcdGet32 (PcdFspmUpdDataAddress) =3D=3D 0) && (FspmHeaderPtr->CfgRe= gionSize !=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 // @@ -79,7 +98,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..5d0e021401 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 # @@ -60,6 +60,7 @@ gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ## CONSUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64 ## CONSUMES =20 [Sources] FspmWrapperPeim.c diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelF= sp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c index f7459a90b5..ddee9cd029 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 **/ @@ -181,6 +181,25 @@ FspSiliconInitDoneGetFspHobList ( } } =20 +/** + Get the FSP S UPD Data address + + @return FSP-S UPD Data Address +**/ + +UINTN +EFIAPI +GetFspsUpdDataAddress ( + VOID + ) +{ + if (PcdGet64 (PcdFspsUpdDataAddress64) !=3D 0) { + return (UINTN) PcdGet64 (PcdFspsUpdDataAddress64); + } else { + return (UINTN) PcdGet32 (PcdFspsUpdDataAddress); + } +} + /** This function is for FSP dispatch mode to perform post FSP-S process. =20 @@ -283,7 +302,7 @@ PeiMemoryDiscoveredNotify ( return EFI_DEVICE_ERROR; } =20 - if ((PcdGet32 (PcdFspsUpdDataAddress) =3D=3D 0) && (FspsHeaderPtr->CfgRe= gionSize !=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 +311,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..da0049a654 100644 --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.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 # @@ -68,6 +68,7 @@ gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ## CONSUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress64 ## CONSUMES =20 [Guids] gFspHobGuid ## CONSUMES ## HOB diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2Wrapper= Pkg/IntelFsp2WrapperPkg.dec index b8dac1b574..a5a8b8a19e 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 --=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 (#84968): https://edk2.groups.io/g/devel/message/84968 Mute This Topic: https://groups.io/mt/87763051/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-