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.web08.6480.1618823276268545931 for ; Mon, 19 Apr 2021 02:07:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=k2Dl+0mY; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: chasel.chiu@intel.com) IronPort-SDR: JR2EvrhBLnzfQ2xmBHX5r3FXAX/wHnG8D63i2XUvMoC1ghB2TzrCaIi2azU+eaJ5410oGSYoND ZcOFl82rhfoQ== X-IronPort-AV: E=McAfee;i="6200,9189,9958"; a="182787850" X-IronPort-AV: E=Sophos;i="5.82,233,1613462400"; d="scan'208";a="182787850" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2021 02:07:55 -0700 IronPort-SDR: Scl3Ajr8VJO3bKhzrvEHGH71TI0xy6YEWHe/DpVjEafv6kp35NSs4xjGIcm0LwWN/HDY6gmgPE 3vqYGF1ULjrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,233,1613462400"; d="scan'208";a="462674490" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga001.jf.intel.com with ESMTP; 19 Apr 2021 02:07:55 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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.2106.2; Mon, 19 Apr 2021 02:07:54 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2106.2 via Frontend Transport; Mon, 19 Apr 2021 02:07:54 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.177) 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.2106.2; Mon, 19 Apr 2021 02:07:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kB3SZZDtuFc6G/Vq+oys/LUKQEplOpnerjsc0r/UFqh5q/FehyzlCZ94UQFa/Rtlq9IgQlCM8jQCsPEOVxpRLL9lZ/yn750ESAtepA+A1gG4rKD1Yvd/gY+rBTf9sLLtcRy7O761Innz8s79uvIKGCjvQmUJyQhryFaBzjGpCMAaG7uuKb0OB192e+hGM7/HF2KfSVq8unMxLyyyecE/cTiMC+9qQmq0Z0nxNFeYJInK5ib4LEUY6hzQXMcI/v0y0jiD1PUQzOS5Ngm/HuioKlo65PbtuXdAl4X+MvIDAXPg/MEEcas7IsnejqepjlzV6iKeNXOxVrWlqHW1EO+LjA== 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=s7nMiVeVpI9JsEf002F3cBTfDebktaLRh9JCIkpT6Mg=; b=l+KXW2LQZhACKVI1GtXaUfmO0t1DDwhBAp3MFNQr/duDBk9PPS9sAkrwnlf9JB7cKYVSEQwHll5zfikS5yWs9vjnO9ELsR41FVfhxlcu72ooO7JuJ7lC2xlTCNw3XlO94MPIEcAoeFxZGYlj7wVtZVZcdcj5RsJ+kA4lpeAz9sclR9UH16vl+Kc3hvii4DFUV3qfVic9Fgv867+MCTmo9PPF63Ss21yv2SnLQRoVeig8aXXxrOraXyNUTqbUGOA2lcGCMAtAh+qSM7FgcuNW7rwFfsog6Wx9wkmZs4SyI9toNBroBkTrfjUBRNDV+9YFrYSHaRPMRWEoo1zGZSW+2Q== 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=s7nMiVeVpI9JsEf002F3cBTfDebktaLRh9JCIkpT6Mg=; b=k2Dl+0mYjlY4e9ybyjkVFAk+1QSslzARLWdBUfVYifZ7v4clddK77vQPxlkc5TH18ngEcF3q7KnHh6e03czwKDZ/4olBedTV7eKGneYzv+ZnGfF3c/vrf+PgxlgnR3/9wuhLt1wfR45o5pfdLvCmTrsqOeUsxILkMYi+IJm2rvI= Received: from SN6PR11MB2814.namprd11.prod.outlook.com (2603:10b6:805:55::15) by SA2PR11MB5114.namprd11.prod.outlook.com (2603:10b6:806:114::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.18; Mon, 19 Apr 2021 09:07:53 +0000 Received: from SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::3101:f483:8348:816]) by SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::3101:f483:8348:816%7]) with mapi id 15.20.4042.023; Mon, 19 Apr 2021 09:07:53 +0000 From: "Chiu, Chasel" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [edk2-platforms][PATCH v1 26/35] CoffeelakeSiliconPkg: Remove SmmSpiFlashCommonLib Thread-Topic: [edk2-platforms][PATCH v1 26/35] CoffeelakeSiliconPkg: Remove SmmSpiFlashCommonLib Thread-Index: AQHXMmjl3hU58F4ieEWoCYLh3F2Usaq7kbzw Date: Mon, 19 Apr 2021 09:07:53 +0000 Message-ID: References: <20210416023152.771-1-mikuback@linux.microsoft.com> <20210416023152.771-28-mikuback@linux.microsoft.com> In-Reply-To: <20210416023152.771-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: [192.55.52.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bf2d60e8-bbdf-4ef4-4397-08d903129d6b x-ms-traffictypediagnostic: SA2PR11MB5114: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UUzNfONNM69k1jnQ2QyfABQMyP63MTVAquTB1YZ6LnO7n9YCS6/OMM5ZvlOvJF0VY5yqzC0r+fubf67pwFlugL3fcE2KH4TjG2yM1niV0L2y2rbmWPpdnNG62Bl40G63LCRWQ8Fgw1GS9B+9MJCBwz3wx4rbfSKy7q/z7b2TaJOqpR+KuySnwFV9HXqlezdwqvYUWFzM2BpfkrD2B+cYd+6tk0bycyT4zJVW1OkYbcC0mCkdXan2l+EHKDuduhoxlJLGBjPUap3G1xCauUgNYdcqDXmMEuH41vgUOHDqrhO0EYsz6BldWCk4BXcbGJJL/cO4hgEbEy3km/moi6GV5AaCp8JYvChn8zlT5C07VQ9GIsCYjtvDdHKvfYFgIvho2XjAhK8JZRQkPLV3hte7HIpNgs/69hrItBIVP/u5Z8ApwfN1Qo2XYLAwJmNilHwC4gB2ke1Zc1Air9WpZOzGiCzS1gyN/0jcGqophgb7GG3ZCm6pdpkS6H0msj3IflYOBvg/+co5rDwmtlQj3+ZC2G7kVCybZ4/dmq/ryZ+x0rHLNO4FFHbZIbmwnfn8I5oNN7yclxj1to1B5H6u3Ab4vxcOXUfZt/7anHtPaVDt1R6uxTtn8BXULZfvaEPzA+JJAhJ9icW4CnnR5Aa6unkCo2R+H4y9DcXwasBktvplD/8G8AS7US6OTB3XprcXoIBPd4jXB1ZiEUbw6hiM3LNFsZwcktGp8CkXp/r4I4Wknf8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2814.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(39860400002)(366004)(346002)(136003)(376002)(66946007)(66476007)(66556008)(64756008)(26005)(33656002)(76116006)(186003)(66446008)(53546011)(6506007)(4326008)(83380400001)(55016002)(7696005)(71200400001)(122000001)(5660300002)(110136005)(316002)(52536014)(8936002)(38100700002)(8676002)(86362001)(9686003)(107886003)(30864003)(2906002)(478600001)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?WTAF+5u1EzU02gt7cZwBgA76AbECeyHUIw2N5PLbytdEKvL2zqtvXsrcykAy?= =?us-ascii?Q?we5KJlB/rdFatQq22i+XY/spUsjRSrUY59+TOa69KPs2mqPXflTq4Y3/PCtl?= =?us-ascii?Q?ut3emfzoP6/qh9Az0k5kKyBuUoO0oX0hu+suuASMtfDAZGJXBTRFr3vkfZT7?= =?us-ascii?Q?H9BaNOlOSw8ByyzVVC1My4MmoHfkkEw33w4rfwHPDMFxeFIuXJpYuGfOkcoL?= =?us-ascii?Q?XVACnHxA32mpi8zKIreFrigjDMmk8NRQTbiTiHyy5GMA7mS/WAc46RgqtUK0?= =?us-ascii?Q?XURrzHqR6GcYp7N/zvPtqHFlpf9z4uHsKa4KtMRgw0V/hJjcDMx7+5O8FzvB?= =?us-ascii?Q?2InjbkrqAkbswQzjpsFQvat6YD9aHWyG//cAq/ftyT46hKzKUsEDe3d+1MkL?= =?us-ascii?Q?Dhwk87BH8h3vwWDE+kYZ32RnPNH2YzzslfffbuIGOzr4CI8jYzZIlOL0njfx?= =?us-ascii?Q?3jqRHtqlRClOeas3By3Z3IfsdVrCEkuzswikSFWlO1hgofzY/oCJTEP5kWsA?= =?us-ascii?Q?6JHSWXcHFI8SvtLHAseSUBAPq0GVwDOnO1nuYjPMlziFJw/OzD9iB9IaapM2?= =?us-ascii?Q?kvFKYuX3JGsZ8UB4ow6Go74gpyhDwj5bKfO6XNGkeam0pyFwvJf8I//zWlVY?= =?us-ascii?Q?E1wl+XpL/VDhLAW51KE6GLcF/4qIpyuZB9+822Rf0E5yfolm94pOvwGRewuI?= =?us-ascii?Q?QIRJwNk3JCmsqMknPLw0LPIjzUZeyIUQmfxf2uI+PGtt+41WlercXQxajJzb?= =?us-ascii?Q?UDghW1uRHt2o52THB6/oCMYwEWKPE34XHA5Ewx4/SX6zekbZFJIWqh+gAexq?= =?us-ascii?Q?vVKmQZxGpFhCuJ/0LZNRQpUojoM/cUDxkD9qIUsX4hXJ6iBcVdeWuvQMKDbR?= =?us-ascii?Q?5tY7PWN1G9elx26q5bP0Zb8F+kzs9FUY5i2OXa+if5YJwBIuE4J7ZmBuvZ7o?= =?us-ascii?Q?e1kbMQw3XHShAQqME+EtoZio+9ysLVAdbILvYaX8I2i48Qeq0gEJiuLe+QGG?= =?us-ascii?Q?+skqEvnQgwuVgoBL6f8NfPILHlmMg7f8/IVFDUHVTwRMCrtUOwkI1uXUpS4x?= =?us-ascii?Q?LlO9F4xTNUFIlB/EQxqLoxrl3XEPm8H32+4Yc5gH0eHKJDWGmU12Mw3cgSbJ?= =?us-ascii?Q?jEJ2xIrt9NuY0YRoV49Y4wrbu4+3fZfRIiu9DKqeAhaxttW6fg7d9McTiCrF?= =?us-ascii?Q?dLFX+AFWs5U3LYEfNuUX9rBimS/rRqothuQEAQ3lc+y5KBbtgixdjqJqAzdr?= =?us-ascii?Q?K7PqstjcUvV2F3uO3q059sGGIGuA7IFqV0GBpQa3o+3YptXHT4CcgkgSdFJA?= =?us-ascii?Q?6AAjnPoR6f/ubVqviT6pLrgr?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2814.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf2d60e8-bbdf-4ef4-4397-08d903129d6b X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2021 09:07:53.3703 (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: voHt3sMBJVokV0ecPXTxboZukwN14IW9sEMWbqpW/iua3xi+xmObSo1Ayb+Wb5bFoO+kBJ0UFgHIijKTD6cdMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5114 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 Hi Michael, Please rename subject to "KabylakeSiliconPkg". With above change, Reviewed-by: Chasel Chiu Thanks, Chasel > -----Original Message----- > From: mikuback@linux.microsoft.com > Sent: Friday, April 16, 2021 10:32 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Chaganty, Rangasai V > > Subject: [edk2-platforms][PATCH v1 26/35] CoffeelakeSiliconPkg: Remove > SmmSpiFlashCommonLib >=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 > --- >=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