aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup_64.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-19 15:34:16 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-23 22:47:34 -0400
commit757c74d298dc8438760b8dea275c4c6e0ac8a77f (patch)
tree77c694ad28230b3714c039fe54ab5497febfd4ac /arch/powerpc/kernel/setup_64.c
parenta033a487f8ae79800a15774cb6565cbbca685fc6 (diff)
powerpc/mm: Introduce early_init_mmu() on 64-bit
This moves some MMU related init code out of setup_64.c into hash_utils_64.c and calls it early_init_mmu() and early_init_mmu_secondary(). This will make it easier to plug in a new MMU type. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r--arch/powerpc/kernel/setup_64.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 73e16e298e28..c410c606955d 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -202,8 +202,6 @@ void __init early_setup(unsigned long dt_ptr)
202 202
203 /* Fix up paca fields required for the boot cpu */ 203 /* Fix up paca fields required for the boot cpu */
204 get_paca()->cpu_start = 1; 204 get_paca()->cpu_start = 1;
205 get_paca()->stab_real = __pa((u64)&initial_stab);
206 get_paca()->stab_addr = (u64)&initial_stab;
207 205
208 /* Probe the machine type */ 206 /* Probe the machine type */
209 probe_machine(); 207 probe_machine();
@@ -212,20 +210,8 @@ void __init early_setup(unsigned long dt_ptr)
212 210
213 DBG("Found, Initializing memory management...\n"); 211 DBG("Found, Initializing memory management...\n");
214 212
215 /* 213 /* Initialize the hash table or TLB handling */
216 * Initialize the MMU Hash table and create the linear mapping 214 early_init_mmu();
217 * of memory. Has to be done before stab/slb initialization as
218 * this is currently where the page size encoding is obtained
219 */
220 htab_initialize();
221
222 /*
223 * Initialize stab / SLB management except on iSeries
224 */
225 if (cpu_has_feature(CPU_FTR_SLB))
226 slb_initialize();
227 else if (!firmware_has_feature(FW_FEATURE_ISERIES))
228 stab_initialize(get_paca()->stab_real);
229 215
230 DBG(" <- early_setup()\n"); 216 DBG(" <- early_setup()\n");
231} 217}
@@ -233,22 +219,11 @@ void __init early_setup(unsigned long dt_ptr)
233#ifdef CONFIG_SMP 219#ifdef CONFIG_SMP
234void early_setup_secondary(void) 220void early_setup_secondary(void)
235{ 221{
236 struct paca_struct *lpaca = get_paca();
237
238 /* Mark interrupts enabled in PACA */ 222 /* Mark interrupts enabled in PACA */
239 lpaca->soft_enabled = 0; 223 get_paca()->soft_enabled = 0;
240 224
241 /* Initialize hash table for that CPU */ 225 /* Initialize the hash table or TLB handling */
242 htab_initialize_secondary(); 226 early_init_mmu_secondary();
243
244 /* Initialize STAB/SLB. We use a virtual address as it works
245 * in real mode on pSeries and we want a virutal address on
246 * iSeries anyway
247 */
248 if (cpu_has_feature(CPU_FTR_SLB))
249 slb_initialize();
250 else
251 stab_initialize(lpaca->stab_addr);
252} 227}
253 228
254#endif /* CONFIG_SMP */ 229#endif /* CONFIG_SMP */