aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pdc2027x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_pdc2027x.c')
-rw-r--r--drivers/ata/pata_pdc2027x.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 2141a99e4da1..f87c800be7f3 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -782,12 +782,14 @@ static void pdc_ata_setup_port(struct ata_ioports *port, void __iomem *base)
782static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 782static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
783{ 783{
784 static int printed_version; 784 static int printed_version;
785 static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 };
786 static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 };
785 unsigned int board_idx = (unsigned int) ent->driver_data; 787 unsigned int board_idx = (unsigned int) ent->driver_data;
786 const struct ata_port_info *ppi[] = 788 const struct ata_port_info *ppi[] =
787 { &pdc2027x_port_info[board_idx], NULL }; 789 { &pdc2027x_port_info[board_idx], NULL };
788 struct ata_host *host; 790 struct ata_host *host;
789 void __iomem *mmio_base; 791 void __iomem *mmio_base;
790 int rc; 792 int i, rc;
791 793
792 if (!printed_version++) 794 if (!printed_version++)
793 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); 795 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -817,10 +819,15 @@ static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_de
817 819
818 mmio_base = host->iomap[PDC_MMIO_BAR]; 820 mmio_base = host->iomap[PDC_MMIO_BAR];
819 821
820 pdc_ata_setup_port(&host->ports[0]->ioaddr, mmio_base + 0x17c0); 822 for (i = 0; i < 2; i++) {
821 host->ports[0]->ioaddr.bmdma_addr = mmio_base + 0x1000; 823 struct ata_port *ap = host->ports[i];
822 pdc_ata_setup_port(&host->ports[1]->ioaddr, mmio_base + 0x15c0); 824
823 host->ports[1]->ioaddr.bmdma_addr = mmio_base + 0x1008; 825 pdc_ata_setup_port(&ap->ioaddr, mmio_base + cmd_offset[i]);
826 ap->ioaddr.bmdma_addr = mmio_base + bmdma_offset[i];
827
828 ata_port_pbar_desc(ap, PDC_MMIO_BAR, -1, "mmio");
829 ata_port_pbar_desc(ap, PDC_MMIO_BAR, cmd_offset[i], "cmd");
830 }
824 831
825 //pci_enable_intx(pdev); 832 //pci_enable_intx(pdev);
826 833