summaryrefslogtreecommitdiff
path: root/Platform/QemuVirt/Library/NorFlashLib/NorFlashLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'Platform/QemuVirt/Library/NorFlashLib/NorFlashLib.c')
-rw-r--r--Platform/QemuVirt/Library/NorFlashLib/NorFlashLib.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/Platform/QemuVirt/Library/NorFlashLib/NorFlashLib.c b/Platform/QemuVirt/Library/NorFlashLib/NorFlashLib.c
new file mode 100644
index 00000000..a04b771d
--- /dev/null
+++ b/Platform/QemuVirt/Library/NorFlashLib/NorFlashLib.c
@@ -0,0 +1,47 @@
+/** @file
+
+ Copyright (c) 2018, ARM Ltd. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ **/
+
+#include <PiDxe.h>
+#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
+#include <Library/NorFlashPlatformLib.h>
+#include <SgiPlatform.h>
+
+STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
+ {
+// 0x403c5000,
+ // 0x403c5000,
+ 0x40419000,
+ 0x40419000,
+ SIZE_256KB * 40,
+ SIZE_256KB,
+ },
+};
+
+EFI_STATUS
+NorFlashPlatformInitialization (
+ VOID
+ )
+{
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+NorFlashPlatformGetDevices (
+ OUT NOR_FLASH_DESCRIPTION **NorFlashDevices,
+ OUT UINT32 *Count
+ )
+{
+ if ((NorFlashDevices == NULL) || (Count == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ *NorFlashDevices = mNorFlashDevices;
+ *Count = ARRAY_SIZE (mNorFlashDevices);
+ return EFI_SUCCESS;
+}