From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.567.1635476629220097154 for ; Thu, 28 Oct 2021 20:03:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=txx1+Oe+; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: heng.luo@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10151"; a="294036980" X-IronPort-AV: E=Sophos;i="5.87,191,1631602800"; d="scan'208";a="294036980" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 20:03:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,191,1631602800"; d="scan'208";a="495598294" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga007.fm.intel.com with ESMTP; 28 Oct 2021 20:03:47 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 20:03:47 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 20:03:46 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 28 Oct 2021 20:03:46 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 28 Oct 2021 20:03:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PBu2VNreAhOUqOApko+/WSPiTgGI8Z3XYa48RNUYzric+hOxjD9MzivdggRGP+MsV2G4iz6a9LuZcrLZBD70BYebpMJed6nScXya2O/vrPbDlT836F/Pub/PFa9rb6ZYOxcVgLDKXBZvMpIYoXJfxwU25hH+GuCpXIkVHwXtb2IVRdvh5dPHeffaHSzs6+9klW4tQrNENvog7zrkKWFtJkXiYUPPa/fmdhzt9KU7jyUHE14kL3pUwQTgLNmMIQqgjhqvB4sS/xwYiQzZ5e9e//s2/IKpUhTav+hZIupaoaDw0rjggs8h6webYJbaGXoZrbVihtO1Kh+Ad+UKWHOZnQ== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vGaARkJ0LviSWKmQt0k01Oni04JF+/xAFlJRSjjRbS8=; b=csbK7fUtmalkxse9q8O7VzUnJJPWgxnA3O/rotZ23Y4OwO7WBdx+eUmE4NltAsH27oOIx1UGbMorJk37N1S0BoR+s6UHPMUB68+ndOJ9RL2S/wxR2fCR4l9vx0HteelZsKKE6R4TbUjUOkBS0tJ6JLyhyZm2QUtDdoL5QXPX8NIe8poPvXVezuyaBUg2r6PTtYxqgD4/QTQPnbIdkdio7e9gfWAtUktUuTJDes15MRqFZJr3E83aE92dfSqGgqjwbm3+91LS3uAeMnYX83LWJymqX4WcTomOlj4uxkUg88/Kt7s55synLxKMu6krQ4raIUTCma1M05NgiBJ7NN/b1w== 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=vGaARkJ0LviSWKmQt0k01Oni04JF+/xAFlJRSjjRbS8=; b=txx1+Oe+IKB+8ziOZc3/czXDgST6HLQgg2XKmp+pb9r3WO6YfUs9E/5rtEhyLDfRiDiBa0eMpChveF2rvFtym11OVKurjd8OWQZyDEFBL9SskxOAmadb/M9bks9hNqA1mXmyY5MCvxdHRnt8PzyndL/nV7Bkdgsst1XVTbZabuU= Received: from SN6PR11MB2752.namprd11.prod.outlook.com (2603:10b6:805:59::31) by SN6PR11MB2974.namprd11.prod.outlook.com (2603:10b6:805:d7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Fri, 29 Oct 2021 03:03:45 +0000 Received: from SN6PR11MB2752.namprd11.prod.outlook.com ([fe80::797d:13bd:e7dc:3918]) by SN6PR11MB2752.namprd11.prod.outlook.com ([fe80::797d:13bd:e7dc:3918%4]) with mapi id 15.20.4628.020; Fri, 29 Oct 2021 03:03:45 +0000 From: "Heng Luo" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Desimone, Nathaniel L" Subject: Re: [PATCH v6 31/52] TigerlakeOpenBoardPkg: Remove SmmSpiFlashCommonLib Thread-Topic: [PATCH v6 31/52] TigerlakeOpenBoardPkg: Remove SmmSpiFlashCommonLib Thread-Index: AQHXzDzf2jxaIl7KTEiMpmsi1OylV6vpSqzg Date: Fri, 29 Oct 2021 03:03:45 +0000 Message-ID: References: <20211028204326.645-1-mikuback@linux.microsoft.com> <20211028204326.645-32-mikuback@linux.microsoft.com> In-Reply-To: <20211028204326.645-32-mikuback@linux.microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 40635a59-9f87-4aad-4290-08d99a88b88b x-ms-traffictypediagnostic: SN6PR11MB2974: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ofMnV6Ra//g5qa6o4UGN2Fuf1zieuG7Nwq1PvetZUhK2pKtDtLEylehHtu2/lcLxm4KgpvVDh9qYfj+GUFE24DnZTeHRwKBxuv5+2y7pVZFyE+8XRW2hHn1LyqmDKlVt2OE5wguMR6XsTZ37yQpDaUEjeswPfN4axRGlnKqe+pgRFArNoIMCq4O5qrzpwSW4tZXfjHoUfq9LitkUD+PWPK7wb3zw0e2XcKuh//l0eJ3cdCWq7Rc4hUQlDkZfXiHGg2TiQSZr88h96UE2qK5ls+d7VGXk6a14zGM4//t9tZufOxfYPq4/WErurKumnOCEfWLOLEkqE/7xFaG9/XJLKGAAEN98FUkAmG/Y2boVcV1ACOx0XPEYGWJGgbPwbFl5VwmGCZ4cwtcd5/vGWmoeBt0nAZtHHccX0wxnCEc4hg0eX509FB95RLjQitHxQZe6//sAEZBVSwFuu0tFYhUYi7NsnzssUDtfC3GBuwQntG5/tvUWQMvdi1mz7k8r8j+MEuJvpXtHwaPyUeW+8cGjUamyJDMlFvqAoabdjGZhftpsNHPELfmAzzNh1LjI6HKSwVvAAM5PkPWv4DOcHYr0u2sTwoGJstnSLuozG7Gzng1KIbxNceqdkO3I2SVzvB4LVIOez5uB/Q4gifkZBnthjxWjFMEh1yAxKEwUJQL+fl/ftFapoOTy3LyHysFm0b1QGPCA3d4t5+urccDrk2XJd+axfRLYBItGaJlZ06taM/QkG1byd1E1ZDHMZ00Fw2mb3LoPN3iwNCBRzvoa+O3BIwlNFsZaMlh/Qz45NlZ2y8v1dw9Yf0MQCTqRDD42Wc5O x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2752.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(122000001)(38100700002)(38070700005)(33656002)(82960400001)(86362001)(107886003)(66946007)(186003)(4326008)(7696005)(9686003)(26005)(55016002)(5660300002)(53546011)(6506007)(66476007)(66556008)(64756008)(66446008)(508600001)(83380400001)(8676002)(8936002)(71200400001)(30864003)(54906003)(110136005)(316002)(2906002)(76116006)(52536014)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LL5VsAva9mHLf3SDzqdOOzGksLas5mdtCnXyUkS7/iZNzgcvmAd5LvYh0Y4u?= =?us-ascii?Q?a2zW0wHCSNICwDDajnzVf6k7Ia8EOHiWzmGTQmbWED+vs892Ps0itcUXyktF?= =?us-ascii?Q?hAr3OrrShx3gJYNwNCIlOHGXa2huVrYkFmGZ1hEfgNtXC0Mnty/eVVlMCJbr?= =?us-ascii?Q?H2l6rEu9Z6/Muku8xP4JKEv4QhweYks7qEuELY/hwiikXy5dCyuVoghwGzrW?= =?us-ascii?Q?yGDELKWN8QsSfaUlsj+nDVGtzNp7jr6OSvJtz1waHw1BNhP1UyCWdpmseLir?= =?us-ascii?Q?wbATCrEW3rYqeEa74JkuS+B+LYxv8PcZdoWzTR38X4tfrbrqUxo7OF+F4X87?= =?us-ascii?Q?axjkrC7u623Dm8SgQ1nFUIGpEbsYMyGFp360rkxLen+rh14nnruRY+sChqUt?= =?us-ascii?Q?W8AR0OFc65vF1CNp3H3detn0lTafSxzWDR6lCeZjsON/baAf6/Rj3sqEVn31?= =?us-ascii?Q?cc2MOb4XagAeK+jg8T0lZXCMPxTr0sXycfmU2y5A277mB69cZW8TWwxaj/kY?= =?us-ascii?Q?X43v5TFJZSu4gvPJqwmdUzTsMaB6CfkhGuq/34j98ZULCUmc+2bFpBbBnn5r?= =?us-ascii?Q?aPl1Y8ApYX6OTCmjM5je2F+ww07g4YBZ6pDXkYGXA2Wm11oBawKUC/elTH4r?= =?us-ascii?Q?6Ysdd8YqZW2/mqAmTUv3d0gEc9NhjoMPW1h7mnmddtq1IQE/9Uq010U96+tt?= =?us-ascii?Q?bQL6ocKhHJNItCSNEFYUO6HVEjbCABsnlPw7IztttJoH5yzUnuIKyRzPwlzG?= =?us-ascii?Q?T7dUH1ajvgQw3/W427E5lrYi6mpurVhHBxmdhvt+Z1xH7EcbF7KFg0nuKTg/?= =?us-ascii?Q?NvJGy5k2Andq/04ccuc2jvwKlb2PSMppEw6Gngyax1O6jNCU12orW4KCozzS?= =?us-ascii?Q?u7ZlpBpf6wwjokMqm+O7MpMVLM3Chj5zBGUscp2d1xh//XPr5PCiMJyN/qnB?= =?us-ascii?Q?/NMbgf1BRT4Btq87kIHFQasrRkSgDnmkUAFcfyGFuil4ha1VlcTFkFsdE434?= =?us-ascii?Q?PoB/4qndvOULhOj7fp+PNZSbdDLL3MvkMfJ/GbSItTW+ouVen0/xKcRGXAhy?= =?us-ascii?Q?ETEJAtNs8oGY6B2w00jfOyxnDNaBOMMUfPgZHnLUhkg/06KsEEQAd47VPnD3?= =?us-ascii?Q?Ax7R/YA+9FK9mzstL0s9X7UOw8Oj0XO8+f8I5/we1XqWQTb6aTZUtnNSUhcx?= =?us-ascii?Q?4bamjkwAt4HILWuyUDQnf4cL13ARBcdNq+aQCHyoHIjZbRNl8yCym39ktMFA?= =?us-ascii?Q?B/3L5f8dUqh+RReKn/NIEhoL2t98F/syMqjRMHh6veoZUMs0CFbmM7dauThd?= =?us-ascii?Q?GHZhBPPrbapmUEo1CkY/hNkoG16h3XQ/Fj+vHq9gxQCbzF9gPooPdhjq/uNQ?= =?us-ascii?Q?Iz5u9y7d7QfwH2TbUGs54nq3BsBzAMOfsAoNqc+EEnDPc2PgDQDUkpIvE/F+?= =?us-ascii?Q?G4TCEyYwzLMiy5Qz/wZjdxIA0uokRmMLfpoOMFh1hQwhldyIJJpFY5W25BeK?= =?us-ascii?Q?FK8IYGwcuBRSxrX4DDNyyInw56CjUCJ4fSmvWAJU0mjNZl8l6mKLhXvAPc4a?= =?us-ascii?Q?wFxeJt1CRrAOakGSRt13q/urGousyjw2R1PArWAM92riCNrSQHnOMuRIb8/4?= =?us-ascii?Q?8A=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2752.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40635a59-9f87-4aad-4290-08d99a88b88b X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2021 03:03:45.0920 (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: XgxYIFNf9Ol978iE22qI1e87BztDBPOCJZKJY5SnPAaEx1WyAw0FR6ybvsI1/BF87HTbtRfClPuraSr1woQzTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2974 Return-Path: heng.luo@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Heng Luo > -----Original Message----- > From: mikuback@linux.microsoft.com > Sent: Friday, October 29, 2021 4:43 AM > To: devel@edk2.groups.io > Cc: Chaganty, Rangasai V ; Desimone, > Nathaniel L ; Luo, Heng > Subject: [PATCH v6 31/52] TigerlakeOpenBoardPkg: Remove > SmmSpiFlashCommonLib >=20 > From: Michael Kubacki >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3307 >=20 > The library has been consolidated with instances in other Intel silicon p= ackages > as a single instance in IntelSiliconPkg >=20 > Cc: Sai Chaganty > Cc: Nate DeSimone > Cc: Heng Luo > Signed-off-by: Michael Kubacki > Reviewed-by: Nate DeSimone > Reviewed-by: Sai Chaganty > --- >=20 > Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFla > shCommon.c | 210 -------------------- >=20 > Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFla > shCommonSmmLib.c | 58 ------ >=20 > Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmS > piFlashCommonLib.inf | 49 ----- > 3 files changed, 317 deletions(-) >=20 > diff --git > a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiF > lashCommon.c > b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiF > lashCommon.c > deleted file mode 100644 > index f86896dd1ff5..000000000000 > --- > a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiF > lashCommon.c > +++ /dev/null > @@ -1,210 +0,0 @@ > -/** @file > - Wrap EFI_SPI_PROTOCOL to provide some library level interfaces > - for module use. > - > - Copyright (c) 2021, Intel Corporation. All rights reserved.
> - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ > - > -#include > -#include > -#include > - > -PCH_SPI_PROTOCOL *mSpiProtocol; > - > -// > -// Variables for boottime and runtime usage. > -// > -UINTN mBiosAreaBaseAddress =3D 0; > -UINTN mBiosSize =3D 0; > -UINTN mBiosOffset =3D 0; > - > -/** > - Enable block protection on the Serial Flash device. > - > - @retval EFI_SUCCESS Opertion is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - > -**/ > -EFI_STATUS > -EFIAPI > -SpiFlashLock ( > - VOID > - ) > -{ > - return EFI_SUCCESS; > -} > - > -/** > - Read NumBytes bytes of data from the address specified by > - PAddress into Buffer. > - > - @param[in] Address The starting physical address of the rea= d. > - @param[in,out] NumBytes On input, the number of bytes to read. O= n > output, the number > - of bytes actually read. > - @param[out] Buffer The destination data buffer for the read= . > - > - @retval EFI_SUCCESS Operation is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - > -**/ > -EFI_STATUS > -EFIAPI > -SpiFlashRead ( > - IN UINTN Address, > - IN OUT UINT32 *NumBytes, > - OUT UINT8 *Buffer > - ) > -{ > - ASSERT ((NumBytes !=3D NULL) && (Buffer !=3D NULL)); > - if ((NumBytes =3D=3D NULL) || (Buffer =3D=3D NULL)) { > - return EFI_INVALID_PARAMETER; > - } > - > - // > - // This function is implemented specifically for those platforms > - // at which the SPI device is memory mapped for read. So this > - // function just do a memory copy for Spi Flash Read. > - // > - CopyMem (Buffer, (VOID *) Address, *NumBytes); > - > - return EFI_SUCCESS; > -} > - > -/** > - Write NumBytes bytes of data from Buffer to the address specified by > - PAddresss. > - > - @param[in] Address The starting physical address of the w= rite. > - @param[in,out] NumBytes On input, the number of bytes to write= . On > output, > - the actual number of bytes written. > - @param[in] Buffer The source data buffer for the write. > - > - @retval EFI_SUCCESS Operation is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - @retval EFI_INVALID_PARAMETER Invalid parameter. > - > -**/ > -EFI_STATUS > -EFIAPI > -SpiFlashWrite ( > - IN UINTN Address, > - IN OUT UINT32 *NumBytes, > - IN UINT8 *Buffer > - ) > -{ > - EFI_STATUS Status; > - UINTN Offset; > - UINT32 Length; > - UINT32 RemainingBytes; > - > - ASSERT ((NumBytes !=3D NULL) && (Buffer !=3D NULL)); > - if ((NumBytes =3D=3D NULL) || (Buffer =3D=3D NULL)) { > - return EFI_INVALID_PARAMETER; > - } > - > - ASSERT (Address >=3D mBiosAreaBaseAddress); > - if (Address < mBiosAreaBaseAddress) { > - return EFI_INVALID_PARAMETER; > - } > - > - Offset =3D Address - mBiosAreaBaseAddress; > - > - ASSERT ((*NumBytes + Offset) <=3D mBiosSize); > - if ((*NumBytes + Offset) > mBiosSize) { > - return EFI_INVALID_PARAMETER; > - } > - > - Status =3D EFI_SUCCESS; > - RemainingBytes =3D *NumBytes; > - > - > - while (RemainingBytes > 0) { > - if (RemainingBytes > SECTOR_SIZE_4KB) { > - Length =3D SECTOR_SIZE_4KB; > - } else { > - Length =3D RemainingBytes; > - } > - Status =3D mSpiProtocol->FlashWrite ( > - mSpiProtocol, > - FlashRegionBios, > - (UINT32) Offset, > - Length, > - Buffer > - ); > - if (EFI_ERROR (Status)) { > - break; > - } > - RemainingBytes -=3D Length; > - Offset +=3D Length; > - Buffer +=3D Length; > - } > - > - // > - // Actual number of bytes written > - // > - *NumBytes -=3D RemainingBytes; > - > - return Status; > -} > - > -/** > - Erase the block starting at Address. > - > - @param[in] Address The starting physical address of the block= to be > erased. > - This library assume that caller garantee t= hat the PAddress > - is at the starting address of this block. > - @param[in] NumBytes On input, the number of bytes of the logic= al block > to be erased. > - On output, the actual number of bytes eras= ed. > - > - @retval EFI_SUCCESS. Operation is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - @retval EFI_INVALID_PARAMETER Invalid parameter. > - > -**/ > -EFI_STATUS > -EFIAPI > -SpiFlashBlockErase ( > - IN UINTN Address, > - IN UINTN *NumBytes > - ) > -{ > - EFI_STATUS Status; > - UINTN Offset; > - UINTN RemainingBytes; > - > - ASSERT (NumBytes !=3D NULL); > - if (NumBytes =3D=3D NULL) { > - return EFI_INVALID_PARAMETER; > - } > - > - ASSERT (Address >=3D mBiosAreaBaseAddress); > - if (Address < mBiosAreaBaseAddress) { > - return EFI_INVALID_PARAMETER; > - } > - > - Offset =3D Address - mBiosAreaBaseAddress; > - > - ASSERT ((*NumBytes % SECTOR_SIZE_4KB) =3D=3D 0); > - if ((*NumBytes % SECTOR_SIZE_4KB) !=3D 0) { > - return EFI_INVALID_PARAMETER; > - } > - > - ASSERT ((*NumBytes + Offset) <=3D mBiosSize); > - if ((*NumBytes + Offset) > mBiosSize) { > - return EFI_INVALID_PARAMETER; > - } > - > - Status =3D EFI_SUCCESS; > - RemainingBytes =3D *NumBytes; > - > - > - Status =3D mSpiProtocol->FlashErase ( > - mSpiProtocol, > - FlashRegionBios, > - (UINT32) Offset, > - (UINT32) RemainingBytes > - ); > - return Status; > -} > - > diff --git > a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiF > lashCommonSmmLib.c > b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiF > lashCommonSmmLib.c > deleted file mode 100644 > index 7941b8f8720c..000000000000 > --- > a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiF > lashCommonSmmLib.c > +++ /dev/null > @@ -1,58 +0,0 @@ > -/** @file > - SMM Library instance of SPI Flash Common Library Class > - > - Copyright (c) 2021, Intel Corporation. All rights reserved.
> - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ > - > -#include -#include -#in= clude > > - > -extern PCH_SPI_PROTOCOL *mSpiProtocol; > - > -extern UINTN mBiosAreaBaseAddress; > -extern UINTN mBiosSize; > -extern UINTN mBiosOffset; > - > -/** > - The library constructuor. > - > - The function does the necessary initialization work for this library > - instance. > - > - @param[in] ImageHandle The firmware allocated handle for the UE= FI > image. > - @param[in] SystemTable A pointer to the EFI system table. > - > - @retval EFI_SUCCESS The function always return EFI_SUCCESS f= or now. > - It will ASSERT on error for debug versio= n. > - @retval EFI_ERROR Please reference LocateProtocol for erro= r code > details. > -**/ > -EFI_STATUS > -EFIAPI > -SmmSpiFlashCommonLibConstructor ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > - ) > -{ > - EFI_STATUS Status; > - UINT32 BaseAddr; > - UINT32 RegionSize; > - > - mBiosAreaBaseAddress =3D (UINTN)PcdGet32 (PcdBiosAreaBaseAddress); > - mBiosSize =3D (UINTN)PcdGet32 (PcdBiosSize); > - > - // > - // Locate the SMM SPI protocol. > - // > - Status =3D gSmst->SmmLocateProtocol ( > - &gPchSmmSpiProtocolGuid, > - NULL, > - (VOID **) &mSpiProtocol > - ); > - ASSERT_EFI_ERROR (Status); > - > - mSpiProtocol->GetRegionAddress (mSpiProtocol, FlashRegionBios, &BaseAd= dr, > &RegionSize); > - mBiosOffset =3D BaseAddr; > - return Status; > -} > diff --git > a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Sm > mSpiFlashCommonLib.inf > b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Sm > mSpiFlashCommonLib.inf > deleted file mode 100644 > index 374f5ea52b98..000000000000 > --- > a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Sm > mSpiFlashCommonLib.inf > +++ /dev/null > @@ -1,49 +0,0 @@ > -## @file > -# SMM Library instance of Spi Flash Common Library Class -# -# Copyrigh= t (c) > 2021, Intel Corporation. All rights reserved.
-# SPDX-License-Identi= fier: > BSD-2-Clause-Patent -# -## > - > -[Defines] > - INF_VERSION =3D 0x00010017 > - BASE_NAME =3D SmmSpiFlashCommonLib > - FILE_GUID =3D 9632D96E-E849-4217-9217-DC500B8AAE4= 7 > - VERSION_STRING =3D 1.0 > - MODULE_TYPE =3D DXE_SMM_DRIVER > - LIBRARY_CLASS =3D SpiFlashCommonLib|DXE_SMM_DRIVER > - CONSTRUCTOR =3D SmmSpiFlashCommonLibConstructor > -# > -# The following information is for reference only and not required by th= e build > tools. > -# > -# VALID_ARCHITECTURES =3D IA32 X64 > -# > - > -[LibraryClasses] > - IoLib > - MemoryAllocationLib > - BaseLib > - UefiLib > - SmmServicesTableLib > - BaseMemoryLib > - DebugLib > - > -[Packages] > - MdePkg/MdePkg.dec > - MinPlatformPkg/MinPlatformPkg.dec > - TigerlakeSiliconPkg/SiPkg.dec > - > -[Pcd] > - gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress ## CONSUMES > - gSiPkgTokenSpaceGuid.PcdBiosSize ## CONSUMES > - > -[Sources] > - SpiFlashCommonSmmLib.c > - SpiFlashCommon.c > - > -[Protocols] > - gPchSmmSpiProtocolGuid ## CONSUMES > - > -[Depex.X64.DXE_SMM_DRIVER] > - gPchSmmSpiProtocolGuid > -- > 2.28.0.windows.1