| 1 |
--- linux-2.6.20/arch/ia64/kernel/quirks.c 1969-12-31 19:00:00.000000000 -0500
|
| 2 |
+++ linux-2.6.20_fix/arch/ia64/kernel/quirks.c 2007-02-13 13:56:34.000000000 -0500
|
| 3 |
@@ -0,0 +1,45 @@
|
| 4 |
+/*
|
| 5 |
+ * This file contains work-arounds for ia64 platform bugs.
|
| 6 |
+ */
|
| 7 |
+#include <linux/pci.h>
|
| 8 |
+
|
| 9 |
+/*
|
| 10 |
+ * quirk_intel_ide_controller: If an ide/ata controller is
|
| 11 |
+ * at legacy mode, BIOS might initiates BAR(bar 0~3 and 5)
|
| 12 |
+ * with incorrect value. This quirk will reset the incorrect
|
| 13 |
+ * value to 0.
|
| 14 |
+ */
|
| 15 |
+static void __devinit quirk_intel_ide_controller(struct pci_dev *dev)
|
| 16 |
+{
|
| 17 |
+ unsigned int pos;
|
| 18 |
+ struct resource *res;
|
| 19 |
+ int fixed = 0;
|
| 20 |
+ u8 tmp8;
|
| 21 |
+
|
| 22 |
+ if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
|
| 23 |
+ return;
|
| 24 |
+
|
| 25 |
+ /* TODO: What if one channel is in native mode ... */
|
| 26 |
+ pci_read_config_byte(dev, PCI_CLASS_PROG, &tmp8);
|
| 27 |
+ if ((tmp8 & 5) == 5)
|
| 28 |
+ return;
|
| 29 |
+
|
| 30 |
+ for( pos = 0; pos < 6; pos ++ ) {
|
| 31 |
+ res = &dev->resource[pos];
|
| 32 |
+ if (!(res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
|
| 33 |
+ continue;
|
| 34 |
+
|
| 35 |
+ if (!res->start && res->end) {
|
| 36 |
+ res->start = res->end = 0;
|
| 37 |
+ res->flags = 0;
|
| 38 |
+ fixed = 1;
|
| 39 |
+ }
|
| 40 |
+ }
|
| 41 |
+ if (fixed)
|
| 42 |
+ printk(KERN_WARNING
|
| 43 |
+ "PCI device %s: BIOS resource configuration fixed.\n",
|
| 44 |
+ pci_name(dev));
|
| 45 |
+}
|
| 46 |
+
|
| 47 |
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_11, quirk_intel_ide_controller);
|
| 48 |
+
|
| 49 |
--- linux-2.6.21.noarch/arch/ia64/kernel/Makefile~ 2007-05-27 23:23:36.000000000 -0400
|
| 50 |
+++ linux-2.6.21.noarch/arch/ia64/kernel/Makefile 2007-05-27 23:23:48.000000000 -0400
|
| 51 |
@@ -33,6 +33,7 @@ obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
| 52 |
obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
|
| 53 |
obj-$(CONFIG_AUDIT) += audit.o
|
| 54 |
obj-$(CONFIG_PCI_MSI) += msi_ia64.o
|
| 55 |
+obj-$(CONFIG_PCI) += quirks.o
|
| 56 |
mca_recovery-y += mca_drv.o mca_drv_asm.o
|
| 57 |
obj-$(CONFIG_IA64_MC_ERR_INJECT)+= err_inject.o
|
| 58 |
|