]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtualizationPkg: add driver for QEMU's NOR flash
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 18 Sep 2014 17:53:36 +0000 (17:53 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Sep 2014 17:53:36 +0000 (17:53 +0000)
This adds an implementation of NorFlashPlatformLib that exposes the
two 64 MB NOR flash banks that are provided by QEMU's mach-virt
emulation both in 32-bit and 64-bit mode.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16133 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmVirtualizationPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c [new file with mode: 0644]
ArmPlatformPkg/ArmVirtualizationPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf [new file with mode: 0644]

diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c b/ArmPlatformPkg/ArmVirtualizationPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
new file mode 100644 (file)
index 0000000..7f34607
--- /dev/null
@@ -0,0 +1,51 @@
+/** @file\r
+\r
+ Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>\r
+\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution.  The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+\r
+#include <ArmPlatform.h>\r
+#include <Library/NorFlashPlatformLib.h>\r
+\r
+EFI_STATUS\r
+NorFlashPlatformInitialization (\r
+  VOID\r
+  )\r
+{\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {\r
+  {\r
+    QEMU_NOR0_BASE,\r
+    QEMU_NOR0_BASE,\r
+    QEMU_NOR0_SIZE,\r
+    QEMU_NOR_BLOCK_SIZE,\r
+    {0xF9B94AE2, 0x8BA6, 0x409B, {0x9D, 0x56, 0xB9, 0xB4, 0x17, 0xF5, 0x3C, 0xB3}}\r
+  }, {\r
+    QEMU_NOR1_BASE,\r
+    QEMU_NOR1_BASE,\r
+    QEMU_NOR1_SIZE,\r
+    QEMU_NOR_BLOCK_SIZE,\r
+    {0x8047DB4B, 0x7E9C, 0x4C0C, {0x8E, 0xBC, 0xDF, 0xBB, 0xAA, 0xCA, 0xCE, 0x8F}}\r
+  }\r
+};\r
+\r
+EFI_STATUS\r
+NorFlashPlatformGetDevices (\r
+  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,\r
+  OUT UINT32                  *Count\r
+  )\r
+{\r
+  *NorFlashDescriptions = mNorFlashDevices;\r
+  *Count = sizeof (mNorFlashDevices) / sizeof (mNorFlashDevices[0]);\r
+  return EFI_SUCCESS;\r
+}\r
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf b/ArmPlatformPkg/ArmVirtualizationPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
new file mode 100644 (file)
index 0000000..126d167
--- /dev/null
@@ -0,0 +1,30 @@
+#/** @file\r
+#\r
+#  Component description file for NorFlashQemuLib module\r
+#\r
+#  Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>\r
+#\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution.  The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = NorFlashQemuLib\r
+  FILE_GUID                      = 339B7829-4C5F-4EFC-B2DD-5050E530DECE\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = NorFlashPlatformLib\r
+\r
+[Sources.common]\r
+  NorFlashQemuLib.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  ArmPlatformPkg/ArmPlatformPkg.dec\r