]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/acpi/boot.c
Merge branches 'release', 'bugzilla-6217', 'bugzilla-6629', 'bugzilla-6933', 'bugzill...
[linux-2.6] / arch / x86 / kernel / acpi / boot.c
index f28b2e251b1ddc2d392751d23dae8898daeb761b..fc8825d4b996f43fbd5f2b2fffc041982cbfd941 100644 (file)
@@ -99,7 +99,7 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 
 /*
  * The default interrupt routing model is PIC (8259).  This gets
- * overriden if IOAPICs are enumerated (below).
+ * overridden if IOAPICs are enumerated (below).
  */
 enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
 
@@ -414,8 +414,8 @@ acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
- * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
- * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
+ * ECLR1 is IRQs 0-7 (IRQ 0, 1, 2 must be 0)
+ * ECLR2 is IRQs 8-15 (IRQ 8, 13 must be 0)
  */
 
 void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
@@ -427,7 +427,7 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
        old = inb(0x4d0) | (inb(0x4d1) << 8);
 
        /*
-        * If we use ACPI to set PCI irq's, then we should clear ELCR
+        * If we use ACPI to set PCI IRQs, then we should clear ELCR
         * since we will set it correctly as we enable the PCI irq
         * routing.
         */
@@ -496,7 +496,8 @@ EXPORT_SYMBOL(acpi_register_gsi);
  *  ACPI based hotplug support for CPU
  */
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
-int acpi_map_lsapic(acpi_handle handle, int *pcpu)
+
+static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
@@ -551,6 +552,11 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
        return 0;
 }
 
+/* wrapper to silence section mismatch warning */
+int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu)
+{
+       return _acpi_map_lsapic(handle, pcpu);
+}
 EXPORT_SYMBOL(acpi_map_lsapic);
 
 int acpi_unmap_lsapic(int cpu)
@@ -581,25 +587,6 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
-static unsigned long __init
-acpi_scan_rsdp(unsigned long start, unsigned long length)
-{
-       unsigned long offset = 0;
-       unsigned long sig_len = sizeof("RSD PTR ") - 1;
-
-       /*
-        * Scan all 16-byte boundaries of the physical memory region for the
-        * RSDP signature.
-        */
-       for (offset = 0; offset < length; offset += 16) {
-               if (strncmp((char *)(phys_to_virt(start) + offset), "RSD PTR ", sig_len))
-                       continue;
-               return (start + offset);
-       }
-
-       return 0;
-}
-
 static int __init acpi_parse_sbf(struct acpi_table_header *table)
 {
        struct acpi_table_boot *sb;
@@ -637,6 +624,38 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
        }
 
        hpet_address = hpet_tbl->address.address;
+
+       /*
+        * Some broken BIOSes advertise HPET at 0x0. We really do not
+        * want to allocate a resource there.
+        */
+       if (!hpet_address) {
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: %#lx is invalid\n",
+                      hpet_tbl->id, hpet_address);
+               return 0;
+       }
+#ifdef CONFIG_X86_64
+       /*
+        * Some even more broken BIOSes advertise HPET at
+        * 0xfed0000000000000 instead of 0xfed00000. Fix it up and add
+        * some noise:
+        */
+       if (hpet_address == 0xfed0000000000000UL) {
+               if (!hpet_force_user) {
+                       printk(KERN_WARNING PREFIX "HPET id: %#x "
+                              "base: 0xfed0000000000000 is bogus\n "
+                              "try hpet=force on the kernel command line to "
+                              "fix it up to 0xfed00000.\n", hpet_tbl->id);
+                       hpet_address = 0;
+                       return 0;
+               }
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: 0xfed0000000000000 fixed up "
+                      "to 0xfed00000.\n", hpet_tbl->id);
+               hpet_address >>= 32;
+       }
+#endif
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
               hpet_tbl->id, hpet_address);
 
@@ -710,27 +729,6 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
        return 0;
 }
 
-unsigned long __init acpi_find_rsdp(void)
-{
-       unsigned long rsdp_phys = 0;
-
-       if (efi_enabled) {
-               if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
-                       return efi.acpi20;
-               else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
-                       return efi.acpi;
-       }
-       /*
-        * Scan memory looking for the RSDP signature. First search EBDA (low
-        * memory) paragraphs and then search upper memory (E0000-FFFFF).
-        */
-       rsdp_phys = acpi_scan_rsdp(0, 0x400);
-       if (!rsdp_phys)
-               rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000);
-
-       return rsdp_phys;
-}
-
 #ifdef CONFIG_X86_LOCAL_APIC
 /*
  * Parse LAPIC entries in MADT