]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtualizationPkg/VirtFdtDxe: wire up XenBusDxe to "xen,xen" DT node
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 28 Feb 2015 20:34:26 +0000 (20:34 +0000)
committerlersek <lersek@Edk2>
Sat, 28 Feb 2015 20:34:26 +0000 (20:34 +0000)
This patchs adds support to VirtFdtDxe for the Xen DT node which
contains the base address of the Grant Table. This data is communicated
to XenBusDxe using a XENIO_PROTOCOL instance.

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

ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc
ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf

index 1a82762cbcf2f1c7db1e862e5dd2f68e835a96d8..565f243091a47cb56ac67a2c3099fab26c2755d1 100644 (file)
   # USB Libraries\r
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
 \r
   # USB Libraries\r
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
 \r
+  XenIoMmioLib|OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.inf\r
+\r
 [LibraryClasses.common.SEC]\r
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
 [LibraryClasses.common.SEC]\r
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
index e63294a12e11ddb5df340f489545151054cfecf9..c9a181a871b8cf2ca555553c649c383bdcc0ec74 100644 (file)
@@ -26,6 +26,7 @@
 #include <Library/DxeServicesLib.h>\r
 #include <Library/HobLib.h>\r
 #include <libfdt.h>\r
 #include <Library/DxeServicesLib.h>\r
 #include <Library/HobLib.h>\r
 #include <libfdt.h>\r
+#include <Library/XenIoMmioLib.h>\r
 \r
 #include <Guid/Fdt.h>\r
 #include <Guid/VirtioMmioTransport.h>\r
 \r
 #include <Guid/Fdt.h>\r
 #include <Guid/VirtioMmioTransport.h>\r
@@ -50,6 +51,7 @@ typedef enum {
   PropertyTypeFwCfg,\r
   PropertyTypePciHost,\r
   PropertyTypeGicV3,\r
   PropertyTypeFwCfg,\r
   PropertyTypePciHost,\r
   PropertyTypeGicV3,\r
+  PropertyTypeXen,\r
 } PROPERTY_TYPE;\r
 \r
 typedef struct {\r
 } PROPERTY_TYPE;\r
 \r
 typedef struct {\r
@@ -68,6 +70,7 @@ STATIC CONST PROPERTY CompatibleProperties[] = {
   { PropertyTypeFwCfg,   "qemu,fw-cfg-mmio"      },\r
   { PropertyTypePciHost, "pci-host-ecam-generic" },\r
   { PropertyTypeGicV3,   "arm,gic-v3"            },\r
   { PropertyTypeFwCfg,   "qemu,fw-cfg-mmio"      },\r
   { PropertyTypePciHost, "pci-host-ecam-generic" },\r
   { PropertyTypeGicV3,   "arm,gic-v3"            },\r
+  { PropertyTypeXen,     "xen,xen"               },\r
   { PropertyTypeUnknown, ""                      }\r
 };\r
 \r
   { PropertyTypeUnknown, ""                      }\r
 };\r
 \r
@@ -523,6 +526,26 @@ InitializeVirtFdtDxe (
       }\r
       break;\r
 \r
       }\r
       break;\r
 \r
+    case PropertyTypeXen:\r
+      ASSERT (Len == 16);\r
+\r
+      //\r
+      // Retrieve the reg base from this node and wire it up to the\r
+      // MMIO flavor of the XenBus root device I/O protocol\r
+      //\r
+      RegBase = fdt64_to_cpu (((UINT64 *)RegProp)[0]);\r
+      Handle = NULL;\r
+      Status = XenIoMmioInstall (&Handle, RegBase);\r
+      if (EFI_ERROR (Status)) {\r
+        DEBUG ((EFI_D_ERROR, "%a: XenIoMmioInstall () failed on a new handle "\r
+          "(Status == %r)\n", __FUNCTION__, Status));\r
+        break;\r
+      }\r
+\r
+      DEBUG ((EFI_D_INFO, "Found Xen node with Grant table @ 0x%Lx\n", RegBase));\r
+\r
+      break;\r
+\r
     default:\r
       break;\r
     }\r
     default:\r
       break;\r
     }\r
index bca0f0b5f39bf0723b3597320c38195986dd486d..d830dd131db829077b894ab7690a0d5c3dcb9995 100644 (file)
@@ -42,6 +42,7 @@
   FdtLib\r
   VirtioMmioDeviceLib\r
   HobLib\r
   FdtLib\r
   VirtioMmioDeviceLib\r
   HobLib\r
+  XenIoMmioLib\r
 \r
 [Guids]\r
   gFdtTableGuid\r
 \r
 [Guids]\r
   gFdtTableGuid\r