aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/kernel/setup.c
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2005-05-10 11:01:00 -0400
committerTony Luck <tony.luck@intel.com>2005-06-28 12:45:45 -0400
commit71a5d027c90dd7e14ddaaf22358ff5138ba89ec9 (patch)
treec29d3d858532c651f686cccca286336232b788fd /arch/ia64/sn/kernel/setup.c
parent8e4641b3ee8073a46995cf97e0875df25b88d776 (diff)
[IA64-SGI] - new macros for SGI SN simulator
This patch changes some macros that are used when running kernel on the SGI simulator. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn/kernel/setup.c')
-rw-r--r--arch/ia64/sn/kernel/setup.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 3e5ba34ac2ef..22e10d282c7f 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -96,6 +96,7 @@ u8 sn_coherency_id;
96EXPORT_SYMBOL(sn_coherency_id); 96EXPORT_SYMBOL(sn_coherency_id);
97u8 sn_region_size; 97u8 sn_region_size;
98EXPORT_SYMBOL(sn_region_size); 98EXPORT_SYMBOL(sn_region_size);
99int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
99 100
100short physical_node_map[MAX_PHYSNODE_ID]; 101short physical_node_map[MAX_PHYSNODE_ID];
101 102
@@ -354,7 +355,7 @@ void __init sn_setup(char **cmdline_p)
354 355
355 ia64_mark_idle = &snidle; 356 ia64_mark_idle = &snidle;
356 357
357 /* 358 /*
358 * 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
359 * call as part of cpu_init in slave cpu initialization. 360 * call as part of cpu_init in slave cpu initialization.
360 */ 361 */
@@ -401,7 +402,7 @@ static void __init sn_init_pdas(char **cmdline_p)
401 nodepdaindr[cnode] = 402 nodepdaindr[cnode] =
402 alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); 403 alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
403 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); 404 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
404 memset(nodepdaindr[cnode]->phys_cpuid, -1, 405 memset(nodepdaindr[cnode]->phys_cpuid, -1,
405 sizeof(nodepdaindr[cnode]->phys_cpuid)); 406 sizeof(nodepdaindr[cnode]->phys_cpuid));
406 } 407 }
407 408
@@ -431,7 +432,7 @@ static void __init sn_init_pdas(char **cmdline_p)
431 } 432 }
432 433
433 /* 434 /*
434 * Initialize the per node hubdev. This includes IO Nodes and 435 * Initialize the per node hubdev. This includes IO Nodes and
435 * headless/memless nodes. 436 * headless/memless nodes.
436 */ 437 */
437 for (cnode = 0; cnode < numionodes; cnode++) { 438 for (cnode = 0; cnode < numionodes; cnode++) {
@@ -459,6 +460,14 @@ void __init sn_cpu_init(void)
459 int i; 460 int i;
460 static int wars_have_been_checked; 461 static int wars_have_been_checked;
461 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
462 memset(pda, 0, sizeof(pda)); 471 memset(pda, 0, sizeof(pda));
463 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,
464 &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, 473 &sn_system_size, &sn_sharing_domain_size, &sn_partition_id,
@@ -524,7 +533,7 @@ void __init sn_cpu_init(void)
524 */ 533 */
525 { 534 {
526 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};
527 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,
528 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; 537 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3};
529 u64 *pio; 538 u64 *pio;
530 pio = is_shub1() ? pio1 : pio2; 539 pio = is_shub1() ? pio1 : pio2;
@@ -556,6 +565,10 @@ static void __init scan_for_ionodes(void)
556 int nasid = 0; 565 int nasid = 0;
557 lboard_t *brd; 566 lboard_t *brd;
558 567
568 /* fakeprom does not support klgraph */
569 if (IS_RUNNING_ON_FAKE_PROM())
570 return;
571
559 /* Setup ionodes with memory */ 572 /* Setup ionodes with memory */
560 for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { 573 for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
561 char *klgraph_header; 574 char *klgraph_header;
@@ -567,8 +580,6 @@ static void __init scan_for_ionodes(void)
567 cnodeid = -1; 580 cnodeid = -1;
568 klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); 581 klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid));
569 if (!klgraph_header) { 582 if (!klgraph_header) {
570 if (IS_RUNNING_ON_SIMULATOR())
571 continue;
572 BUG(); /* All nodes must have klconfig tables! */ 583 BUG(); /* All nodes must have klconfig tables! */
573 } 584 }
574 cnodeid = nasid_to_cnodeid(nasid); 585 cnodeid = nasid_to_cnodeid(nasid);
@@ -634,8 +645,8 @@ int
634nasid_slice_to_cpuid(int nasid, int slice) 645nasid_slice_to_cpuid(int nasid, int slice)
635{ 646{
636 long cpu; 647 long cpu;
637 648
638 for (cpu=0; cpu < NR_CPUS; cpu++) 649 for (cpu=0; cpu < NR_CPUS; cpu++)
639 if (cpuid_to_nasid(cpu) == nasid && 650 if (cpuid_to_nasid(cpu) == nasid &&
640 cpuid_to_slice(cpu) == slice) 651 cpuid_to_slice(cpu) == slice)
641 return cpu; 652 return cpu;