diff options
Diffstat (limited to 'arch/ia64/sn/kernel/setup.c')
-rw-r--r-- | arch/ia64/sn/kernel/setup.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 44bfc7f318cb..22e10d282c7f 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/machvec.h> | 36 | #include <asm/machvec.h> |
37 | #include <asm/system.h> | 37 | #include <asm/system.h> |
38 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
39 | #include <asm/vga.h> | ||
39 | #include <asm/sn/arch.h> | 40 | #include <asm/sn/arch.h> |
40 | #include <asm/sn/addrs.h> | 41 | #include <asm/sn/addrs.h> |
41 | #include <asm/sn/pda.h> | 42 | #include <asm/sn/pda.h> |
@@ -95,6 +96,7 @@ u8 sn_coherency_id; | |||
95 | EXPORT_SYMBOL(sn_coherency_id); | 96 | EXPORT_SYMBOL(sn_coherency_id); |
96 | u8 sn_region_size; | 97 | u8 sn_region_size; |
97 | EXPORT_SYMBOL(sn_region_size); | 98 | EXPORT_SYMBOL(sn_region_size); |
99 | int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */ | ||
98 | 100 | ||
99 | short physical_node_map[MAX_PHYSNODE_ID]; | 101 | short physical_node_map[MAX_PHYSNODE_ID]; |
100 | 102 | ||
@@ -273,14 +275,17 @@ void __init sn_setup(char **cmdline_p) | |||
273 | 275 | ||
274 | ia64_sn_plat_set_error_handling_features(); | 276 | ia64_sn_plat_set_error_handling_features(); |
275 | 277 | ||
278 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) | ||
276 | /* | 279 | /* |
277 | * If the generic code has enabled vga console support - lets | 280 | * If there was a primary vga adapter identified through the |
278 | * get rid of it again. This is a kludge for the fact that ACPI | 281 | * EFI PCDP table, make it the preferred console. Otherwise |
279 | * currtently has no way of informing us if legacy VGA is available | 282 | * zero out conswitchp. |
280 | * or not. | ||
281 | */ | 283 | */ |
282 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) | 284 | |
283 | if (conswitchp == &vga_con) { | 285 | if (vga_console_membase) { |
286 | /* usable vga ... make tty0 the preferred default console */ | ||
287 | add_preferred_console("tty", 0, NULL); | ||
288 | } else { | ||
284 | printk(KERN_DEBUG "SGI: Disabling VGA console\n"); | 289 | printk(KERN_DEBUG "SGI: Disabling VGA console\n"); |
285 | #ifdef CONFIG_DUMMY_CONSOLE | 290 | #ifdef CONFIG_DUMMY_CONSOLE |
286 | conswitchp = &dummy_con; | 291 | conswitchp = &dummy_con; |
@@ -350,7 +355,7 @@ void __init sn_setup(char **cmdline_p) | |||
350 | 355 | ||
351 | ia64_mark_idle = &snidle; | 356 | ia64_mark_idle = &snidle; |
352 | 357 | ||
353 | /* | 358 | /* |
354 | * For the bootcpu, we do this here. All other cpus will make the | 359 | * For the bootcpu, we do this here. All other cpus will make the |
355 | * call as part of cpu_init in slave cpu initialization. | 360 | * call as part of cpu_init in slave cpu initialization. |
356 | */ | 361 | */ |
@@ -397,7 +402,7 @@ static void __init sn_init_pdas(char **cmdline_p) | |||
397 | nodepdaindr[cnode] = | 402 | nodepdaindr[cnode] = |
398 | alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); | 403 | alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); |
399 | memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); | 404 | memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); |
400 | memset(nodepdaindr[cnode]->phys_cpuid, -1, | 405 | memset(nodepdaindr[cnode]->phys_cpuid, -1, |
401 | sizeof(nodepdaindr[cnode]->phys_cpuid)); | 406 | sizeof(nodepdaindr[cnode]->phys_cpuid)); |
402 | } | 407 | } |
403 | 408 | ||
@@ -427,7 +432,7 @@ static void __init sn_init_pdas(char **cmdline_p) | |||
427 | } | 432 | } |
428 | 433 | ||
429 | /* | 434 | /* |
430 | * Initialize the per node hubdev. This includes IO Nodes and | 435 | * Initialize the per node hubdev. This includes IO Nodes and |
431 | * headless/memless nodes. | 436 | * headless/memless nodes. |
432 | */ | 437 | */ |
433 | for (cnode = 0; cnode < numionodes; cnode++) { | 438 | for (cnode = 0; cnode < numionodes; cnode++) { |
@@ -455,6 +460,14 @@ void __init sn_cpu_init(void) | |||
455 | int i; | 460 | int i; |
456 | static int wars_have_been_checked; | 461 | static int wars_have_been_checked; |
457 | 462 | ||
463 | if (smp_processor_id() == 0 && IS_MEDUSA()) { | ||
464 | if (ia64_sn_is_fake_prom()) | ||
465 | sn_prom_type = 2; | ||
466 | else | ||
467 | sn_prom_type = 1; | ||
468 | printk("Running on medusa with %s PROM\n", (sn_prom_type == 1) ? "real" : "fake"); | ||
469 | } | ||
470 | |||
458 | memset(pda, 0, sizeof(pda)); | 471 | memset(pda, 0, sizeof(pda)); |
459 | if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, | 472 | if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, |
460 | &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, | 473 | &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, |
@@ -520,7 +533,7 @@ void __init sn_cpu_init(void) | |||
520 | */ | 533 | */ |
521 | { | 534 | { |
522 | u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; | 535 | u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; |
523 | u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, | 536 | u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, |
524 | SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; | 537 | SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; |
525 | u64 *pio; | 538 | u64 *pio; |
526 | pio = is_shub1() ? pio1 : pio2; | 539 | pio = is_shub1() ? pio1 : pio2; |
@@ -552,6 +565,10 @@ static void __init scan_for_ionodes(void) | |||
552 | int nasid = 0; | 565 | int nasid = 0; |
553 | lboard_t *brd; | 566 | lboard_t *brd; |
554 | 567 | ||
568 | /* fakeprom does not support klgraph */ | ||
569 | if (IS_RUNNING_ON_FAKE_PROM()) | ||
570 | return; | ||
571 | |||
555 | /* Setup ionodes with memory */ | 572 | /* Setup ionodes with memory */ |
556 | for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { | 573 | for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { |
557 | char *klgraph_header; | 574 | char *klgraph_header; |
@@ -563,8 +580,6 @@ static void __init scan_for_ionodes(void) | |||
563 | cnodeid = -1; | 580 | cnodeid = -1; |
564 | klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); | 581 | klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); |
565 | if (!klgraph_header) { | 582 | if (!klgraph_header) { |
566 | if (IS_RUNNING_ON_SIMULATOR()) | ||
567 | continue; | ||
568 | BUG(); /* All nodes must have klconfig tables! */ | 583 | BUG(); /* All nodes must have klconfig tables! */ |
569 | } | 584 | } |
570 | cnodeid = nasid_to_cnodeid(nasid); | 585 | cnodeid = nasid_to_cnodeid(nasid); |
@@ -630,8 +645,8 @@ int | |||
630 | nasid_slice_to_cpuid(int nasid, int slice) | 645 | nasid_slice_to_cpuid(int nasid, int slice) |
631 | { | 646 | { |
632 | long cpu; | 647 | long cpu; |
633 | 648 | ||
634 | for (cpu=0; cpu < NR_CPUS; cpu++) | 649 | for (cpu=0; cpu < NR_CPUS; cpu++) |
635 | if (cpuid_to_nasid(cpu) == nasid && | 650 | if (cpuid_to_nasid(cpu) == nasid && |
636 | cpuid_to_slice(cpu) == slice) | 651 | cpuid_to_slice(cpu) == slice) |
637 | return cpu; | 652 | return cpu; |