From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.6667.1624016337361092293 for ; Fri, 18 Jun 2021 04:38:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=HRHmdyo8; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: chasel.chiu@intel.com) IronPort-SDR: p6/HtRSweF4AoI0SOarMT4N/Xu64BOvP7PaahLVTPV0fQEqIaR8jAVhueU9OkJkvSQ/P/f0Lyz +rBfkyFqUl7A== X-IronPort-AV: E=McAfee;i="6200,9189,10018"; a="193851509" X-IronPort-AV: E=Sophos;i="5.83,283,1616482800"; d="scan'208";a="193851509" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 04:38:56 -0700 IronPort-SDR: Yv1iidTBwa5hgRoxm4XP9ZtjpO3xgeIgRPh3KcTvKXQg3QC3LK3Mmdv6ZIR/KAabpbOGAe2Kj/ EJ2gxYt7nQTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,283,1616482800"; d="scan'208";a="489028181" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga002.fm.intel.com with ESMTP; 18 Jun 2021 04:38:55 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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.4; Fri, 18 Jun 2021 04:38:54 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Fri, 18 Jun 2021 04:38:54 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) 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; Fri, 18 Jun 2021 04:38:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y7uKENjLczBofM7vISDo83ow5XzPGvXd6DA2RbkIY7yYuwxuWq14bA4e5TG2Xg8qCbdlUOflb7lsnZel0rPDqxs/PTqWKtDJloiyVPLFmWVoBPF3cykBGN6/adYnFshdlTgrD/6eLJrQfTW5ce70EEvExRJHtOvP7UEgbbdUTCjn4JQrm5h3CnArn02ImIhBdJvcwyl4Ja50Sbe9PdL1oUyTxZS56QenubE+LLqJeQj1602F3WdaLgUVkgutsMC1Gy8o9n6f2MGDBeeYBjO27mShFIp+LxaS9kE9gXVbRHj/nHC14pVXvM4SyvtrTQK1Zq3J5qwSpNZcupseOUVk5A== 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=hcYso/HT3kRI01+6c5JZwpdrdRsxfpCZYBgKUqDJVtw=; b=WKtgLZMu3Q08uF+ddUh+uIo2sk5e18AM9xFcsekEfWno7TTI6ET8KCe3LRLRXcn00ijkmQ/x7YMJWiWMiD9LfbQf3JhHQdLz1SPgOUKi6cbtBm2t42bjwz29g11o1Nru6ZTlK05e4ZK5ZJlF4dTOCxv1mEoga0Yfg328Cs1Cd/fSyJhI0MNO4GeWZtH1MIsydCUXKNYu3E5ZQKEYvqiIQU+1w/HD7wxNvt7mTlYKUKFN2ffGS/NUQNQtDNF1TmP3QSAvjfbBctL8Mlyw8KRcqd+6dWCL8yhkBGae66WrRZFLeaOBQOw+qvNX2bmEDu1LWem7+PSTYdrbTY2ebXHhwg== 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=hcYso/HT3kRI01+6c5JZwpdrdRsxfpCZYBgKUqDJVtw=; b=HRHmdyo8nRtXL+kDGzgSfV8uOCt3B7hF9ouC6Vlm5w1cVkuDBo3wluntTRCPeRmoRbfhY0nqrTEwyyJQb7y+FWS5MJypXTw0j8IHp8iiOO45mnyEDtDEAVViZMg6QgBuDRfJKVybHR6vRZjljEfE26Pw82+sq9nU3IP3r+BxH5g= Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by BN6PR1101MB2132.namprd11.prod.outlook.com (2603:10b6:405:5b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21; Fri, 18 Jun 2021 11:38:53 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::2162:be61:a479:4168]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::2162:be61:a479:4168%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 11:38:53 +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 v3 27/41] KabylakeSiliconPkg: Remove SmmSpiFlashCommonLib Thread-Topic: [edk2-platforms][PATCH v3 27/41] KabylakeSiliconPkg: Remove SmmSpiFlashCommonLib Thread-Index: AQHXY+brCAgqi7IV80upEc+DBDvpgKsZpRuw Date: Fri, 18 Jun 2021 11:38:53 +0000 Message-ID: References: <20210618020726.5991-1-mikuback@linux.microsoft.com> <20210618020726.5991-28-mikuback@linux.microsoft.com> In-Reply-To: <20210618020726.5991-28-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.31.18] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aff13cde-dbe1-4308-c25b-08d9324da63e x-ms-traffictypediagnostic: BN6PR1101MB2132: 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: xfxJ1UJb1Iq50mc5lfz5BZRyi0KrtvuGMubNapLsri1TFJDf53tiVPg8YDOnxGLSRtgyNsP/ns8ysod+JCqajl80NvCNvGwaLE3myrQphSjFgjzKs2TkFQMjkBmFiuk5FAaFqDQ7bAyIkQfehIsRIcMZdr8uMECszOtwoNK5NsDjautxtHmDClvxMPaDE/glaq1jwzHoSPrPm3X071Kfy+fl4pFL/UqUQ96LQeHIzSkTsCfTNN1TlFqxi0gfueOS/D8zId11QfiHUMU4Au9timRMW7+jfoN0weRsr1cYzVoFiPq+1bDWo4aZ9JKpm2WdLWB3YzBQUXMmR/uWauyrEYXBw2AA97hsvXVFAzbTKCjGWff5BZOI0BU182VVWsqSZ8bHOGMWkJIgPgINTveCiTmIup5NaDfU05g+NUIRXN2JK08SMcG0DVGcSAW1a8C1MEvMFWAAzWTVmlGMfy/VkMbAp3pCMyNCVh16L7D711GK/pZkhVSWYbdH3+7rSGPioWE41WgEXOPipwNweC71a6fo9C7vIt8XIBrWFadJta59peRUCQwXcLZoexwo7Lqabaepmp+DyB7cRP4TtFZuDggRqRTcVl7CjM8EBWT9AfGOXKIbUI+hq/a9pgrimkc6bwtpUBpRQzzYVM7vAqlLO93YTKJLFJXAAnUPHsaEsWvjmwerMPaajBUp8aBwtx3YCbom+dcNixY9pGF6ONoLIPoHCT2g+M1TMHYx2chBIqDADrzv/T8LELTO99ytTRgtEccbq5YJxdLDEYLgr+ikZzVowhSB5i0rfWUhkQC19sg= 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:(376002)(366004)(346002)(39860400002)(396003)(136003)(76116006)(9686003)(55016002)(6506007)(66476007)(86362001)(4326008)(110136005)(186003)(64756008)(54906003)(26005)(66946007)(7696005)(33656002)(53546011)(66556008)(66446008)(316002)(5660300002)(30864003)(2906002)(52536014)(107886003)(38100700002)(122000001)(478600001)(71200400001)(8676002)(83380400001)(8936002)(11716005)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/apf79CBSE0c5zHK9aE57KevUz830xj1wzk5WAZ4HFOmAkaxpfD/9m8132NX?= =?us-ascii?Q?8Txp6QtLTxsAvQUUGDUASIQ+xsOqSBZm0ZXfQt1bwGrI4sP+1D15O2gNbCJl?= =?us-ascii?Q?y918ZkQkkq1XI9bSvYT/XKBl1Rw2coOXjYGmSaybaPKhvFuN+P/BnLYpxPTu?= =?us-ascii?Q?aprtrHFZqypqOy04CGrrksm/3l/GT2QZy25+CKOoqsXP1rSeXxh/9rC5wvah?= =?us-ascii?Q?qBS4go64gl4ND4dmfbF/VMH2RvBMkchfNmw3121gd+PyUCDFmpabOywe1m0d?= =?us-ascii?Q?iEl1gfzad9Anmm5QUg5YNYfmmMS19PAvGPfTn088IlycjX9u+p//krRBMbVc?= =?us-ascii?Q?okeB/ijtANRezxr2GBmQb604jf1En9V0OvQ4qNBG3d6vqXN/m+wU70uuZjJN?= =?us-ascii?Q?MK6c2DEyPe7j9viPFHVlXgtYyzVFolqjvRI7Sp7/k2PIa1Cc7y0npM89tV0T?= =?us-ascii?Q?SNgB+EINheXeWP9PWcfMx3TnXMGU519j3AM/b+VxrNe/fVsdxIUrPR5N01WQ?= =?us-ascii?Q?mhWJ0TFnX+kXa1ZOcxi7Pmrt+LO3aHNXh/gNOnoDXfQu92Z77Br2oVj/U4q0?= =?us-ascii?Q?3dkXt/lUcU7UhjxIYjS4GFwtbCbB9y1ZJbwdNjdNjOPaSsN8oMI+CDB8JtX2?= =?us-ascii?Q?PyZVJb0gJXecGpxaYIR4gOwf3r/SkoROxeLsNZi+p8bD6WKfD791E4ENOhEL?= =?us-ascii?Q?xgOV9VihA8tsIO2CVlufMJnL19rojAsqVB3QMp58skUDmNUPqrb8y1BuberT?= =?us-ascii?Q?Q4QzgWWPmCO+ujBqe5okiLAaTMKzZCxHYB8NvW3hMhM3/C8dU0wTqdTA+PQs?= =?us-ascii?Q?FBLF/zrQWW/dDX6TVsLkg2sdZWfXgOXMN07v/UoRvmfdwI7GkYKKuwGj+tQ8?= =?us-ascii?Q?G+RZMkHhibZTN9zm5qznuLIurQIJQqNd/gagc2gFu4H8vyVf4GfCSCySsmEI?= =?us-ascii?Q?8CJlQzDgqdlUWU8PLkIwySPN+RXDMmadZmFy4ajfq/QYHHn+QA2RbW5RDqX0?= =?us-ascii?Q?o2hQ/baWuMq/IT+ukYznQ/t6EULlzuiHwXno/+GAcn1c8ZaX1MG2cc1UkzYC?= =?us-ascii?Q?ndtEV1IaZ4e59+AL/82jYPjXlzzLi/X2t5B/BDMuqWL/RF0RwQIMtFB35sSM?= =?us-ascii?Q?uTa8AGFQ+t/8vcfpr5dRxTT7eFqRg6VPRs4AqG1dOtIcEbWh0FMl66WtMVss?= =?us-ascii?Q?1+a1ZR4uLo8MHexfL2o9gBXx5YQ5CpTzA+WLJ5Tkkk4mIyRsF2tERfWUMPg5?= =?us-ascii?Q?H5HMl9QrCaE9oTV1Ku6Rn4m3YWGHtccvlHEHm7s8NP7ipZA4bKGUO7ytXBl3?= =?us-ascii?Q?lTzwumM11vx9sdvjgUZ9LcDy?= 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: aff13cde-dbe1-4308-c25b-08d9324da63e X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jun 2021 11:38:53.1432 (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: aCP3KTf70FrcMc5MDhXguSVAkwdIpkNdlew2LU9eufC9R4YKRNB6ox+TEiwIlnT4LXK/BC2aKQlwcWqdFOGtgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2132 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: Friday, June 18, 2021 10:07 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Chaganty, Rangasai V > ; Desimone, Nathaniel L > > Subject: [edk2-platforms][PATCH v3 27/41] KabylakeSiliconPkg: 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: Nate DeSimone > --- >=20 > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFlas= hC > ommon.c | 196 -------------------- >=20 > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFlas= hC > ommonSmmLib.c | 54 ------ > Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLib.h > | 98 ---------- >=20 > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SmmSpiF= l > ashCommonLib.inf | 53 ------ > 4 files changed, 401 deletions(-) >=20 > diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommon.c > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommon.c > deleted file mode 100644 > index 7ee7ffab5001..000000000000 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommon.c > +++ /dev/null > @@ -1,196 +0,0 @@ > -/** @file > - Wrap EFI_SPI_PROTOCOL to provide some library level interfaces > - for module use. > - > -Copyright (c) 2017, 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/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommonSmmLib.c > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommonSmmLib.c > deleted file mode 100644 > index 11133163d2d4..000000000000 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFl= as > hCommonSmmLib.c > +++ /dev/null > @@ -1,54 +0,0 @@ > -/** @file > - SMM Library instance of SPI Flash Common Library Class > - > -Copyright (c) 2017, 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 (PcdFlashAreaBaseAddress); > - mFlashAreaSize =3D (UINTN)PcdGet32 (PcdFlashAreaSize); > - > - // > - // Locate the SMM SPI protocol. > - // > - Status =3D gSmst->SmmLocateProtocol ( > - &gPchSmmSpiProtocolGuid, > - NULL, > - (VOID **) &mSpiProtocol > - ); > - ASSERT_EFI_ERROR (Status); > - > - return Status; > -} > diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLib.= h > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLib.= h > deleted file mode 100644 > index 0c5e72258c2d..000000000000 > --- a/Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Library/SpiFlashCommon= Lib.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) 2017, 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/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SmmSp > iFlashCommonLib.inf > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SmmSp > iFlashCommonLib.inf > deleted file mode 100644 > index d712b9e5f769..000000000000 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SmmSp > iFlashCommonLib.inf > +++ /dev/null > @@ -1,53 +0,0 @@ > -### @file > -# SMM Library instance of Spi Flash Common Library Class -# -# Copyright= (c) > 2017, 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 > - KabylakeSiliconPkg/SiPkg.dec > - > -[Pcd] > - gSiPkgTokenSpaceGuid.PcdFlashAreaBaseAddress ## CONSUMES > - gSiPkgTokenSpaceGuid.PcdFlashAreaSize ## CONSUMES > - gSiPkgTokenSpaceGuid.PcdBiosGuardEnable ## CONSUMES > - > -[Sources] > - SpiFlashCommonSmmLib.c > - SpiFlashCommon.c > - > -[Protocols] > - gPchSmmSpiProtocolGuid ## CONSUMES > - gSmmBiosGuardProtocolGuid ## CONSUMES > - > -[Depex.X64.DXE_SMM_DRIVER] > - gPchSmmSpiProtocolGuid > -- > 2.28.0.windows.1