aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-01-27 05:30:44 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-02 00:56:15 -0500
commit6dd227002972be910c6191f38f8641e01796557f (patch)
tree2dbfe9ef7a95c0f95ea4938a9fa60d9e65c23165
parentc7704d352d45de47333f2d9f10aead820b49044c (diff)
powerpc: Fix memory limits when starting at a non-zero address
memblock_enforce_memory_limit() takes the desired maximum quantity of memory to end up with, not an address above which memory will not be used. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/kernel/prom.c2
-rw-r--r--arch/powerpc/mm/init_32.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 7185f0da7dc3..05b7139d6a27 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -97,7 +97,7 @@ static void __init move_device_tree(void)
97 start = __pa(initial_boot_params); 97 start = __pa(initial_boot_params);
98 size = be32_to_cpu(initial_boot_params->totalsize); 98 size = be32_to_cpu(initial_boot_params->totalsize);
99 99
100 if ((memory_limit && (start + size) > memory_limit) || 100 if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
101 overlaps_crashkernel(start, size)) { 101 overlaps_crashkernel(start, size)) {
102 p = __va(memblock_alloc(size, PAGE_SIZE)); 102 p = __va(memblock_alloc(size, PAGE_SIZE));
103 memcpy(p, initial_boot_params, size); 103 memcpy(p, initial_boot_params, size);
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 742da43b4ab6..d65b591e5556 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -148,7 +148,7 @@ void __init MMU_init(void)
148 lowmem_end_addr = memstart_addr + total_lowmem; 148 lowmem_end_addr = memstart_addr + total_lowmem;
149#ifndef CONFIG_HIGHMEM 149#ifndef CONFIG_HIGHMEM
150 total_memory = total_lowmem; 150 total_memory = total_lowmem;
151 memblock_enforce_memory_limit(lowmem_end_addr); 151 memblock_enforce_memory_limit(total_lowmem);
152 memblock_analyze(); 152 memblock_analyze();
153#endif /* CONFIG_HIGHMEM */ 153#endif /* CONFIG_HIGHMEM */
154 } 154 }