diff options
author | Tejun Heo <htejun@gmail.com> | 2007-02-01 01:06:36 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-09 17:39:38 -0500 |
commit | 0d5ff566779f894ca9937231a181eb31e4adff0e (patch) | |
tree | d1c7495c932581c1d41aa7f0fdb303348da49106 /include/linux/libata.h | |
parent | 1a68ff13c8a9b517de3fd4187dc525412a6eba1b (diff) |
libata: convert to iomap
Convert libata core layer and LLDs to use iomap.
* managed iomap is used. Pointer to pcim_iomap_table() is cached at
host->iomap and used through out LLDs. This basically replaces
host->mmio_base.
* if possible, pcim_iomap_regions() is used
Most iomap operation conversions are taken from Jeff Garzik
<jgarzik@pobox.com>'s iomap branch.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 68 |
1 files changed, 28 insertions, 40 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index cebbcc8d45fd..308bb8cbe50f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -348,21 +348,21 @@ typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes); | |||
348 | typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); | 348 | typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); |
349 | 349 | ||
350 | struct ata_ioports { | 350 | struct ata_ioports { |
351 | unsigned long cmd_addr; | 351 | void __iomem *cmd_addr; |
352 | unsigned long data_addr; | 352 | void __iomem *data_addr; |
353 | unsigned long error_addr; | 353 | void __iomem *error_addr; |
354 | unsigned long feature_addr; | 354 | void __iomem *feature_addr; |
355 | unsigned long nsect_addr; | 355 | void __iomem *nsect_addr; |
356 | unsigned long lbal_addr; | 356 | void __iomem *lbal_addr; |
357 | unsigned long lbam_addr; | 357 | void __iomem *lbam_addr; |
358 | unsigned long lbah_addr; | 358 | void __iomem *lbah_addr; |
359 | unsigned long device_addr; | 359 | void __iomem *device_addr; |
360 | unsigned long status_addr; | 360 | void __iomem *status_addr; |
361 | unsigned long command_addr; | 361 | void __iomem *command_addr; |
362 | unsigned long altstatus_addr; | 362 | void __iomem *altstatus_addr; |
363 | unsigned long ctl_addr; | 363 | void __iomem *ctl_addr; |
364 | unsigned long bmdma_addr; | 364 | void __iomem *bmdma_addr; |
365 | unsigned long scr_addr; | 365 | void __iomem *scr_addr; |
366 | }; | 366 | }; |
367 | 367 | ||
368 | struct ata_probe_ent { | 368 | struct ata_probe_ent { |
@@ -381,7 +381,7 @@ struct ata_probe_ent { | |||
381 | unsigned int irq_flags; | 381 | unsigned int irq_flags; |
382 | unsigned long port_flags; | 382 | unsigned long port_flags; |
383 | unsigned long _host_flags; | 383 | unsigned long _host_flags; |
384 | void __iomem *mmio_base; | 384 | void __iomem * const *iomap; |
385 | void *private_data; | 385 | void *private_data; |
386 | 386 | ||
387 | /* port_info for the secondary port. Together with irq2, it's | 387 | /* port_info for the secondary port. Together with irq2, it's |
@@ -398,7 +398,7 @@ struct ata_host { | |||
398 | struct device *dev; | 398 | struct device *dev; |
399 | unsigned long irq; | 399 | unsigned long irq; |
400 | unsigned long irq2; | 400 | unsigned long irq2; |
401 | void __iomem *mmio_base; | 401 | void __iomem * const *iomap; |
402 | unsigned int n_ports; | 402 | unsigned int n_ports; |
403 | void *private_data; | 403 | void *private_data; |
404 | const struct ata_port_operations *ops; | 404 | const struct ata_port_operations *ops; |
@@ -768,12 +768,10 @@ extern u8 ata_altstatus(struct ata_port *ap); | |||
768 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 768 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
769 | extern int ata_port_start (struct ata_port *ap); | 769 | extern int ata_port_start (struct ata_port *ap); |
770 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance); | 770 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance); |
771 | extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, | 771 | extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, |
772 | unsigned int buflen, int write_data); | 772 | unsigned int buflen, int write_data); |
773 | extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf, | 773 | extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, |
774 | unsigned int buflen, int write_data); | 774 | unsigned int buflen, int write_data); |
775 | extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, | ||
776 | unsigned int buflen, int write_data); | ||
777 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 775 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
778 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | 776 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
779 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 777 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
@@ -1084,10 +1082,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap) | |||
1084 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 1082 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
1085 | 1083 | ||
1086 | if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { | 1084 | if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { |
1087 | unsigned long l = ap->ioaddr.status_addr; | ||
1088 | if (ata_msg_warn(ap)) | 1085 | if (ata_msg_warn(ap)) |
1089 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", | 1086 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n", |
1090 | status, l); | 1087 | status, ap->ioaddr.status_addr); |
1091 | } | 1088 | } |
1092 | 1089 | ||
1093 | return status; | 1090 | return status; |
@@ -1172,20 +1169,11 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | |||
1172 | printk(KERN_ERR "abnormal status 0x%X\n", status); | 1169 | printk(KERN_ERR "abnormal status 0x%X\n", status); |
1173 | 1170 | ||
1174 | /* get controller status; clear intr, err bits */ | 1171 | /* get controller status; clear intr, err bits */ |
1175 | if (ap->flags & ATA_FLAG_MMIO) { | 1172 | host_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
1176 | void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr; | 1173 | iowrite8(host_stat | ATA_DMA_INTR | ATA_DMA_ERR, |
1177 | host_stat = readb(mmio + ATA_DMA_STATUS); | 1174 | ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
1178 | writeb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR, | 1175 | |
1179 | mmio + ATA_DMA_STATUS); | 1176 | post_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
1180 | |||
1181 | post_stat = readb(mmio + ATA_DMA_STATUS); | ||
1182 | } else { | ||
1183 | host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | ||
1184 | outb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR, | ||
1185 | ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | ||
1186 | |||
1187 | post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | ||
1188 | } | ||
1189 | 1177 | ||
1190 | if (ata_msg_intr(ap)) | 1178 | if (ata_msg_intr(ap)) |
1191 | printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", | 1179 | printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", |