]> git.hungrycats.org Git - linux/commitdiff
[libata] Integrate Serial ATA driver into kernel tree.
authorJeff Garzik <jgarzik@redhat.com>
Tue, 21 Oct 2003 15:27:28 +0000 (11:27 -0400)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 21 Oct 2003 15:27:28 +0000 (11:27 -0400)
Documentation/DocBook/Makefile
drivers/ide/pci/piix.c
drivers/pci/quirks.c
drivers/scsi/Kconfig
drivers/scsi/Makefile
include/linux/ioport.h
kernel/resource.c

index 4f992e5761dccbf29cdc53c6e017d95d8cf79489..1a45873e4724c6fc25cd719a243951f27ebe6725 100644 (file)
@@ -12,7 +12,7 @@ DOCBOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \
            deviceiobook.sgml procfs-guide.sgml tulip-user.sgml \
            writing_usb_driver.sgml scsidrivers.sgml sis900.sgml \
            kernel-api.sgml journal-api.sgml lsm.sgml usb.sgml \
-           gadget.sgml
+           gadget.sgml libata.sgml
 
 ###
 # The build process is as follows (targets):
index e8679d9cab46ba8425c0518c72115131316837f3..fd9a59c9a0164393d5edd7158a6620fc64a09493 100644 (file)
@@ -797,7 +797,9 @@ static struct pci_device_id piix_pci_tbl[] = {
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
+#ifndef CONFIG_SCSI_SATA
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
+#endif /* !CONFIG_SCSI_SATA */
        { 0, },
 };
 
index 9e75311327e988f2cd4b81f9a1a3c9be95e99a4d..29313362a8b663ee85a43bcd7f70220bd64598e4 100644 (file)
@@ -748,6 +748,60 @@ static void __init quirk_sis_96x_compatible(struct pci_dev *dev)
        sis_96x_compatible = 1;
 }
 
+#ifdef CONFIG_SCSI_SATA
+static void __init quirk_intel_ide_combined(struct pci_dev *pdev)
+{
+       u8 prog, comb, tmp;
+
+       /*
+        * Narrow down to Intel SATA PCI devices.
+        */
+       switch (pdev->device) {
+       /* PCI ids taken from drivers/scsi/ata_piix.c */
+       case 0x24d1:
+       case 0x24df:
+       case 0x25a3:
+       case 0x25b0:
+               break;
+       default:
+               /* we do not handle this PCI device */
+               return;
+       }
+
+       /*
+        * Read combined mode register.
+        */
+       pci_read_config_byte(pdev, 0x90, &tmp); /* combined mode reg */
+       tmp &= 0x6;     /* interesting bits 2:1, PATA primary/secondary */
+       if (tmp == 0x4)         /* bits 10x */
+               comb = (1 << 0);                /* SATA port 0, PATA port 1 */
+       else if (tmp == 0x6)    /* bits 11x */
+               comb = (1 << 2);                /* PATA port 0, SATA port 1 */
+       else
+               return;                         /* not in combined mode */
+
+       /*
+        * Read programming interface register.
+        * (Tells us if it's legacy or native mode)
+        */
+       pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
+
+       /* if SATA port is in native mode, we're ok. */
+       if (prog & comb)
+               return;
+
+       /* SATA port is in legacy mode.  Reserve port so that
+        * IDE driver does not attempt to use it.  If request_region
+        * fails, it will be obvious at boot time, so we don't bother
+        * checking return values.
+        */
+       if (comb == (1 << 0))
+               request_region(0x1f0, 8, "libata");     /* port 0 */
+       else
+               request_region(0x170, 8, "libata");     /* port 1 */
+}
+#endif /* CONFIG_SCSI_SATA */
+
 /*
  *  The main table of quirks.
  *
@@ -851,6 +905,14 @@ static struct pci_fixup pci_fixups[] __devinitdata = {
        { PCI_FIXUP_HEADER,     PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801DB_0,  asus_hides_smbus_lpc },
        { PCI_FIXUP_HEADER,     PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801BA_0,  asus_hides_smbus_lpc },
 
+#ifdef CONFIG_SCSI_SATA
+       /* Fixup BIOSes that configure Parallel ATA (PATA / IDE) and
+        * Serial ATA (SATA) into the same PCI ID.
+        */
+       { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,    PCI_ANY_ID,
+         quirk_intel_ide_combined },
+#endif /* CONFIG_SCSI_SATA */
+
        { 0 }
 };
 
index 55bae98f5a4b415b36c99b039715900b8fbc7329..3d6a7b9cc71a521be600832d9df232964cdd9098 100644 (file)
@@ -403,6 +403,58 @@ config SCSI_MEGARAID
          To compile this driver as a module, choose M here: the
          module will be called megaraid.
 
+config SCSI_SATA
+       bool "Serial ATA (SATA) support"
+       depends on SCSI && EXPERIMENTAL
+       help
+         This driver family supports Serial ATA host controllers
+         and devices.
+
+         If unsure, say N.
+
+config SCSI_SATA_SVW
+       tristate "ServerWorks Frodo / Apple K2 SATA support (EXPERIMENTAL)"
+       depends on SCSI_SATA && PCI && EXPERIMENTAL
+       help
+         This option enables support for Broadcom/Serverworks/Apple K2
+         SATA support.
+
+         If unsure, say N.
+
+config SCSI_ATA_PIIX
+       tristate "Intel PIIX/ICH SATA support"
+       depends on SCSI_SATA && PCI
+       help
+         This option enables support for ICH5 Serial ATA.
+         If PATA support was enabled previously, this enables
+         support for select Intel PIIX/ICH PATA host controllers.
+
+         If unsure, say N.
+
+config SCSI_SATA_PROMISE
+       tristate "Promise SATA support"
+       depends on SCSI_SATA && PCI && EXPERIMENTAL
+       help
+         This option enables support for Promise Serial ATA.
+
+         If unsure, say N.
+
+config SCSI_SATA_SIL
+       tristate "Silicon Image SATA support"
+       depends on SCSI_SATA && PCI && BROKEN
+       help
+         This option enables support for Silicon Image Serial ATA.
+
+         If unsure, say N.
+
+config SCSI_SATA_VIA
+       tristate "VIA SATA support"
+       depends on SCSI_SATA && PCI && EXPERIMENTAL
+       help
+         This option enables support for VIA Serial ATA.
+
+         If unsure, say N.
+
 config SCSI_BUSLOGIC
        tristate "BusLogic SCSI support"
        depends on (PCI || ISA) && SCSI
index 3dc8e76fffee2925bb529aa2f4c626aba95f2d7c..b4dcd58dc85122dad104a1822521ebc719a1ff25 100644 (file)
@@ -112,6 +112,11 @@ obj-$(CONFIG_SCSI_FCAL)            += fcal.o
 obj-$(CONFIG_SCSI_CPQFCTS)     += cpqfc.o
 obj-$(CONFIG_SCSI_LASI700)     += lasi700.o 53c700.o
 obj-$(CONFIG_SCSI_NSP32)       += nsp32.o
+obj-$(CONFIG_SCSI_SATA_SVW)    += libata.o sata_svw.o
+obj-$(CONFIG_SCSI_ATA_PIIX)    += libata.o ata_piix.o
+obj-$(CONFIG_SCSI_SATA_PROMISE)        += libata.o sata_promise.o
+obj-$(CONFIG_SCSI_SATA_SIL)    += libata.o sata_sil.o
+obj-$(CONFIG_SCSI_SATA_VIA)    += libata.o sata_via.o
 
 obj-$(CONFIG_ARM)              += arm/
 
@@ -146,6 +151,7 @@ zalon7xx-objs       := zalon.o ncr53c8xx.o
 NCR_Q720_mod-objs      := NCR_Q720.o ncr53c8xx.o
 cpqfc-objs     := cpqfcTSinit.o cpqfcTScontrol.o cpqfcTSi2c.o \
                   cpqfcTSworker.o cpqfcTStrigger.o
+libata-objs    := libata-core.o libata-scsi.o
 
 # Files generated that shall be removed upon make clean
 clean-files := 53c7xx_d.h 53c700_d.h   \
index 236fce32581d965266b8d857870c050fe6836ca5..5ad913d3cd96ec7c71592a2494720d8924a37141 100644 (file)
@@ -89,6 +89,7 @@ extern struct resource iomem_resource;
 extern int get_resource_list(struct resource *, char *buf, int size);
 
 extern int request_resource(struct resource *root, struct resource *new);
+extern struct resource * ____request_resource(struct resource *root, struct resource *new);
 extern int release_resource(struct resource *new);
 extern int insert_resource(struct resource *parent, struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
index f5ea2bb294e1b1fa85172acc218c38f936147713..58413f46cdf5fa07b5feb0002a818192bbec5de8 100644 (file)
@@ -206,6 +206,18 @@ int request_resource(struct resource *root, struct resource *new)
 
 EXPORT_SYMBOL(request_resource);
 
+struct resource *____request_resource(struct resource *root, struct resource *new)
+{
+       struct resource *conflict;
+
+       write_lock(&resource_lock);
+       conflict = __request_resource(root, new);
+       write_unlock(&resource_lock);
+       return conflict;
+}
+
+EXPORT_SYMBOL(____request_resource);
+
 int release_resource(struct resource *old)
 {
        int retval;