aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pdc2027x.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-18 00:14:55 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:37 -0400
commitcbcdd87593a1d85c5c4b259945a3a09eee12814d (patch)
treeee03df963a12ec7f30f6c3a8742421daf2c34f50 /drivers/ata/pata_pdc2027x.c
parente923090ddd9fef1d4e06dc6c5295e29baced19f3 (diff)
libata: implement and use ata_port_desc() to report port configuration
Currently, port configuration reporting has the following problems. * iomapped address is reported instead of raw address * report contains irrelevant fields or lacks necessary fields for non-SFF controllers. * host->irq/irq2 are there just for reporting and hacky. This patch implements and uses ata_port_desc() and ata_port_pbar_desc(). ata_port_desc() is almost identical to ata_ehi_push_desc() except that it takes @ap instead of @ehi, has no locking requirement, can only be used during host initialization and " " is used as separator instead of ", ". ata_port_pbar_desc() is a helper to ease reporting of a PCI BAR or an offsetted address into it. LLD pushes whatever description it wants using the above two functions. The accumulated description is printed on host registration after "[S/P]ATA max MAX_XFERMODE ". SFF init helpers and ata_host_activate() automatically add descriptions for addresses and irq respectively, so only LLDs which isn't standard SFF need to add custom descriptions. In many cases, such controllers need to report different things anyway. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
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