From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.1201.1624925311687105830 for ; Mon, 28 Jun 2021 17:08:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=xUjpboUI; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: rangasai.v.chaganty@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10029"; a="207876687" X-IronPort-AV: E=Sophos;i="5.83,307,1616482800"; d="scan'208";a="207876687" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2021 17:08:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,307,1616482800"; d="scan'208";a="407942690" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 28 Jun 2021 17:08:30 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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; Mon, 28 Jun 2021 17:08:30 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 28 Jun 2021 17:08:29 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) 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; Mon, 28 Jun 2021 17:08:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nb2Etn5kGZT9Z+qiiEV9iqrcyDa3HMCMjbE6GvzBhSDJpojqNIzw29r/+3CxJF/9isJZBtqAvyg0jiGs1fhff9i3BBYJfdLDZ3xRYKqb5A1WOUEsUaORHgDZYIhNrdDEUeFuajdSOGCAq4hXyws9Fk9MVku8+Pfe3dnq8sdV/GHqcSBO1o6Uf2CpcuynhuK9bsKAg/lEZdj0uljsOLdCjAA+4yHPtp2qy1Xr5tEuY79tZGPccNUPmNfps5U6CzWKJNjENjTVnbO46FGouHKGNnliqEI+Stg5s5/5+LvXElyx11+z1BQkn9+gOEd8CbMQjJz9GlwmVVkDGRr8seovJA== 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=fk6uA8ZV9jaI2MfMlGNNjZTewHNqhUG2QmKUT90FHnQ=; b=n0aaWJDzbM4WvDb3goH+UdrdRA2byzKBpO9OrNjNlrilLGZcAstOxmcB08MT9RVHONgatHdMli4O7qlHzmmI0QyF/ko0Nwh3GrBYbrDt+WBn93yWhFTIWQzuG3x8qNeaHOwtmWefARDqpFvdBcJwLslchsGECcAGfswoqM4O9d0bSoFBTRXk9Zvxua6cs/wadksZozrHExuENuC0nSrNTKT1wVdJb4ARS1140j3NhPKtvXGFSWZ+WzDv2uInZdE0cGd9ySQsnkXOJeBiJtZh9hvQl2695JPuHcVTuClnSrUNCrWxd724jaFEniZ43O0epK2vaxhGGfVPREk21E8FCQ== 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=fk6uA8ZV9jaI2MfMlGNNjZTewHNqhUG2QmKUT90FHnQ=; b=xUjpboUIH/VhhunsiIJhzskcrZaS6Jpq5mwsBn/+fhaSLgPWfvBs/oZlQBmqp0L8+eMtqS1kD7hGC1WbthQ92WyKUmJ4aF2nO9B/l7uXUgMuLQcOtTqSrMIM7ecJEUnuufilf7r/2oUWS/lEItAMjuh0JU66PIzCrF780FCvoCY= Received: from MW3PR11MB4602.namprd11.prod.outlook.com (2603:10b6:303:52::19) by MWHPR11MB1581.namprd11.prod.outlook.com (2603:10b6:301:d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18; Tue, 29 Jun 2021 00:08:28 +0000 Received: from MW3PR11MB4602.namprd11.prod.outlook.com ([fe80::451e:1727:7108:3873]) by MW3PR11MB4602.namprd11.prod.outlook.com ([fe80::451e:1727:7108:3873%9]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 00:08:28 +0000 From: "Chaganty, Rangasai V" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "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: AQHXaghFjKHKkFpQ7UCADKfEmWUDj6sqIagw Date: Tue, 29 Jun 2021 00:08:27 +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-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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: [50.45.159.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37592aae-076c-4aa6-a595-08d93a92056a x-ms-traffictypediagnostic: MWHPR11MB1581: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +nRo3BZN6GVraSt3PJXjHRhd+q/6D8X2zsI3jbA5qm4WuajOvSZn0MiDeZBKg7proTgWBHpCEtKFPwbwy3+8kiirukRxjDHmyEwypyqG+qnrOwofHxYgP32YelDp5r8F3zHS5LmORFi5pg0GOqYqx+fAI114gafl2SPAhhzDQiQDELUXYTX+9ZtQTUqZFAn0kPTvTB9/FzZBRqQzyxEXkRkgPVF9hKiQoGLx9e1qPL8uc4Tk/8owNLwfkDYvIb8t0vhGGSyLG3c4E02JTrsd5JLfkSYPDa0Ad9NbIFmzm6lVyQU/cVess41G6wfnY/L/3EyuVlC+doGuSfqlrV4MxtpFPbYPmcGVx0E8GoCoexuvDNUtlHuY+QZr6Wyk3Wrfx+e+ho9oqelrUa7lCGkSKkCcS/PuVPbqRfPTTMLO6bzSUL6rGiMewpUQjsw1V8XiG8HMocrHGWDjgmGwFpJbeK63Aqc0AfsQQg+l5/OoXcEr3QJLi5GLxllvlRdD54suyaW3e7zQnCSh/qvaqRpvaEUdK/8y9PMp7AOYZIC6fxRALLNukBBfPVtwXiwQM+6nuUUgBmwdUF53Qin2tjXnajEIErhzP7/ubQxAjvdI/tMGKvhsH8ws14h5jbjiBIUCKGHUWL/yiZ+VZocWyNXLrifdjIgNHkpxU5AaQ3JYTTcgKomDyL0qZV3UqN4fc1z3jdX6h7b8NWgpRNWjvWam+VPEUoRDtYEcLheZR2DOsj6ItcqkJ+mo71kQUEN5p7W0ih/jjcWMqFPwnCRVPt4hIvK6Y4wuzhq0uCSRndduc/wdv8Tlvji3M7XX6M2xGiJI x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4602.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(136003)(376002)(396003)(39860400002)(86362001)(33656002)(7696005)(110136005)(54906003)(316002)(5660300002)(55016002)(9686003)(66476007)(107886003)(2906002)(66946007)(478600001)(6506007)(64756008)(66556008)(53546011)(66446008)(52536014)(4326008)(76116006)(8936002)(186003)(8676002)(83380400001)(71200400001)(26005)(122000001)(30864003)(38100700002)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?CbXRBowANbb+kZ9OD4thdqM9epUq4fgaF4o5JONZn7/v9eX5oKJC+lk/7uZd?= =?us-ascii?Q?ylu/FUV1VjFydZDyjwLuqIJ90kfmmOrzms4ecHn8g20O+ogFHH8Ahz4BWk/0?= =?us-ascii?Q?UpoOKidF4xkzvAMMnHNXROFnEtVNDyE7ypEdEGaTh8VICJlGPtgtdO6bD08G?= =?us-ascii?Q?0QNSzOJlbRJY69al8s33/y7GaAVFVgzgRaJ1NLxNlyiZRsvgsV2u8joADsUW?= =?us-ascii?Q?OLfVhKQHGA4OAJ7Uo6+xTaNGb1Q7BsvffAXA4TTt95JBNFhBeTlnI95P8gO4?= =?us-ascii?Q?nT+tjUmml0AEh3yJFYCFc20UrwLtCC74cQia/z4xV7tsONWYJW8SZxrqXge9?= =?us-ascii?Q?SoEFxPB1pVKvrdglIoS+esvJ07HVoh+TxTHtYIgkiCFw1SdPLXfFXQ7NtWx6?= =?us-ascii?Q?+uexzkpV9wHhfTNVtOXn4ANDmfB9wP9djNr31oXaB5zQkUXNG7gHH16FwX9b?= =?us-ascii?Q?Hnm8k4Uaf+rIvk2HEFzmHvViZzynCRtVveyV4khldC3a3DJ5HOAwSH/Sa06e?= =?us-ascii?Q?tpq7cFlJwNYGgGcrSTUg4L5x7B4cIT8QIyIovluBt+yUOr7IuNj4HgNo+bQO?= =?us-ascii?Q?nu2qNR3ue2K94Gf3eIQuqn+5SC5amGtbsPVp44cOWqUNQOxG/pSlVPkxg908?= =?us-ascii?Q?cOM0QGXaP4HqwULBRsUdzl2pqAA5dM38lbDZrhqh2/Y42uC48ylFtXJBbQ2g?= =?us-ascii?Q?7uIsLCyGUKyvYZxK85xWNcHX93NjXCGqqZFk8hIGBdNFE2tCWxveJhQBMUrF?= =?us-ascii?Q?Y2aSHOqQllbChfADWF3oTIbwDSVwMt0ArEjM5glJwxbfbuOur2c9Eer+aWBt?= =?us-ascii?Q?oXQ4bT9j8YwNkcJF64kzGUxbNpJKN1aEZeM7/Jb9M40uWIknRRiOQ7LHgeBi?= =?us-ascii?Q?Bn37J2Ce0fXZEJxTaZnYXecM0Y46ATvNaoLbtEyl6foH8haKnQCNmzjRxNxY?= =?us-ascii?Q?sezCa5hE/AMg+FWnU7Bu/llAOMoOiXCTrvH9LzFT1xZBcTTU0zFj8DcSftrP?= =?us-ascii?Q?k6b7gZy0V5mumCAgGzVfnY/cH0MOpQVTV8gcsMAqGufghFYU01ttoWNgPCvO?= =?us-ascii?Q?aCo6k1X9bBOwyPGQyRd288IV33HYHno9RQYcFddemTPwUc/tlKVCQlZpCJIi?= =?us-ascii?Q?1WyWEN7W3dpWEjZHbM7T97aOgWUqCXWcmzwqrguNmZF7lp+ru8C1IBt+erX8?= =?us-ascii?Q?BkDoa+bCqFRVQGWKrxPpnZTgQVZVxPdTcfLIt60T7v9+irMaKIOtKNPofetn?= =?us-ascii?Q?bIAlFkVsZjyTC6Wobsl2LhlNfDjPlknq6NXkKf1AOqQo9pgbNOn/ZRh+xIv1?= =?us-ascii?Q?fbMPY8kLhBvlngyb0Ktcpq00?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4602.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37592aae-076c-4aa6-a595-08d93a92056a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2021 00:08:27.9330 (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: EwGek99rCsxKlEzY7m8YIhTKzocFZvWswmwJyZC60CUNlnn9eBXC6WSdRJ6yo0iX7u8cfl7lXQBQDLzTIW/LosXpijkfxl4S8huh9lWrEDI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1581 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty =20 -----Original Message----- From: mikuback@linux.microsoft.com =20 Sent: Friday, June 25, 2021 2:21 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Chaganty, Rangasai V ; Desimone, Nathaniel L Subject: [edk2-platforms][PATCH v4 26/41] CoffeelakeSiliconPkg: Remove SmmS= piFlashCommonLib From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3307 The library has been consolidated with instances in other Intel silicon pac= kages as a single instance in IntelSiliconPkg. Cc: Chasel Chiu Cc: Sai Chaganty Signed-off-by: Michael Kubacki Reviewed-by: Chasel Chiu Reviewed-by: Nate DeSimone --- Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFla= shCommon.c | 196 -------------------- Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFla= shCommonSmmLib.c | 54 ------ Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Library/SpiFlashCommonLib.h= | 98 ---------- Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SmmSpi= FlashCommonLib.inf | 51 ----- 4 files changed, 399 deletions(-) diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashComm= onLib/SpiFlashCommon.c b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/Smm= SpiFlashCommonLib/SpiFlashCommon.c deleted file mode 100644 index 53711db6325f..000000000000 --- a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/S= piFlashCommon.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 read. - @param[in,out] NumBytes On input, the number of bytes to read. On = 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 wri= te. - @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 t= o be erased. - This library assume that caller garantee tha= t the PAddress - is at the starting address of this block. - @param[in] NumBytes On input, the number of bytes of the logical= block to be erased. - On output, the actual number of bytes erased= . - - @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/SmmSpiFlashComm= onLib/SpiFlashCommonSmmLib.c b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Libra= ry/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c deleted file mode 100644 index 43c0218d85df..000000000000 --- a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/S= piFlashCommonSmmLib.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 UEFI= image. - @param[in] SystemTable A pointer to the EFI system table. - - @retval EFI_SUCCESS The function always return EFI_SUCCESS for= now. - It will ASSERT on error for debug version. - @retval EFI_ERROR Please reference LocateProtocol for error = 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/SpiFlas= hCommonLib.h b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Library/SpiFl= ashCommonLib.h deleted file mode 100644 index 53c11bb59ac6..000000000000 --- a/Silicon/Intel/CoffeelakeSiliconPkg/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) 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 read. - @param[in,out] NumBytes On input, the number of bytes to read. On = 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 wri= te. - @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 t= o be erased. - This library assume that caller garantee tha= t the PAddress - is at the starting address of this block. - @param[in] NumBytes On input, the number of bytes of the logical= block to be erased. - On output, the actual number of bytes erased= . - - @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/SmmSpiFlashComm= onLib/SmmSpiFlashCommonLib.inf b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Lib= rary/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf deleted file mode 100644 index abc919867ca2..000000000000 --- a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/S= mmSpiFlashCommonLib.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-Ide= ntifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010017 - BASE_NAME =3D SmmSpiFlashCommonLib - FILE_GUID =3D 9632D96E-E849-4217-9217-DC500B8AAE47 - 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 the = 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