powerpc/32: Add the ability for a classic ppc kernel to be loaded at 32M

Add the ability for a classic ppc kernel to be loaded at an address
of 32MB.  This done by fixing a few places that assume we are loaded
at address 0, and by changing several uses of KERNELBASE to use
PAGE_OFFSET, instead.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Dale Farnsworth
2008-12-17 10:09:13 +00:00
committed by Paul Mackerras
parent 01695a9687
commit ccdcef72c2
5 changed files with 15 additions and 14 deletions

View File

@@ -48,7 +48,7 @@
#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
/* The ammount of lowmem must be within 0xF0000000 - KERNELBASE. */
#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - KERNELBASE))
#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - PAGE_OFFSET))
#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
#endif
#endif

View File

@@ -269,7 +269,7 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
}
/*
* Map in a big chunk of physical memory starting at KERNELBASE.
* Map in a big chunk of physical memory starting at PAGE_OFFSET.
*/
void __init mapin_ram(void)
{
@@ -278,7 +278,7 @@ void __init mapin_ram(void)
int ktext;
s = mmu_mapin_ram();
v = KERNELBASE + s;
v = PAGE_OFFSET + s;
p = memstart_addr + s;
for (; s < total_lowmem; s += PAGE_SIZE) {
ktext = ((char *) v >= _stext && (char *) v < etext);

View File

@@ -95,16 +95,16 @@ unsigned long __init mmu_mapin_ram(void)
break;
}
setbat(2, KERNELBASE, 0, bl, _PAGE_RAM);
done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
setbat(2, PAGE_OFFSET, 0, bl, _PAGE_RAM);
done = (unsigned long)bat_addrs[2].limit - PAGE_OFFSET + 1;
if ((done < tot) && !bat_addrs[3].limit) {
/* use BAT3 to cover a bit more */
tot -= done;
for (bl = 128<<10; bl < max_size; bl <<= 1)
if (bl * 2 > tot)
break;
setbat(3, KERNELBASE+done, done, bl, _PAGE_RAM);
done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
setbat(3, PAGE_OFFSET+done, done, bl, _PAGE_RAM);
done = (unsigned long)bat_addrs[3].limit - PAGE_OFFSET + 1;
}
return done;