aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-09-24 23:20:01 -0400
committerRob Herring <rob.herring@calxeda.com>2013-10-09 12:38:19 -0400
commit068f6310b965d67d57f89ebf4c539e5933754366 (patch)
tree7f149f244a5d6451d4f4b4122e2a7fefe06ccf66 /drivers/of
parent7745fc1fec6ec9556e4cc36c21b0e02589078902 (diff)
of: create default early_init_dt_add_memory_arch
Create a weak version of early_init_dt_add_memory_arch which uses memblock. This will unify all architectures except ones with custom memory bank structs. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Jonas Bonn <jonas@southpole.se> Acked-by: Grant Likely <grant.likely@linaro.org> Cc: linux-arm-kernel@lists.infradead.org Cc: microblaze-uclinux@itee.uq.edu.au Cc: linux@lists.openrisc.net Cc: devicetree@vger.kernel.org
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/fdt.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index bfbfda543768..5bc55b6e2b41 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -775,6 +775,25 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
775} 775}
776 776
777#ifdef CONFIG_HAVE_MEMBLOCK 777#ifdef CONFIG_HAVE_MEMBLOCK
778void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
779{
780 const u64 phys_offset = __pa(PAGE_OFFSET);
781 base &= PAGE_MASK;
782 size &= PAGE_MASK;
783 if (base + size < phys_offset) {
784 pr_warning("Ignoring memory block 0x%llx - 0x%llx\n",
785 base, base + size);
786 return;
787 }
788 if (base < phys_offset) {
789 pr_warning("Ignoring memory range 0x%llx - 0x%llx\n",
790 base, phys_offset);
791 size -= phys_offset - base;
792 base = phys_offset;
793 }
794 memblock_add(base, size);
795}
796
778/* 797/*
779 * called from unflatten_device_tree() to bootstrap devicetree itself 798 * called from unflatten_device_tree() to bootstrap devicetree itself
780 * Architectures can override this definition if memblock isn't used 799 * Architectures can override this definition if memblock isn't used