aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/prom.c17
-rw-r--r--arch/powerpc/mm/init_32.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/wii.c22
3 files changed, 16 insertions, 25 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index a7ee83e6eb17..28500d4f29d9 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -754,17 +754,12 @@ void __init early_init_devtree(void *params)
754 early_reserve_mem(); 754 early_reserve_mem();
755 phyp_dump_reserve_mem(); 755 phyp_dump_reserve_mem();
756 756
757 limit = memory_limit; 757 /*
758 if (! limit) { 758 * Ensure that total memory size is page-aligned, because otherwise
759 phys_addr_t memsize; 759 * mark_bootmem() gets upset.
760 760 */
761 /* Ensure that total memory size is page-aligned, because 761 memblock_analyze();
762 * otherwise mark_bootmem() gets upset. */ 762 limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
763 memblock_analyze();
764 memsize = memblock_phys_mem_size();
765 if ((memsize & PAGE_MASK) != memsize)
766 limit = memsize & PAGE_MASK;
767 }
768 memblock_enforce_memory_limit(limit); 763 memblock_enforce_memory_limit(limit);
769 764
770 memblock_analyze(); 765 memblock_analyze();
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 161cefde5c15..12bb528e51c5 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -134,7 +134,7 @@ void __init MMU_init(void)
134 134
135 if (memblock.memory.cnt > 1) { 135 if (memblock.memory.cnt > 1) {
136#ifndef CONFIG_WII 136#ifndef CONFIG_WII
137 memblock.memory.cnt = 1; 137 memblock_enforce_memory_limit(memblock.memory.regions[0].size);
138 memblock_analyze(); 138 memblock_analyze();
139 printk(KERN_WARNING "Only using first contiguous memory region"); 139 printk(KERN_WARNING "Only using first contiguous memory region");
140#else 140#else
diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c
index 1b5dc1a2e145..1cbe9d3c7977 100644
--- a/arch/powerpc/platforms/embedded6xx/wii.c
+++ b/arch/powerpc/platforms/embedded6xx/wii.c
@@ -79,23 +79,19 @@ void __init wii_memory_fixups(void)
79 BUG_ON(memblock.memory.cnt != 2); 79 BUG_ON(memblock.memory.cnt != 2);
80 BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base)); 80 BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base));
81 81
82 p[0].size = _ALIGN_DOWN(p[0].size, PAGE_SIZE); 82 /* trim unaligned tail */
83 p[1].size = _ALIGN_DOWN(p[1].size, PAGE_SIZE); 83 memblock_remove(ALIGN(p[1].base + p[1].size, PAGE_SIZE),
84 (phys_addr_t)ULLONG_MAX);
84 85
85 wii_hole_start = p[0].base + p[0].size; 86 /* determine hole, add & reserve them */
87 wii_hole_start = ALIGN(p[0].base + p[0].size, PAGE_SIZE);
86 wii_hole_size = p[1].base - wii_hole_start; 88 wii_hole_size = p[1].base - wii_hole_start;
87 89 memblock_add(wii_hole_start, wii_hole_size);
88 pr_info("MEM1: <%08llx %08llx>\n", p[0].base, p[0].size); 90 memblock_reserve(wii_hole_start, wii_hole_size);
89 pr_info("HOLE: <%08lx %08lx>\n", wii_hole_start, wii_hole_size);
90 pr_info("MEM2: <%08llx %08llx>\n", p[1].base, p[1].size);
91
92 p[0].size += wii_hole_size + p[1].size;
93
94 memblock.memory.cnt = 1;
95 memblock_analyze(); 91 memblock_analyze();
96 92
97 /* reserve the hole */ 93 BUG_ON(memblock.memory.cnt != 1);
98 memblock_reserve(wii_hole_start, wii_hole_size); 94 __memblock_dump_all();
99 95
100 /* allow ioremapping the address space in the hole */ 96 /* allow ioremapping the address space in the hole */
101 __allow_ioremap_reserved = 1; 97 __allow_ioremap_reserved = 1;