aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaresh Bhat <naresh.bhat@linaro.org>2014-10-18 01:02:15 +0530
committerNaresh Bhat <naresh.bhat@linaro.org>2014-10-18 01:02:15 +0530
commit61b4afd6853700240fbe7e287b134a3cccdc4c7b (patch)
tree0eb472a67953e4c3228bdde0b31b27db223d7cf7
parent419cd263555ffcd49b20784584a611fdb6f15f79 (diff)
downloadxen-arm64-uefi-acpi.tar.gz
xen/arm: Create RSDP node for DOM0xen-arm64-uefi-acpi
In the ACPI case we need to pass the RSDP (Root System Descriptor Pointer) to DOM0. DOM0 does not have access to UEFI hence we need to map ACPI RSDP pointer in the RAM region and pass the same. The patch does the following - Prepare RSDP pointer for DOM0. - Add RSDP pointer into kernel_info structure. - Create RSDP node into DOM0 FDT file. Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
-rw-r--r--xen/arch/arm/domain_build.c36
-rw-r--r--xen/arch/arm/kernel.h4
2 files changed, 40 insertions, 0 deletions
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6aea23d481..4dc7a540b7 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1177,6 +1177,28 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
return res;
}
+/* Create a ACPI RSDP node */
+static int make_rsdp_node(const struct domain *d, void *fdt)
+{
+ int res;
+ const char acpi20[] = "0xfebfa014";
+
+ DPRINT("Create ACPI RSDP chosen node\n");
+
+ res = fdt_begin_node(fdt, "rsdp");
+ if ( res )
+ return res;
+
+ res = fdt_property(fdt, "rsdp", acpi20, sizeof(acpi20));
+ if ( res )
+ return res;
+
+ res = fdt_end_node(fdt);
+
+ return res;
+
+}
+
static int make_memory_node_acpi(const struct domain *d,
void *fdt,
int addr_cells,
@@ -1250,6 +1272,14 @@ static int make_chosen_node(const struct domain *d, void *fdt)
return res;
}
+static int prepare_acpi_rsdp(struct domain *d, struct kernel_info *kinfo)
+{
+ DPRINT("Prepare RSDP for DOM0\n");
+
+ kinfo->acpi20 = 0xfebfa014;
+
+ return 0;
+}
/*
* Prepare a minimal DTB for DOM0 which contains
* bootargs, memory information,
@@ -1300,6 +1330,10 @@ static int prepare_dtb_acpi(struct domain *d, struct kernel_info *kinfo)
if ( ret )
goto err;
+ ret = make_rsdp_node(d, kinfo->fdt);
+ if ( ret )
+ goto err;
+
ret = fdt_end_node(kinfo->fdt);
if ( ret < 0 )
goto err;
@@ -1464,6 +1498,8 @@ int construct_dom0(struct domain *d)
allocate_memory(d, &kinfo);
+ prepare_acpi_rsdp(d, &kinfo);
+
if (acpi_disabled)
rc = prepare_dtb(d, &kinfo);
else
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index 0050dfb130..a9b119022e 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -15,6 +15,10 @@ struct kernel_info {
enum domain_type type;
#endif
+#if defined(CONFIG_ARM_64) && defined(CONFIG_ACPI)
+ u64 acpi20; /* ACPI table (ACPI 2.0) */
+#endif
+
void *fdt; /* flat device tree */
paddr_t unassigned_mem; /* RAM not (yet) assigned to a bank */
struct meminfo mem;