x86, gart: fix gart detection for Fam11h CPUs
[safe/jmp/linux-2.6] / arch / x86 / kernel / summit_32.c
index c7b579d..7b98785 100644 (file)
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <asm/io.h>
-#include <asm/mach-summit/mach_mpparse.h>
+#include <asm/bios_ebda.h>
+#include <asm/summit/mpparse.h>
 
 static struct rio_table_hdr *rio_table_hdr __initdata;
 static struct scal_detail   *scal_devs[MAX_NUMNODES] __initdata;
 static struct rio_detail    *rio_devs[MAX_NUMNODES*4] __initdata;
 
+#ifndef CONFIG_X86_NUMAQ
+static int mp_bus_id_to_node[MAX_MP_BUSSES] __initdata;
+#endif
+
 static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
 {
        int twister = 0, node = 0;
@@ -47,7 +52,7 @@ static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
                }
        }
        if (i == rio_table_hdr->num_rio_dev) {
-               printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __FUNCTION__);
+               printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __func__);
                return last_bus;
        }
 
@@ -58,7 +63,7 @@ static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
                }
        }
        if (i == rio_table_hdr->num_scal_dev) {
-               printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __FUNCTION__);
+               printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __func__);
                return last_bus;
        }
 
@@ -88,7 +93,7 @@ static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
                num_buses = 9;
                break;
        default:
-               printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __FUNCTION__);
+               printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __func__);
                return last_bus;
        }
 
@@ -103,13 +108,13 @@ static int __init build_detail_arrays(void)
        int i, scal_detail_size, rio_detail_size;
 
        if (rio_table_hdr->num_scal_dev > MAX_NUMNODES) {
-               printk(KERN_WARNING "%s: MAX_NUMNODES too low!  Defined as %d, but system has %d nodes.\n", __FUNCTION__, MAX_NUMNODES, rio_table_hdr->num_scal_dev);
+               printk(KERN_WARNING "%s: MAX_NUMNODES too low!  Defined as %d, but system has %d nodes.\n", __func__, MAX_NUMNODES, rio_table_hdr->num_scal_dev);
                return 0;
        }
 
        switch (rio_table_hdr->version) {
        default:
-               printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __FUNCTION__, rio_table_hdr->version);
+               printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __func__, rio_table_hdr->version);
                return 0;
        case 2:
                scal_detail_size = 11;
@@ -138,8 +143,8 @@ void __init setup_summit(void)
        int                     i, next_wpeg, next_bus = 0;
 
        /* The pointer to the EBDA is stored in the word @ phys 0x40E(40:0E) */
-       ptr = *(unsigned short *)phys_to_virt(0x40Eul);
-       ptr = (unsigned long)phys_to_virt(ptr << 4);
+       ptr = get_bios_ebda();
+       ptr = (unsigned long)phys_to_virt(ptr);
 
        rio_table_hdr = NULL;
        offset = 0x180;
@@ -154,7 +159,7 @@ void __init setup_summit(void)
                offset = *((unsigned short *)(ptr + offset));
        }
        if (!rio_table_hdr) {
-               printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __FUNCTION__);
+               printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __func__);
                return;
        }