Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277172
b: refs/heads/master
c: 6fbef13
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Dec 8, 2011
1 parent cf3aadf commit 88f2f98
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0ce8fef55896a2813a3d94e1b2d0e6d7fab6228
refs/heads/master: 6fbef13c4feaf0c5576e2315f4d2999c4b670c88
17 changes: 6 additions & 11 deletions trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,17 +754,12 @@ void __init early_init_devtree(void *params)
early_reserve_mem();
phyp_dump_reserve_mem();

limit = memory_limit;
if (! limit) {
phys_addr_t memsize;

/* Ensure that total memory size is page-aligned, because
* otherwise mark_bootmem() gets upset. */
memblock_analyze();
memsize = memblock_phys_mem_size();
if ((memsize & PAGE_MASK) != memsize)
limit = memsize & PAGE_MASK;
}
/*
* Ensure that total memory size is page-aligned, because otherwise
* mark_bootmem() gets upset.
*/
memblock_analyze();
limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
memblock_enforce_memory_limit(limit);

memblock_analyze();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void __init MMU_init(void)

if (memblock.memory.cnt > 1) {
#ifndef CONFIG_WII
memblock.memory.cnt = 1;
memblock_enforce_memory_limit(memblock.memory.regions[0].size);
memblock_analyze();
printk(KERN_WARNING "Only using first contiguous memory region");
#else
Expand Down
22 changes: 9 additions & 13 deletions trunk/arch/powerpc/platforms/embedded6xx/wii.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,19 @@ void __init wii_memory_fixups(void)
BUG_ON(memblock.memory.cnt != 2);
BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base));

p[0].size = _ALIGN_DOWN(p[0].size, PAGE_SIZE);
p[1].size = _ALIGN_DOWN(p[1].size, PAGE_SIZE);
/* trim unaligned tail */
memblock_remove(ALIGN(p[1].base + p[1].size, PAGE_SIZE),
(phys_addr_t)ULLONG_MAX);

wii_hole_start = p[0].base + p[0].size;
/* determine hole, add & reserve them */
wii_hole_start = ALIGN(p[0].base + p[0].size, PAGE_SIZE);
wii_hole_size = p[1].base - wii_hole_start;

pr_info("MEM1: <%08llx %08llx>\n", p[0].base, p[0].size);
pr_info("HOLE: <%08lx %08lx>\n", wii_hole_start, wii_hole_size);
pr_info("MEM2: <%08llx %08llx>\n", p[1].base, p[1].size);

p[0].size += wii_hole_size + p[1].size;

memblock.memory.cnt = 1;
memblock_add(wii_hole_start, wii_hole_size);
memblock_reserve(wii_hole_start, wii_hole_size);
memblock_analyze();

/* reserve the hole */
memblock_reserve(wii_hole_start, wii_hole_size);
BUG_ON(memblock.memory.cnt != 1);
__memblock_dump_all();

/* allow ioremapping the address space in the hole */
__allow_ioremap_reserved = 1;
Expand Down

0 comments on commit 88f2f98

Please sign in to comment.