From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 1B18DD80212 for ; Thu, 16 May 2024 15:18:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8wergN0hoXr6pDG3W9atAUmmGvdxX3luZXlW1U8jBdU=; c=relaxed/simple; d=groups.io; h=Received-SPF:Authentication-Results-Original:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:NoDisclaimer:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1715872685; v=1; b=f722VSKUKG9x916nU4BZqtwMZHlCh2Z5DdH1ju6M8YyRZ9MGEUAWcXIASbvPE6/iooa552Oe vrVjbkBPtf9cDCAxhAF0BMfgssEHM1Fu9+TlOU0AbGKXJ4w8WktdLjh0s0vmxmlc6WINnKN+zZl 744h3BYgB9+CTXKYWwBSEt4MsE7DeEWhtpo1P8/uejb1N248YJLpu1YCY3fd7JyyKAFsPJajJxG uTKcy4WgJXG/8WN3S493SzkQF6i14D0kRkVSQWWq7OWt55PowIWSnjnPj+FVni0VwEMKsGygGUT 8TF+bMIVgDhzFnBhNggPFtfvPzVkg5ODikURZOCCv80yw== X-Received: by 127.0.0.2 with SMTP id UYVvYY7687511xsXGbdnApfW; Thu, 16 May 2024 08:18:05 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.50]) by mx.groups.io with SMTP id smtpd.web11.16858.1715872679474142155 for ; Thu, 16 May 2024 08:18:00 -0700 X-Received: from AM0PR02CA0126.eurprd02.prod.outlook.com (2603:10a6:20b:28c::23) by DBBPR08MB5881.eurprd08.prod.outlook.com (2603:10a6:10:208::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Thu, 16 May 2024 15:17:54 +0000 X-Received: from AM4PEPF00027A6A.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::12) by AM0PR02CA0126.outlook.office365.com (2603:10a6:20b:28c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27 via Frontend Transport; Thu, 16 May 2024 15:17:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00027A6A.mail.protection.outlook.com (10.167.16.88) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7587.21 via Frontend Transport; Thu, 16 May 2024 15:17:53 +0000 X-Received: ("Tessian outbound e46bb127ed3d:v315"); Thu, 16 May 2024 15:17:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 690ddcf3f0147161 X-CR-MTA-TID: 64aa7808 X-Received: from 01ca6f25d800.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 37880DE3-1DB9-4F04-ACFE-285F5ACB3690.1; Thu, 16 May 2024 15:17:46 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 01ca6f25d800.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 16 May 2024 15:17:46 +0000 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by DB8PR08MB5339.eurprd08.prod.outlook.com (2603:10a6:10:114::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.28; Thu, 16 May 2024 15:17:45 +0000 X-Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::1e13:dc65:224e:219c]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::1e13:dc65:224e:219c%5]) with mapi id 15.20.7587.028; Thu, 16 May 2024 15:17:45 +0000 Message-ID: <08cd3ecc-5db9-48d5-969a-c16f5f15f5cb@arm.com> Date: Thu, 16 May 2024 16:17:42 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 03/14] Platform/ARM/NorFlashDxe: Add NorFlashCommon.h header file To: Sahil Kaushal , devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , sahil , "nd@arm.com" References: <20240423055638.1271531-1-Sahil.Kaushal@arm.com> <20240423055638.1271531-4-Sahil.Kaushal@arm.com> From: "Sami Mujawar" In-Reply-To: <20240423055638.1271531-4-Sahil.Kaushal@arm.com> X-ClientProxiedBy: LO4P123CA0395.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::22) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|DB8PR08MB5339:EE_|AM4PEPF00027A6A:EE_|DBBPR08MB5881:EE_ X-MS-Office365-Filtering-Correlation-Id: f116ff06-be7e-46d7-de79-08dc75bb5bce x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?NTF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IP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5339 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A6A.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2f238b93-815e-470c-3b8e-08dc75bb567b X-Microsoft-Antispam-Message-Info: =?utf-8?B?RWFvUjBWdHFYTU9oZlg2azJRSndxSHgvVFJLbmtFaXBBNHFEOG5ZWVJyWHRx?= =?utf-8?B?RXpFQTNLV2RYMVAvcWlCbmthNjBBNjRNRkJSWlpPV1l5OC9pYnpzUEJvdHJv?= =?utf-8?B?S1lodkNuSTk2Zjh2eE9aWVN1eS9QUnlqby9WREVORXdiTFhDQmUxNW1wenBn?= =?utf-8?B?Vi9MVkRvTXFoV1JkdmxDWVpzTUp5N3owV2lwWVRZekc2RW9HaTBCdlVMWDZo?= =?utf-8?B?VnNiVHVmUUdvVEdJbHdBNThpZ3crYkM4RStoQVQ3aHlFbnNUcVVDTWptZHRK?= =?utf-8?B?TS9MQ09ZSjNvRVMxSUZKVWxmWVFrcTJqSjFYK09QcEJtdzVSQ1VsemEwM2Vv?= =?utf-8?B?SkRRSlZXZVpLN2cyQ2xrOGhVVEhlWnpiODQ1TmlsU3BacmJ5TU9wZlBKa21u?= =?utf-8?B?L2dHdmxuZ0R0cW9iL2N0ZVo0bnBrdHJFL1poK29tUllub2t3MmpYSENGVmN0?= =?utf-8?B?NTFEd2pJRU02N2JCTDBoN1hrenJxbVJMbUFlcjNpMFNNa2ova1ErRkxIME40?= =?utf-8?B?SDhDTUFlM2lhWng5bkI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utf-8?B?UEQzNStZaG1RN1Uvd1NGNHJHcXoweld1Sy8yTzUyK3YxR2V3d29GUHBZZ01q?= =?utf-8?B?eXBhcFY5Yk1HR3Z2QUFXV2pVQmV3TVlGYW1QTmc5aER6U2RFRjVzaGkzdFVt?= =?utf-8?B?cE5UaFlxaFJtZjdWbXFPSXFSU0U1a3d0VXB1NG5kZDNUWXF2YmVBOVRvZWN1?= =?utf-8?B?cStIMEVnMnE5RjdLRGR5anhxemF0RlpIbzBuUVhrL3JPbDZtNkpTbVFHU3pq?= =?utf-8?B?eCtSakpXUUtpL3c3c0FieFdEYzRnWmNjMkZHV1cwc0ptei9yVnY2cTF0NStw?= =?utf-8?B?VjRKY3pUeVVyOU45QXRvTzdUbld6eU5nclowdXRtYmUxN3RQQ2RXRWVaWFd1?= =?utf-8?B?dnFCSW8ycGNKRlRyaG13dURRT3FPTzZVOHRqNUo5YU0zbU0remIzOXgxNzNG?= =?utf-8?Q?UIVlTK+iM8v65?= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 15:17:53.8760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f116ff06-be7e-46d7-de79-08dc75bb5bce X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A6A.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5881 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 16 May 2024 08:18:00 -0700 Resent-From: sami.mujawar@arm.com Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: iLKtQNUtVU6LJNIx9RQoTmPzx7686176AA= Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=f722VSKU; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Hi Sahil, Thank you for this patch. These changes look good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 23/04/2024 06:56 am, Sahil Kaushal wrote: > From: sahil > > This patch splits NorFlash.h and adds NorFlashCommon.h which > will have all the flash independent functions and macros. > Whereas all the flash specific functions will be in NorFlash.h > header file. > > Signed-off-by: sahil > --- > Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf | 1 + > Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf | 1 + > Platform/ARM/Drivers/NorFlashDxe/NorFlash.h | 199 -------= ----------- > Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h | 221 +++++++= +++++++++++++ > Platform/ARM/Drivers/NorFlashDxe/NorFlash.c | 1 + > Platform/ARM/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c | 1 + > Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c | 1 + > Platform/ARM/Drivers/NorFlashDxe/NorFlashFvb.c | 1 + > Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c | 1 + > 9 files changed, 228 insertions(+), 199 deletions(-) > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf b/Platform/= ARM/Drivers/NorFlashDxe/NorFlashDxe.inf > index cdf1f5c27f35..18e99bac8888 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.inf > @@ -21,6 +21,7 @@ > NorFlash.h > > NorFlashBlockIoDxe.c > > NorFlashDxe.c > > + NorFlashCommon.h > > NorFlashFvb.c > > =20 > > [Packages] > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf b/= Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf > index 001f281220f2..69c40ccf9c27 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf > @@ -22,6 +22,7 @@ > NorFlash.c > > NorFlash.h > > NorFlashFvb.c > > + NorFlashCommon.h > > NorFlashStandaloneMm.c > > =20 > > [Packages] > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h b/Platform/ARM/D= rivers/NorFlashDxe/NorFlash.h > index d4d97bd22cc5..e0ebb1e2fd35 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h > @@ -20,9 +20,6 @@ > =20 > > #include > > #include > > -#include > > -#include > > -#include > > =20 > > #define NOR_FLASH_ERASE_RETRY 10 > > =20 > > @@ -108,11 +105,6 @@ > #define P30_CMD_READ_CONFIGURATION_REGISTER_SETUP 0x0060 > > #define P30_CMD_READ_CONFIGURATION_REGISTER 0x0003 > > =20 > > -#define NOR_FLASH_SIGNATURE SIGNATURE_32('n', 'o', 'r', '0') > > -#define INSTANCE_FROM_FVB_THIS(a) CR(a, NOR_FLASH_INSTANCE, FvbProto= col, NOR_FLASH_SIGNATURE) > > -#define INSTANCE_FROM_BLKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, BlockIoP= rotocol, NOR_FLASH_SIGNATURE) > > -#define INSTANCE_FROM_DISKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, DiskIoPr= otocol, NOR_FLASH_SIGNATURE) > > - > > typedef struct _NOR_FLASH_INSTANCE NOR_FLASH_INSTANCE; > > =20 > > #pragma pack (1) > > @@ -158,197 +150,6 @@ NorFlashWriteBuffer ( > IN UINT32 *Buffer > > ); > > =20 > > -// > > -// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.Reset > > -// > > -EFI_STATUS > > -EFIAPI > > -NorFlashBlockIoReset ( > > - IN EFI_BLOCK_IO_PROTOCOL *This, > > - IN BOOLEAN ExtendedVerification > > - ); > > - > > -// > > -// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.ReadBlocks > > -// > > -EFI_STATUS > > -EFIAPI > > -NorFlashBlockIoReadBlocks ( > > - IN EFI_BLOCK_IO_PROTOCOL *This, > > - IN UINT32 MediaId, > > - IN EFI_LBA Lba, > > - IN UINTN BufferSizeInBytes, > > - OUT VOID *Buffer > > - ); > > - > > -// > > -// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.WriteBlocks > > -// > > -EFI_STATUS > > -EFIAPI > > -NorFlashBlockIoWriteBlocks ( > > - IN EFI_BLOCK_IO_PROTOCOL *This, > > - IN UINT32 MediaId, > > - IN EFI_LBA Lba, > > - IN UINTN BufferSizeInBytes, > > - IN VOID *Buffer > > - ); > > - > > -// > > -// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.FlushBlocks > > -// > > -EFI_STATUS > > -EFIAPI > > -NorFlashBlockIoFlushBlocks ( > > - IN EFI_BLOCK_IO_PROTOCOL *This > > - ); > > - > > -// > > -// DiskIO Protocol function EFI_DISK_IO_PROTOCOL.ReadDisk > > -// > > -EFI_STATUS > > -EFIAPI > > -NorFlashDiskIoReadDisk ( > > - IN EFI_DISK_IO_PROTOCOL *This, > > - IN UINT32 MediaId, > > - IN UINT64 Offset, > > - IN UINTN BufferSize, > > - OUT VOID *Buffer > > - ); > > - > > -// > > -// DiskIO Protocol function EFI_DISK_IO_PROTOCOL.WriteDisk > > -// > > -EFI_STATUS > > -EFIAPI > > -NorFlashDiskIoWriteDisk ( > > - IN EFI_DISK_IO_PROTOCOL *This, > > - IN UINT32 MediaId, > > - IN UINT64 Offset, > > - IN UINTN BufferSize, > > - IN VOID *Buffer > > - ); > > - > > -// > > -// NorFlashFvbDxe.c > > -// > > - > > -EFI_STATUS > > -EFIAPI > > -FvbGetAttributes ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - OUT EFI_FVB_ATTRIBUTES_2 *Attributes > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -FvbSetAttributes ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -FvbGetPhysicalAddress ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - OUT EFI_PHYSICAL_ADDRESS *Address > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -FvbGetBlockSize ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - IN EFI_LBA Lba, > > - OUT UINTN *BlockSize, > > - OUT UINTN *NumberOfBlocks > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -FvbRead ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - IN EFI_LBA Lba, > > - IN UINTN Offset, > > - IN OUT UINTN *NumBytes, > > - IN OUT UINT8 *Buffer > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -FvbWrite ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - IN EFI_LBA Lba, > > - IN UINTN Offset, > > - IN OUT UINTN *NumBytes, > > - IN UINT8 *Buffer > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -FvbEraseBlocks ( > > - IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > - ... > > - ); > > - > > -EFI_STATUS > > -ValidateFvHeader ( > > - IN NOR_FLASH_INSTANCE *Instance > > - ); > > - > > -EFI_STATUS > > -InitializeFvAndVariableStoreHeaders ( > > - IN NOR_FLASH_INSTANCE *Instance > > - ); > > - > > -VOID > > -EFIAPI > > -FvbVirtualNotifyEvent ( > > - IN EFI_EVENT Event, > > - IN VOID *Context > > - ); > > - > > -// > > -// NorFlashDxe.c > > -// > > - > > -EFI_STATUS > > -NorFlashWriteFullBlock ( > > - IN NOR_FLASH_INSTANCE *Instance, > > - IN EFI_LBA Lba, > > - IN UINT32 *DataBuffer, > > - IN UINT32 BlockSizeInWords > > - ); > > - > > -EFI_STATUS > > -NorFlashUnlockAndEraseSingleBlock ( > > - IN NOR_FLASH_INSTANCE *Instance, > > - IN UINTN BlockAddress > > - ); > > - > > -EFI_STATUS > > -NorFlashCreateInstance ( > > - IN UINTN NorFlashDeviceBase, > > - IN UINTN NorFlashRegionBase, > > - IN UINTN NorFlashSize, > > - IN UINT32 Index, > > - IN UINT32 BlockSize, > > - IN BOOLEAN SupportFvb, > > - OUT NOR_FLASH_INSTANCE **NorFlashInstance > > - ); > > - > > -EFI_STATUS > > -EFIAPI > > -NorFlashFvbInitialize ( > > - IN NOR_FLASH_INSTANCE *Instance > > - ); > > - > > -VOID > > -EFIAPI > > -NorFlashVirtualNotifyEvent ( > > - IN EFI_EVENT Event, > > - IN VOID *Context > > - ); > > - > > // > > // NorFlash.c > > // > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h b/Platform= /ARM/Drivers/NorFlashDxe/NorFlashCommon.h > new file mode 100644 > index 000000000000..e329e0727617 > --- /dev/null > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashCommon.h > @@ -0,0 +1,221 @@ > +/** @file > > + > > + Copyright (c) 2011-2024, Arm Limited. All rights reserved.
> > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#ifndef NOR_FLASH_COMMON_H_ > > +#define NOR_FLASH_COMMON_H_ > > + > > +#include > > +#include > > + > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#define NOR_FLASH_SIGNATURE SIGNATURE_32('n', 'o', 'r', '0') > > +#define INSTANCE_FROM_FVB_THIS(a) CR(a, NOR_FLASH_INSTANCE, FvbProto= col, NOR_FLASH_SIGNATURE) > > +#define INSTANCE_FROM_BLKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, BlockIoP= rotocol, NOR_FLASH_SIGNATURE) > > +#define INSTANCE_FROM_DISKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, DiskIoPr= otocol, NOR_FLASH_SIGNATURE) > > + > > +// > > +// NorFlashDxe.c > > +// > > +EFI_STATUS > > +NorFlashWriteFullBlock ( > > + IN NOR_FLASH_INSTANCE *Instance, > > + IN EFI_LBA Lba, > > + IN UINT32 *DataBuffer, > > + IN UINT32 BlockSizeInWords > > + ); > > + > > +EFI_STATUS > > +NorFlashUnlockAndEraseSingleBlock ( > > + IN NOR_FLASH_INSTANCE *Instance, > > + IN UINTN BlockAddress > > + ); > > + > > +EFI_STATUS > > +NorFlashCreateInstance ( > > + IN UINTN NorFlashDeviceBase, > > + IN UINTN NorFlashRegionBase, > > + IN UINTN NorFlashSize, > > + IN UINT32 Index, > > + IN UINT32 BlockSize, > > + IN BOOLEAN SupportFvb, > > + OUT NOR_FLASH_INSTANCE **NorFlashInstance > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +NorFlashFvbInitialize ( > > + IN NOR_FLASH_INSTANCE *Instance > > + ); > > + > > +VOID > > +EFIAPI > > +NorFlashVirtualNotifyEvent ( > > + IN EFI_EVENT Event, > > + IN VOID *Context > > + ); > > + > > +// > > +// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.Reset > > +// > > +EFI_STATUS > > +EFIAPI > > +NorFlashBlockIoReset ( > > + IN EFI_BLOCK_IO_PROTOCOL *This, > > + IN BOOLEAN ExtendedVerification > > + ); > > + > > +// > > +// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.ReadBlocks > > +// > > +EFI_STATUS > > +EFIAPI > > +NorFlashBlockIoReadBlocks ( > > + IN EFI_BLOCK_IO_PROTOCOL *This, > > + IN UINT32 MediaId, > > + IN EFI_LBA Lba, > > + IN UINTN BufferSizeInBytes, > > + OUT VOID *Buffer > > + ); > > + > > +// > > +// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.WriteBlocks > > +// > > +EFI_STATUS > > +EFIAPI > > +NorFlashBlockIoWriteBlocks ( > > + IN EFI_BLOCK_IO_PROTOCOL *This, > > + IN UINT32 MediaId, > > + IN EFI_LBA Lba, > > + IN UINTN BufferSizeInBytes, > > + IN VOID *Buffer > > + ); > > + > > +// > > +// BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.FlushBlocks > > +// > > +EFI_STATUS > > +EFIAPI > > +NorFlashBlockIoFlushBlocks ( > > + IN EFI_BLOCK_IO_PROTOCOL *This > > + ); > > + > > +// > > +// DiskIO Protocol function EFI_DISK_IO_PROTOCOL.ReadDisk > > +// > > +EFI_STATUS > > +EFIAPI > > +NorFlashDiskIoReadDisk ( > > + IN EFI_DISK_IO_PROTOCOL *This, > > + IN UINT32 MediaId, > > + IN UINT64 Offset, > > + IN UINTN BufferSize, > > + OUT VOID *Buffer > > + ); > > + > > +// > > +// DiskIO Protocol function EFI_DISK_IO_PROTOCOL.WriteDisk > > +// > > +EFI_STATUS > > +EFIAPI > > +NorFlashDiskIoWriteDisk ( > > + IN EFI_DISK_IO_PROTOCOL *This, > > + IN UINT32 MediaId, > > + IN UINT64 Offset, > > + IN UINTN BufferSize, > > + IN VOID *Buffer > > + ); > > + > > +// > > +// NorFlashFvbDxe.c > > +// > > + > > +EFI_STATUS > > +EFIAPI > > +FvbGetAttributes ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + OUT EFI_FVB_ATTRIBUTES_2 *Attributes > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +FvbSetAttributes ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +FvbGetPhysicalAddress ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + OUT EFI_PHYSICAL_ADDRESS *Address > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +FvbGetBlockSize ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + IN EFI_LBA Lba, > > + OUT UINTN *BlockSize, > > + OUT UINTN *NumberOfBlocks > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +FvbRead ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + IN EFI_LBA Lba, > > + IN UINTN Offset, > > + IN OUT UINTN *NumBytes, > > + IN OUT UINT8 *Buffer > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +FvbWrite ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + IN EFI_LBA Lba, > > + IN UINTN Offset, > > + IN OUT UINTN *NumBytes, > > + IN UINT8 *Buffer > > + ); > > + > > +EFI_STATUS > > +EFIAPI > > +FvbEraseBlocks ( > > + IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, > > + ... > > + ); > > + > > +EFI_STATUS > > +ValidateFvHeader ( > > + IN NOR_FLASH_INSTANCE *Instance > > + ); > > + > > +EFI_STATUS > > +InitializeFvAndVariableStoreHeaders ( > > + IN NOR_FLASH_INSTANCE *Instance > > + ); > > + > > +VOID > > +EFIAPI > > +FvbVirtualNotifyEvent ( > > + IN EFI_EVENT Event, > > + IN VOID *Context > > + ); > > + > > +#endif /* NOR_FLASH_COMMON_H_ */ > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c b/Platform/ARM/D= rivers/NorFlashDxe/NorFlash.c > index 55f6abd0eef3..4e5a97c83c7b 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c > @@ -10,6 +10,7 @@ > #include > > =20 > > #include "NorFlash.h" > > +#include "NorFlashCommon.h" > > =20 > > // > > // Global variable declarations > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c b/Plat= form/ARM/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c > index 9b8c76a171d4..a6c73312c596 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c > @@ -10,6 +10,7 @@ > #include > > =20 > > #include "NorFlash.h" > > +#include "NorFlashCommon.h" > > =20 > > // > > // BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.Reset > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c b/Platform/AR= M/Drivers/NorFlashDxe/NorFlashDxe.c > index 963af7dcf435..b1e01169c24e 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c > @@ -15,6 +15,7 @@ > #include > > =20 > > #include "NorFlash.h" > > +#include "NorFlashCommon.h" > > =20 > > STATIC EFI_EVENT mNorFlashVirtualAddrChangeEvent; > > =20 > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashFvb.c b/Platform/AR= M/Drivers/NorFlashDxe/NorFlashFvb.c > index 0767581308d2..f9f2856e0c81 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashFvb.c > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashFvb.c > @@ -19,6 +19,7 @@ > #include > > =20 > > #include "NorFlash.h" > > +#include "NorFlashCommon.h" > > =20 > > extern UINTN mFlashNvStorageVariableBase; > > /// > > diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c b/Pl= atform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c > index b72ad97b0b55..f2919265139b 100644 > --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c > +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c > @@ -12,6 +12,7 @@ > #include > > =20 > > #include "NorFlash.h" > > +#include "NorFlashCommon.h" > > =20 > > // > > // Global variable declarations > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118959): https://edk2.groups.io/g/devel/message/118959 Mute This Topic: https://groups.io/mt/105690938/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-