summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-08-28 21:18:32 +0100
committerIshan Mittal <imittal@nvidia.com>2014-04-30 11:39:02 +0530
commite8188ec56f073815820652b4fc06d866f56fb3bc (patch)
treed3c25877820efef902d6e7c353e3720602a37b82 /drivers/of
parent7c6af0387f43897dcebe509e23e3032478bf18cf (diff)
of: consolidate definition of early_init_dt_alloc_memory_arch()
Most architectures use the same implementation. Collapse the common ones into a single weak function that can be overridden. (cherry picked from commit a1727da599ad030ccaf4073473fd235c8ee28219) Change-Id: I5cfcac67b98407f8e4c4dcb89829f2a8e0d1b88b Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/fdt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index a1ebaecc8122..028b5be967e4 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/initrd.h>
+#include <linux/memblock.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
@@ -700,6 +701,17 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
return 1;
}
+#ifdef CONFIG_HAVE_MEMBLOCK
+/*
+ * called from unflatten_device_tree() to bootstrap devicetree itself
+ * Architectures can override this definition if memblock isn't used
+ */
+void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+ return __va(memblock_alloc(size, align));
+}
+#endif
+
/**
* unflatten_device_tree - create tree of device_nodes from flat blob
*