aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/kernel/setup.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-06-15 17:06:48 -0400
committerTony Luck <tony.luck@intel.com>2005-06-15 17:06:48 -0400
commitf2cbb4f01936a3e4225692e03b084b78c56d386d (patch)
treef89f3d8baa250589a38a4dd2df56f84cddae3c76 /arch/ia64/sn/kernel/setup.c
parent325a479c4c110db278ef3361460a48c4093252cc (diff)
parent1016888fb69662936b32ab767c7419a3be9a69d3 (diff)
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'arch/ia64/sn/kernel/setup.c')
-rw-r--r--arch/ia64/sn/kernel/setup.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index d35f2a6f9c94..44bfc7f318cb 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/config.h> 9#include <linux/config.h>
@@ -73,6 +73,12 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second);
73DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); 73DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
74EXPORT_PER_CPU_SYMBOL(__sn_hub_info); 74EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
75 75
76DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
77EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);
78
79DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
80EXPORT_PER_CPU_SYMBOL(__sn_nodepda);
81
76partid_t sn_partid = -1; 82partid_t sn_partid = -1;
77EXPORT_SYMBOL(sn_partid); 83EXPORT_SYMBOL(sn_partid);
78char sn_system_serial_number_string[128]; 84char sn_system_serial_number_string[128];
@@ -216,7 +222,7 @@ void __init early_sn_setup(void)
216 222
217extern int platform_intr_list[]; 223extern int platform_intr_list[];
218extern nasid_t master_nasid; 224extern nasid_t master_nasid;
219static int shub_1_1_found __initdata; 225static int __initdata shub_1_1_found = 0;
220 226
221/* 227/*
222 * sn_check_for_wars 228 * sn_check_for_wars
@@ -245,7 +251,7 @@ static void __init sn_check_for_wars(void)
245 } else { 251 } else {
246 for_each_online_node(cnode) { 252 for_each_online_node(cnode) {
247 if (is_shub_1_1(cnodeid_to_nasid(cnode))) 253 if (is_shub_1_1(cnodeid_to_nasid(cnode)))
248 sn_hub_info->shub_1_1_found = 1; 254 shub_1_1_found = 1;
249 } 255 }
250 } 256 }
251} 257}
@@ -265,6 +271,8 @@ void __init sn_setup(char **cmdline_p)
265 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); 271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();
266 extern void sn_cpu_init(void); 272 extern void sn_cpu_init(void);
267 273
274 ia64_sn_plat_set_error_handling_features();
275
268 /* 276 /*
269 * If the generic code has enabled vga console support - lets 277 * If the generic code has enabled vga console support - lets
270 * get rid of it again. This is a kludge for the fact that ACPI 278 * get rid of it again. This is a kludge for the fact that ACPI
@@ -373,11 +381,11 @@ static void __init sn_init_pdas(char **cmdline_p)
373{ 381{
374 cnodeid_t cnode; 382 cnodeid_t cnode;
375 383
376 memset(pda->cnodeid_to_nasid_table, -1, 384 memset(sn_cnodeid_to_nasid, -1,
377 sizeof(pda->cnodeid_to_nasid_table)); 385 sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
378 for_each_online_node(cnode) 386 for_each_online_node(cnode)
379 pda->cnodeid_to_nasid_table[cnode] = 387 sn_cnodeid_to_nasid[cnode] =
380 pxm_to_nasid(nid_to_pxm_map[cnode]); 388 pxm_to_nasid(nid_to_pxm_map[cnode]);
381 389
382 numionodes = num_online_nodes(); 390 numionodes = num_online_nodes();
383 scan_for_ionodes(); 391 scan_for_ionodes();
@@ -477,7 +485,8 @@ void __init sn_cpu_init(void)
477 485
478 cnode = nasid_to_cnodeid(nasid); 486 cnode = nasid_to_cnodeid(nasid);
479 487
480 pda->p_nodepda = nodepdaindr[cnode]; 488 sn_nodepda = nodepdaindr[cnode];
489
481 pda->led_address = 490 pda->led_address =
482 (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); 491 (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT));
483 pda->led_state = LED_ALWAYS_SET; 492 pda->led_state = LED_ALWAYS_SET;
@@ -486,15 +495,18 @@ void __init sn_cpu_init(void)
486 pda->idle_flag = 0; 495 pda->idle_flag = 0;
487 496
488 if (cpuid != 0) { 497 if (cpuid != 0) {
489 memcpy(pda->cnodeid_to_nasid_table, 498 /* copy cpu 0's sn_cnodeid_to_nasid table to this cpu's */
490 pdacpu(0)->cnodeid_to_nasid_table, 499 memcpy(sn_cnodeid_to_nasid,
491 sizeof(pda->cnodeid_to_nasid_table)); 500 (&per_cpu(__sn_cnodeid_to_nasid, 0)),
501 sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
492 } 502 }
493 503
494 /* 504 /*
495 * Check for WARs. 505 * Check for WARs.
496 * Only needs to be done once, on BSP. 506 * Only needs to be done once, on BSP.
497 * Has to be done after loop above, because it uses pda.cnodeid_to_nasid_table[i]. 507 * Has to be done after loop above, because it uses this cpu's
508 * sn_cnodeid_to_nasid table which was just initialized if this
509 * isn't cpu 0.
498 * Has to be done before assignment below. 510 * Has to be done before assignment below.
499 */ 511 */
500 if (!wars_have_been_checked) { 512 if (!wars_have_been_checked) {
@@ -580,8 +592,7 @@ static void __init scan_for_ionodes(void)
580 brd = find_lboard_any(brd, KLTYPE_SNIA); 592 brd = find_lboard_any(brd, KLTYPE_SNIA);
581 593
582 while (brd) { 594 while (brd) {
583 pda->cnodeid_to_nasid_table[numionodes] = 595 sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid;
584 brd->brd_nasid;
585 physical_node_map[brd->brd_nasid] = numionodes; 596 physical_node_map[brd->brd_nasid] = numionodes;
586 root_lboard[numionodes] = brd; 597 root_lboard[numionodes] = brd;
587 numionodes++; 598 numionodes++;
@@ -602,8 +613,7 @@ static void __init scan_for_ionodes(void)
602 root_lboard[nasid_to_cnodeid(nasid)], 613 root_lboard[nasid_to_cnodeid(nasid)],
603 KLTYPE_TIO); 614 KLTYPE_TIO);
604 while (brd) { 615 while (brd) {
605 pda->cnodeid_to_nasid_table[numionodes] = 616 sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid;
606 brd->brd_nasid;
607 physical_node_map[brd->brd_nasid] = numionodes; 617 physical_node_map[brd->brd_nasid] = numionodes;
608 root_lboard[numionodes] = brd; 618 root_lboard[numionodes] = brd;
609 numionodes++; 619 numionodes++;
@@ -614,7 +624,6 @@ static void __init scan_for_ionodes(void)
614 brd = find_lboard_any(brd, KLTYPE_TIO); 624 brd = find_lboard_any(brd, KLTYPE_TIO);
615 } 625 }
616 } 626 }
617
618} 627}
619 628
620int 629int
@@ -623,7 +632,8 @@ nasid_slice_to_cpuid(int nasid, int slice)
623 long cpu; 632 long cpu;
624 633
625 for (cpu=0; cpu < NR_CPUS; cpu++) 634 for (cpu=0; cpu < NR_CPUS; cpu++)
626 if (nodepda->phys_cpuid[cpu].nasid == nasid && nodepda->phys_cpuid[cpu].slice == slice) 635 if (cpuid_to_nasid(cpu) == nasid &&
636 cpuid_to_slice(cpu) == slice)
627 return cpu; 637 return cpu;
628 638
629 return -1; 639 return -1;