Merge branch 'master' of /home/sam/kernel/linux-2.6/
[pandora-kernel.git] / arch / ia64 / sn / kernel / setup.c
index 8b6d5c8..dd6bcf4 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 1999,2001-2006 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -139,7 +138,7 @@ static int __init pxm_to_nasid(int pxm)
        int i;
        int nid;
 
-       nid = pxm_to_nid_map[pxm];
+       nid = pxm_to_node(pxm);
        for (i = 0; i < num_node_memblks; i++) {
                if (node_memblk[i].nid == nid) {
                        return NASID_GET(node_memblk[i].start_paddr);
@@ -327,10 +326,11 @@ sn_scan_pcdp(void)
        struct pcdp_interface_pci if_pci;
        extern struct efi efi;
 
-       pcdp = efi.hcdp;
-       if (! pcdp)
+       if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
                return;         /* no hcdp/pcdp table */
 
+       pcdp = __va(efi.hcdp);
+
        if (pcdp->rev < 3)
                return;         /* only support PCDP (rev >= 3) */
 
@@ -457,7 +457,7 @@ void __init sn_setup(char **cmdline_p)
         * support here so we don't have to listen to failed keyboard probe
         * messages.
         */
-       if (version <= 0x0209 && acpi_kbd_controller_present) {
+       if (is_shub1() && version <= 0x0209 && acpi_kbd_controller_present) {
                printk(KERN_INFO "Disabling legacy keyboard support as prom "
                       "is too old and doesn't provide FADT\n");
                acpi_kbd_controller_present = 0;
@@ -576,7 +576,8 @@ void __init sn_cpu_init(void)
        int i;
        static int wars_have_been_checked;
 
-       if (smp_processor_id() == 0 && IS_MEDUSA()) {
+       cpuid = smp_processor_id();
+       if (cpuid == 0 && IS_MEDUSA()) {
                if (ia64_sn_is_fake_prom())
                        sn_prom_type = 2;
                else
@@ -595,6 +596,12 @@ void __init sn_cpu_init(void)
                BUG();
        sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2;
 
+       /*
+        * Don't check status. The SAL call is not supported on all PROMs
+        * but a failure is harmless.
+        */
+       (void) ia64_sn_set_cpu_number(cpuid);
+
        /*
         * The boot cpu makes this call again after platform initialization is
         * complete.
@@ -606,7 +613,6 @@ void __init sn_cpu_init(void)
                if (ia64_sn_get_prom_feature_set(i, &sn_prom_features[i]) != 0)
                        break;
 
-       cpuid = smp_processor_id();
        cpuphyid = get_sapicid();
 
        if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice))
@@ -703,7 +709,7 @@ void __init build_cnode_tables(void)
         * cnode == node for all C & M bricks.
         */
        for_each_online_node(node) {
-               nasid = pxm_to_nasid(nid_to_pxm_map[node]);
+               nasid = pxm_to_nasid(node_to_pxm(node));
                sn_cnodeid_to_nasid[node] = nasid;
                physical_node_map[nasid] = node;
        }