diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-05 22:23:33 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-05 22:23:33 -0400 |
commit | 7c8c6b9776fb41134d87ef50706a777a45d61cd4 (patch) | |
tree | 5f3cc71e34bc244d53364e103a9746bfe92da9ae /arch/powerpc/mm/ppc_mmu.c | |
parent | 9b6b563c0d2d25ecc3111916031aa7255543fbfb (diff) |
powerpc: Merge lmb.c and make MM initialization use it.
This also creates merged versions of do_init_bootmem, paging_init
and mem_init and moves them to arch/powerpc/mm/mem.c. It gets rid
of the mem_pieces stuff.
I made memory_limit a parameter to lmb_enforce_memory_limit rather
than a global referenced by that function. This will require some
small changes to ppc64 if we want to continue building ARCH=ppc64
using the merged lmb.c.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/ppc_mmu.c')
-rw-r--r-- | arch/powerpc/mm/ppc_mmu.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/powerpc/mm/ppc_mmu.c b/arch/powerpc/mm/ppc_mmu.c index 9a381ed5eb21..cef9e83cc7e9 100644 --- a/arch/powerpc/mm/ppc_mmu.c +++ b/arch/powerpc/mm/ppc_mmu.c | |||
@@ -32,9 +32,9 @@ | |||
32 | #include <asm/prom.h> | 32 | #include <asm/prom.h> |
33 | #include <asm/mmu.h> | 33 | #include <asm/mmu.h> |
34 | #include <asm/machdep.h> | 34 | #include <asm/machdep.h> |
35 | #include <asm/lmb.h> | ||
35 | 36 | ||
36 | #include "mmu_decl.h" | 37 | #include "mmu_decl.h" |
37 | #include "mem_pieces.h" | ||
38 | 38 | ||
39 | PTE *Hash, *Hash_end; | 39 | PTE *Hash, *Hash_end; |
40 | unsigned long Hash_size, Hash_mask; | 40 | unsigned long Hash_size, Hash_mask; |
@@ -215,17 +215,6 @@ void __init MMU_init_hw(void) | |||
215 | #define MIN_N_HPTEG 1024 /* min 64kB hash table */ | 215 | #define MIN_N_HPTEG 1024 /* min 64kB hash table */ |
216 | #endif | 216 | #endif |
217 | 217 | ||
218 | #ifdef CONFIG_POWER4 | ||
219 | /* The hash table has already been allocated and initialized | ||
220 | in prom.c */ | ||
221 | n_hpteg = Hash_size >> LG_HPTEG_SIZE; | ||
222 | lg_n_hpteg = __ilog2(n_hpteg); | ||
223 | |||
224 | /* Remove the hash table from the available memory */ | ||
225 | if (Hash) | ||
226 | reserve_phys_mem(__pa(Hash), Hash_size); | ||
227 | |||
228 | #else /* CONFIG_POWER4 */ | ||
229 | /* | 218 | /* |
230 | * Allow 1 HPTE (1/8 HPTEG) for each page of memory. | 219 | * Allow 1 HPTE (1/8 HPTEG) for each page of memory. |
231 | * This is less than the recommended amount, but then | 220 | * This is less than the recommended amount, but then |
@@ -245,10 +234,10 @@ void __init MMU_init_hw(void) | |||
245 | * Find some memory for the hash table. | 234 | * Find some memory for the hash table. |
246 | */ | 235 | */ |
247 | if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322); | 236 | if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322); |
248 | Hash = mem_pieces_find(Hash_size, Hash_size); | 237 | Hash = __va(lmb_alloc_base(Hash_size, Hash_size, |
238 | __initial_memory_limit)); | ||
249 | cacheable_memzero(Hash, Hash_size); | 239 | cacheable_memzero(Hash, Hash_size); |
250 | _SDR1 = __pa(Hash) | SDR1_LOW_BITS; | 240 | _SDR1 = __pa(Hash) | SDR1_LOW_BITS; |
251 | #endif /* CONFIG_POWER4 */ | ||
252 | 241 | ||
253 | Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); | 242 | Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); |
254 | 243 | ||