Browse Source

Platform/SbsaQemu: Switch to VirtNorFlashDxe

Switch to the OVMF version of the NOR flash DXE driver, which supports
QEMU's NOR flash emulation specifically, and carries some optimizations
that are therefore permitted.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Ard Biesheuvel 1 year ago
parent
commit
2ce82b713d

+ 2 - 2
Platform/Qemu/SbsaQemu/SbsaQemu.dsc

@@ -178,7 +178,7 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE       = FALSE
   ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
 
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
-  NorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
+  VirtNorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
 
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
@@ -663,7 +663,7 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE       = FALSE
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
-  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 
   #

+ 1 - 1
Platform/Qemu/SbsaQemu/SbsaQemu.fdf

@@ -189,7 +189,7 @@ READ_LOCK_STATUS   = TRUE
 
   INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
-  INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
   INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 
   #

+ 6 - 6
Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c

@@ -8,19 +8,19 @@
 
 #include <Base.h>
 #include <PiDxe.h>
-#include <Library/NorFlashPlatformLib.h>
+#include <Library/VirtNorFlashPlatformLib.h>
 
 #define QEMU_NOR_BLOCK_SIZE    SIZE_256KB
 
 EFI_STATUS
-NorFlashPlatformInitialization (
+VirtNorFlashPlatformInitialization (
   VOID
   )
 {
   return EFI_SUCCESS;
 }
 
-NOR_FLASH_DESCRIPTION mNorFlashDevice =
+STATIC VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevice =
 {
  FixedPcdGet64(PcdFdBaseAddress),
  FixedPcdGet64(PcdFlashNvStorageVariableBase),
@@ -29,9 +29,9 @@ NOR_FLASH_DESCRIPTION mNorFlashDevice =
 };
 
 EFI_STATUS
-NorFlashPlatformGetDevices (
-  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,
-  OUT UINT32                  *Count
+VirtNorFlashPlatformGetDevices (
+  OUT VIRT_NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,
+  OUT UINT32                      *Count
   )
 {
   *NorFlashDescriptions = &mNorFlashDevice;

+ 2 - 2
Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf

@@ -14,16 +14,16 @@
   FILE_GUID                      = c53d904d-de50-40f1-a148-a2ece48303d8
   MODULE_TYPE                    = BASE
   VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = NorFlashPlatformLib
+  LIBRARY_CLASS                  = VirtNorFlashPlatformLib
 
 [Sources.common]
   SbsaQemuNorFlashLib.c
 
 [Packages]
-  ArmPlatformPkg/ArmPlatformPkg.dec
   ArmPkg/ArmPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
+  OvmfPkg/OvmfPkg.dec
 
 [FixedPcd]
   gArmTokenSpaceGuid.PcdFdBaseAddress