summaryrefslogtreecommitdiff
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-02-16 13:52:32 +0100
committerJeff Vander Stoep <jeffv@google.com>2016-09-22 13:38:22 -0700
commit6bfaecfc5801909762309f4ec831f789581f279b (patch)
tree1d69cc623324c3e8364342fe3298489798681726 /drivers/of/fdt.c
parentc39e2026d6c2daef475d66cc0656769f93b42fc4 (diff)
UPSTREAM: of/fdt: make memblock minimum physical address arch configurable
By default, early_init_dt_add_memory_arch() ignores memory below the base of the kernel image since it won't be addressable via the linear mapping. However, this is not appropriate anymore once we decouple the kernel text mapping from the linear mapping, so archs may want to drop the low limit entirely. So allow the minimum to be overridden by setting MIN_MEMBLOCK_ADDR. Acked-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Bug: 30369029 Patchset: kaslr-arm64-4.4 (cherry picked from commit 270522a04f7a9911983878fa37da467f9ff1c938) Signed-off-by: Jeff Vander Stoep <jeffv@google.com> Change-Id: I4bb2626a87493262a64584b3d808de260129127e
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 86fff625f6d5..628f436e16f6 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1006,13 +1006,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
}
#ifdef CONFIG_HAVE_MEMBLOCK
+#ifndef MIN_MEMBLOCK_ADDR
+#define MIN_MEMBLOCK_ADDR __pa(PAGE_OFFSET)
+#endif
#ifndef MAX_MEMBLOCK_ADDR
#define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0)
#endif
void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
{
- const u64 phys_offset = __pa(PAGE_OFFSET);
+ const u64 phys_offset = MIN_MEMBLOCK_ADDR;
if (!PAGE_ALIGNED(base)) {
if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {