]> git.pld-linux.org Git - packages/kernel.git/blame - piix-ide-fix.patch
- obsolete
[packages/kernel.git] / piix-ide-fix.patch
CommitLineData
6d3f3054 1--- drivers/ide/ide-pci.c Wed Aug 7 19:28:13 2002
2+++ drivers/ide/ide-pci.c.old Wed Sep 11 13:42:15 2002
3@@ -951,6 +951,42 @@
4 ide_setup_pci_device(dev2, d2);
5 }
6
7+inline void ide_register_xp_fix(struct pci_dev *dev)
8+{
9+ int i;
10+ unsigned short cmd;
11+ unsigned long flags;
12+ unsigned long base_address[4] = { 0x1f0, 0x3f4, 0x170, 0x374 };
13+
14+ local_irq_save(flags);
15+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
16+ pci_write_config_word(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO);
17+ for (i=0; i<4; i++) {
18+ dev->resource[i].start = 0;
19+ dev->resource[i].end = 0;
20+ dev->resource[i].flags = 0;
21+ }
22+ for (i=0; i<4; i++) {
23+ dev->resource[i].start = base_address[i];
24+ dev->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
25+ pci_write_config_dword(dev,
26+ (PCI_BASE_ADDRESS_0 + (i * 4)),
27+ dev->resource[i].start);
28+ }
29+ pci_write_config_word(dev, PCI_COMMAND, cmd);
30+ local_irq_restore(flags);
31+}
32+
33+void __init fixup_device_piix (struct pci_dev *dev, ide_pci_device_t *d)
34+{
35+ if (dev->resource[0].start != 0x01F1)
36+ ide_register_xp_fix(dev);
37+ printk("%s: IDE controller on PCI bus %02x dev %02x\n",
38+ d->name, dev->bus->number, dev->devfn);
39+ ide_setup_pci_device(dev, d);
40+
41+}
42+
43 /*
44 * ide_scan_pcibus() gets invoked at boot time from ide.c.
45 * It finds all PCI IDE controllers and calls ide_setup_pci_device for them.
46@@ -977,6 +1013,8 @@
47 hpt366_device_order_fixup(dev, d);
48 else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20270))
49 pdc20270_device_order_fixup(dev, d);
50+ else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_ICH3M))
51+ fixup_device_piix(dev, d);
52 else if (!IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL) || (dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
53 if (IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL))
54 printk("%s: unknown IDE controller on PCI bus %02x device %02x, VID=%04x, DID=%04x\n",
This page took 0.612095 seconds and 4 git commands to generate.