From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb@kernel.org>,
Leif Lindholm <quic_llindhol@quicinc.com>,
Graeme Gregory <graeme@nuviainc.com>
Subject: [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe
Date: Wed, 26 Oct 2022 19:42:10 +0200 [thread overview]
Message-ID: <20221026174210.1255165-1-ardb@kernel.org> (raw)
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
next reply other threads:[~2022-10-26 17:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 17:42 Ard Biesheuvel [this message]
2022-10-27 10:48 ` [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe Leif Lindholm
2022-10-27 17:15 ` 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=20221026174210.1255165-1-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