[PATCH] Add libata support for Intel Poulsbo chipset

Amit Kucheria amit at ubuntu.com
Tue Aug 14 08:07:13 UTC 2007


On 8/13/07, Du, Alek <alek.du at intel.com> wrote:
> Amit, Ben and kernel team,
>
> Attached is the patch for libata support on Intel Poulsbo chipset, it is
> against ubuntu-gutsy git tree.
>

commit fecfc5a40a78e64ad9098baea15ef852127c24cc
Author: Alek Du <alek.du at intel.com>
Date:   Sun Aug 12 23:14:37 2007 -0400

    Add Intel Poulsbo chipset Libata support

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 7a7fac7..97b0df1 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -632,7 +632,14 @@ static int piix_pata_prereset(struct ata_port
*ap, unsigned long deadline)
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);

        if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
-               return -ENOENT;
+/* Although a PCI quirk function is added to ~/drivers/pci/quirks.c to
+ * handle that, but currently, the quirk function won't work because
+ * Poulsbo chipset regards these "reserved" registers read 00 and wrote no
+ * effect
+ */

Please add a message such as "Temporary workaround" to the patch
comment since I assume this part will be reverted once the new
stepping fixes the problems.

+               if (pdev->vendor != PCI_VENDOR_ID_INTEL ||
+                       pdev->device != PCI_DEVICE_ID_INTEL_POULSBO_IDE)
+                       return -ENOENT;
        return ata_std_prereset(ap, deadline);
 }

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 9fd27ae..1fb10a7 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1730,3 +1730,35 @@ static void __devinit
quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
                        quirk_nvidia_ck804_msi_ht_cap);
 #endif /* CONFIG_PCI_MSI */
+
+/* The Intel Poulsbo chipset pata controller IDE decode enable bit
holds default
+ * value -- it will always be 0. Actually on current stepping, this quirk
+ * function won't work either (write to this bit has no effect). But we still
+ * put it here, may for upcoming steppings.
+ */
+static void __devinit quirk_intel_poulsbo_ide_enable(struct pci_dev *dev)
+{
+       unsigned char value;
+
+       pci_read_config_byte(dev, 0x41, &value);
+       if (!(value & 0x80)) {
+               printk(KERN_ERR "PCI: PIIX4: Fixing "
+                       "Poulsbo PATA port 1 IDE decode enabling bit\n");

KERN_ERR? Perhaps KERN_INFO or KERN_DEBUG are more appropriate?

+               value |= 0x80;
+               pci_write_config_byte(dev, 0x41, value);
+               pci_read_config_byte(dev, 0x41, &value);
+               printk(KERN_ERR "Re-read enabling bit:%d\n", value);

same here.

+       }
+       pci_read_config_byte(dev, 0x43, &value);
+       if (!(value & 0x80)) {
+               printk(KERN_ERR "PCI: PIIX4: Fixing "
+                       "Poulsbo PATA port 2 IDE decode enabling bit\n");

and here

+               value |= 0x80;
+               pci_write_config_byte(dev, 0x43, value);
+               pci_read_config_byte(dev, 0x43, &value);
+               printk(KERN_ERR "Re-read enabling bit:%d\n", value);

and here.

+       }
+}
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_POULSBO_IDE,
+                       quirk_intel_poulsbo_ide_enable);




More information about the kernel-team mailing list