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 5C121740049 for ; Tue, 23 Apr 2024 14:55:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RxX89FpAxcSu0wHh8dAvTXwn8qwLZwwwAwBqFRoBNUQ=; 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=1713884152; v=1; b=lmmipbFlxKT/kmehQJ2Swd3i1BQvASVN2T/suxK47j/CKfHxhpCNRYzcehULWGtJzA4Og399 MNsVpjadxhn/vsT4WR2fMZ5VTzCYFKWz5WCH2AJs8yGn5THmKzqZSgUZ5if1YgAoMsEUukBXvUf hmGgfj3NalLKi7Z0OzIXPJJUMBtL0+TGQIPh7mze8ZRr9c9ooMa+mrUl06KBsqn6E2xgeAPNgVU zLQhaKCP9+tnwPYVnWq4o5no5FvF2u7/W+VTxb0m5gahi88Ap7gJpbAZ0fVi/7kmsyDdmi+po0t Awldc5OBvCKS0xI2e6JXyArRohTSxav5rNTPtP2/JoXbA== X-Received: by 127.0.0.2 with SMTP id UE3KYY7687511xbWH7vfbSUv; Tue, 23 Apr 2024 07:55:52 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.11901.1713851814801885544 for ; Mon, 22 Apr 2024 22:56: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 918DC1476; Mon, 22 Apr 2024 22:57:22 -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 D799A3F7BD; Mon, 22 Apr 2024 22:56: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] [PATCH RESEND edk2-platforms][PATCH V2 02/14] Platform/ARM/NorFlashDxe: Move NorFlashVirtualNotifyEvent Date: Tue, 23 Apr 2024 11:26:26 +0530 Message-Id: <20240423055638.1271531-3-Sahil.Kaushal@arm.com> In-Reply-To: <20240423055638.1271531-1-Sahil.Kaushal@arm.com> References: <20240423055638.1271531-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: Tue, 23 Apr 2024 07:55:50 -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: tQmQkfNMT7cq6eMyrCVgH6x1x7686176AA= 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=lmmipbFl; 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 (#118152): https://edk2.groups.io/g/devel/message/118152 Mute This Topic: https://groups.io/mt/105690937/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-