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 1E7719416B4 for ; Thu, 23 May 2024 10:55:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=V1xG8xRHV77G7Bp8S1GsGWsILiuHNPqTkLGjISyClpo=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1716461755; v=1; b=27n7locTHLSxgq1MI3EpaiDGoI8PvtHyMYKhmM67vv+8oRRKaMR9aumJD7V7KcgQFjFgQSJJ fkH71Gdj9JTjGBhP2J8KMUc/8RrQOrpMCFBgDUGwWnTwcSsPGrYMcdf0zoxERkhlYFKPNkNfJkx rmV53CFWDKb0XOT8Taufxc0+rRy/l1EFaGwivgpz9LsVvt7MxKLnjXiMSN4VqlW0qEhuJ5Qk2aC ZdSN07S94Zho4MDGkezy8OzH4hnPqfEnYrOowzogcbsA29vvhiQ8DXryx/52aDgn+Vx/45solu6 r6nJ5FvyBdP/NMra/r8/tcaQPIxG8Mcpdj6W0Hvh1VYHw== X-Received: by 127.0.0.2 with SMTP id nj9nYY7687511xDTvy96mjQq; Thu, 23 May 2024 03:55:55 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.12629.1716461754627924001 for ; Thu, 23 May 2024 03:55:54 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42637339; Thu, 23 May 2024 03:56:18 -0700 (PDT) X-Received: from usa.arm.com (a077434.arm.com [10.162.46.143]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7FBA23F766; Thu, 23 May 2024 03:55:52 -0700 (PDT) From: "Sahil Kaushal" To: devel@edk2.groups.io Cc: Ard Biesheuvel , =?UTF-8?q?Leif=20Lindholm=20=C2=A0?= , Sami Mujawar , =?UTF-8?q?sahil=20=C2=A0?= Subject: [edk2-devel] [edk2-platforms][PATCH V3 02/17] Platform/ARM/NorFlashDxe: Move NorFlashVirtualNotifyEvent Date: Thu, 23 May 2024 16:24:56 +0530 Message-Id: <20240523105511.13189-3-Sahil.Kaushal@arm.com> In-Reply-To: <20240523105511.13189-1-Sahil.Kaushal@arm.com> References: <20240523105511.13189-1-Sahil.Kaushal@arm.com> MIME-Version: 1.0 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, 23 May 2024 03:55:54 -0700 Resent-From: sahil.kaushal@arm.com Reply-To: devel@edk2.groups.io,sahil.kaushal@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3cbuKWM84r0SQqMbs9x8kwYMx7686176AA= 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=27n7locT; 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 From: sahil Moving this function from NorFlash.c to NorFlashDxe.c as it is not dependent on any particular flash implementation. Signed-off-by: sahil --- Platform/ARM/Drivers/NorFlashDxe/NorFlash.h | 14 +++---- Platform/ARM/Drivers/NorFlashDxe/NorFlash.c | 44 -------------------- Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c | 44 ++++++++++++++++++++ 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h b/Platform/ARM/Dri= vers/NorFlashDxe/NorFlash.h index c83032e87d9c..d4d97bd22cc5 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlash.h @@ -342,6 +342,13 @@ NorFlashFvbInitialize ( IN NOR_FLASH_INSTANCE *Instance=0D );=0D =0D +VOID=0D +EFIAPI=0D +NorFlashVirtualNotifyEvent (=0D + IN EFI_EVENT Event,=0D + IN VOID *Context=0D + );=0D +=0D //=0D // NorFlash.c=0D //=0D @@ -412,11 +419,4 @@ NorFlashWriteSingleWord ( IN UINT32 WriteData=0D );=0D =0D -VOID=0D -EFIAPI=0D -NorFlashVirtualNotifyEvent (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - );=0D -=0D #endif /* __NOR_FLASH_H__ */=0D diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c b/Platform/ARM/Dri= vers/NorFlashDxe/NorFlash.c index 60854ef2a7d0..55f6abd0eef3 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c @@ -816,47 +816,3 @@ NorFlashReset ( SEND_NOR_COMMAND (Instance->DeviceBaseAddress, 0, P30_CMD_READ_ARRAY);=0D return EFI_SUCCESS;=0D }=0D -=0D -/**=0D - Fixup internal data so that EFI can be call in virtual mode.=0D - Call the passed in Child Notify event and convert any pointers in=0D - lib to virtual mode.=0D -=0D - @param[in] Event The Event that is being processed=0D - @param[in] Context Event Context=0D -**/=0D -VOID=0D -EFIAPI=0D -NorFlashVirtualNotifyEvent (=0D - IN EFI_EVENT Event,=0D - IN VOID *Context=0D - )=0D -{=0D - UINTN Index;=0D -=0D - for (Index =3D 0; Index < mNorFlashDeviceCount; Index++) {=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->DeviceBas= eAddress);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->RegionBas= eAddress);=0D -=0D - // Convert BlockIo protocol=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.FlushBlocks);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.ReadBlocks);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.Reset);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.WriteBlocks);=0D -=0D - // Convert Fvb=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.EraseBlocks);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.GetAttributes);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.GetBlockSize);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.GetPhysicalAddress);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.Read);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.SetAttributes);=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.Write);=0D -=0D - if (mNorFlashInstances[Index]->ShadowBuffer !=3D NULL) {=0D - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->ShadowB= uffer);=0D - }=0D - }=0D -=0D - return;=0D -}=0D diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c b/Platform/ARM/= Drivers/NorFlashDxe/NorFlashDxe.c index f7b92de21a57..963af7dcf435 100644 --- a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c +++ b/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c @@ -504,3 +504,47 @@ NorFlashFvbInitialize ( =0D return Status;=0D }=0D +=0D +/**=0D + Fixup internal data so that EFI can be call in virtual mode.=0D + Call the passed in Child Notify event and convert any pointers in=0D + lib to virtual mode.=0D +=0D + @param[in] Event The Event that is being processed=0D + @param[in] Context Event Context=0D +**/=0D +VOID=0D +EFIAPI=0D +NorFlashVirtualNotifyEvent (=0D + IN EFI_EVENT Event,=0D + IN VOID *Context=0D + )=0D +{=0D + UINTN Index;=0D +=0D + for (Index =3D 0; Index < mNorFlashDeviceCount; Index++) {=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->DeviceBas= eAddress);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->RegionBas= eAddress);=0D +=0D + // Convert BlockIo protocol=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.FlushBlocks);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.ReadBlocks);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.Reset);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIoPr= otocol.WriteBlocks);=0D +=0D + // Convert Fvb=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.EraseBlocks);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.GetAttributes);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.GetBlockSize);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.GetPhysicalAddress);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.Read);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.SetAttributes);=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProtoc= ol.Write);=0D +=0D + if (mNorFlashInstances[Index]->ShadowBuffer !=3D NULL) {=0D + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->ShadowB= uffer);=0D + }=0D + }=0D +=0D + return;=0D +}=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119144): https://edk2.groups.io/g/devel/message/119144 Mute This Topic: https://groups.io/mt/106260140/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-