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.web08.5613.1624844061301007488 for ; Sun, 27 Jun 2021 18:34:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=SDZC7uo9; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: chasel.chiu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10028"; a="271730862" X-IronPort-AV: E=Sophos;i="5.83,304,1616482800"; d="scan'208";a="271730862" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2021 18:34:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,304,1616482800"; d="scan'208";a="418989588" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 27 Jun 2021 18:34:20 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Sun, 27 Jun 2021 18:34:19 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Sun, 27 Jun 2021 18:34:19 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Sun, 27 Jun 2021 18:34:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P1s7URvVCm5z0uwjGVm5aPVMT39TDJlareZLOQ5P+D4Ek9UpiU0bzmdtY+k45KqN7salkgNs4w6R6VvkTlu0yCje9k7AlDNudoROork10L/5fSs6sOoZEE5kMJkzhTPz56Q1b2jrG+SK/1obFZudPH2DDcJREjlCbOuWg8mpigQuUvCds+DvMawjNF4RtGM/P2jqdYEeZWcNsq531iTC/LILAnLUTHgq90SVwsAEC43ltxzGcUPN2jAyPyD/3yKt6UYLR92vz6fpU6SIRic8D/2B2mcvukNfZZjAtmxmTooRlaFIQp4Sk4YwtyulrGNziO81Sv4d6F0yIJKae3//Ww== 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-SenderADCheck; bh=kqHPvUj7VO5R4/Sku9s4GoURI2O9hMlRuH2nWiO9Cq8=; b=BE6BSGkLjc9oM6hn+AY8G1Rf1dYVkER8xF/cti0aWnPHFuo1Hvhz/JkuknPPDgSJgaBuTgjyIcdLsPJ7Ka1ag4KQkPkedg0pCrs/XOMC1q0dOKcnSdzZ8rsqrqITzil8j3lB4W8hrsid+j7h+ILeCpERGipATVgJgI4uiSxNGPEIFWBrIiwKSWyvr1G5blxMC/py5plxfe4XsxdJl9R2onh35Y6zruWY60HedGv2xuZFkqMIR1px2uctJurL9c0SfHOL81+I2aKy757YTvnL1OSSIHPjhR9NNSWXAk7i03kspOnJ3t/ADVdKMirbzwGUJgNiXIS5hLUOeHMnc5f2Qw== 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=kqHPvUj7VO5R4/Sku9s4GoURI2O9hMlRuH2nWiO9Cq8=; b=SDZC7uo91j1X7ItseyV8XAmXVathHj4ULtrqTnMoTW7wa8/XfxVliHDw3gzwldOw/TCAzt0EmBC6LNfZxUOV+Xbvfib39KEIyfUzhPw1H5gzuN0vX+9SPAY0tLQWmfD2ka8W1eyj1jAy+lXCvoB8oYuy+xGLV8a6seKaOHN3x+0= Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by BN7PR11MB2612.namprd11.prod.outlook.com (2603:10b6:406:b4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Mon, 28 Jun 2021 01:34:18 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::2162:be61:a479:4168]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::2162:be61:a479:4168%7]) with mapi id 15.20.4264.026; Mon, 28 Jun 2021 01:34:18 +0000 From: "Chiu, Chasel" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Desimone, Nathaniel L" Subject: Re: [edk2-platforms][PATCH v4 26/41] CoffeelakeSiliconPkg: Remove SmmSpiFlashCommonLib Thread-Topic: [edk2-platforms][PATCH v4 26/41] CoffeelakeSiliconPkg: Remove SmmSpiFlashCommonLib Thread-Index: AQHXaghFjDUAFE/eXkq6FFQZFMyooasop1KQ Date: Mon, 28 Jun 2021 01:34:18 +0000 Message-ID: References: <20210625212120.235-1-mikuback@linux.microsoft.com> <20210625212120.235-27-mikuback@linux.microsoft.com> In-Reply-To: <20210625212120.235-27-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.5.1.3 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-originating-ip: [114.43.34.211] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 06d7e0c2-12cb-425b-0b3f-08d939d4d8d1 x-ms-traffictypediagnostic: BN7PR11MB2612: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4tO+jo5njTRLQ2iYk++i6tbAQa7B1csk0C3qf4RyiFkMulI+xTlhTEEUQSZelIFgrIZ4YLH2HsAkHPYeeG5f9RfKpc/SurvkcfbKsJBK9hkbKTHydzNZ5cCLhvSoK1aBQblBvXjOdQrwNK+PWtD8sdonU4Lkz4/T/4QHZ2qxKY458pNXhwfri3PxvyUhoC2p8IBbeZYUNM031AP/QP8Jy8p29qKFKdP5hYYtv9adGa+c1dmDBlLCkbQqo17wU6PgrgwcjOC18kxvR7jUS3up1bUQpIGmcAWra8dAj++a8cujzV8ZIuXLprVgsa6zvkBX3de2vuJ+qQ3HQxMs/n9X5TgCizg+U0qY3nOZHuL2xwjlJroJF9xwBONhQOZA1DyJN1IJUposNIlUcteHEeJbYTq6zi/oNrnIuxx2ZirbNXzveLCXhkUlvPT4wvsxUxk0qdSSVX5XBFmptswWay/lnwmzzSTgV3srn84TA1EiuTtR5SX8ejChsdPiW2tm85BsZ+WJNE3vFeWuiqwrV8Q2q36qsT+re9QFIYULAOABAuvS6kxvbBK5k+2Cy5nbHx5y9QuX719hXaS1UCSx+ByHBlFm1dU4BTHUMZ/SgYhj4IBfIfM/23W1HuA7ppfe7nEPOU2sWkb1VzvMPFYVla03Ydh8AEzg+5L8iF38NM9ZAR2fRUeKI9QQd4fQmSzhM5mDU7lUqqmo341DeFU9x9HH8MNp7bn7Yhb/nqEYRZvcjKAIeZPQ7lgfXGPLwJ8KBX/8IPPNIxjQalPwM34yVgvUu3d5o+fiJS7XNK9ixTMSOCzHeYMVMxde2MG/ZVGqA1ncML4etsOO7KjHshMuBd1KzFudSk/OAolQnUeS9YTs0QM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(136003)(376002)(346002)(39860400002)(38100700002)(26005)(8676002)(5660300002)(54906003)(2906002)(110136005)(83380400001)(86362001)(107886003)(6506007)(122000001)(478600001)(53546011)(33656002)(52536014)(66556008)(55016002)(76116006)(186003)(7696005)(66946007)(9686003)(30864003)(66446008)(316002)(64756008)(8936002)(4326008)(66476007)(71200400001)(11716005)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7BZR44x4mr5BhTSy08G9kQIPhAjCygmQYFvg/dVwjCuotvRs0egHn68q95dq?= =?us-ascii?Q?y0tZOT9re5w/NTu6VeTYNaxAGa2Rv6sbbVXL0IwRE9oFYanjLvKuXGHulFzE?= =?us-ascii?Q?4H5UiMIMhkGbFhOXTAdJ4EUkf+Qh7sgXJrbo+H+SDeWrvPD+rfckPztcdj99?= =?us-ascii?Q?+jT5Qe4Smd5iQlEfFuevHN5OewaXRfUe31PyNHHiAtaHFTf/wi79MehziXVK?= =?us-ascii?Q?Ah+XOZPAIMH2OT+kelAD0+pkyI9kwdNGoQ8uZIBj5ped+bmvTvx7LWZPhaAh?= =?us-ascii?Q?k/b5Y0iI41uFjlC5ix0hktPsBl3cg1kTF1hq4f863LQukv78qy8vcpQQtt4l?= =?us-ascii?Q?YUUbUljpAK3rXx7bhBzJaFLBO1LGSlL97gREHV8nOoEPtX7vhi+7Eu6vucEA?= =?us-ascii?Q?TkPHjczyhvRvFY66+0AZdmWKBAEuYSpDpnEKV4dhv4lak/eYB50CMbmkHbMy?= =?us-ascii?Q?wEX4HjO5uqGPT1EX3O3wM+LJIvp8k/owLfWhzuDBanX3d+qRs9ykpNreso50?= =?us-ascii?Q?50O9l7G8rCgfV3yTdEVpgCQq+20QPlz4cC8LpIhlk37SWZrKvsyd5TAVbqLj?= =?us-ascii?Q?nskWdBGJIIH1zYl61TneoP/MUr83SJ01Zemg7US3CkrIMNefUH4riJgiCOEc?= =?us-ascii?Q?HmEGI1iYVIFIAjzsoYdow7t4vPwl63yVSSKtsgiXOywzcmC4KtVH1x2hdDZG?= =?us-ascii?Q?CkeSsfgNFcL62gPpd+MxJj6E9FWFfs79RGg/AEEunRVurZDXYNoStK7UGgj4?= =?us-ascii?Q?haNYB14BfGKaPL1EPnHzGjLI6aTbu2X8lAWzg0gvdIHW4bPIPnlzDFDcDe5T?= =?us-ascii?Q?h4jjpRuutl8gD5KhYKA1P3i22cInaNOg1zsFdkSqNVRFXZdN5bJqvlXPkgmo?= =?us-ascii?Q?fjNWbpmaEk0fI79/RDebTWtliC+Dfm6UNG3uAgv8i23rkW8HP2hhBi7+UKzP?= =?us-ascii?Q?VMzQMkf/hIZRD29SHUR8daSzSGtj41eMUsTbQCtvdIJqtrKS6PJa5jDbKK8T?= =?us-ascii?Q?QtIyVaYWg7v7t58D/+2i3LtUsM53tW/zNKH/+VakKDpukMvXut07fwIpsQZ+?= =?us-ascii?Q?MwyLuJ6yH9XIittd9g4yLL8b3PS/E0AKH+pjJKqWPkF1t5GL1n/zKZ4sRw+T?= =?us-ascii?Q?Eh06u8ZtdmWc26hjiOl68IOzFFAJxvWtPJ2UsJzripbz2SKU24/vVaPmevIr?= =?us-ascii?Q?2xTknHb8oJa3eqBFUi/8Pj11H0hHzwr6K3qhFDnl9lfVbBM7n3+DoKWnfFyv?= =?us-ascii?Q?MtTs0t7hVpxoAtp7HiBYp+7uhjDZUpe2Yqhhi2Prel8WI7xz7aQe98jRKGfs?= =?us-ascii?Q?4mzWztneNe26yg3dS57CwJTo?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06d7e0c2-12cb-425b-0b3f-08d939d4d8d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2021 01:34:18.1969 (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: Z/yH/KypWCeAMaMpozNScDhlI2j3WK3E0Ay935/pyxhxU50ZppniFSqgKuoy1urpdlKT+NG3GHnefcA/xQiPQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2612 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: mikuback@linux.microsoft.com > Sent: Saturday, June 26, 2021 5:21 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Chaganty, Rangasai V > ; Desimone, Nathaniel L > > Subject: [edk2-platforms][PATCH v4 26/41] CoffeelakeSiliconPkg: 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: Chasel Chiu > Cc: Sai Chaganty > Signed-off-by: Michael Kubacki > Reviewed-by: Chasel Chiu > Reviewed-by: Nate DeSimone > --- >=20 > Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommon.c | 196 -------------------- >=20 > Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommonSmmLib.c | 54 ------ > Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLib= .h > | 98 ---------- >=20 > Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SmmSp > iFlashCommonLib.inf | 51 ----- > 4 files changed, 399 deletions(-) >=20 > diff --git > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Spi= Fl > ashCommon.c > b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Spi= Fl > ashCommon.c > deleted file mode 100644 > index 53711db6325f..000000000000 > --- > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Spi= Fl > ashCommon.c > +++ /dev/null > @@ -1,196 +0,0 @@ > -/** @file > - Wrap EFI_SPI_PROTOCOL to provide some library level interfaces > - for module use. > - > - Copyright (c) 2019 Intel Corporation. All rights reserved.
> - > - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ > - > -#include > -#include > -#include > -#include > -#include > -#include > - > - > -PCH_SPI_PROTOCOL *mSpiProtocol; > - > -// > -// FlashAreaBaseAddress and Size for boottime and runtime usage. > -// > -UINTN mFlashAreaBaseAddress =3D 0; > -UINTN mFlashAreaSize =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 Opertion 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 Opertion is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - > -**/ > -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 mFlashAreaBaseAddress); > - > - Offset =3D Address - mFlashAreaBaseAddress; > - > - ASSERT ((*NumBytes + Offset) <=3D mFlashAreaSize); > - > - 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. Opertion is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - > -**/ > -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 mFlashAreaBaseAddress); > - > - Offset =3D Address - mFlashAreaBaseAddress; > - > - ASSERT ((*NumBytes % SECTOR_SIZE_4KB) =3D=3D 0); > - ASSERT ((*NumBytes + Offset) <=3D mFlashAreaSize); > - > - Status =3D EFI_SUCCESS; > - RemainingBytes =3D *NumBytes; > - > - > - Status =3D mSpiProtocol->FlashErase ( > - mSpiProtocol, > - FlashRegionBios, > - (UINT32) Offset, > - (UINT32) RemainingBytes > - ); > - return Status; > -} > - > diff --git > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Spi= Fl > ashCommonSmmLib.c > b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Spi= Fl > ashCommonSmmLib.c > deleted file mode 100644 > index 43c0218d85df..000000000000 > --- > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Spi= Fl > ashCommonSmmLib.c > +++ /dev/null > @@ -1,54 +0,0 @@ > -/** @file > - SMM Library instance of SPI Flash Common Library Class > - > - Copyright (c) 2019 Intel Corporation. All rights reserved.
> - > - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ > - > -#include > -#include -#include > - > -extern PCH_SPI_PROTOCOL *mSpiProtocol; > - > -extern UINTN mFlashAreaBaseAddress; > -extern UINTN mFlashAreaSize; > - > -/** > - 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; > - > - mFlashAreaBaseAddress =3D (UINTN)PcdGet32 (PcdBiosAreaBaseAddress); > - mFlashAreaSize =3D (UINTN)PcdGet32 (PcdBiosSize); > - > - // > - // Locate the SMM SPI protocol. > - // > - Status =3D gSmst->SmmLocateProtocol ( > - &gPchSmmSpiProtocolGuid, > - NULL, > - (VOID **) &mSpiProtocol > - ); > - ASSERT_EFI_ERROR (Status); > - > - return Status; > -} > diff --git > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLi= b.h > b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLi= b.h > deleted file mode 100644 > index 53c11bb59ac6..000000000000 > --- > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLi= b.h > +++ /dev/null > @@ -1,98 +0,0 @@ > -/** @file > - The header file includes the common header files, defines > - internal structure and functions used by SpiFlashCommonLib. > - > - Copyright (c) 2019 Intel Corporation. All rights reserved.
> - > - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ > - > -#ifndef __SPI_FLASH_COMMON_LIB_H__ > -#define __SPI_FLASH_COMMON_LIB_H__ > - > -#include > -#include > -#include > -#include > -#include > -#include -#include > -#include > > - > -#define SECTOR_SIZE_4KB 0x1000 // Common 4kBytes sector size > -/** > - 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 > - ); > - > -/** > - 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 Opertion 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 > - ); > - > -/** > - 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 Opertion is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - > -**/ > -EFI_STATUS > -EFIAPI > -SpiFlashWrite ( > - IN UINTN Address, > - IN OUT UINT32 *NumBytes, > - IN UINT8 *Buffer > - ); > - > -/** > - 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. Opertion is successful. > - @retval EFI_DEVICE_ERROR If there is any device errors. > - > -**/ > -EFI_STATUS > -EFIAPI > -SpiFlashBlockErase ( > - IN UINTN Address, > - IN UINTN *NumBytes > - ); > - > -#endif > diff --git > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Smm > SpiFlashCommonLib.inf > b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Smm > SpiFlashCommonLib.inf > deleted file mode 100644 > index abc919867ca2..000000000000 > --- > a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Smm > SpiFlashCommonLib.inf > +++ /dev/null > @@ -1,51 +0,0 @@ > -## @file > -# SMM Library instance of Spi Flash Common Library Class -# -# Copyright= (c) > 2019 Intel Corporation. All rights reserved.
-# -# SPDX-License-Iden= tifier: > 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] > - PciLib > - IoLib > - MemoryAllocationLib > - BaseLib > - UefiLib > - SmmServicesTableLib > - BaseMemoryLib > - DebugLib > - MmPciLib > - > -[Packages] > - MdePkg/MdePkg.dec > - CoffeelakeSiliconPkg/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