Create a new library class in Ovmf that duplicates the existing
NorFlashPlatformLib, but which will be tied to the VirtNorFlashDxe
driver that will be introduced in a subsequent patch. This allows us to
retire the original from ArmPlatformPkg.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
---
 OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h | 30 ++++++++++++++++++++
 OvmfPkg/OvmfPkg.dec                               |  4 +++
 2 files changed, 34 insertions(+)

diff --git a/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h 
b/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h
new file mode 100644
index 000000000000..d2128a032714
--- /dev/null
+++ b/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h
@@ -0,0 +1,30 @@
+/** @file
+
+ Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ **/
+
+#ifndef _VIRTNORFLASHPLATFORMLIB_H_
+#define _VIRTNORFLASHPLATFORMLIB_H_
+
+typedef struct {
+  UINTN    DeviceBaseAddress;       // Start address of the Device Base 
Address (DBA)
+  UINTN    RegionBaseAddress;       // Start address of one single region
+  UINTN    Size;
+  UINTN    BlockSize;
+} VIRT_NOR_FLASH_DESCRIPTION;
+
+EFI_STATUS
+VirtNorFlashPlatformInitialization (
+  VOID
+  );
+
+EFI_STATUS
+VirtNorFlashPlatformGetDevices (
+  OUT VIRT_NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,
+  OUT UINT32                      *Count
+  );
+
+#endif /* _VIRTNORFLASHPLATFORMLIB_H_ */
diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec
index f13dd4a61f01..5f5556c67c6c 100644
--- a/OvmfPkg/OvmfPkg.dec
+++ b/OvmfPkg/OvmfPkg.dec
@@ -101,6 +101,10 @@ [LibraryClasses]
   #                  transports.
   VirtioMmioDeviceLib|Include/Library/VirtioMmioDeviceLib.h
 
+  ##  @libraryclass  Provides a Nor flash interface.
+  #
+  VirtNorFlashPlatformLib|Include/Library/VirtNorFlashPlatformLib.h
+
   ##  @libraryclass  Invoke Xen hypercalls
   #
   XenHypercallLib|Include/Library/XenHypercallLib.h
-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95511): https://edk2.groups.io/g/devel/message/95511
Mute This Topic: https://groups.io/mt/94539643/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to