[edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 25/34] ArmPlatformPkg/NorFlashPlatformLib.h:Move to MdePkg
Sunil V L
sunilvl at ventanamicro.com
Fri Oct 14 16:48:27 UTC 2022
Migrate NorFlashPlatformLib.h to MdePkg and add a Null
instance of the NorFlashPlatformLib library in MdePkg.
Cc: Leif Lindholm <quic_llindhol at quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Michael D Kinney <michael.d.kinney at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu at intel.com>
Cc: Andrew Fish <afish at apple.com>
Signed-off-by: Sunil V L <sunilvl at ventanamicro.com>
---
ArmPlatformPkg/ArmPlatformPkg.dec | 4 ---
MdePkg/MdePkg.dec | 4 +++
MdePkg/MdePkg.dsc | 1 +
MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.inf | 22 +++++++++++++++++
{ArmPlatformPkg => MdePkg}/Include/Library/NorFlashPlatformLib.h | 0
MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.c | 26 ++++++++++++++++++++
6 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec
index dd6e78f62aa1..86559aa6e57d 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dec
+++ b/ArmPlatformPkg/ArmPlatformPkg.dec
@@ -38,10 +38,6 @@ [LibraryClasses]
#
LcdPlatformLib|Include/Library/LcdPlatformLib.h
- ## @libraryclass Provides a Nor flash interface.
- #
- NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h
-
## @libraryclass Provides an interface to the clock of a PL011 device.
#
PL011UartClockLib|Include/Library/PL011UartClockLib.h
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index df681b2b99a5..7193160cd496 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -279,6 +279,10 @@ [LibraryClasses]
## @libraryclass Provides function for SMM CPU Rendezvous Library.
SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h
+ ## @libraryclass Provides a Nor flash interface.
+ #
+ NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h
+
[LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]
## @libraryclass Provides services to generate random number.
#
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index c7961a9b03f1..1b3cd822e45e 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -134,6 +134,7 @@ [Components]
MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf
+ MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.inf
[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
#
diff --git a/MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.inf b/MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.inf
new file mode 100644
index 000000000000..e4bd85ba7ace
--- /dev/null
+++ b/MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.inf
@@ -0,0 +1,22 @@
+## @file
+# NorFlashPlatformLib null instance
+#
+# Copyright (c) 2022, Ventana Micro Systems Inc. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = NorFlashPlatformLibNull
+ FILE_GUID = DE9C2866-5C5C-4BD3-9A09-3C4EB7448069
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = NorFlashPlatformLib
+
+[Sources.common]
+ NorFlashPlatformLibNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec
diff --git a/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h b/MdePkg/Include/Library/NorFlashPlatformLib.h
similarity index 100%
rename from ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
rename to MdePkg/Include/Library/NorFlashPlatformLib.h
diff --git a/MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.c b/MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.c
new file mode 100644
index 000000000000..cd779f504e40
--- /dev/null
+++ b/MdePkg/Library/NorFlashPlatformLibNull/NorFlashPlatformLibNull.c
@@ -0,0 +1,26 @@
+/** @file
+
+ Copyright (c) 2022, Ventana Micro Systems Inc. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ **/
+
+#include <Library/NorFlashPlatformLib.h>
+
+EFI_STATUS
+NorFlashPlatformInitialization (
+ VOID
+ )
+{
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+NorFlashPlatformGetDevices (
+ OUT NOR_FLASH_DESCRIPTION **NorFlashDescriptions,
+ OUT UINT32 *Count
+ )
+{
+ return EFI_SUCCESS;
+}
--
2.38.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95239): https://edk2.groups.io/g/devel/message/95239
Mute This Topic: https://groups.io/mt/94330857/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