[edk2-devel] [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe

Leif Lindholm quic_llindhol at quicinc.com
Thu Oct 27 10:48:07 UTC 2022


On Wed, Oct 26, 2022 at 19:42:10 +0200, Ard Biesheuvel wrote:
> 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.
> 
> Cc: Leif Lindholm <quic_llindhol at quicinc.com>
> Cc: Graeme Gregory <graeme at nuviainc.com>

Graeme Gregory <quic_ggregory at quicinc.com> is probably more likely to
be seen these days. Patch to Maintainers.txt coming up (although
Graeme is out this week).

> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>

Reviewed-by: Leif Lindholm <quic_llindhol at quicinc.com>


> ---
>  Platform/Qemu/SbsaQemu/SbsaQemu.dsc                                       |  4 ++--
>  Platform/Qemu/SbsaQemu/SbsaQemu.fdf                                       |  2 +-
>  Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf |  4 ++--
>  Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c   | 12 ++++++------
>  4 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> index ff280709a509..79dd200ca7fc 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> @@ -178,7 +178,7 @@ [LibraryClasses.common]
>    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 @@ [Components.common]
>  
>    ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
>    ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> -  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> +  OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
>    MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
>  
>    #
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> index 9f031c3e6649..781215707c3d 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> @@ -189,7 +189,7 @@ [FV.FvMain]
>  
>    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
>  
>    #
> diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> index f2ba41e1df99..f7e3f8e05eec 100644
> --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> @@ -14,16 +14,16 @@ [Defines]
>    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
> diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> index 0946327cb529..56c26019a140 100644
> --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> +++ b/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.35.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95639): https://edk2.groups.io/g/devel/message/95639
Mute This Topic: https://groups.io/mt/94587261/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list