aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r--arch/powerpc/kernel/setup_64.c93
1 files changed, 45 insertions, 48 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 0471e843b6c..6791668213e 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -61,6 +61,8 @@
61#include <asm/xmon.h> 61#include <asm/xmon.h>
62#include <asm/udbg.h> 62#include <asm/udbg.h>
63 63
64#include "setup.h"
65
64#ifdef DEBUG 66#ifdef DEBUG
65#define DBG(fmt...) udbg_printf(fmt) 67#define DBG(fmt...) udbg_printf(fmt)
66#else 68#else
@@ -94,15 +96,6 @@ extern void udbg_init_maple_realmode(void);
94 do { udbg_putc = call_rtas_display_status_delay; } while(0) 96 do { udbg_putc = call_rtas_display_status_delay; } while(0)
95#endif 97#endif
96 98
97/* extern void *stab; */
98extern unsigned long klimit;
99
100extern void mm_init_ppc64(void);
101extern void stab_initialize(unsigned long stab);
102extern void htab_initialize(void);
103extern void early_init_devtree(void *flat_dt);
104extern void unflatten_device_tree(void);
105
106int have_of = 1; 99int have_of = 1;
107int boot_cpuid = 0; 100int boot_cpuid = 0;
108int boot_cpuid_phys = 0; 101int boot_cpuid_phys = 0;
@@ -254,11 +247,10 @@ void __init early_setup(unsigned long dt_ptr)
254 * Iterate all ppc_md structures until we find the proper 247 * Iterate all ppc_md structures until we find the proper
255 * one for the current machine type 248 * one for the current machine type
256 */ 249 */
257 DBG("Probing machine type for platform %x...\n", 250 DBG("Probing machine type for platform %x...\n", _machine);
258 systemcfg->platform);
259 251
260 for (mach = machines; *mach; mach++) { 252 for (mach = machines; *mach; mach++) {
261 if ((*mach)->probe(systemcfg->platform)) 253 if ((*mach)->probe(_machine))
262 break; 254 break;
263 } 255 }
264 /* What can we do if we didn't find ? */ 256 /* What can we do if we didn't find ? */
@@ -290,6 +282,28 @@ void __init early_setup(unsigned long dt_ptr)
290 DBG(" <- early_setup()\n"); 282 DBG(" <- early_setup()\n");
291} 283}
292 284
285#ifdef CONFIG_SMP
286void early_setup_secondary(void)
287{
288 struct paca_struct *lpaca = get_paca();
289
290 /* Mark enabled in PACA */
291 lpaca->proc_enabled = 0;
292
293 /* Initialize hash table for that CPU */
294 htab_initialize_secondary();
295
296 /* Initialize STAB/SLB. We use a virtual address as it works
297 * in real mode on pSeries and we want a virutal address on
298 * iSeries anyway
299 */
300 if (cpu_has_feature(CPU_FTR_SLB))
301 slb_initialize();
302 else
303 stab_initialize(lpaca->stab_addr);
304}
305
306#endif /* CONFIG_SMP */
293 307
294#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) 308#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
295void smp_release_cpus(void) 309void smp_release_cpus(void)
@@ -315,7 +329,8 @@ void smp_release_cpus(void)
315#endif /* CONFIG_SMP || CONFIG_KEXEC */ 329#endif /* CONFIG_SMP || CONFIG_KEXEC */
316 330
317/* 331/*
318 * Initialize some remaining members of the ppc64_caches and systemcfg structures 332 * Initialize some remaining members of the ppc64_caches and systemcfg
333 * structures
319 * (at least until we get rid of them completely). This is mostly some 334 * (at least until we get rid of them completely). This is mostly some
320 * cache informations about the CPU that will be used by cache flush 335 * cache informations about the CPU that will be used by cache flush
321 * routines and/or provided to userland 336 * routines and/or provided to userland
@@ -340,7 +355,7 @@ static void __init initialize_cache_info(void)
340 const char *dc, *ic; 355 const char *dc, *ic;
341 356
342 /* Then read cache informations */ 357 /* Then read cache informations */
343 if (systemcfg->platform == PLATFORM_POWERMAC) { 358 if (_machine == PLATFORM_POWERMAC) {
344 dc = "d-cache-block-size"; 359 dc = "d-cache-block-size";
345 ic = "i-cache-block-size"; 360 ic = "i-cache-block-size";
346 } else { 361 } else {
@@ -360,8 +375,8 @@ static void __init initialize_cache_info(void)
360 DBG("Argh, can't find dcache properties ! " 375 DBG("Argh, can't find dcache properties ! "
361 "sizep: %p, lsizep: %p\n", sizep, lsizep); 376 "sizep: %p, lsizep: %p\n", sizep, lsizep);
362 377
363 systemcfg->dcache_size = ppc64_caches.dsize = size; 378 _systemcfg->dcache_size = ppc64_caches.dsize = size;
364 systemcfg->dcache_line_size = 379 _systemcfg->dcache_line_size =
365 ppc64_caches.dline_size = lsize; 380 ppc64_caches.dline_size = lsize;
366 ppc64_caches.log_dline_size = __ilog2(lsize); 381 ppc64_caches.log_dline_size = __ilog2(lsize);
367 ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; 382 ppc64_caches.dlines_per_page = PAGE_SIZE / lsize;
@@ -378,8 +393,8 @@ static void __init initialize_cache_info(void)
378 DBG("Argh, can't find icache properties ! " 393 DBG("Argh, can't find icache properties ! "
379 "sizep: %p, lsizep: %p\n", sizep, lsizep); 394 "sizep: %p, lsizep: %p\n", sizep, lsizep);
380 395
381 systemcfg->icache_size = ppc64_caches.isize = size; 396 _systemcfg->icache_size = ppc64_caches.isize = size;
382 systemcfg->icache_line_size = 397 _systemcfg->icache_line_size =
383 ppc64_caches.iline_size = lsize; 398 ppc64_caches.iline_size = lsize;
384 ppc64_caches.log_iline_size = __ilog2(lsize); 399 ppc64_caches.log_iline_size = __ilog2(lsize);
385 ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; 400 ppc64_caches.ilines_per_page = PAGE_SIZE / lsize;
@@ -387,10 +402,12 @@ static void __init initialize_cache_info(void)
387 } 402 }
388 403
389 /* Add an eye catcher and the systemcfg layout version number */ 404 /* Add an eye catcher and the systemcfg layout version number */
390 strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); 405 strcpy(_systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
391 systemcfg->version.major = SYSTEMCFG_MAJOR; 406 _systemcfg->version.major = SYSTEMCFG_MAJOR;
392 systemcfg->version.minor = SYSTEMCFG_MINOR; 407 _systemcfg->version.minor = SYSTEMCFG_MINOR;
393 systemcfg->processor = mfspr(SPRN_PVR); 408 _systemcfg->processor = mfspr(SPRN_PVR);
409 _systemcfg->platform = _machine;
410 _systemcfg->physicalMemorySize = lmb_phys_mem_size();
394 411
395 DBG(" <- initialize_cache_info()\n"); 412 DBG(" <- initialize_cache_info()\n");
396} 413}
@@ -479,10 +496,10 @@ void __init setup_system(void)
479 printk("-----------------------------------------------------\n"); 496 printk("-----------------------------------------------------\n");
480 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 497 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
481 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); 498 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
482 printk("systemcfg = 0x%p\n", systemcfg); 499 printk("systemcfg = 0x%p\n", _systemcfg);
483 printk("systemcfg->platform = 0x%x\n", systemcfg->platform); 500 printk("systemcfg->platform = 0x%x\n", _systemcfg->platform);
484 printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount); 501 printk("systemcfg->processorCount = 0x%lx\n", _systemcfg->processorCount);
485 printk("systemcfg->physicalMemorySize = 0x%lx\n", systemcfg->physicalMemorySize); 502 printk("systemcfg->physicalMemorySize = 0x%lx\n", _systemcfg->physicalMemorySize);
486 printk("ppc64_caches.dcache_line_size = 0x%x\n", 503 printk("ppc64_caches.dcache_line_size = 0x%x\n",
487 ppc64_caches.dline_size); 504 ppc64_caches.dline_size);
488 printk("ppc64_caches.icache_line_size = 0x%x\n", 505 printk("ppc64_caches.icache_line_size = 0x%x\n",
@@ -564,12 +581,12 @@ void __init setup_syscall_map(void)
564 for (i = 0; i < __NR_syscalls; i++) { 581 for (i = 0; i < __NR_syscalls; i++) {
565 if (sys_call_table[i*2] != sys_ni_syscall) { 582 if (sys_call_table[i*2] != sys_ni_syscall) {
566 count64++; 583 count64++;
567 systemcfg->syscall_map_64[i >> 5] |= 584 _systemcfg->syscall_map_64[i >> 5] |=
568 0x80000000UL >> (i & 0x1f); 585 0x80000000UL >> (i & 0x1f);
569 } 586 }
570 if (sys_call_table[i*2+1] != sys_ni_syscall) { 587 if (sys_call_table[i*2+1] != sys_ni_syscall) {
571 count32++; 588 count32++;
572 systemcfg->syscall_map_32[i >> 5] |= 589 _systemcfg->syscall_map_32[i >> 5] |=
573 0x80000000UL >> (i & 0x1f); 590 0x80000000UL >> (i & 0x1f);
574 } 591 }
575 } 592 }
@@ -858,26 +875,6 @@ int check_legacy_ioport(unsigned long base_port)
858} 875}
859EXPORT_SYMBOL(check_legacy_ioport); 876EXPORT_SYMBOL(check_legacy_ioport);
860 877
861#ifdef CONFIG_XMON
862static int __init early_xmon(char *p)
863{
864 /* ensure xmon is enabled */
865 if (p) {
866 if (strncmp(p, "on", 2) == 0)
867 xmon_init(1);
868 if (strncmp(p, "off", 3) == 0)
869 xmon_init(0);
870 if (strncmp(p, "early", 5) != 0)
871 return 0;
872 }
873 xmon_init(1);
874 debugger(NULL);
875
876 return 0;
877}
878early_param("xmon", early_xmon);
879#endif
880
881void cpu_die(void) 878void cpu_die(void)
882{ 879{
883 if (ppc_md.cpu_die) 880 if (ppc_md.cpu_die)