aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_icside.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_icside.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_icside.c')
-rw-r--r--drivers/ata/pata_icside.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index 4a69328a4c43..be30923566c5 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -70,6 +70,8 @@ struct pata_icside_info {
70 unsigned int mwdma_mask; 70 unsigned int mwdma_mask;
71 unsigned int nr_ports; 71 unsigned int nr_ports;
72 const struct portinfo *port[2]; 72 const struct portinfo *port[2];
73 unsigned long raw_base;
74 unsigned long raw_ioc_base;
73}; 75};
74 76
75#define ICS_TYPE_A3IN 0 77#define ICS_TYPE_A3IN 0
@@ -392,9 +394,10 @@ static struct ata_port_operations pata_icside_port_ops = {
392}; 394};
393 395
394static void __devinit 396static void __devinit
395pata_icside_setup_ioaddr(struct ata_ioports *ioaddr, void __iomem *base, 397pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base,
396 const struct portinfo *info) 398 const struct portinfo *info)
397{ 399{
400 struct ata_ioports *ioaddr = &ap->ioaddr;
398 void __iomem *cmd = base + info->dataoffset; 401 void __iomem *cmd = base + info->dataoffset;
399 402
400 ioaddr->cmd_addr = cmd; 403 ioaddr->cmd_addr = cmd;
@@ -411,6 +414,13 @@ pata_icside_setup_ioaddr(struct ata_ioports *ioaddr, void __iomem *base,
411 414
412 ioaddr->ctl_addr = base + info->ctrloffset; 415 ioaddr->ctl_addr = base + info->ctrloffset;
413 ioaddr->altstatus_addr = ioaddr->ctl_addr; 416 ioaddr->altstatus_addr = ioaddr->ctl_addr;
417
418 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
419 info->raw_base + info->dataoffset,
420 info->raw_base + info->ctrloffset);
421
422 if (info->raw_ioc_base)
423 ata_port_desc(ap, "iocbase 0x%lx", info->raw_ioc_base);
414} 424}
415 425
416static int __devinit pata_icside_register_v5(struct pata_icside_info *info) 426static int __devinit pata_icside_register_v5(struct pata_icside_info *info)
@@ -431,6 +441,8 @@ static int __devinit pata_icside_register_v5(struct pata_icside_info *info)
431 info->nr_ports = 1; 441 info->nr_ports = 1;
432 info->port[0] = &pata_icside_portinfo_v5; 442 info->port[0] = &pata_icside_portinfo_v5;
433 443
444 info->raw_base = ecard_resource_start(ec, ECARD_RES_MEMC);
445
434 return 0; 446 return 0;
435} 447}
436 448
@@ -471,6 +483,9 @@ static int __devinit pata_icside_register_v6(struct pata_icside_info *info)
471 info->port[0] = &pata_icside_portinfo_v6_1; 483 info->port[0] = &pata_icside_portinfo_v6_1;
472 info->port[1] = &pata_icside_portinfo_v6_2; 484 info->port[1] = &pata_icside_portinfo_v6_2;
473 485
486 info->raw_base = ecard_resource_start(ec, ECARD_RES_EASI);
487 info->raw_ioc_base = ecard_resource_start(ec, ECARD_RES_IOCFAST);
488
474 return icside_dma_init(info); 489 return icside_dma_init(info);
475} 490}
476 491
@@ -507,7 +522,7 @@ static int __devinit pata_icside_add_ports(struct pata_icside_info *info)
507 ap->flags |= ATA_FLAG_SLAVE_POSS; 522 ap->flags |= ATA_FLAG_SLAVE_POSS;
508 ap->ops = &pata_icside_port_ops; 523 ap->ops = &pata_icside_port_ops;
509 524
510 pata_icside_setup_ioaddr(&ap->ioaddr, info->base, info->port[i]); 525 pata_icside_setup_ioaddr(ap, info->base, info->port[i]);
511 } 526 }
512 527
513 return ata_host_activate(host, ec->irq, ata_interrupt, 0, 528 return ata_host_activate(host, ec->irq, ata_interrupt, 0,