1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks.

Now that mmu_mapin_ram() is able to handle other blocks
than the one starting at 0, the WII can use it for all
its blocks.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Christophe Leroy 2019-02-21 19:08:40 +00:00 committed by Michael Ellerman
parent e4d6654ebe
commit 9e849f231c

View file

@ -254,26 +254,17 @@ static void __init __mapin_ram_chunk(unsigned long offset, unsigned long top)
void __init mapin_ram(void) void __init mapin_ram(void)
{ {
unsigned long s, top; struct memblock_region *reg;
#ifndef CONFIG_WII for_each_memblock(memory, reg) {
top = total_lowmem; phys_addr_t base = reg->base;
s = mmu_mapin_ram(0, top); phys_addr_t top = min(base + reg->size, total_lowmem);
__mapin_ram_chunk(s, top);
#else
if (!wii_hole_size) {
s = mmu_mapin_ram(0, total_lowmem);
__mapin_ram_chunk(s, total_lowmem);
} else {
top = wii_hole_start;
s = mmu_mapin_ram(0, top);
__mapin_ram_chunk(s, top);
top = memblock_end_of_DRAM(); if (base >= top)
s = wii_mmu_mapin_mem2(top); continue;
__mapin_ram_chunk(s, top); base = mmu_mapin_ram(base, top);
__mapin_ram_chunk(base, top);
} }
#endif
} }
/* Scan the real Linux page tables and return a PTE pointer for /* Scan the real Linux page tables and return a PTE pointer for