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.web10.51.1635799117789855381 for ; Mon, 01 Nov 2021 13:38:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=yGHhH6y8; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: isaac.w.oram@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="218027056" X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="218027056" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 13:38:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,200,1631602800"; d="scan'208";a="583118742" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga002.fm.intel.com with ESMTP; 01 Nov 2021 13:38:26 -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.12; Mon, 1 Nov 2021 13:38:26 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.12; Mon, 1 Nov 2021 13:38:26 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 1 Nov 2021 13:38:26 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 1 Nov 2021 13:38:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFmmNg7VGh1BJ4zfqX+KmPq51eUF7sNGENMqkBHv8AQ/N8hhe8UVmJZP8NtVtiyzJcarq3sg5o6pJaPzd2/W1yYkUVvNxuxiOQvIo+MJyuUHleIho508KJPCNwIPSZ95rvYSjtog5JUbm5p0CNaJDEGzUurWYrtv8X9Mx3tL3eBt8SkVbnhduzth3nsbEN3O4IzGzaMFBwwv6RNSgoCvQkjfoibsu2kp+hM8Fer602sNTrfaC+jJaEbMFetnXo/0kp6n1tFh7Oj7TPN3UFxL6b1aJGm1GjmRushGWqmPh7wYOx29qIF2uOWRPlz3gaBZpCrBcRehyh3Vow+FN6pnIw== 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=Im/Q6+Ds6kXuFvONx+c6jzBjRS2RilYHpV22BfN2Pyw=; b=OmjWZjuQxugghAElgbRMPFBt59ifsfUu4lh1HgEOgOzczIokwRb38akpWdNWH+2Bk3+tdlRBIWmtbU3BR/FzI1MmKGPrvFI3AKzG4LcbsdktlZFKkmuOyGpmxf6ZglvYfpfvit9/w9p+EJUWk5RLgbORXDoH7HqXGvWq73KPnw6lzI0Y/juRDeZTQmuYNnfcBVBbZroBNi0JlsLzg+7yTRArJlMav02of7z1HxGMf46OT0dWZYG5SI07ozK75/YaVlfo9pJbRnALf/3e5wkLG0WEMQEZAwM713HhIChCwGTHTMcACt56A7H0fPlksG3gmASDE5Zezp6efCr1EJrqPw== 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=Im/Q6+Ds6kXuFvONx+c6jzBjRS2RilYHpV22BfN2Pyw=; b=yGHhH6y8Lr9SQsElnQsM2GAow0Xt3R3fILPaAztKQrThGiNebfO6Y4qDTh5ozolbhef0Mz51hl5tadiW9sHc9EW0itRM5F2D8ZTFPHycQd14Ij5HHNh8nTKpo/6/14FgIhDpXGDW4tEnHpiumGf4qyR/W8jLM3hXUdh4308H5dk= Received: from MW3PR11MB4747.namprd11.prod.outlook.com (2603:10b6:303:2f::11) by MWHPR11MB1278.namprd11.prod.outlook.com (2603:10b6:300:1d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Mon, 1 Nov 2021 20:38:24 +0000 Received: from MW3PR11MB4747.namprd11.prod.outlook.com ([fe80::7cc4:11e3:2f09:f658]) by MW3PR11MB4747.namprd11.prod.outlook.com ([fe80::7cc4:11e3:2f09:f658%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 20:38:24 +0000 From: "Oram, Isaac W" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Chiu, Chasel" Subject: Re: [PATCH v6 33/52] PurleyOpenBoardPkg: Add SpiFlashCommonLib.h Thread-Topic: [PATCH v6 33/52] PurleyOpenBoardPkg: Add SpiFlashCommonLib.h Thread-Index: AQHXzDznxXw9N6wWQ0e8JcrNQkrPmKvo5rxQ Date: Mon, 1 Nov 2021 20:38:23 +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-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action 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: a24cc3b4-bed1-4b76-68a1-08d99d778cef x-ms-traffictypediagnostic: MWHPR11MB1278: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lZP+SIPs/sE4CG6n/ZO4TKZpGn0Tb5T0cspBc7w6y4ryXXIg6G55OII/5DiBWHdpYproKQGMXt8MMSTmsg2r9tPrg53+cF8G0B1rNSQZb4DTzwaLoXK98q6Q9gGptTe0coCxCaCr/U1Hm53LnjW03shNAO1devUShU0Z2pAX4YdP7qLXhVMAa/oHLtKd2LZJILgSzdr+r/5imtjUV2kr7MXkNqDr2E7mqvGJ0BYM9sqb811Ou5skSyM9+fa9MgkjFqQSHhv6xlvScDPsJWTrP+HZSwVnsnHkL3hOYmNfG7k+dMYuyFENYyWiw83V5URORQvdMpITX1Lm+FCsz409Vq2YroSnNl9dTo/hffb1fG/pE1rQ2FmAiESL22J7M7PBZ+61Xt0cpaw/t1DfEqXFfaA5Rz2rb6mcQNDCVZlv5DRY2GGRu6VG4VAurWmbrg5SkjR/7ry0P2uw9Jb4VuBBdavXX/ENMHdsFExKmF8+BE2Y8sld+EUX/dS/4yWe+eW3/1VK8pTEyXyQ4IflFC2dQ94hFlpvNDCSDbgfzGH1AioRv3VRTZl5nPAjzDFusAEw2Fv0pdm9e1KL8ZYYhoYky0OSIxUPOGmagEN2WiZSK7sMW7z1EfoE4BUaBRPqdNk6X2ns5stpUaT3jJeP2Dnf0PSZKXKriTdAtZVK+N7+BvYAPtRTm0+4mb1JnzSEhlcwLcDmfG0oyMaJK2XH0hDUJ7oGw2fax5XYigWC8d+ewaXiUe1asAgx4e4PRyFYV3CjwszhReok4rENHXsICZeQQuP2eLXgXWmCnoullXRcZSU= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4747.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(2906002)(38070700005)(71200400001)(53546011)(6506007)(55016002)(38100700002)(33656002)(107886003)(54906003)(9686003)(82960400001)(122000001)(8676002)(66556008)(66476007)(64756008)(66946007)(110136005)(5660300002)(508600001)(8936002)(76116006)(66446008)(26005)(186003)(4326008)(86362001)(52536014)(83380400001)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2Ph0dZTPkhWlbYFelf55V+sFs0XlcoJBZrGxYHIH5lOiggyhOTJ/nD9dpvQF?= =?us-ascii?Q?6bPu5XNLVO1NMivDybwe+2zqsTm0RMEm3YIdwfIC7lbd+UQUaGRAmUhyyKzA?= =?us-ascii?Q?II8//cTmdAX4KWzCza4wCcEMuFYXVdImaLKOMnMCx4ODl93MmkHOezk9rqMh?= =?us-ascii?Q?y7tXrP0mab6C9iEcGrz1L/lvIj5EBJAryuX1lzBcGSlCSxqWE7Ob1p5oM583?= =?us-ascii?Q?ANjsZdVFxgoQd4ukB0/n8T+s9M6D720HsdPyxoSG+wAdCEgluvrvKWymMW2Y?= =?us-ascii?Q?VQIDE4EY9vwjpusuO4ZCKxVrY44JfOQ06P+V6Met+ZAwvX0LwRwiu8NZrfNf?= =?us-ascii?Q?UP0uo+20biPvq9ZrEyOKYrdLV/VbOcFk3JGbi1NmQYa7gpLIFO3ZD7ygFaqs?= =?us-ascii?Q?a8+wkGM3ePfW2TA45DcLE3rfjmuubm/rui5KA9AR+yt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5yAYYvXn8pOHbA/a7EC/2BHEK39k4vbPXKUxvn2uamUC2XAMpQ?= =?us-ascii?Q?b1E9Pvq8NP1+r9EBSxZW77gDILv48ChvRaNb+xZW9j1QoJjDrCXQB+9Joner?= =?us-ascii?Q?hvkPopDwpLqbRHrG2tZe7JPquAEwCHtBEXjr7yYP94hghIgFkrZCZp9I6hmv?= =?us-ascii?Q?SCcMV3v711e3lhYQVmjeoCWwfmBzzwg0IqRLnn5K0MEwW15t9cB9noz7khDT?= =?us-ascii?Q?2ajcAl/0C0XtdrD4BubS/s+dwS9cmPceSeDV7MmWCXWSvZGgccwsjVh62Ld7?= =?us-ascii?Q?gll/JBcGMgoQa72IGExOlmk=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4747.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a24cc3b4-bed1-4b76-68a1-08d99d778cef X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2021 20:38:23.9759 (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: ZOlMNMztfY9Jh1sYkd3RG0hCdiw8yoz/wg7qBcbA4kL3/64ADmaPAPDiXCCexZaodm/v4MtOUcundA4EToCrZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1278 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Isaac Oram Please note subject/title and message body indicate PurleyOpenBoardPkg, but= actual file is located in WhitleyOpenBoardPkg. I don't see any content difference and think it would be better to modify I= NF to include IntelSiliconPkg/IntelSiliconPkg.dec. I can do this in the patch series I have to extend the WhitleyOpenBoardPkg = for WHEA functionality. I need to rebase it to this series anyway. However, if this is a bug and you meant to add to PurleyOpenBoardPkg, then = it might be better to fix this series. I verified no build/boot issues usi= ng INF fix with WhitleyOpenBoardPkg. Regards, Isaac -----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