From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.29192.1632737742877884081 for ; Mon, 27 Sep 2021 03:15:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=qeB32cQI; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: ashraf.ali.s@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10119"; a="221246854" X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="221246854" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 03:15:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="615719491" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga001.fm.intel.com with ESMTP; 27 Sep 2021 03:15:41 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX605.amr.corp.intel.com (10.22.229.18) 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 03:15:41 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) 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 03:15:41 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.103) 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 03:15:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=myJk9jTrE7k2FTt1j7vvhZ/b93bMNQp1ouiknXB2wu4ilUjG+2dk8efJClcgcXXZqNSwR8dLPY/8OJnUNyb+MSqUlauY7+ojQLQabi8fCaedfwTWq4qOumm8vncDQIEwfoh6x3h2wbIhYZFKhw/LnFUbejWGfgEoNPH+B92bFj9k/FYLBcpCFIWPL7057I4wb2ya9OV6GzOEjhP3DhtY8negDzv0utBpN/XigB6e6AQxOLCH7ZfZFYQLemzTvwVNn/aU7Nm7mQE2IHmw1jE6qPIHUw9LXLe5UmS6gpfGCPp0hx+XmCzam8tq1bJmL+7OzvU8/yTIWX2ZzUrYe0KP7w== 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=9ZjR6BPE+ccxO7QHzDhD8duBD5iFcjbO1JE8OVe5zF0=; b=O5gJ/tbPFLebFUSjNXVCW217EcuajyZkouR3BTOzYFh0DIfrUwvZ+ToKE8nZbL1IMihwajZaJXaybUVG1h20nOrWNSNdAjMmMDGdoUPF2eeC+Q/enf4IHsU5LLV2vW7stOHFXKIN/BebYkTQsJsAGhp4EI9dYoJ9BDFmAAF8ckNLvByjgSLBrv1SJh/28+dh6yPbnHpIyW1NJKgnPVarh15IHLHRLDbAY7HazfMaK5jDF6rPYfLFGDFeEdH5EVgwO7BkaEQUlSE8G7nIjkb76wapg+x9m9FQWhl9E5jIMWBU2JSZH9Y5XhZLOLAY5NIYwgMlukFPJUIoDd22TXA5Fw== 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=9ZjR6BPE+ccxO7QHzDhD8duBD5iFcjbO1JE8OVe5zF0=; b=qeB32cQIxy4x0f/KQIvDFWCH8TbZEgFIjjKBrgFsgiEWDw6RpURa+7oVH6y7NPoqk+KJX04wTbVMJwlTagP9Isze8obDLQPAQPWfx/zZ94rxmLAljYdOeCX+u9mgXYOM8+lcGyLElCGB3VhE6cmWDH4FOZoYEzFhdOlKYY20iwY= Received: from DM4PR11MB5280.namprd11.prod.outlook.com (2603:10b6:5:38b::18) by DM5PR1101MB2265.namprd11.prod.outlook.com (2603:10b6:4:50::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Mon, 27 Sep 2021 10:15:34 +0000 Received: from DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::50ee:dd49:1b33:c557]) by DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::50ee:dd49:1b33:c557%2]) with mapi id 15.20.4544.021; Mon, 27 Sep 2021 10:15:34 +0000 From: "Ashraf Ali S" To: "Zeng, Star" , "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "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 Thread-Topic: [PATCH v7] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type Thread-Index: AQHXsTlTwft93cADz0at+gNwW+WdUau3Fl+AgAB/DYCAABbnkA== Date: Mon, 27 Sep 2021 10:15:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-Mentions: star.zeng@intel.com X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows 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: ffa0d3f8-5c7b-4484-c0f3-08d9819fbe9e x-ms-traffictypediagnostic: DM5PR1101MB2265: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1468; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6CFNpDBCixD7Fbf+by2rwe4JHiZN1pVYM6srSDTeX4TrSjR1gCBQ0V1aQCucD0x6HOrwRbiJgHRIAwTRB7/7lYr9G6IlW2cM3YH49VPtchvEwUXgDTnj3V3Gn2pHxac5pD5Q/pCzw2cXv+5n3nCUX48SCCEdBZWPLUHLb8iBnveS51k5wzc9X4Bsy0lk3jIfKwHN8lEgAm6bqizRaSktifnodrD1BT26qvj6rP7n/w/Bdmns4Ltj9EmqD5Oub0S9pDNeA+Z205sPl5+xi1Adf7rVFNF2S91p3nZXVMEHFRLFveW8Trs1LU6/1ll63Lg8Ghwp3NW3U9LxBL+21fome7nkgRgTBhQeeLjjmQJ9ppq1aSzQJCgdB9SflGABsx2vUWDVjRqTIK3sDofRWixVfEk2O0TjOYpt8m8ytJF91s0TLxfgJ8QAMRaxW4aQHV6/0J8KTaod+FXUlzB4ejLjeM0ZC0Y1DtFu/IXFJt9lttd3CuM88iRS8L2m9CjOgez/vauuFJK3cRLaPaLPo6QqEVjKUZJacJ4vZuq9d9PF2cJmNp5k4AHpsfJKUTjwp0RSSHZlQ4Rbxz1iM+uUeirO8E5bM4qWuBuNA8Gx7liRQ8nJmCIaRFTocUjBy/ZI+cFnf1GJPrYLtUnPyXRdb1DgMd9HCjrR6iENwEwAfq5zLilhyUEGCdFsN/4DsHSjgug1CVbLV03uyffPWGph8fys0C2fizIp0VguitFeLINN5mapkPtQVz9/d2vC7vF9hE7ZIGL+DuNu4SyA77bk75ouXrbaoc6Dze1qPH7eKh2hvHs= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5280.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(8676002)(8936002)(86362001)(110136005)(6506007)(54906003)(316002)(107886003)(53546011)(4326008)(19627235002)(71200400001)(83380400001)(76116006)(186003)(9686003)(33656002)(38070700005)(55016002)(66946007)(2906002)(5660300002)(66446008)(66476007)(66556008)(64756008)(38100700002)(30864003)(122000001)(52536014)(508600001)(26005)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?sNfeOCuh3s4kf+6y6VFdO0sDUzAHhXojUnqxjJI5Pa12QFKJaRGEx/wHke?= =?iso-8859-1?Q?Qw50q4SXBFP/rVpTcxeUT/tFFtpiuzip4p5o73yyZTj9T4TrP5MjLffwlh?= =?iso-8859-1?Q?gC6hoqRLXbRC0Qij2WeSMCnUjIl/8dpBXrQbDg4pHVhlcNtzQ4GzESdfG9?= =?iso-8859-1?Q?T5HAf2NCNVu0Sn5VORqWQwRJqf0WEuVDl1b9EQzNJ4y4RdxdBlN9iTXW4A?= =?iso-8859-1?Q?Zq9ZdzXk3QhuxlztM5LY5joOqYbYh7M7O2CBtV6E/MnEU92DU5sZG3IB9D?= =?iso-8859-1?Q?2GcN1fHK4iJTFKBJHFnsiWFEUxqT67D5tn+gDvhybDouoRA3FdgNogJq5P?= =?iso-8859-1?Q?8PBcomJ/bS20Otb0yt1+wBzYqILowAu0eiNGbG/Ib0QFnvKfvIyQZdzwHe?= =?iso-8859-1?Q?htsYXMKnuoUOTIVoAIs0DYGEalnPx+lF019IUY41hXu44sUnnK+/kK6PEd?= =?iso-8859-1?Q?evPdIhCWJ9FWxihYYk2j+7vAf8Zv/HM4BtcYt7DgPjSwhCx288+7WJcum4?= =?iso-8859-1?Q?6iwcnHLXcwfAVBjnEB3MVIFNVzKfkLv+iJFfX3wS+olDWQMpuUclgLGb0V?= =?iso-8859-1?Q?a1pIV+zICauXgppBOnsBkRwYdvRR6lZgrqtMszxIC+tPgSWgfjbJV6xpB+?= =?iso-8859-1?Q?CyasTXcOPbmsIVkvKW/eXZUrE+5BGBFJ3qFNFjSzhihlLTVypt+TUycG/N?= =?iso-8859-1?Q?n4J39Mxg/XSkj42tfd2m8lSiKO1K/Ov6Upq/DPCl5p+OTIBg7pBrwvgRBK?= =?iso-8859-1?Q?GuK36XIoz/EFWse8ZPpZNubCKcgYbfAlUVss8TQRa3gTQNBP3FAKa4PPh5?= =?iso-8859-1?Q?nkbd90RrNlp11AD4AnYjlD7oerTNbxwyEcSkZOSDODAV1EcAjkJCnNLpgL?= =?iso-8859-1?Q?9uZI3JLLbl8tIYef0HjzPPFRktqZ8yfwK427FJNDTLVYCoOkkcACiS6T6o?= =?iso-8859-1?Q?P7HW0P0h+6xLGU+IotVDN1Dm6A6f4RC/qpOdg5lgSYvqMqPEcV3SCbIcVA?= =?iso-8859-1?Q?HTItYtoHtOrjarr5EDc/AM6u3NPHO8adwi6E5fl7qxdyg0VhNPWZdMWCJm?= =?iso-8859-1?Q?uO4h6iPr1UenLimo5jDy7qNHtsB2+h5KXmB6zcTFfKuJCGLxfVfMNCneKo?= =?iso-8859-1?Q?0y6296CuYsF+MLnkj6lj8ZWjkkDOgs2NObDD21VTEvPzytXP5iT6jpC44l?= =?iso-8859-1?Q?BBX/KgJ3Ox+xxgj1U7EGwCtbR3InKQKtYQBkxSwWKjKVKl8qKpIkwWRQ5M?= =?iso-8859-1?Q?aISHf+JtproGgBP2x3sfNTEZzKX59pR082IA61HpLPeaOO5k39bFnEVx+t?= =?iso-8859-1?Q?Tl1fJPxTV1Yu0EEyRzK3ZS9glt3AQLow3HWAM1yurGpz0TE=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5280.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffa0d3f8-5c7b-4484-c0f3-08d9819fbe9e X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2021 10:15:34.5682 (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: fC6+0IMumIFMiPrCltyK64gvyhnr27bJcytRCuE1QhQosjOO9xrQTHHuAjNktpggaASDzS3jl+BxJXkpq//9BA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2265 Return-Path: ashraf.ali.s@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi., @Zeng, Star Creating a single function is doable, but the problem with that is=20 If someone set the PCD PcdFspmUpdDataAddress64 accidentally which should b= e applicable only in X64. Since the PCD has some junk value, it will return= the false data in IA32 case. Which will break everything with respect to F= SP-S/M. To Avoid Such cases separating the IA32 vs X64 is more feasible. And easily= differentiating with IA32 and X64.=20 Regards, Ashraf Ali S Intel Technology India Pvt. Ltd.=A0 -----Original Message----- From: Zeng, Star =20 Sent: Monday, September 27, 2021 2:15 PM To: Chiu, Chasel ; S, Ashraf Ali ; devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Kuo, Ted ; Duggapu, Chinni B ; Chaganty, Ra= ngasai V ; Solanki, Digant H ; V, Sangeetha ; Ni, Ray ; Zeng, Star Subject: RE: [PATCH v7] IntelFsp2WrapperPkg : FSPM/S UPD data address based= on Build Type 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