* [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe
@ 2022-10-26 17:42 Ard Biesheuvel
2022-10-27 10:48 ` Leif Lindholm
0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2022-10-26 17:42 UTC (permalink / raw)
To: devel; +Cc: Ard Biesheuvel, Leif Lindholm, Graeme Gregory
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@quicinc.com>
Cc: Graeme Gregory <graeme@nuviainc.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe
2022-10-26 17:42 [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe Ard Biesheuvel
@ 2022-10-27 10:48 ` Leif Lindholm
2022-10-27 17:15 ` Ard Biesheuvel
0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2022-10-27 10:48 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: devel, Graeme Gregory
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@quicinc.com>
> Cc: Graeme Gregory <graeme@nuviainc.com>
Graeme Gregory <quic_ggregory@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@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe
2022-10-27 10:48 ` Leif Lindholm
@ 2022-10-27 17:15 ` Ard Biesheuvel
0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2022-10-27 17:15 UTC (permalink / raw)
To: Leif Lindholm; +Cc: devel, Graeme Gregory
On Thu, 27 Oct 2022 at 12:48, Leif Lindholm <quic_llindhol@quicinc.com> wrote:
>
> 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@quicinc.com>
> > Cc: Graeme Gregory <graeme@nuviainc.com>
>
> Graeme Gregory <quic_ggregory@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@kernel.org>
>
> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
>
>
Thanks
Merged as 8ea6ec38da88..2ce82b713db8
> > ---
> > 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
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-27 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-26 17:42 [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe Ard Biesheuvel
2022-10-27 10:48 ` Leif Lindholm
2022-10-27 17:15 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox