From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web12.656.1666630912346005677 for ; Mon, 24 Oct 2022 10:01:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZR7I7gxu; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BC6366148D; Mon, 24 Oct 2022 17:01:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40D22C43140; Mon, 24 Oct 2022 17:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666630911; bh=kCKYIWObOlVm5eDChzXyuGkNxEVgC7Y+kfIC8pWKYDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZR7I7gxuTMv0k+wRfEYFDSsHp7tRPf1F7eSGB0msGQzssPbz3MwkD+CKa0nMBrUhK XGHrc50HxrVJF9W8pDc+P6if8GrmrLl6sxAuoQHWGH5kn8F4B/PUrP7hRBajkTQX+G HVCS8RVxEzM7Bcvjh6IBxal0cFcLnonh3sVtL1pwbXOQM9S3W+s3XjN8gsVlYBiTi5 TWs2H+0cuBMsTc3MFaIwMiH/Bv4Sb6n6DpI/v/X8LO35fugHdtIYwwmCo5NVm1Tu3Q rvXbyOE3ZVHgdjgBRumdfbdDCQNdyKL2reqYsFpXciB0rHxQBRITv6IcjpOtWRwQr5 pBcI39XYFIWIg== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Sunil V L , Sami Mujawar , Leif Lindholm Subject: [PATCH 10/11] ArmVirtPkg/ArmVirtKvmTool: Migrate to OVMF's VirtNorFlashDxe Date: Mon, 24 Oct 2022 19:01:21 +0200 Message-Id: <20221024170122.594577-11-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221024170122.594577-1-ardb@kernel.org> References: <20221024170122.594577-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Migrate to the virt specific NOR flash driver as the ArmPlatformPkg is going away. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtKvmTool.dsc | 4 ++-- ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c | 20 ++++++++= ++---------- ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index 3bd3ebd6e0b3..c598903b33d2 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -50,7 +50,7 @@ [LibraryClasses.common] ArmVirtMemInfoLib|ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMe= mInfoLib.inf=0D =0D TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf=0D - NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoo= lLib.inf=0D + VirtNorFlashPlatformLib|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKv= mtoolLib.inf=0D =0D CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf= =0D =0D @@ -291,7 +291,7 @@ [Components.common] NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClie= ntLib.inf=0D }=0D =0D - ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf=0D + OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf=0D =0D MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf=0D =0D diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf index 9e006e83ee5c..b696bffc7ccb 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.fdf +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf @@ -154,7 +154,7 @@ [FV.FvMain] INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf=0D INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf=0D INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf=0D - INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf=0D + INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf=0D =0D #=0D # FAT filesystem + GPT/MBR partitioning + UDF filesystem=0D diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c b/ArmV= irtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c index 39d2615b5409..129c16b7110c 100644 --- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c @@ -9,8 +9,8 @@ =0D #include =0D #include =0D -#include =0D #include =0D +#include =0D #include =0D =0D /** Macro defining the NOR block size configured in Kvmtool.=0D @@ -25,10 +25,10 @@ */=0D #define LABEL_UEFI_VAR_STORE "System-firmware"=0D =0D -STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_DEVICES];=0D -STATIC UINTN mNorFlashDeviceCount =3D 0;=0D -STATIC INT32 mUefiVarStoreNode =3D MAX_INT32;=0D -STATIC FDT_CLIENT_PROTOCOL *mFdtClient;=0D +STATIC VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_DEVICES];=0D +STATIC UINTN mNorFlashDeviceCount =3D 0;=0D +STATIC INT32 mUefiVarStoreNode =3D MAX_INT32;=0D +STATIC FDT_CLIENT_PROTOCOL *mFdtClient;=0D =0D /** This function performs platform specific actions to initialise=0D the NOR flash, if required.=0D @@ -36,7 +36,7 @@ STATIC FDT_CLIENT_PROTOCOL *mFdtClient; @retval EFI_SUCCESS Success.=0D **/=0D EFI_STATUS=0D -NorFlashPlatformInitialization (=0D +VirtNorFlashPlatformInitialization (=0D VOID=0D )=0D {=0D @@ -89,7 +89,7 @@ NorFlashPlatformInitialization ( STATIC=0D EFI_STATUS=0D SetupVariableStore (=0D - IN NOR_FLASH_DESCRIPTION *FlashDevice=0D + IN VIRT_NOR_FLASH_DESCRIPTION *FlashDevice=0D )=0D {=0D UINTN FlashRegion;=0D @@ -187,9 +187,9 @@ SetupVariableStore ( @retval EFI_NOT_FOUND Flash device not found.=0D **/=0D EFI_STATUS=0D -NorFlashPlatformGetDevices (=0D - OUT NOR_FLASH_DESCRIPTION **NorFlashDescriptions,=0D - OUT UINT32 *Count=0D +VirtNorFlashPlatformGetDevices (=0D + OUT VIRT_NOR_FLASH_DESCRIPTION **NorFlashDescriptions,=0D + OUT UINT32 *Count=0D )=0D {=0D if (mNorFlashDeviceCount > 0) {=0D diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf b= /ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf index 04d672329537..b5f35d478289 100644 --- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf @@ -12,7 +12,7 @@ [Defines] FILE_GUID =3D E75F07A1-B160-4893-BDD4-09E32FF847DC= =0D MODULE_TYPE =3D DXE_DRIVER=0D VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D NorFlashPlatformLib=0D + LIBRARY_CLASS =3D VirtNorFlashPlatformLib=0D CONSTRUCTOR =3D NorFlashPlatformLibConstructor=0D =0D [Sources.common]=0D @@ -20,11 +20,11 @@ [Sources.common] =0D [Packages]=0D ArmPkg/ArmPkg.dec=0D - ArmPlatformPkg/ArmPlatformPkg.dec=0D ArmVirtPkg/ArmVirtPkg.dec=0D EmbeddedPkg/EmbeddedPkg.dec=0D MdePkg/MdePkg.dec=0D MdeModulePkg/MdeModulePkg.dec=0D + OvmfPkg/OvmfPkg.dec=0D =0D [LibraryClasses]=0D BaseLib=0D --=20 2.35.1