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 9A9EFAC0DF8 for ; Wed, 24 Apr 2024 09:49:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=NzIUadO9TPxOwfPCqvbFqPtkXd2TM45P38P0MXTHvX0=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:Authentication-Results-Original:nodisclaimer:MIME-Version: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=1713952191; v=1; b=JTozNX2+1DLrtO7bdyvNC1p85myGPV+sYl38rxBasaRa57WoCwtJt8AUX70Pw24iRaKuS3/R 4lPQ/ET1WDcn+KS9RcSNk74ept9P67qEZqAAd5eiUu/dbWZy8MCtT7ttlbJ2AfI2WmQcuxF5tKr Yrp4QJK/hvV8uxAYvDWRhDgkxZhrNPccCXGA6Bl1kGfgI5rm3465HFpj0xog6LobKEckvRxt5eZ cnqT+gC/IXpN553fN5gOKB2pgfFTW76+hLi6x608rPphOTk+VNCib3za8ER9FhXl1Z6s4mLb64U onZPQHUKpO0iKQf/b+6CzXorXYcKubwZJ5FdNfU58oZxg== X-Received: by 127.0.0.2 with SMTP id 2gAnYY7687511x2DF7ZCerhd; Wed, 24 Apr 2024 02:49:51 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.48]) by mx.groups.io with SMTP id smtpd.web10.12560.1713952189766330367 for ; Wed, 24 Apr 2024 02:49:50 -0700 X-Received: from DUZPR01CA0111.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::12) by DBBPR08MB10532.eurprd08.prod.outlook.com (2603:10a6:10:530::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 09:49:45 +0000 X-Received: from DU6PEPF0000B61E.eurprd02.prod.outlook.com (2603:10a6:10:4bb:cafe::6f) by DUZPR01CA0111.outlook.office365.com (2603:10a6:10:4bb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.22 via Frontend Transport; Wed, 24 Apr 2024 09:49:42 +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 DU6PEPF0000B61E.mail.protection.outlook.com (10.167.8.133) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7519.19 via Frontend Transport; Wed, 24 Apr 2024 09:49:42 +0000 X-Received: ("Tessian outbound 8c03561b2da6:v313"); Wed, 24 Apr 2024 09:49:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 009b8f2a0c356177 X-CR-MTA-TID: 64aa7808 X-Received: from 04c7f8b11d58.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5141D013-9D67-4306-8BA7-86ED4E9BD99B.1; Wed, 24 Apr 2024 09:49:35 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 04c7f8b11d58.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Apr 2024 09:49:35 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) by DB9PR08MB6427.eurprd08.prod.outlook.com (2603:10a6:10:25a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 09:49:33 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::4a5d:48:bf49:a524]) by AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::4a5d:48:bf49:a524%7]) with mapi id 15.20.7472.044; Wed, 24 Apr 2024 09:49:33 +0000 From: "levi.yun" To: "devel@edk2.groups.io" , Sahil Kaushal CC: Ard Biesheuvel , =?koi8-r?Q?Leif_Lindholm_=9A?= , Sami Mujawar Subject: Re: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 03/14] Platform/ARM/NorFlashDxe: Add NorFlashCommon.h header file Thread-Topic: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 03/14] Platform/ARM/NorFlashDxe: Add NorFlashCommon.h header file Thread-Index: AQHalY8UKK0TauNcN0S8r4wkyb1Ad7F3Lkw3 Date: Wed, 24 Apr 2024 09:49:33 +0000 Message-ID: References: <20240423055638.1271531-1-Sahil.Kaushal@arm.com> <20240423055638.1271531-4-Sahil.Kaushal@arm.com> In-Reply-To: <20240423055638.1271531-4-Sahil.Kaushal@arm.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AM0PR08MB4289:EE_|DB9PR08MB6427:EE_|DU6PEPF0000B61E:EE_|DBBPR08MB10532:EE_ X-MS-Office365-Filtering-Correlation-Id: 51b3a471-07c4-4576-0249-08dc6443dd8d x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-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ZgulDCqSi+NR+xz4NL7bWTuhMa7+Yq6QmLUwQHz?= =?koi8-r?Q?mpG4m6Ngr3jWI8yIyoQmfb1OZUJqW91+RRaGwBxsX1zlZ14NLOdjqJAX74k4ew?= =?koi8-r?Q?F6kzlSq4i+mlsmIX6psb4zUo+4XVJ2QoltRUOxMArqztb998WyLYy5lu7gqeQv?= =?koi8-r?Q?YDRFqAkYpdzsy95+BqWCOU2efcPxC1sNys0XA3g0YizQwVg9fEaC6piZYz0Okx?= =?koi8-r?Q?5UpNjulp6KSG+rlpiVvzitKnD8v+vjm2cvEFLR0H7wHFh19N/cS7yxRUGtEo62?= =?koi8-r?Q?VXNbzhY9UAFAbAv+tIQw9UBtQOTPEnN5e/Kflifm3HnRbJKdxU6RsoomrgUaBQ?= =?koi8-r?Q?CwBWvX9KdhI+OFMdLmC/cKirqVpgIZeH8TuGHFLjyU2aoH9z5a3qloWy+WYXiF?= =?koi8-r?Q?kdKqFkalUfmLrXeIPJiTLEzmWUtR+tsJGsCXAd11IwdYHUassAvUY4EOh2evRh?= =?koi8-r?Q?fdWeQfHuXI1du3J9K+qqNQVqaN8wDJ7gvaGCP5jf57QYF/UVInhsv2wAkjUzvR?= =?koi8-r?Q?mQ=3D=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB4289.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6427 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: DU6PEPF0000B61E.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 07c791ce-311e-48d8-8691-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3ooK7?= =?koi8-r?Q?O+RNVcaN0foH312bBFPEGPxQuPiNH5DJwFgDrm0ssRLjGZBtC+d6hTjvK9PMjX?= =?koi8-r?Q?n+2RTPe6Xk3iJRCQRVkwUOITUdtqNEXwpAUmh6M6IquWutLEWfC4mOmCGoq3ox?= =?koi8-r?Q?V30NWeR6XHJhqwge6x7xtQ5qAb4PzzAYzV0h1BxTc/6F/5JnDlTdQpSDnvqHHq?= =?koi8-r?Q?jsNwoVnpoKn5N6PXPnaty3mJ+pQn3XjLWOJWysACq6AZzUGqWdIGDY464Ku8Ag?= =?koi8-r?Q?AVjquAIMn6fTUrt/QNcjiRo5ak2HA9xeWWm1HoAY07aBTP9A4NHaRFhpoCsr5b?= =?koi8-r?Q?N+C8OyoGAJXCHi2UD9DBDMSD96r2t21mjrRJ+7qfdFluA13MIBFtDOf1s0FsVO?= =?koi8-r?Q?tVdlwrqWtqmgML64Kn9vOdCBAeSnohL96hS34HT4lx5XOM5eLrolCdYc3Xj4h9?= =?koi8-r?Q?3XbEWiwicW4wsRNu82mLdhPAd/XsxEaqsT2oLoCUgNWOveFiWo24dg9UkRMSTU?= =?koi8-r?Q?o4ucxT0t2CSrlD4UlgDMv+YCNT8oYZ8Z8jpfzeE9Exwh?= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 09:49:42.2203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51b3a471-07c4-4576-0249-08dc6443dd8d 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: DU6PEPF0000B61E.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10532 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: Wed, 24 Apr 2024 02:49:50 -0700 Resent-From: yeoreum.yun@arm.com Reply-To: devel@edk2.groups.io,yeoreum.yun@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Aw8S0rS7pOY2rFJgVYYOV1Pzx7686176AA= Content-Language: en-GB Content-Type: text/plain; charset="koi8-r" 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=JTozNX2+; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: levi.yun ________________________________________ From: devel@edk2.groups.io on behalf of Sahil Kausha= l via groups.io Sent: 23 April 2024 06:56 To: devel@edk2.groups.io Cc: Ard Biesheuvel; Leif Lindholm ; Sami Mujawar; Sahil Kaushal Subject: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 03/14] Platfor= m/ARM/NorFlashDxe: Add NorFlashCommon.h header file 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/AR= M/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 [Packages] diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf b/Pl= atform/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 [Packages] diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h b/Platform/ARM/Dri= vers/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 @@ #include #include -#include -#include -#include #define NOR_FLASH_ERASE_RETRY 10 @@ -108,11 +105,6 @@ #define P30_CMD_READ_CONFIGURATION_REGISTER_SETUP 0x0060 #define P30_CMD_READ_CONFIGURATION_REGISTER 0x0003 -#define NOR_FLASH_SIGNATURE SIGNATURE_32('n', 'o', 'r', '0') -#define INSTANCE_FROM_FVB_THIS(a) CR(a, NOR_FLASH_INSTANCE, FvbProtoco= l, NOR_FLASH_SIGNATURE) -#define INSTANCE_FROM_BLKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, BlockIoPro= tocol, NOR_FLASH_SIGNATURE) -#define INSTANCE_FROM_DISKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, DiskIoProt= ocol, NOR_FLASH_SIGNATURE) - typedef struct _NOR_FLASH_INSTANCE NOR_FLASH_INSTANCE; #pragma pack (1) @@ -158,197 +150,6 @@ NorFlashWriteBuffer ( IN UINT32 *Buffer ); -// -// 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/A= RM/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, FvbProtoco= l, NOR_FLASH_SIGNATURE) +#define INSTANCE_FROM_BLKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, BlockIoPro= tocol, NOR_FLASH_SIGNATURE) +#define INSTANCE_FROM_DISKIO_THIS(a) CR(a, NOR_FLASH_INSTANCE, DiskIoProt= ocol, 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/Dri= vers/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 #include "NorFlash.h" +#include "NorFlashCommon.h" // // Global variable declarations diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashBlockIoDxe.c b/Platfo= rm/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 #include "NorFlash.h" +#include "NorFlashCommon.h" // // BlockIO Protocol function EFI_BLOCK_IO_PROTOCOL.Reset diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c b/Platform/ARM/= 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 #include "NorFlash.h" +#include "NorFlashCommon.h" STATIC EFI_EVENT mNorFlashVirtualAddrChangeEvent; diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashFvb.c b/Platform/ARM/= 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 #include "NorFlash.h" +#include "NorFlashCommon.h" extern UINTN mFlashNvStorageVariableBase; /// diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashStandaloneMm.c b/Plat= form/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 #include "NorFlash.h" +#include "NorFlashCommon.h" // // Global variable declarations -- 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118153): https://edk2.groups.io/g/devel/message/118153 Mute This Topic: https://groups.io/mt/105690938/7717249 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [yeoreum.yun@arm.com] -=3D-=3D-=3D-=3D-=3D-=3D IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#118187): https://edk2.groups.io/g/devel/message/118187 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-