[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 15/17] libxl/arm: Add ACPI module



From: Shannon Zhao <shannon.zhao@xxxxxxxxxx>

Add the ARM Multiboot module for ACPI, so UEFI or DomU can get the base
address of ACPI tables from it.

Signed-off-by: Shannon Zhao <shannon.zhao@xxxxxxxxxx>
---
 docs/misc/arm/device-tree/acpi.txt | 23 +++++++++++++++++++++++
 tools/libxl/libxl_arm.c            | 24 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 docs/misc/arm/device-tree/acpi.txt

diff --git a/docs/misc/arm/device-tree/acpi.txt 
b/docs/misc/arm/device-tree/acpi.txt
new file mode 100644
index 0000000..c39c4d0
--- /dev/null
+++ b/docs/misc/arm/device-tree/acpi.txt
@@ -0,0 +1,23 @@
+DomU ACPI module
+================================
+
+Xen toolstack passes the domU ACPI tables via a reference in the /chosen node 
of
+the device tree.
+
+Each node contains the following properties:
+
+- compatible
+
+       "xen,guest-acpi", "multiboot,module"
+
+- reg
+
+       Specifies the physical address and the length of the module.
+
+Examples
+========
+
+       module@0x20000000 {
+               compatible = "xen,guest-acpi", "multiboot,module";
+               reg = <0x20000000 0x1234>;
+       };
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 97958ed..240a215 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -288,6 +288,25 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, bool 
ramdisk,
         if (res) return res;
     }
 
+    if (state->config.acpi) {
+        const uint64_t acpi_base = GUEST_ACPI_BASE;
+        const char *name = GCSPRINTF("module@%"PRIx64, acpi_base);
+
+        res = fdt_begin_node(fdt, name);
+        if (res) return res;
+
+        res = fdt_property_compat(gc, fdt, 2, "xen,guest-acpi",
+                                  "multiboot,module");
+        if (res) return res;
+
+        res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
+                                1, 0, 0);
+        if (res) return res;
+
+        res = fdt_end_node(fdt);
+        if (res) return res;
+    }
+
     res = fdt_end_node(fdt);
     if (res) return res;
 
@@ -973,6 +992,11 @@ int libxl__arch_domain_finalise_hw_description(libxl__gc 
*gc,
         finalise_one_node(gc, fdt, "/memory", bankbase[i], size);
     }
 
+    if (dom->acpitable_blob) {
+        finalise_one_node(gc, fdt, "/chosen/module", GUEST_ACPI_BASE,
+                          dom->acpitable_size);
+    }
+
     debug_dump_fdt(gc, fdt);
 
     return 0;
-- 
2.0.4



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.