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.350.1635895088982844108 for ; Tue, 02 Nov 2021 16:18:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=yud7MN+4; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="218296231" X-IronPort-AV: E=Sophos;i="5.87,203,1631602800"; d="scan'208";a="218296231" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 16:18:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,203,1631602800"; d="scan'208";a="500799424" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga008.jf.intel.com with ESMTP; 02 Nov 2021 16:18:07 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 2 Nov 2021 16:18:07 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 2 Nov 2021 16:18:07 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) 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.2242.12; Tue, 2 Nov 2021 16:18:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TIWYaaJAu0dQVE0tWRcL5veDLjkaMFkDEpJdLh90y2QwTJFE+hEv6PvuWT8XoHn8Cgmv2Q52WEHvpldOyHnTdUIq7f2HKauRLFCAwWgv43OeURWlLlGVTEHCOAec+jUEP4D6nifA4Z98w7p2A/KsNQnbBu4/hJ/MLEeXTvz/bmlebKVIxPxd5GyGEXlCFzFUEza8JxSL3PI45xzqnHEFmN83MUVTRcysd2uEr+4rA6OmijNnQcSLD37m5x8lTxwPvghMY058UeLbFscAiuu8Iml8Yue6eULcmIei6MuX0/1lYTW2AmFbbdN18W9LdnmKiNnfyMmCVjROzXoes6T0dg== 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=AMQalT6Ln03vKphwx6e5b9vWVNFqtE7nq27RvJL6YEQ=; b=X2turzo4J4yM2YwzSDvRzNRsjjRXLq41DhKkZJVLBBrTKOD1EWIDJh14YAQ8N89t3PEXyKEgRYlkqnvsaDThJv18S/o/bxq2ZxPaPOpImSq3zNSE2lt4adE6l1coWiYd7oY/lr1Qf81stCFqCCtv8vwdmWcqVpqWVafVzr+SSotAr2mzP2pkNE1AZMBIZSGMj3z0bs/MoxCGwa3107VZND0gKBAsi5k3kPyZv5OL/dGfg4pIZ9UDUFVBg3x8Rf5ZspEOYtltqW1ASpzlKL2HIz8mqDutbXuLsLLjF0AA35Uu1q3oRfIvvuOSt81DMxDj1oYC9cJpyoGxKJoXXkjuVA== 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=AMQalT6Ln03vKphwx6e5b9vWVNFqtE7nq27RvJL6YEQ=; b=yud7MN+4aAujiSVKEt9qk0g5PdMsnLcNeNoYK9WCKAcKJpXbjbPmCX7qv+ecjGbUr5Nvk5ADzfZbejr2Q9SbSosPYdyncuYsj00JCwuvgd1Rnnu4kbKpc2Om55L6PpyMtXsBn/ya2lZmkzohQPCO4S2N1blOo+Ms9jXUdHRNp+4= Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by MW3PR11MB4522.namprd11.prod.outlook.com (2603:10b6:303:2d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Tue, 2 Nov 2021 23:18:03 +0000 Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::6140:8298:9d5a:df46]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::6140:8298:9d5a:df46%9]) with mapi id 15.20.4649.019; Tue, 2 Nov 2021 23:18:03 +0000 From: "Nate DeSimone" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Oram, Isaac W" , "Chiu, Chasel" Subject: Re: [PATCH v6 33/52] PurleyOpenBoardPkg: Add SpiFlashCommonLib.h Thread-Topic: [PATCH v6 33/52] PurleyOpenBoardPkg: Add SpiFlashCommonLib.h Thread-Index: AQHXzDzn88Olj6NUek2KD/TtaL86Xavw5yJA Date: Tue, 2 Nov 2021 23:18:03 +0000 Message-ID: References: <20211028204326.645-1-mikuback@linux.microsoft.com> <20211028204326.645-34-mikuback@linux.microsoft.com> In-Reply-To: <20211028204326.645-34-mikuback@linux.microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 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-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cefc71d4-ac39-48e3-181b-08d99e57054d x-ms-traffictypediagnostic: MW3PR11MB4522: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: v4eA1tVopF6bVy+11jFUjo3cFb5UcOsCeLGL1znxXihumEJrgnhIhnTiU1ImQMIC67Hq0lNS8ctRZyjZxwTiKGhRUXXBBG4anGr1LnGThyAKEJrVjvWjda5ZJIr25IHlrwQpiOw/0NPeTqEsWPKh1zZ85IeLpAwBgP3TMnps3BNJpOW86ftEMgG+EX9PC6qX/WgiZe09wEBBY+hd91duxMFuTqFdcgKNFdoEYdVYRmXkHaIcnGWmq+wx7nUlpMmLLadeuYHkpo16SuoukLhXEZAysD4M5s7sY0ahvdGq6lTkF/omhRi/uXIw3/O6yhKpf2bNGeL8C1dVtXgriYrgiiZMH1PpTDdpkJq3KcQve1LfjuD3yrtWXRvUvsC7mQ28PwZfTJ9FSFdnqGzYLLhZFe+a6vCv3If0viNilfiAbegPdi/um2dWC31rZg6wypkWzaLv8ZZmJPU4gb+y4tNzT7hg+7CM3WUhkv5I//Zn9RJjvNKDkxzIxZQhqWZIK/gOBe4nGqhL8wShLrH24muehscgVgU+kvz5IL/dWszdc3dcaLh3Qip8MvHlE6wTi2hnWu3rEaXQXroT/3XvDxLuRIoR3m6IITLjRr72aYen9Lrt8XPy/Wf0hPnMzybpJWHbcgxpuvVKyG6tYz2aRmKqa+iUTHPv9gMbW57CunAWL+boG3f2OryEGsSmuwFYfu1Kx9EYFXQRJcg1vJmVFqwdU/a3ysSyf9AnDy2OLDud8pM1Cbo/EsA2mn3DzqnpsUTbHG6rP4Mg+yobOGx9AEf/NhiUf++njNF9HZHWURCN4sA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5821.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(122000001)(55016002)(186003)(52536014)(76116006)(82960400001)(83380400001)(508600001)(2906002)(53546011)(54906003)(38100700002)(38070700005)(8676002)(7696005)(6506007)(8936002)(66476007)(86362001)(4326008)(316002)(64756008)(66556008)(110136005)(66446008)(9686003)(5660300002)(71200400001)(33656002)(66946007)(26005)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3NlY56b2Uju2+OUFimEqNiqCzFkOlrLgdGpafboK1ljl7AXzzqh3S4mrFuNd?= =?us-ascii?Q?zuLlcaTa96rmRxBPpCBrWxlP54bqdV9fqLceEMiasDCplrNh72KhuGdghPXW?= =?us-ascii?Q?7vxPPAKQF3RRQAgdejrvJU9LrCqJW3fVj4NeNVvT38NIb7Uog9A4MRs9iCWN?= =?us-ascii?Q?Si+G048fDk1K/5yFaWPBj4EQSNqsodvTB2UxIE2CCvYmrCDWczww5KXQ5EGi?= =?us-ascii?Q?DJjzff35JRx625o04CTiU7lIihtGmDE24yEOkGzCUCeCMOAgnvym8mC7xisq?= =?us-ascii?Q?giUy4+0H+xxM5xp/ndVPUcFJv7pG1+VRnzXSVH0n2TMLX9zHmBB/J8yMs2Zb?= =?us-ascii?Q?IIZy3fMGuyDGzf3ikzxvzRufXUA08dohXNwVZGr0NdmrCUes39l1DuNFjv6b?= =?us-ascii?Q?AltwvptP+mlAXYH4HGXCUhMSO+VbVFX6ejkMfiqdgqEmrPZ4hFjWP+aTulAY?= =?us-ascii?Q?by3tEn8n9HlOOwA4cN4Sd4lu09/nE/5xl98kz67CVXm2vL7Xmhb/1Wjw7WqG?= =?us-ascii?Q?Qe5RuY5OORaWPjpP7IFT5q1/nxjUUAbPigC+JNL+oSUn1OTTh/n00iPfZbBK?= =?us-ascii?Q?Vm5PXGoDVY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Y93DzbgjW0El5oyI?= =?us-ascii?Q?HpR1nmYVW9D3ugtb75/xxCQt7pz9B64orA4S/7Tal2jFYl7AeH/gxeOpQRgD?= =?us-ascii?Q?qEiax6Xj+AOTbDntvfDeY56J56P7Re1kZGX0kqkgYAdQF0xDU3jq63+1Epg1?= =?us-ascii?Q?5tnae7SPetjHuMpTOR/w2PH8cOvSMeOCnkgDs/HvA+GpzTB31//AUJIcDlq3?= =?us-ascii?Q?L5bBMw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cefc71d4-ac39-48e3-181b-08d99e57054d X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2021 23:18:03.6404 (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: S5REVCVcuehih3eD4mDQrEahL6PW6uXLHy9h/deC+r5sdqFZHViDPDZW65xrzQk6XHp+poEVkEEE502AoNrduAabtBFhdPeMSUSfnt6FCek= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4522 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone I will correct the commit message during the upstreaming process. Thanks, Nate -----Original Message----- From: mikuback@linux.microsoft.com =20 Sent: Thursday, October 28, 2021 1:43 PM To: devel@edk2.groups.io Cc: Oram, Isaac W ; Desimone, Nathaniel L ; Chiu, Chasel Subject: [PATCH v6 33/52] PurleyOpenBoardPkg: Add SpiFlashCommonLib.h From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3307 Adds the header file to PurleyOpenBoardPkg since it was removed from MinPla= tformPkg. Cc: Isaac Oram Cc: Nate DeSimone Cc: Chasel Chiu Signed-off-by: Michael Kubacki --- Platform/Intel/WhitleyOpenBoardPkg/Include/Library/SpiFlashCommonLib.h | 9= 8 ++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/SpiFlashCom= monLib.h b/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/SpiFlashCommo= nLib.h new file mode 100644 index 000000000000..ef62ba238d71 --- /dev/null +++ b/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/SpiFlashCommonL +++ ib.h @@ -0,0 +1,98 @@ +/** @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=20 + #include=20 + + +#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 -- 2.28.0.windows.1