aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/ppc_mmu_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/ppc_mmu_32.c')
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index 5c45d474cfcc..cef9f156874b 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -26,11 +26,11 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/highmem.h> 28#include <linux/highmem.h>
29#include <linux/lmb.h>
29 30
30#include <asm/prom.h> 31#include <asm/prom.h>
31#include <asm/mmu.h> 32#include <asm/mmu.h>
32#include <asm/machdep.h> 33#include <asm/machdep.h>
33#include <asm/lmb.h>
34 34
35#include "mmu_decl.h" 35#include "mmu_decl.h"
36 36
@@ -82,7 +82,6 @@ unsigned long __init mmu_mapin_ram(void)
82#else 82#else
83 unsigned long tot, bl, done; 83 unsigned long tot, bl, done;
84 unsigned long max_size = (256<<20); 84 unsigned long max_size = (256<<20);
85 unsigned long align;
86 85
87 if (__map_without_bats) { 86 if (__map_without_bats) {
88 printk(KERN_DEBUG "RAM mapped without BATs\n"); 87 printk(KERN_DEBUG "RAM mapped without BATs\n");
@@ -93,19 +92,13 @@ unsigned long __init mmu_mapin_ram(void)
93 92
94 /* Make sure we don't map a block larger than the 93 /* Make sure we don't map a block larger than the
95 smallest alignment of the physical address. */ 94 smallest alignment of the physical address. */
96 /* alignment of PPC_MEMSTART */
97 align = ~(PPC_MEMSTART-1) & PPC_MEMSTART;
98 /* set BAT block size to MIN(max_size, align) */
99 if (align && align < max_size)
100 max_size = align;
101
102 tot = total_lowmem; 95 tot = total_lowmem;
103 for (bl = 128<<10; bl < max_size; bl <<= 1) { 96 for (bl = 128<<10; bl < max_size; bl <<= 1) {
104 if (bl * 2 > tot) 97 if (bl * 2 > tot)
105 break; 98 break;
106 } 99 }
107 100
108 setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM); 101 setbat(2, KERNELBASE, 0, bl, _PAGE_RAM);
109 done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1; 102 done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
110 if ((done < tot) && !bat_addrs[3].limit) { 103 if ((done < tot) && !bat_addrs[3].limit) {
111 /* use BAT3 to cover a bit more */ 104 /* use BAT3 to cover a bit more */
@@ -113,7 +106,7 @@ unsigned long __init mmu_mapin_ram(void)
113 for (bl = 128<<10; bl < max_size; bl <<= 1) 106 for (bl = 128<<10; bl < max_size; bl <<= 1)
114 if (bl * 2 > tot) 107 if (bl * 2 > tot)
115 break; 108 break;
116 setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM); 109 setbat(3, KERNELBASE+done, done, bl, _PAGE_RAM);
117 done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1; 110 done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
118 } 111 }
119 112
@@ -240,7 +233,7 @@ void __init MMU_init_hw(void)
240 */ 233 */
241 if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322); 234 if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
242 Hash = __va(lmb_alloc_base(Hash_size, Hash_size, 235 Hash = __va(lmb_alloc_base(Hash_size, Hash_size,
243 __initial_memory_limit)); 236 __initial_memory_limit_addr));
244 cacheable_memzero(Hash, Hash_size); 237 cacheable_memzero(Hash, Hash_size);
245 _SDR1 = __pa(Hash) | SDR1_LOW_BITS; 238 _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
246 239