diff options
author | Tejun Heo <htejun@gmail.com> | 2007-08-18 00:14:55 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:37 -0400 |
commit | cbcdd87593a1d85c5c4b259945a3a09eee12814d (patch) | |
tree | ee03df963a12ec7f30f6c3a8742421daf2c34f50 /drivers/ata/pata_ixp4xx_cf.c | |
parent | e923090ddd9fef1d4e06dc6c5295e29baced19f3 (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_ixp4xx_cf.c')
-rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 7b0d2fc57484..fcd532afbf2e 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -131,8 +131,12 @@ static struct ata_port_operations ixp4xx_port_ops = { | |||
131 | }; | 131 | }; |
132 | 132 | ||
133 | static void ixp4xx_setup_port(struct ata_ioports *ioaddr, | 133 | static void ixp4xx_setup_port(struct ata_ioports *ioaddr, |
134 | struct ixp4xx_pata_data *data) | 134 | struct ixp4xx_pata_data *data, |
135 | unsigned long raw_cs0, unsigned long raw_cs1) | ||
135 | { | 136 | { |
137 | unsigned long raw_cmd = raw_cs0; | ||
138 | unsigned long raw_ctl = raw_cs1 + 0x06; | ||
139 | |||
136 | ioaddr->cmd_addr = data->cs0; | 140 | ioaddr->cmd_addr = data->cs0; |
137 | ioaddr->altstatus_addr = data->cs1 + 0x06; | 141 | ioaddr->altstatus_addr = data->cs1 + 0x06; |
138 | ioaddr->ctl_addr = data->cs1 + 0x06; | 142 | ioaddr->ctl_addr = data->cs1 + 0x06; |
@@ -158,7 +162,12 @@ static void ixp4xx_setup_port(struct ata_ioports *ioaddr, | |||
158 | *(unsigned long *)&ioaddr->device_addr ^= 0x03; | 162 | *(unsigned long *)&ioaddr->device_addr ^= 0x03; |
159 | *(unsigned long *)&ioaddr->status_addr ^= 0x03; | 163 | *(unsigned long *)&ioaddr->status_addr ^= 0x03; |
160 | *(unsigned long *)&ioaddr->command_addr ^= 0x03; | 164 | *(unsigned long *)&ioaddr->command_addr ^= 0x03; |
165 | |||
166 | raw_cmd ^= 0x03; | ||
167 | raw_ctl ^= 0x03; | ||
161 | #endif | 168 | #endif |
169 | |||
170 | ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", raw_cmd, raw_ctl); | ||
162 | } | 171 | } |
163 | 172 | ||
164 | static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | 173 | static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) |
@@ -203,7 +212,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
203 | ap->pio_mask = 0x1f; /* PIO4 */ | 212 | ap->pio_mask = 0x1f; /* PIO4 */ |
204 | ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; | 213 | ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; |
205 | 214 | ||
206 | ixp4xx_setup_port(&ap->ioaddr, data); | 215 | ixp4xx_setup_port(ap, data, cs0->start, cs1->start); |
207 | 216 | ||
208 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); | 217 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); |
209 | 218 | ||