]> err.no Git - linux-2.6/blobdiff - drivers/ata/sata_sx4.c
ahci: implement AHCI_HFLAG_NO_PMP
[linux-2.6] / drivers / ata / sata_sx4.c
index b425061dbe8c75990407197c95919a8766173f7d..9f9f7b30654a3b5ff05b0dd1ad35140167a00689 100644 (file)
@@ -1381,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");
@@ -1409,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);