aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_sx4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_sx4.c')
-rw-r--r--drivers/ata/sata_sx4.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 97aefdd87be4..9f9f7b30654a 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -254,7 +254,6 @@ static struct scsi_host_template pdc_sata_sht = {
254}; 254};
255 255
256static const struct ata_port_operations pdc_20621_ops = { 256static const struct ata_port_operations pdc_20621_ops = {
257 .port_disable = ata_port_disable,
258 .tf_load = pdc_tf_load_mmio, 257 .tf_load = pdc_tf_load_mmio,
259 .tf_read = ata_tf_read, 258 .tf_read = ata_tf_read,
260 .check_status = ata_check_status, 259 .check_status = ata_check_status,
@@ -267,7 +266,6 @@ static const struct ata_port_operations pdc_20621_ops = {
267 .eng_timeout = pdc_eng_timeout, 266 .eng_timeout = pdc_eng_timeout,
268 .irq_clear = pdc20621_irq_clear, 267 .irq_clear = pdc20621_irq_clear,
269 .irq_on = ata_irq_on, 268 .irq_on = ata_irq_on,
270 .irq_ack = ata_irq_ack,
271 .port_start = pdc_port_start, 269 .port_start = pdc_port_start,
272}; 270};
273 271
@@ -854,7 +852,7 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance)
854 !(ap->flags & ATA_FLAG_DISABLED)) { 852 !(ap->flags & ATA_FLAG_DISABLED)) {
855 struct ata_queued_cmd *qc; 853 struct ata_queued_cmd *qc;
856 854
857 qc = ata_qc_from_tag(ap, ap->active_tag); 855 qc = ata_qc_from_tag(ap, ap->link.active_tag);
858 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) 856 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)))
859 handled += pdc20621_host_intr(ap, qc, (i > 4), 857 handled += pdc20621_host_intr(ap, qc, (i > 4),
860 mmio_base); 858 mmio_base);
@@ -881,7 +879,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
881 879
882 spin_lock_irqsave(&host->lock, flags); 880 spin_lock_irqsave(&host->lock, flags);
883 881
884 qc = ata_qc_from_tag(ap, ap->active_tag); 882 qc = ata_qc_from_tag(ap, ap->link.active_tag);
885 883
886 switch (qc->tf.protocol) { 884 switch (qc->tf.protocol) {
887 case ATA_PROT_DMA: 885 case ATA_PROT_DMA:
@@ -1383,9 +1381,8 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1383 const struct ata_port_info *ppi[] = 1381 const struct ata_port_info *ppi[] =
1384 { &pdc_port_info[ent->driver_data], NULL }; 1382 { &pdc_port_info[ent->driver_data], NULL };
1385 struct ata_host *host; 1383 struct ata_host *host;
1386 void __iomem *base;
1387 struct pdc_host_priv *hpriv; 1384 struct pdc_host_priv *hpriv;
1388 int rc; 1385 int i, rc;
1389 1386
1390 if (!printed_version++) 1387 if (!printed_version++)
1391 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); 1388 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -1411,11 +1408,17 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
1411 return rc; 1408 return rc;
1412 host->iomap = pcim_iomap_table(pdev); 1409 host->iomap = pcim_iomap_table(pdev);
1413 1410
1414 base = host->iomap[PDC_MMIO_BAR] + PDC_CHIP0_OFS; 1411 for (i = 0; i < 4; i++) {
1415 pdc_sata_setup_port(&host->ports[0]->ioaddr, base + 0x200); 1412 struct ata_port *ap = host->ports[i];
1416 pdc_sata_setup_port(&host->ports[1]->ioaddr, base + 0x280); 1413 void __iomem *base = host->iomap[PDC_MMIO_BAR] + PDC_CHIP0_OFS;
1417 pdc_sata_setup_port(&host->ports[2]->ioaddr, base + 0x300); 1414 unsigned int offset = 0x200 + i * 0x80;
1418 pdc_sata_setup_port(&host->ports[3]->ioaddr, base + 0x380); 1415
1416 pdc_sata_setup_port(&ap->ioaddr, base + offset);
1417
1418 ata_port_pbar_desc(ap, PDC_MMIO_BAR, -1, "mmio");
1419 ata_port_pbar_desc(ap, PDC_DIMM_BAR, -1, "dimm");
1420 ata_port_pbar_desc(ap, PDC_MMIO_BAR, offset, "port");
1421 }
1419 1422
1420 /* configure and activate */ 1423 /* configure and activate */
1421 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK); 1424 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);