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 9CC52941551 for ; Wed, 29 May 2024 08:55:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=JQ4LVAWctgUnTG3b2IIEJWcza6IWiAKDeJIUFia0KHc=; 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=1716972933; v=1; b=WKYZOLZdFgGhJZpKfQI7yEnAyR4e2nP/BybDDqvILVcrOmrIDZgjBgc7etgLojDkdDkMnfc6 dESJY+3ydIyspil8ueRPPubYXQXCyPiKrQJZok9eDX2YOlqyMM6qZN484qBNuAq24xgQCjYJnsb BBYnzbrud+UlOQLcPNQPpKUk8etii6NSfKrRFNH5YSINUFs+1V9BqvJ/Oe+BJKHNjKjvjMSkq0W w/AFl+dK3E3/ljSv25fv3V5CTFHhlvgDqWOsS/d/lOuhReE1LINhRe6nbfXo/K8pV1X+xrSgoN6 Z9+knmvatxm2GVS0/30qZi578tyaufjTubfjQEbCqsZ/g== X-Received: by 127.0.0.2 with SMTP id LtlZYY7687511xejcmE0Z1Db; Wed, 29 May 2024 01:55:32 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9170.1716972931469840955 for ; Wed, 29 May 2024 01:55:31 -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 352DF15BF; Wed, 29 May 2024 01:55:55 -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 50C063F762; Wed, 29 May 2024 01:55:29 -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 V4 02/17] Platform/ARM/NorFlashDxe: Move NorFlashVirtualNotifyEvent Date: Wed, 29 May 2024 14:25:02 +0530 Message-Id: <20240529085517.1074417-3-Sahil.Kaushal@arm.com> In-Reply-To: <20240529085517.1074417-1-Sahil.Kaushal@arm.com> References: <20240529085517.1074417-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: Wed, 29 May 2024 01:55:31 -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: oEaoGZnTQCKGvsNxBmO88XGmx7686176AA= 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=WKYZOLZd; 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/D= rivers/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 ); =20 +VOID +EFIAPI +NorFlashVirtualNotifyEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ); + // // NorFlash.c // @@ -412,11 +419,4 @@ NorFlashWriteSingleWord ( IN UINT32 WriteData ); =20 -VOID -EFIAPI -NorFlashVirtualNotifyEvent ( - IN EFI_EVENT Event, - IN VOID *Context - ); - #endif /* __NOR_FLASH_H__ */ diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlash.c b/Platform/ARM/D= rivers/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); return EFI_SUCCESS; } - -/** - Fixup internal data so that EFI can be call in virtual mode. - Call the passed in Child Notify event and convert any pointers in - lib to virtual mode. - - @param[in] Event The Event that is being processed - @param[in] Context Event Context -**/ -VOID -EFIAPI -NorFlashVirtualNotifyEvent ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - UINTN Index; - - for (Index =3D 0; Index < mNorFlashDeviceCount; Index++) { - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->DeviceB= aseAddress); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->RegionB= aseAddress); - - // Convert BlockIo protocol - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.FlushBlocks); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.ReadBlocks); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.Reset); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.WriteBlocks); - - // Convert Fvb - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.EraseBlocks); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.GetAttributes); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.GetBlockSize); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.GetPhysicalAddress); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.Read); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.SetAttributes); - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.Write); - - if (mNorFlashInstances[Index]->ShadowBuffer !=3D NULL) { - EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->Shado= wBuffer); - } - } - - return; -} diff --git a/Platform/ARM/Drivers/NorFlashDxe/NorFlashDxe.c b/Platform/AR= M/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 ( =20 return Status; } + +/** + Fixup internal data so that EFI can be call in virtual mode. + Call the passed in Child Notify event and convert any pointers in + lib to virtual mode. + + @param[in] Event The Event that is being processed + @param[in] Context Event Context +**/ +VOID +EFIAPI +NorFlashVirtualNotifyEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + UINTN Index; + + for (Index =3D 0; Index < mNorFlashDeviceCount; Index++) { + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->DeviceB= aseAddress); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->RegionB= aseAddress); + + // Convert BlockIo protocol + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.FlushBlocks); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.ReadBlocks); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.Reset); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->BlockIo= Protocol.WriteBlocks); + + // Convert Fvb + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.EraseBlocks); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.GetAttributes); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.GetBlockSize); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.GetPhysicalAddress); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.Read); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.SetAttributes); + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->FvbProt= ocol.Write); + + if (mNorFlashInstances[Index]->ShadowBuffer !=3D NULL) { + EfiConvertPointer (0x0, (VOID **)&mNorFlashInstances[Index]->Shado= wBuffer); + } + } + + return; +} --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119317): https://edk2.groups.io/g/devel/message/119317 Mute This Topic: https://groups.io/mt/106365452/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-