aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/init_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/init_32.c')
-rw-r--r--arch/powerpc/mm/init_32.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 977cb1ee5e72..47325f23c51f 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -30,6 +30,7 @@
30#include <linux/highmem.h> 30#include <linux/highmem.h>
31#include <linux/initrd.h> 31#include <linux/initrd.h>
32#include <linux/pagemap.h> 32#include <linux/pagemap.h>
33#include <linux/lmb.h>
33 34
34#include <asm/pgalloc.h> 35#include <asm/pgalloc.h>
35#include <asm/prom.h> 36#include <asm/prom.h>
@@ -41,7 +42,6 @@
41#include <asm/machdep.h> 42#include <asm/machdep.h>
42#include <asm/btext.h> 43#include <asm/btext.h>
43#include <asm/tlb.h> 44#include <asm/tlb.h>
44#include <asm/lmb.h>
45#include <asm/sections.h> 45#include <asm/sections.h>
46 46
47#include "mmu_decl.h" 47#include "mmu_decl.h"
@@ -59,8 +59,8 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
59unsigned long total_memory; 59unsigned long total_memory;
60unsigned long total_lowmem; 60unsigned long total_lowmem;
61 61
62unsigned long ppc_memstart; 62phys_addr_t memstart_addr;
63unsigned long ppc_memoffset = PAGE_OFFSET; 63phys_addr_t lowmem_end_addr;
64 64
65int boot_mapsize; 65int boot_mapsize;
66#ifdef CONFIG_PPC_PMAC 66#ifdef CONFIG_PPC_PMAC
@@ -95,10 +95,10 @@ int __map_without_ltlbs;
95unsigned long __max_low_memory = MAX_LOW_MEM; 95unsigned long __max_low_memory = MAX_LOW_MEM;
96 96
97/* 97/*
98 * limit of what is accessible with initial MMU setup - 98 * address of the limit of what is accessible with initial MMU setup -
99 * 256MB usually, but only 16MB on 601. 99 * 256MB usually, but only 16MB on 601.
100 */ 100 */
101unsigned long __initial_memory_limit = 0x10000000; 101phys_addr_t __initial_memory_limit_addr = (phys_addr_t)0x10000000;
102 102
103/* 103/*
104 * Check for command-line options that affect what MMU_init will do. 104 * Check for command-line options that affect what MMU_init will do.
@@ -131,10 +131,10 @@ void __init MMU_init(void)
131 131
132 /* 601 can only access 16MB at the moment */ 132 /* 601 can only access 16MB at the moment */
133 if (PVR_VER(mfspr(SPRN_PVR)) == 1) 133 if (PVR_VER(mfspr(SPRN_PVR)) == 1)
134 __initial_memory_limit = 0x01000000; 134 __initial_memory_limit_addr = 0x01000000;
135 /* 8xx can only access 8MB at the moment */ 135 /* 8xx can only access 8MB at the moment */
136 if (PVR_VER(mfspr(SPRN_PVR)) == 0x50) 136 if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
137 __initial_memory_limit = 0x00800000; 137 __initial_memory_limit_addr = 0x00800000;
138 138
139 /* parse args from command line */ 139 /* parse args from command line */
140 MMU_setup(); 140 MMU_setup();
@@ -145,8 +145,8 @@ void __init MMU_init(void)
145 printk(KERN_WARNING "Only using first contiguous memory region"); 145 printk(KERN_WARNING "Only using first contiguous memory region");
146 } 146 }
147 147
148 total_memory = lmb_end_of_DRAM(); 148 total_lowmem = total_memory = lmb_end_of_DRAM() - memstart_addr;
149 total_lowmem = total_memory; 149 lowmem_end_addr = memstart_addr + total_lowmem;
150 150
151#ifdef CONFIG_FSL_BOOKE 151#ifdef CONFIG_FSL_BOOKE
152 /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB 152 /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB
@@ -157,9 +157,10 @@ void __init MMU_init(void)
157 157
158 if (total_lowmem > __max_low_memory) { 158 if (total_lowmem > __max_low_memory) {
159 total_lowmem = __max_low_memory; 159 total_lowmem = __max_low_memory;
160 lowmem_end_addr = memstart_addr + total_lowmem;
160#ifndef CONFIG_HIGHMEM 161#ifndef CONFIG_HIGHMEM
161 total_memory = total_lowmem; 162 total_memory = total_lowmem;
162 lmb_enforce_memory_limit(total_lowmem); 163 lmb_enforce_memory_limit(lowmem_end_addr);
163 lmb_analyze(); 164 lmb_analyze();
164#endif /* CONFIG_HIGHMEM */ 165#endif /* CONFIG_HIGHMEM */
165 } 166 }
@@ -184,8 +185,6 @@ void __init MMU_init(void)
184 /* Map in I/O resources */ 185 /* Map in I/O resources */
185 if (ppc_md.progress) 186 if (ppc_md.progress)
186 ppc_md.progress("MMU:setio", 0x302); 187 ppc_md.progress("MMU:setio", 0x302);
187 if (ppc_md.setup_io_mappings)
188 ppc_md.setup_io_mappings();
189 188
190 /* Initialize the context management stuff */ 189 /* Initialize the context management stuff */
191 mmu_context_init(); 190 mmu_context_init();
@@ -208,7 +207,7 @@ void __init *early_get_page(void)
208 p = alloc_bootmem_pages(PAGE_SIZE); 207 p = alloc_bootmem_pages(PAGE_SIZE);
209 } else { 208 } else {
210 p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE, 209 p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE,
211 __initial_memory_limit)); 210 __initial_memory_limit_addr));
212 } 211 }
213 return p; 212 return p;
214} 213}
@@ -276,7 +275,7 @@ static int __init setup_kcore(void)
276 275
277 kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC); 276 kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
278 if (!kcore_mem) 277 if (!kcore_mem)
279 panic("%s: kmalloc failed\n", __FUNCTION__); 278 panic("%s: kmalloc failed\n", __func__);
280 279
281 /* must stay under 32 bits */ 280 /* must stay under 32 bits */
282 if ( 0xfffffffful - (unsigned long)__va(base) < size) { 281 if ( 0xfffffffful - (unsigned long)__va(base) < size) {