diff options
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index fe39aac4f24d..be607b877a55 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -100,10 +100,9 @@ extern void udbg_init_maple_realmode(void); | |||
100 | extern unsigned long klimit; | 100 | extern unsigned long klimit; |
101 | 101 | ||
102 | extern void mm_init_ppc64(void); | 102 | extern void mm_init_ppc64(void); |
103 | extern void stab_initialize(unsigned long stab); | ||
104 | extern void htab_initialize(void); | ||
105 | extern void early_init_devtree(void *flat_dt); | 103 | extern void early_init_devtree(void *flat_dt); |
106 | extern void unflatten_device_tree(void); | 104 | extern void unflatten_device_tree(void); |
105 | extern void check_for_initrd(void); | ||
107 | 106 | ||
108 | int have_of = 1; | 107 | int have_of = 1; |
109 | int boot_cpuid = 0; | 108 | int boot_cpuid = 0; |
@@ -256,11 +255,10 @@ void __init early_setup(unsigned long dt_ptr) | |||
256 | * Iterate all ppc_md structures until we find the proper | 255 | * Iterate all ppc_md structures until we find the proper |
257 | * one for the current machine type | 256 | * one for the current machine type |
258 | */ | 257 | */ |
259 | DBG("Probing machine type for platform %x...\n", | 258 | DBG("Probing machine type for platform %x...\n", _machine); |
260 | systemcfg->platform); | ||
261 | 259 | ||
262 | for (mach = machines; *mach; mach++) { | 260 | for (mach = machines; *mach; mach++) { |
263 | if ((*mach)->probe(systemcfg->platform)) | 261 | if ((*mach)->probe(_machine)) |
264 | break; | 262 | break; |
265 | } | 263 | } |
266 | /* What can we do if we didn't find ? */ | 264 | /* What can we do if we didn't find ? */ |
@@ -292,6 +290,28 @@ void __init early_setup(unsigned long dt_ptr) | |||
292 | DBG(" <- early_setup()\n"); | 290 | DBG(" <- early_setup()\n"); |
293 | } | 291 | } |
294 | 292 | ||
293 | #ifdef CONFIG_SMP | ||
294 | void early_setup_secondary(void) | ||
295 | { | ||
296 | struct paca_struct *lpaca = get_paca(); | ||
297 | |||
298 | /* Mark enabled in PACA */ | ||
299 | lpaca->proc_enabled = 0; | ||
300 | |||
301 | /* Initialize hash table for that CPU */ | ||
302 | htab_initialize_secondary(); | ||
303 | |||
304 | /* Initialize STAB/SLB. We use a virtual address as it works | ||
305 | * in real mode on pSeries and we want a virutal address on | ||
306 | * iSeries anyway | ||
307 | */ | ||
308 | if (cpu_has_feature(CPU_FTR_SLB)) | ||
309 | slb_initialize(); | ||
310 | else | ||
311 | stab_initialize(lpaca->stab_addr); | ||
312 | } | ||
313 | |||
314 | #endif /* CONFIG_SMP */ | ||
295 | 315 | ||
296 | #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) | 316 | #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) |
297 | void smp_release_cpus(void) | 317 | void smp_release_cpus(void) |
@@ -317,7 +337,8 @@ void smp_release_cpus(void) | |||
317 | #endif /* CONFIG_SMP || CONFIG_KEXEC */ | 337 | #endif /* CONFIG_SMP || CONFIG_KEXEC */ |
318 | 338 | ||
319 | /* | 339 | /* |
320 | * Initialize some remaining members of the ppc64_caches and systemcfg structures | 340 | * Initialize some remaining members of the ppc64_caches and systemcfg |
341 | * structures | ||
321 | * (at least until we get rid of them completely). This is mostly some | 342 | * (at least until we get rid of them completely). This is mostly some |
322 | * cache informations about the CPU that will be used by cache flush | 343 | * cache informations about the CPU that will be used by cache flush |
323 | * routines and/or provided to userland | 344 | * routines and/or provided to userland |
@@ -342,7 +363,7 @@ static void __init initialize_cache_info(void) | |||
342 | const char *dc, *ic; | 363 | const char *dc, *ic; |
343 | 364 | ||
344 | /* Then read cache informations */ | 365 | /* Then read cache informations */ |
345 | if (systemcfg->platform == PLATFORM_POWERMAC) { | 366 | if (_machine == PLATFORM_POWERMAC) { |
346 | dc = "d-cache-block-size"; | 367 | dc = "d-cache-block-size"; |
347 | ic = "i-cache-block-size"; | 368 | ic = "i-cache-block-size"; |
348 | } else { | 369 | } else { |
@@ -362,8 +383,8 @@ static void __init initialize_cache_info(void) | |||
362 | DBG("Argh, can't find dcache properties ! " | 383 | DBG("Argh, can't find dcache properties ! " |
363 | "sizep: %p, lsizep: %p\n", sizep, lsizep); | 384 | "sizep: %p, lsizep: %p\n", sizep, lsizep); |
364 | 385 | ||
365 | systemcfg->dcache_size = ppc64_caches.dsize = size; | 386 | _systemcfg->dcache_size = ppc64_caches.dsize = size; |
366 | systemcfg->dcache_line_size = | 387 | _systemcfg->dcache_line_size = |
367 | ppc64_caches.dline_size = lsize; | 388 | ppc64_caches.dline_size = lsize; |
368 | ppc64_caches.log_dline_size = __ilog2(lsize); | 389 | ppc64_caches.log_dline_size = __ilog2(lsize); |
369 | ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; | 390 | ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; |
@@ -380,8 +401,8 @@ static void __init initialize_cache_info(void) | |||
380 | DBG("Argh, can't find icache properties ! " | 401 | DBG("Argh, can't find icache properties ! " |
381 | "sizep: %p, lsizep: %p\n", sizep, lsizep); | 402 | "sizep: %p, lsizep: %p\n", sizep, lsizep); |
382 | 403 | ||
383 | systemcfg->icache_size = ppc64_caches.isize = size; | 404 | _systemcfg->icache_size = ppc64_caches.isize = size; |
384 | systemcfg->icache_line_size = | 405 | _systemcfg->icache_line_size = |
385 | ppc64_caches.iline_size = lsize; | 406 | ppc64_caches.iline_size = lsize; |
386 | ppc64_caches.log_iline_size = __ilog2(lsize); | 407 | ppc64_caches.log_iline_size = __ilog2(lsize); |
387 | ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; | 408 | ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; |
@@ -389,10 +410,12 @@ static void __init initialize_cache_info(void) | |||
389 | } | 410 | } |
390 | 411 | ||
391 | /* Add an eye catcher and the systemcfg layout version number */ | 412 | /* Add an eye catcher and the systemcfg layout version number */ |
392 | strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); | 413 | strcpy(_systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); |
393 | systemcfg->version.major = SYSTEMCFG_MAJOR; | 414 | _systemcfg->version.major = SYSTEMCFG_MAJOR; |
394 | systemcfg->version.minor = SYSTEMCFG_MINOR; | 415 | _systemcfg->version.minor = SYSTEMCFG_MINOR; |
395 | systemcfg->processor = mfspr(SPRN_PVR); | 416 | _systemcfg->processor = mfspr(SPRN_PVR); |
417 | _systemcfg->platform = _machine; | ||
418 | _systemcfg->physicalMemorySize = lmb_phys_mem_size(); | ||
396 | 419 | ||
397 | DBG(" <- initialize_cache_info()\n"); | 420 | DBG(" <- initialize_cache_info()\n"); |
398 | } | 421 | } |
@@ -481,10 +504,10 @@ void __init setup_system(void) | |||
481 | printk("-----------------------------------------------------\n"); | 504 | printk("-----------------------------------------------------\n"); |
482 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); | 505 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); |
483 | printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); | 506 | printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); |
484 | printk("systemcfg = 0x%p\n", systemcfg); | 507 | printk("systemcfg = 0x%p\n", _systemcfg); |
485 | printk("systemcfg->platform = 0x%x\n", systemcfg->platform); | 508 | printk("systemcfg->platform = 0x%x\n", _systemcfg->platform); |
486 | printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount); | 509 | printk("systemcfg->processorCount = 0x%lx\n", _systemcfg->processorCount); |
487 | printk("systemcfg->physicalMemorySize = 0x%lx\n", systemcfg->physicalMemorySize); | 510 | printk("systemcfg->physicalMemorySize = 0x%lx\n", _systemcfg->physicalMemorySize); |
488 | printk("ppc64_caches.dcache_line_size = 0x%x\n", | 511 | printk("ppc64_caches.dcache_line_size = 0x%x\n", |
489 | ppc64_caches.dline_size); | 512 | ppc64_caches.dline_size); |
490 | printk("ppc64_caches.icache_line_size = 0x%x\n", | 513 | printk("ppc64_caches.icache_line_size = 0x%x\n", |
@@ -566,12 +589,12 @@ void __init setup_syscall_map(void) | |||
566 | for (i = 0; i < __NR_syscalls; i++) { | 589 | for (i = 0; i < __NR_syscalls; i++) { |
567 | if (sys_call_table[i*2] != sys_ni_syscall) { | 590 | if (sys_call_table[i*2] != sys_ni_syscall) { |
568 | count64++; | 591 | count64++; |
569 | systemcfg->syscall_map_64[i >> 5] |= | 592 | _systemcfg->syscall_map_64[i >> 5] |= |
570 | 0x80000000UL >> (i & 0x1f); | 593 | 0x80000000UL >> (i & 0x1f); |
571 | } | 594 | } |
572 | if (sys_call_table[i*2+1] != sys_ni_syscall) { | 595 | if (sys_call_table[i*2+1] != sys_ni_syscall) { |
573 | count32++; | 596 | count32++; |
574 | systemcfg->syscall_map_32[i >> 5] |= | 597 | _systemcfg->syscall_map_32[i >> 5] |= |
575 | 0x80000000UL >> (i & 0x1f); | 598 | 0x80000000UL >> (i & 0x1f); |
576 | } | 599 | } |
577 | } | 600 | } |