public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>
Subject: [PATCH 10/11] ArmVirtPkg/ArmVirtKvmTool: Migrate to OVMF's VirtNorFlashDxe
Date: Mon, 24 Oct 2022 19:01:21 +0200	[thread overview]
Message-ID: <20221024170122.594577-11-ardb@kernel.org> (raw)
In-Reply-To: <20221024170122.594577-1-ardb@kernel.org>

Migrate to the virt specific NOR flash driver as the ArmPlatformPkg is
going away.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 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/KvmtoolVirtMemInfoLib.inf
 
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
-  NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
+  VirtNorFlashPlatformLib|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
 
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
 
@@ -291,7 +291,7 @@ [Components.common]
       NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
   }
 
-  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
 
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 
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
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
-  INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
 
   #
   # FAT filesystem + GPT/MBR partitioning + UDF filesystem
diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
index 39d2615b5409..129c16b7110c 100644
--- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
+++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c
@@ -9,8 +9,8 @@
 
 #include <Library/BaseLib.h>
 #include <Library/DebugLib.h>
-#include <Library/NorFlashPlatformLib.h>
 #include <Library/UefiBootServicesTableLib.h>
+#include <Library/VirtNorFlashPlatformLib.h>
 #include <Protocol/FdtClient.h>
 
 /** Macro defining the NOR block size configured in Kvmtool.
@@ -25,10 +25,10 @@
 */
 #define LABEL_UEFI_VAR_STORE  "System-firmware"
 
-STATIC NOR_FLASH_DESCRIPTION  mNorFlashDevices[MAX_FLASH_DEVICES];
-STATIC UINTN                  mNorFlashDeviceCount = 0;
-STATIC INT32                  mUefiVarStoreNode    = MAX_INT32;
-STATIC FDT_CLIENT_PROTOCOL    *mFdtClient;
+STATIC VIRT_NOR_FLASH_DESCRIPTION  mNorFlashDevices[MAX_FLASH_DEVICES];
+STATIC UINTN                       mNorFlashDeviceCount = 0;
+STATIC INT32                       mUefiVarStoreNode    = MAX_INT32;
+STATIC FDT_CLIENT_PROTOCOL         *mFdtClient;
 
 /** This function performs platform specific actions to initialise
     the NOR flash, if required.
@@ -36,7 +36,7 @@ STATIC FDT_CLIENT_PROTOCOL    *mFdtClient;
   @retval EFI_SUCCESS           Success.
 **/
 EFI_STATUS
-NorFlashPlatformInitialization (
+VirtNorFlashPlatformInitialization (
   VOID
   )
 {
@@ -89,7 +89,7 @@ NorFlashPlatformInitialization (
 STATIC
 EFI_STATUS
 SetupVariableStore (
-  IN NOR_FLASH_DESCRIPTION  *FlashDevice
+  IN VIRT_NOR_FLASH_DESCRIPTION  *FlashDevice
   )
 {
   UINTN  FlashRegion;
@@ -187,9 +187,9 @@ SetupVariableStore (
   @retval EFI_NOT_FOUND         Flash device not found.
 **/
 EFI_STATUS
-NorFlashPlatformGetDevices (
-  OUT NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,
-  OUT UINT32                 *Count
+VirtNorFlashPlatformGetDevices (
+  OUT VIRT_NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,
+  OUT UINT32                      *Count
   )
 {
   if (mNorFlashDeviceCount > 0) {
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                      = E75F07A1-B160-4893-BDD4-09E32FF847DC
   MODULE_TYPE                    = DXE_DRIVER
   VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = NorFlashPlatformLib
+  LIBRARY_CLASS                  = VirtNorFlashPlatformLib
   CONSTRUCTOR                    = NorFlashPlatformLibConstructor
 
 [Sources.common]
@@ -20,11 +20,11 @@ [Sources.common]
 
 [Packages]
   ArmPkg/ArmPkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
+  OvmfPkg/OvmfPkg.dec
 
 [LibraryClasses]
   BaseLib
-- 
2.35.1


  parent reply	other threads:[~2022-10-24 17:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 17:01 [PATCH 00/11] ArmVirtPkg: introduce VirtNorFlashDxe Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 01/11] OvmfPkg: clone NorFlashPlatformLib into VirtNorFlashPlatformLib Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 02/11] OvmfPkg/VirtNorFlashDxe: clone ArmPlatformPkg's NOR flash driver Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 03/11] OvmfPkg/VirtNorFlashDxe: remove CheckBlockLocked feature Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 04/11] OvmfPkg/VirtNorFlashDxe: remove disk I/O protocol implementation Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 05/11] OvmfPkg/VirtNorFlashDxe: drop block " Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 06/11] OvmfPkg/VirtNorFlashDxe: avoid array mode switch after each word write Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 07/11] OvmfPkg/VirtNorFlashDxe: avoid switching between modes in a tight loop Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 08/11] OvmfPkg/VirtNorFlashDxe: use EFI_MEMORY_WC and drop AlignedCopyMem() Ard Biesheuvel
2022-10-24 17:01 ` [PATCH 09/11] ArmVirtPkg/ArmVirtQemu: migrate to OVMF's VirtNorFlashDxe Ard Biesheuvel
2022-10-24 17:01 ` Ard Biesheuvel [this message]
2022-10-24 17:01 ` [PATCH 11/11] ArmPlatformPkg: Retire NorFlashDxe driver Ard Biesheuvel
2022-10-25 16:32   ` Leif Lindholm
2022-10-27  4:47 ` [PATCH 00/11] ArmVirtPkg: introduce VirtNorFlashDxe Sunil V L
2022-10-27 16:56   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221024170122.594577-11-ardb@kernel.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox