From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.28443.1632732297736627102 for ; Mon, 27 Sep 2021 01:44:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=piVKFrmk; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: star.zeng@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10119"; a="285447124" X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="285447124" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 01:44:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="518483322" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 27 Sep 2021 01:44:53 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 01:44:52 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 01:44:52 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 27 Sep 2021 01:44:52 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 27 Sep 2021 01:44:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aegYfx13U2QiUPTYAdkf7cJsk9hfPHZss52fVuI/a5qfTB7UEPDd51q5fsA/GH3oIX4Z2P/s/vkBTblbkD3GNiYlQmJNBhZDAkP+Hn2CEnM8m5A4RvkG76pzwRoaZuY9attEooL+n43ZWGJtvrbYrfVPqNXf2GOeJn+PI8WS5CG1fv0v22BnZzyUJgVOqO1ZU7aQwcx2TGocaAYZAU0QY6zwc/GkJ6YHKWmKIdolDgYHHxmdau2ZqvaNy5IAG57c6hfrw5+TFYpMhChHcrK/ScIM18NHp10RAkQ60qOK5uVzmDsV1v6PrtGTGd0ubVYiKr5ukfNvH41IhPRUlbAZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QRDTujPpp/3ijoyrjuGUoZ1ZWops+Vj8LhAJ1gTpgt0=; b=Go3mJVq4Qxu365z8S7vonMIj7Jj7/LBM8PIlfHtcVTvBAQPrzhz1VvmqiYoWRDuSjnU471n/du6na/GJdX0VbSNmiv4EmW8m4pA3nH736YHwgUdfleKJaq8JkspQMqi3ceIjWALzkUNFltASPbgf6lXaBC1Aa2wjMWYU+uKtFRH57bnqaAgybNonmD9Ajp1R9p6ilbWTkXOVPbuAKwT5t1RaLJfIKSd7aROLsBCVt2QifMBf/M4+k2K4qP4Q/2X4pfDNJBJDG7muC6JoS/FK1zbVvHhOOuvVXfRNqLLn3TPIMSB1cCzZ4H6giSxnwXlNbCWM2Yo1MA1rTOPe63tluQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QRDTujPpp/3ijoyrjuGUoZ1ZWops+Vj8LhAJ1gTpgt0=; b=piVKFrmkdpK6bEPceEYXFHbUWSfBb5ZRrT1yC+/MVMeZTsdxhQatmEI8f1NIeVYqIXpPokytSn0UGoTfy+N/3edwrweYmpmB/CM5yDHBotW9lWsRFRHocRe59Lt9K+S8cFn/BwO3vvfNDPjFsfi+5yZWk6xXXASeC3czZSk94Fw= Received: from DM6PR11MB4058.namprd11.prod.outlook.com (2603:10b6:5:193::13) by DM5PR1101MB2363.namprd11.prod.outlook.com (2603:10b6:3:a7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Mon, 27 Sep 2021 08:44:51 +0000 Received: from DM6PR11MB4058.namprd11.prod.outlook.com ([fe80::dd12:1911:3b44:25b4]) by DM6PR11MB4058.namprd11.prod.outlook.com ([fe80::dd12:1911:3b44:25b4%4]) with mapi id 15.20.4544.021; Mon, 27 Sep 2021 08:44:51 +0000 From: "Zeng, Star" To: "Chiu, Chasel" , "S, Ashraf Ali" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Kuo, Ted" , "Duggapu, Chinni B" , "Chaganty, Rangasai V" , "Solanki, Digant H" , "V, Sangeetha" , "Ni, Ray" , "Zeng, Star" Subject: Re: [PATCH v7] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type Thread-Topic: [PATCH v7] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type Thread-Index: AQHXsTlTJ6fjWxdzhUigwLgljBZrPau3Fl+AgAB9PxA= Date: Mon, 27 Sep 2021 08:44:51 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4e22c3ea-274e-413e-251c-08d98193121f x-ms-traffictypediagnostic: DM5PR1101MB2363: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:873; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wkEt6HsWshJKqNg8ho1cTCb8XRa/BS5rSAgMb2JDM9AH/wu4hF9jBZEl5Gl2e1t1cySTI3+A+yKFCEJ58fqkdxqhLU4PyAcYk//1iDCtyis7GYLJstiGRuQesz4KUh70OvVtTQENnnxxAS3eiGChcxfPtXKLRJnWRa022jvNx3xYQGfimRhub177ttZgMn27RgWTdc1+hHhjHt1os+Ipmte0TYDqew9Chu2fXhvFJrKxseVevTwXZe7gGPuoCc0NyKu0jjjJc3QjsAkdz3JBWz17h9IsmPTbH6jgu0NVqM9yknNG4HgQs/9s5aWHtX/mTI15yLlS5i6OS4bs25njFZDpm0j4SIkvHWeacdhaZl6Js5Gct2sKsAocsi5w43eux4Pf9fvWloSuZlYix/LMVtIO2RWlqNu5CaQLRNtu0K8qBOZg06aK8GG+iYW9Br95MchPxzn+gZdinCNzsAnTxJk/iaw2hfKzEI/f5NCJjWulB2nRTD3xQpKcZrzR30JA+/3YRHnnGEx0Bvc9JLP0cpdERidssoxsAMD9oLw2JFdyEw8Xd/KGYtx522OTtOQEkL5rCIRl0ErBo4+4U3UGNsvPBR56iumCIhP6dV8gFJrZ+NzkYXxAjF17blgJl37mfV4YuPt1SGL6NWp8oHg5MGgNLXNicwAo6G3rK1/mpwUldqmAzuSO79DudkbzOKhCg4zpm0KzBDZcyYkGunVp80KEHY1eBLMmIukpuEOc/pysR2HZLa2xZ01AwiMmuNEVkBJhQFehNjNDhtqsVboM6uqE50TSt04nfdUvoxgYIp8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4058.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(186003)(54906003)(64756008)(66946007)(66556008)(30864003)(122000001)(5660300002)(86362001)(110136005)(38100700002)(2906002)(66476007)(8676002)(8936002)(66446008)(26005)(33656002)(76116006)(316002)(83380400001)(52536014)(6506007)(38070700005)(19627235002)(9686003)(71200400001)(4326008)(7696005)(55016002)(508600001)(107886003)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Cz8BU8APh7tI4XZl04qat7+I9n2CfVgxy25XRiaQJNHMFarygIds413GSmde?= =?us-ascii?Q?LmCspxGWag/aqFNUris8oS0Ixqn78vy54REtHEQ9f4RLh9IPb3rqekoRZ9l7?= =?us-ascii?Q?eQSpYJ5zAcYsCTxWFUvYbPe4CWwuiC2jEQ7VhW0JKy0gSgZIMVKZA6WL7nTk?= =?us-ascii?Q?yM/N5n2Uj0XHcl92oz6RYsicYkti7lNpBMHKA8subZxZNAVlaOi9iLzdWgyb?= =?us-ascii?Q?zqUjgRVACMMtH5QdOlvEsV2GAU0B5Z5Z+/aNBpLISejk8eqKZItQSIYCMeA2?= =?us-ascii?Q?3UA17k2tO3U8d6jHuMFBMi+g2cVBeOfm9cCVozQK7kTUBDQIpwiF9kZ8jArg?= =?us-ascii?Q?I9zTej3UZm38By9UKk/0FO3KItIUss8StKL0mYce3pxRn2gFBVoUK5qsRxNj?= =?us-ascii?Q?B/Dfjfcogzdst3x8U144p4krEoUszveHp9DJIV/hADqDaqrh49ZDLSefc24g?= =?us-ascii?Q?sXFC1yzdmalhqOE9xaAGFK9/YH/1NywCVFU/CMgcDDO3ndsLyEBWdrtwCncU?= =?us-ascii?Q?ZpFw/YRH+tTpo/XLxcePsQFNZ2PQEbU0oKfc1GzyMYywCh+NpHAsh9XplSXz?= =?us-ascii?Q?FQLlM9e7Bgjl7WohqxMFCwCeBviYNuPjICDNc89Ur4piSt14BbyrkZN+WlQj?= =?us-ascii?Q?x6zTx9gFo7ijgH2itIrCM27sotMzI4qZX8FTJPkipqyA96WmBWhKNysFFswu?= =?us-ascii?Q?K365ZK0iYElV5Levr41kXQadZCcZgGDRIurEMXurwaGnLdrW8LAlLweZk+rY?= =?us-ascii?Q?bXOlY9n+HCzx8IGldgilOl/s8ymKJL1H/zHpCxqvoTzNIpaBAmefXoAVC+YK?= =?us-ascii?Q?8Uis5DUdtjQqH0dlTFq4EwRQDOF5b9MMRusac5MWeDh5zXrBnPX9DMSMiUch?= =?us-ascii?Q?XzYNiYAmSoeRvIVY5X5L4PICYiMTzMWhlqCHwpC4KFYISFIGQfwPjOpJFLJG?= =?us-ascii?Q?y6IR4QLPMTXf6OqWm/p7YenCkXKHk1p7XtPZUFMRoflu11LfidvAxlaLY/qc?= =?us-ascii?Q?mnw/skVQB3KM+UB7oOnTMBo9uRtcnHobqSp24xeOLccsI6+YQ0v3EBurJXKc?= =?us-ascii?Q?HXIz+XW5yVHMtZKG2KRWFyqgDYYihvt1064rISOVgn82m966mMgoeeP2Kf5o?= =?us-ascii?Q?GLbCcRRkCJaBFrpwSJiehCBMnBL3Kl3YrD8RaoAmZItoqJ6Kq1EDaetU7P0C?= =?us-ascii?Q?jSEmW+I6MXg9nVcGZ79fYZOWZdWJsMoif5E/Gq1of4WDTRB0d9AwsM+hL2LV?= =?us-ascii?Q?1sZqDJdx00UaaZs14ZLBWZUJODdTxCtNhjvfl+kz4v03tIhvIaPoCxSKDG+D?= =?us-ascii?Q?kz5b7XwzN7QZJ1pchCHhdIaq?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4058.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e22c3ea-274e-413e-251c-08d98193121f X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2021 08:44:51.2573 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Mk0Fp6GorbzJbThIFoPMLW9a7AJ7dDzCvFE9cuN1HCy0ATlv89c23IMIkvCoVRnA4ZQKDCyv5XnPMNFY5dUZCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2363 Return-Path: star.zeng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Curious: It does not work to have one function implementation like below? UINTN EFIAPI GetFspmUpdDataAddress ( VOID ) { if (PcdGet64 (PcdFspmUpdDataAddress) !=3D 0) { return (UINTN) PcdGet64 (PcdFspmUpdDataAddress64); } else { return (UINTN) PcdGet32 (PcdFspmUpdDataAddress); } } Thanks, Star -----Original Message----- From: Chiu, Chasel =20 Sent: Monday, September 27, 2021 9:10 AM To: S, Ashraf Ali ; devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Zeng, Star ; Kuo, Ted ; Duggapu, Chinni B ; Chaganty, Rangasai V ;= Solanki, Digant H ; V, Sangeetha ; Ni, Ray Subject: RE: [PATCH v7] IntelFsp2WrapperPkg : FSPM/S UPD data address based= on Build Type Reviewed-by: Chasel Chiu > -----Original Message----- > From: S, Ashraf Ali > Sent: Friday, September 24, 2021 7:43 PM > To: devel@edk2.groups.io > Cc: S, Ashraf Ali ; Chiu, Chasel=20 > ; Desimone, Nathaniel L=20 > ; Zeng, Star ;=20 > Kuo, Ted ; Duggapu, Chinni B=20 > ; Chaganty, Rangasai V=20 > ; Solanki, Digant H=20 > ; V, Sangeetha ;=20 > Ni, Ray > Subject: [PATCH v7] IntelFsp2WrapperPkg : FSPM/S UPD data address=20 > based on Build Type >=20 > 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=20 > width which cannot be fit in 32bit address which will lead to error.=20 > 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 >=20 > 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 | 19 +++++++++++--- > .../FspmWrapperPeim/FspmWrapperPeim.inf | 16 ++++++++++-- > .../FspmWrapperPeim/IA32/FspmHelper.c | 26 +++++++++++++++++++ > .../FspmWrapperPeim/X64/FspmHelper.c | 26 +++++++++++++++++++ > .../FspsWrapperPeim/FspsWrapperPeim.c | 17 +++++++++--- > .../FspsWrapperPeim/FspsWrapperPeim.inf | 14 +++++++++- > .../FspsWrapperPeim/IA32/FspsHelper.c | 26 +++++++++++++++++++ > .../FspsWrapperPeim/X64/FspsHelper.c | 26 +++++++++++++++++++ > IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 2 ++ > 9 files changed, 162 insertions(+), 10 deletions(-) create mode=20 > 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c > create mode 100644 > IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c > create mode 100644 > IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c > create mode 100644=20 > IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c >=20 > diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > index 24ab534620..4a15136c39 100644 > --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > @@ -3,7 +3,7 @@ > register TemporaryRamDonePpi to call TempRamExit API, and register=20 > MemoryDiscoveredPpi > notify to call FspSiliconInit API. >=20 > - Copyright (c) 2014 - 2020, Intel Corporation. All rights=20 > reserved.
> + Copyright (c) 2014 - 2021, Intel Corporation. All rights=20 > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -39,6 +39,17 @@ >=20 > extern EFI_GUID gFspHobGuid; >=20 > +/** > + Get the Fspm Upd Data Address from the PCD > + > + @return FSPM UPD Data Address > +**/ > +UINTN > +EFIAPI > +GetFspmUpdDataAddress ( > + VOID > + ); > + > /** > Call FspMemoryInit API. >=20 > @@ -59,7 +70,7 @@ PeiFspMemoryInit ( >=20 > DEBUG ((DEBUG_INFO, "PeiFspMemoryInit enter\n")); >=20 > - FspHobListPtr =3D NULL; > + FspHobListPtr =3D NULL; > FspmUpdDataPtr =3D NULL; >=20 > FspmHeaderPtr =3D (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32=20 > (PcdFspmBaseAddress)); @@ -68,7 +79,7 @@ PeiFspMemoryInit ( > return EFI_DEVICE_ERROR; > } >=20 > - if (PcdGet32 (PcdFspmUpdDataAddress) =3D=3D 0 && (FspmHeaderPtr- > >CfgRegionSize !=3D 0) && (FspmHeaderPtr->CfgRegionOffset !=3D 0)) { > + if (GetFspmUpdDataAddress () =3D=3D 0 && (FspmHeaderPtr->CfgRegionSize= =20 > + !=3D > + 0) && (FspmHeaderPtr->CfgRegionOffset !=3D 0)) { > // > // Copy default FSP-M UPD data from Flash > // > @@ -80,7 +91,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/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > index 00166e56a0..5b4ad531e7 100644 > --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > @@ -6,7 +6,7 @@ > # register TemporaryRamDonePpi to call TempRamExit API, and register=20 > MemoryDiscoveredPpi # notify to call FspSiliconInit API. > # > -# Copyright (c) 2014 - 2020, Intel Corporation. All rights=20 > reserved.
> +# Copyright (c) 2014 - 2021, Intel Corporation. All rights=20 > +reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -45,6 +45,7 @@ > FspWrapperApiLib > FspWrapperApiTestLib > FspMeasurementLib > + PcdLib >=20 > [Packages] > MdePkg/MdePkg.dec > @@ -56,14 +57,25 @@ >=20 > [Pcd] > gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## > CONSUMES > gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES > gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress ## CONSUMES > gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ##=20 > CONSUMES >=20 > +[Pcd.IA32] > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## > CONSUMES > + > +[Pcd.X64] > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64 ## > CONSUMES > + > [Sources] > FspmWrapperPeim.c >=20 > +[Sources.IA32] > + IA32/FspmHelper.c > + > +[Sources.X64] > + X64/FspmHelper.c > + > [Guids] > gFspHobGuid ## PRODUCES ## HOB > gFspApiPerformanceGuid ## SOMETIMES_CONSUMES ## GUID > diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c > b/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c > new file mode 100644 > index 0000000000..cab11173cc > --- /dev/null > +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c > @@ -0,0 +1,26 @@ > +/** @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=20 > + > + > +/** > + Get the Fspm Upd Data Address from the PCD > + > + @return FSPM UPD Data Address > +**/ > +UINTN > +EFIAPI > +GetFspmUpdDataAddress ( > + VOID > + ) > +{ > + return PcdGet32 (PcdFspmUpdDataAddress); } > diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c > b/IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c > new file mode 100644 > index 0000000000..25b89ff2e1 > --- /dev/null > +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c > @@ -0,0 +1,26 @@ > +/** @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=20 > + > + > +/** > + Get the Fspm Upd Data Address from the PCD > + > + @return FSPM UPD Data Address > +**/ > +UINTN > +EFIAPI > +GetFspmUpdDataAddress ( > + VOID > + ) > +{ > + return PcdGet64 (PcdFspmUpdDataAddress64); } > diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > index 9d4f279e81..8bd510502f 100644 > --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > @@ -3,7 +3,7 @@ > register TemporaryRamDonePpi to call TempRamExit API, and register=20 > MemoryDiscoveredPpi > notify to call FspSiliconInit API. >=20 > - Copyright (c) 2014 - 2020, Intel Corporation. All rights=20 > reserved.
> + Copyright (c) 2014 - 2021, Intel Corporation. All rights=20 > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -58,6 +58,17 @@ S3EndOfPeiNotify( > IN VOID *Ppi > ); >=20 > +/** > + Get the Fsps Upd Data Address from the PCD > + > + @return FSPS UPD Data Address > +**/ > +UINTN > +EFIAPI > +GetFspsUpdDataAddress ( > + VOID > + ); > + > EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc =3D { > (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |=20 > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), > &gEfiEndOfPeiSignalPpiGuid, > @@ -283,7 +294,7 @@ PeiMemoryDiscoveredNotify ( > return EFI_DEVICE_ERROR; > } >=20 > - if (PcdGet32 (PcdFspsUpdDataAddress) =3D=3D 0 && (FspsHeaderPtr- > >CfgRegionSize !=3D 0) && (FspsHeaderPtr->CfgRegionOffset !=3D 0)) { > + if (GetFspsUpdDataAddress () =3D=3D 0 && (FspsHeaderPtr->CfgRegionSize= =20 > + !=3D > + 0) && (FspsHeaderPtr->CfgRegionOffset !=3D 0)) { > // > // Copy default FSP-S UPD data from Flash > // > @@ -292,7 +303,7 @@ PeiMemoryDiscoveredNotify ( > SourceData =3D (UINTN *)((UINTN)FspsHeaderPtr->ImageBase +=20 > (UINTN)FspsHeaderPtr->CfgRegionOffset); > CopyMem (FspsUpdDataPtr, SourceData, (UINTN)FspsHeaderPtr- > >CfgRegionSize); > } 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/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > index aeeca58d6d..e988ebab21 100644 > --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > @@ -45,6 +45,7 @@ > FspWrapperApiLib > FspWrapperApiTestLib > FspMeasurementLib > + PcdLib >=20 > [Packages] > MdePkg/MdePkg.dec > @@ -65,10 +66,15 @@ >=20 > [Pcd] > gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES > gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES > gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ##=20 > CONSUMES >=20 > +[Pcd.IA32] > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES > + > +[Pcd.X64] > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress64 ## > CONSUMES > + > [Guids] > gFspHobGuid ## CONSUMES ## HOB > gFspApiPerformanceGuid ## SOMETIMES_CONSUMES ## GUID > @@ -76,5 +82,11 @@ > [Sources] > FspsWrapperPeim.c >=20 > +[Sources.IA32] > + IA32/FspsHelper.c > + > +[Sources.X64] > + X64/FspsHelper.c > + > [Depex] > gEfiPeiMemoryDiscoveredPpiGuid > diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c > b/IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c > new file mode 100644 > index 0000000000..c4ae292ffb > --- /dev/null > +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c > @@ -0,0 +1,26 @@ > +/** @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=20 > + > + > +/** > + 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/FspsWrapperPeim/X64/FspsHelper.c > b/IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c > new file mode 100644 > index 0000000000..a0d6adb281 > --- /dev/null > +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c > @@ -0,0 +1,26 @@ > +/** @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=20 > + > + > +/** > + Get the Fsps Upd Data Address from the PCD > + > + @return FSPS UPD Data Address > +**/ > +UINTN > +EFIAPI > +GetFspsUpdDataAddress ( > + VOID > + ) > +{ > + return PcdGet64 (PcdFspsUpdDataAddress64); } > diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec > b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec > index a3b9363779..8c98dbd55d 100644 > --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec > +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec > @@ -121,3 +121,5 @@ > # >=20 > gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress|0x00000000|UIN > T32|0x50000000 >=20 > gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress|0x00000000|UINT > 32|0x50000001 > + > + > gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64|0x00000000|U > IN > + T64|0x50000002 > + > + > gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress64|0x00000000|UI > N > + T64|0x50000003 > -- > 2.30.2.windows.1