aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sil24.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-29 17:49:12 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-29 17:49:12 -0400
commitb0c4e148bd591629749d02a8fbc8d81c26d548cf (patch)
tree3e2142635f3dc2ceeae870ead2dceab7b9c6def1 /drivers/scsi/sata_sil24.c
parent5615ca7906aefbdc3318604c89db5931d0a25910 (diff)
parentbe15cd72d256e5eb3261a781b8507fac83ab33f6 (diff)
Merge branch 'master'
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r--drivers/scsi/sata_sil24.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index e0d27a0fbad0..423096f7fe93 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -220,8 +220,8 @@ struct sil24_port_priv {
220 220
221/* ap->host_set->private_data */ 221/* ap->host_set->private_data */
222struct sil24_host_priv { 222struct sil24_host_priv {
223 void *host_base; /* global controller control (128 bytes @BAR0) */ 223 void __iomem *host_base; /* global controller control (128 bytes @BAR0) */
224 void *port_base; /* port registers (4 * 8192 bytes @BAR2) */ 224 void __iomem *port_base; /* port registers (4 * 8192 bytes @BAR2) */
225}; 225};
226 226
227static u8 sil24_check_status(struct ata_port *ap); 227static u8 sil24_check_status(struct ata_port *ap);
@@ -349,10 +349,12 @@ static struct ata_port_info sil24_port_info[] = {
349static inline void sil24_update_tf(struct ata_port *ap) 349static inline void sil24_update_tf(struct ata_port *ap)
350{ 350{
351 struct sil24_port_priv *pp = ap->private_data; 351 struct sil24_port_priv *pp = ap->private_data;
352 void *port = (void *)ap->ioaddr.cmd_addr; 352 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
353 struct sil24_prb *prb = port; 353 struct sil24_prb __iomem *prb = port;
354 u8 fis[6 * 4];
354 355
355 ata_tf_from_fis(prb->fis, &pp->tf); 356 memcpy_fromio(fis, prb->fis, 6 * 4);
357 ata_tf_from_fis(fis, &pp->tf);
356} 358}
357 359
358static u8 sil24_check_status(struct ata_port *ap) 360static u8 sil24_check_status(struct ata_port *ap)
@@ -376,9 +378,9 @@ static int sil24_scr_map[] = {
376 378
377static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) 379static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg)
378{ 380{
379 void *scr_addr = (void *)ap->ioaddr.scr_addr; 381 void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr;
380 if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { 382 if (sc_reg < ARRAY_SIZE(sil24_scr_map)) {
381 void *addr; 383 void __iomem *addr;
382 addr = scr_addr + sil24_scr_map[sc_reg] * 4; 384 addr = scr_addr + sil24_scr_map[sc_reg] * 4;
383 return readl(scr_addr + sil24_scr_map[sc_reg] * 4); 385 return readl(scr_addr + sil24_scr_map[sc_reg] * 4);
384 } 386 }
@@ -387,9 +389,9 @@ static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg)
387 389
388static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) 390static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val)
389{ 391{
390 void *scr_addr = (void *)ap->ioaddr.scr_addr; 392 void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr;
391 if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { 393 if (sc_reg < ARRAY_SIZE(sil24_scr_map)) {
392 void *addr; 394 void __iomem *addr;
393 addr = scr_addr + sil24_scr_map[sc_reg] * 4; 395 addr = scr_addr + sil24_scr_map[sc_reg] * 4;
394 writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); 396 writel(val, scr_addr + sil24_scr_map[sc_reg] * 4);
395 } 397 }
@@ -459,7 +461,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
459static int sil24_qc_issue(struct ata_queued_cmd *qc) 461static int sil24_qc_issue(struct ata_queued_cmd *qc)
460{ 462{
461 struct ata_port *ap = qc->ap; 463 struct ata_port *ap = qc->ap;
462 void *port = (void *)ap->ioaddr.cmd_addr; 464 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
463 struct sil24_port_priv *pp = ap->private_data; 465 struct sil24_port_priv *pp = ap->private_data;
464 dma_addr_t paddr = pp->cmd_block_dma + qc->tag * sizeof(*pp->cmd_block); 466 dma_addr_t paddr = pp->cmd_block_dma + qc->tag * sizeof(*pp->cmd_block);
465 467
@@ -472,7 +474,7 @@ static void sil24_irq_clear(struct ata_port *ap)
472 /* unused */ 474 /* unused */
473} 475}
474 476
475static int __sil24_reset_controller(void *port) 477static int __sil24_reset_controller(void __iomem *port)
476{ 478{
477 int cnt; 479 int cnt;
478 u32 tmp; 480 u32 tmp;
@@ -498,7 +500,7 @@ static void sil24_reset_controller(struct ata_port *ap)
498{ 500{
499 printk(KERN_NOTICE DRV_NAME 501 printk(KERN_NOTICE DRV_NAME
500 " ata%u: resetting controller...\n", ap->id); 502 " ata%u: resetting controller...\n", ap->id);
501 if (__sil24_reset_controller((void *)ap->ioaddr.cmd_addr)) 503 if (__sil24_reset_controller((void __iomem *)ap->ioaddr.cmd_addr))
502 printk(KERN_ERR DRV_NAME 504 printk(KERN_ERR DRV_NAME
503 " ata%u: failed to reset controller\n", ap->id); 505 " ata%u: failed to reset controller\n", ap->id);
504} 506}
@@ -532,7 +534,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat)
532{ 534{
533 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); 535 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
534 struct sil24_port_priv *pp = ap->private_data; 536 struct sil24_port_priv *pp = ap->private_data;
535 void *port = (void *)ap->ioaddr.cmd_addr; 537 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
536 u32 irq_stat, cmd_err, sstatus, serror; 538 u32 irq_stat, cmd_err, sstatus, serror;
537 539
538 irq_stat = readl(port + PORT_IRQ_STAT); 540 irq_stat = readl(port + PORT_IRQ_STAT);
@@ -579,7 +581,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat)
579static inline void sil24_host_intr(struct ata_port *ap) 581static inline void sil24_host_intr(struct ata_port *ap)
580{ 582{
581 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); 583 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
582 void *port = (void *)ap->ioaddr.cmd_addr; 584 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
583 u32 slot_stat; 585 u32 slot_stat;
584 586
585 slot_stat = readl(port + PORT_SLOT_STAT); 587 slot_stat = readl(port + PORT_SLOT_STAT);
@@ -694,7 +696,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
694 struct ata_port_info *pinfo = &sil24_port_info[board_id]; 696 struct ata_port_info *pinfo = &sil24_port_info[board_id];
695 struct ata_probe_ent *probe_ent = NULL; 697 struct ata_probe_ent *probe_ent = NULL;
696 struct sil24_host_priv *hpriv = NULL; 698 struct sil24_host_priv *hpriv = NULL;
697 void *host_base = NULL, *port_base = NULL; 699 void __iomem *host_base = NULL;
700 void __iomem *port_base = NULL;
698 int i, rc; 701 int i, rc;
699 702
700 if (!printed_version++) 703 if (!printed_version++)
@@ -776,7 +779,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
776 writel(0, host_base + HOST_CTRL); 779 writel(0, host_base + HOST_CTRL);
777 780
778 for (i = 0; i < probe_ent->n_ports; i++) { 781 for (i = 0; i < probe_ent->n_ports; i++) {
779 void *port = port_base + i * PORT_REGS_SIZE; 782 void __iomem *port = port_base + i * PORT_REGS_SIZE;
780 unsigned long portu = (unsigned long)port; 783 unsigned long portu = (unsigned long)port;
781 u32 tmp; 784 u32 tmp;
782 int cnt; 785 int cnt;