aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/device_tree.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2012-02-13 14:33:10 +0000
committerDavid Vrabel <david.vrabel@citrix.com>2012-02-13 14:33:10 +0000
commit1bdc81dac816330a831f321f4dd05bbe76d71ce4 (patch)
tree87bf258ea32e548337937d968e1c0f153ebbc0d2 /xen/common/device_tree.c
parent3e99c95ba1c8a9508b3dc5e94c67f0ae46c7d360 (diff)
downloadxen-1bdc81dac816330a831f321f4dd05bbe76d71ce4.tar.gz
xen-1bdc81dac816330a831f321f4dd05bbe76d71ce4.tar.bz2
xen-1bdc81dac816330a831f321f4dd05bbe76d71ce4.zip
arm: setup MM using information from the device tree
Setup memory management, heaps etc. using the location and size of the first memory bank given in the device tree. The DTB is also copied so it can be used afterwards. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/common/device_tree.c')
-rw-r--r--xen/common/device_tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 7d7514dc01..d50cb9cc6b 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -22,6 +22,7 @@
#include <libfdt.h>
struct dt_early_info __initdata early_info;
+void *device_tree_flattened;
static void __init get_val(const u32 **cell, u32 cells, u64 *val)
{
@@ -126,8 +127,10 @@ static void __init early_print_info(void)
/**
* device_tree_early_init - initialize early info from a DTB
* @fdt: flattened device tree binary
+ *
+ * Returns the size of the DTB.
*/
-void __init device_tree_early_init(const void *fdt)
+size_t __init device_tree_early_init(const void *fdt)
{
int ret;
@@ -137,6 +140,8 @@ void __init device_tree_early_init(const void *fdt)
early_scan(fdt);
early_print_info();
+
+ return fdt_totalsize(fdt);
}
/**