diff options
Diffstat (limited to 'arch/powerpc/platforms/embedded6xx/wii.c')
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/wii.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c index 1b5dc1a2e145..6d8dadf19f0b 100644 --- a/arch/powerpc/platforms/embedded6xx/wii.c +++ b/arch/powerpc/platforms/embedded6xx/wii.c | |||
@@ -79,24 +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); | ||
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(); | ||
96 | |||
97 | /* reserve the hole */ | ||
98 | memblock_reserve(wii_hole_start, wii_hole_size); | 90 | memblock_reserve(wii_hole_start, wii_hole_size); |
99 | 91 | ||
92 | BUG_ON(memblock.memory.cnt != 1); | ||
93 | __memblock_dump_all(); | ||
94 | |||
100 | /* allow ioremapping the address space in the hole */ | 95 | /* allow ioremapping the address space in the hole */ |
101 | __allow_ioremap_reserved = 1; | 96 | __allow_ioremap_reserved = 1; |
102 | } | 97 | } |