]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/sata_sx4.c
[libata] AHCI: enable AHCI mode, before using AHCI reset
[linux-2.6-omap-h63xx.git] / drivers / ata / sata_sx4.c
index d5cbd16629ad2d117d675324fb991875586444fd..9f9f7b30654a3b5ff05b0dd1ad35140167a00689 100644 (file)
@@ -254,7 +254,6 @@ static struct scsi_host_template pdc_sata_sht = {
 };
 
 static const struct ata_port_operations pdc_20621_ops = {
-       .port_disable           = ata_port_disable,
        .tf_load                = pdc_tf_load_mmio,
        .tf_read                = ata_tf_read,
        .check_status           = ata_check_status,
@@ -1382,9 +1381,8 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
        const struct ata_port_info *ppi[] =
                { &pdc_port_info[ent->driver_data], NULL };
        struct ata_host *host;
-       void __iomem *base;
        struct pdc_host_priv *hpriv;
-       int rc;
+       int i, rc;
 
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -1410,11 +1408,17 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
                return rc;
        host->iomap = pcim_iomap_table(pdev);
 
-       base = host->iomap[PDC_MMIO_BAR] + PDC_CHIP0_OFS;
-       pdc_sata_setup_port(&host->ports[0]->ioaddr, base + 0x200);
-       pdc_sata_setup_port(&host->ports[1]->ioaddr, base + 0x280);
-       pdc_sata_setup_port(&host->ports[2]->ioaddr, base + 0x300);
-       pdc_sata_setup_port(&host->ports[3]->ioaddr, base + 0x380);
+       for (i = 0; i < 4; i++) {
+               struct ata_port *ap = host->ports[i];
+               void __iomem *base = host->iomap[PDC_MMIO_BAR] + PDC_CHIP0_OFS;
+               unsigned int offset = 0x200 + i * 0x80;
+
+               pdc_sata_setup_port(&ap->ioaddr, base + offset);
+
+               ata_port_pbar_desc(ap, PDC_MMIO_BAR, -1, "mmio");
+               ata_port_pbar_desc(ap, PDC_DIMM_BAR, -1, "dimm");
+               ata_port_pbar_desc(ap, PDC_MMIO_BAR, offset, "port");
+       }
 
        /* configure and activate */
        rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);