Merge branch 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied...
[linux-drm-fsl-dcu.git] / arch / i386 / kernel / acpi / boot.c
index 5fafbacdd4cb11cf84cb62120afcd08c45da5464..280898b045b2a76f921b3867b9e415652378d4f7 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <linux/init.h>
 #include <linux/acpi.h>
+#include <linux/acpi_pmtmr.h>
 #include <linux/efi.h>
 #include <linux/cpumask.h>
 #include <linux/module.h>
@@ -92,11 +93,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 #warning ACPI uses CMPXCHG, i486 and later hardware
 #endif
 
-#define MAX_MADT_ENTRIES       256
-u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
-    {[0 ... MAX_MADT_ENTRIES - 1] = 0xff };
-EXPORT_SYMBOL(x86_acpiid_to_apicid);
-
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -166,7 +162,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
 
 #ifdef CONFIG_PCI_MMCONFIG
 /* The physical address of the MMCONFIG aperture.  Set from ACPI tables. */
-struct acpi_table_mcfg_config *pci_mmcfg_config;
+struct acpi_mcfg_allocation *pci_mmcfg_config;
 int pci_mmcfg_config_num;
 
 int __init acpi_parse_mcfg(struct acpi_table_header *header)
@@ -179,17 +175,13 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
                return -EINVAL;
 
        mcfg = (struct acpi_table_mcfg *)header;
-       if (!mcfg) {
-               printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
-               return -ENODEV;
-       }
 
        /* how many config structures do we have */
        pci_mmcfg_config_num = 0;
        i = header->length - sizeof(struct acpi_table_mcfg);
-       while (i >= sizeof(struct acpi_table_mcfg_config)) {
+       while (i >= sizeof(struct acpi_mcfg_allocation)) {
                ++pci_mmcfg_config_num;
-               i -= sizeof(struct acpi_table_mcfg_config);
+               i -= sizeof(struct acpi_mcfg_allocation);
        };
        if (pci_mmcfg_config_num == 0) {
                printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
@@ -206,7 +198,7 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
 
        memcpy(pci_mmcfg_config, &mcfg[1], config_size);
        for (i = 0; i < pci_mmcfg_config_num; ++i) {
-               if (pci_mmcfg_config[i].base_reserved) {
+               if (pci_mmcfg_config[i].address > 0xFFFFFFFF) {
                        printk(KERN_ERR PREFIX
                               "MMCONFIG not in low 4GB of memory\n");
                        kfree(pci_mmcfg_config);
@@ -220,14 +212,14 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
 #endif                         /* CONFIG_PCI_MMCONFIG */
 
 #ifdef CONFIG_X86_LOCAL_APIC
-static int __init acpi_parse_madt(struct acpi_table_header *header)
+static int __init acpi_parse_madt(struct acpi_table_header *table)
 {
        struct acpi_table_madt *madt = NULL;
 
-       if (!header|| !cpu_has_apic)
+       if (!cpu_has_apic)
                return -EINVAL;
 
-       madt = (struct acpi_table_madt *)header;
+       madt = (struct acpi_table_madt *)table;
        if (!madt) {
                printk(KERN_WARNING PREFIX "Unable to map MADT\n");
                return -ENODEV;
@@ -257,10 +249,6 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
 
        acpi_table_print_madt_entry(header);
 
-       /* Record local apic id only when enabled */
-       if (processor->lapic_flags & ACPI_MADT_ENABLED)
-               x86_acpiid_to_apicid[processor->processor_id] = processor->id;
-
        /*
         * We need to register disabled CPU as well to permit
         * counting disabled CPUs. This allows us to size
@@ -567,14 +555,6 @@ EXPORT_SYMBOL(acpi_map_lsapic);
 
 int acpi_unmap_lsapic(int cpu)
 {
-       int i;
-
-       for_each_possible_cpu(i) {
-               if (x86_acpiid_to_apicid[i] == x86_cpu_to_apicid[cpu]) {
-                       x86_acpiid_to_apicid[i] = -1;
-                       break;
-               }
-       }
        x86_cpu_to_apicid[cpu] = -1;
        cpu_clear(cpu, cpu_present_map);
        num_processors--;
@@ -636,6 +616,7 @@ static int __init acpi_parse_sbf(struct acpi_table_header *table)
 }
 
 #ifdef CONFIG_HPET_TIMER
+#include <asm/hpet.h>
 
 static int __init acpi_parse_hpet(struct acpi_table_header *table)
 {
@@ -666,24 +647,11 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
                hpet_res->end = (1 * 1024) - 1;
        }
 
-#ifdef CONFIG_X86_64
-       vxtime.hpet_address = hpet_tbl->address.address;
-
+       hpet_address = hpet_tbl->address.address;
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-               hpet_tbl->id, vxtime.hpet_address);
-
-       res_start = vxtime.hpet_address;
-#else                          /* X86 */
-       {
-               extern unsigned long hpet_address;
-
-               hpet_address = hpet_tbl->address.address;
-               printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-                       hpet_tbl->id, hpet_address);
+              hpet_tbl->id, hpet_address);
 
-               res_start = hpet_address;
-       }
-#endif                         /* X86 */
+       res_start = hpet_address;
 
        if (hpet_res) {
                hpet_res->start = res_start;
@@ -697,10 +665,6 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 #define        acpi_parse_hpet NULL
 #endif
 
-#ifdef CONFIG_X86_PM_TIMER
-extern u32 pmtmr_ioport;
-#endif
-
 static int __init acpi_parse_fadt(struct acpi_table_header *table)
 {
 
@@ -886,10 +850,9 @@ static inline int acpi_parse_madt_ioapic_entries(void)
 static void __init acpi_process_madt(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-       int count, error;
+       int error;
 
-       count = acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
-       if (count >= 1) {
+       if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
 
                /*
                 * Parse MADT LAPIC entries
@@ -911,7 +874,7 @@ static void __init acpi_process_madt(void)
                                acpi_ioapic = 1;
 
                                smp_found_config = 1;
-                               clustered_apic_check();
+                               setup_apic_routing();
                        }
                }
                if (error == -EINVAL) {
@@ -1109,7 +1072,28 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
                               "ASUS A7V ACPI BIOS Revision 1007"),
                     },
         },
-
+       {
+               /*
+                * Latest BIOS for IBM 600E (1.16) has bad pcinum
+                * for LPC bridge, which is needed for the PCI
+                * interrupt links to work. DSDT fix is in bug 5966.
+                * 2645, 2646 model numbers are shared with 600/600E/600X
+                */
+        .callback = disable_acpi_irq,
+        .ident = "IBM Thinkpad 600 Series 2645",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "2645"),
+                    },
+        },
+       {
+        .callback = disable_acpi_irq,
+        .ident = "IBM Thinkpad 600 Series 2646",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "2646"),
+                    },
+        },
        /*
         * Boxes that need ACPI PCI IRQ routing and PCI scan disabled
         */