aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 367733c8c1de..505878cc21ea 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -460,11 +460,11 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
460 unsigned long addr = siimage_selreg(hwif, 0x1); 460 unsigned long addr = siimage_selreg(hwif, 0x1);
461 461
462 if (SATA_ERROR_REG) { 462 if (SATA_ERROR_REG) {
463 u32 ext_stat = hwif->INL(base + 0x10); 463 u32 ext_stat = readl((void __iomem *)(base + 0x10));
464 u8 watchdog = 0; 464 u8 watchdog = 0;
465 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) { 465 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) {
466 u32 sata_error = hwif->INL(SATA_ERROR_REG); 466 u32 sata_error = readl((void __iomem *)SATA_ERROR_REG);
467 hwif->OUTL(sata_error, SATA_ERROR_REG); 467 writel(sata_error, (void __iomem *)SATA_ERROR_REG);
468 watchdog = (sata_error & 0x00680000) ? 1 : 0; 468 watchdog = (sata_error & 0x00680000) ? 1 : 0;
469 printk(KERN_WARNING "%s: sata_error = 0x%08x, " 469 printk(KERN_WARNING "%s: sata_error = 0x%08x, "
470 "watchdog = %d, %s\n", 470 "watchdog = %d, %s\n",
@@ -481,11 +481,11 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
481 } 481 }
482 482
483 /* return 1 if INTR asserted */ 483 /* return 1 if INTR asserted */
484 if ((hwif->INB(hwif->dma_status) & 0x04) == 0x04) 484 if ((readb((void __iomem *)hwif->dma_status) & 0x04) == 0x04)
485 return 1; 485 return 1;
486 486
487 /* return 1 if Device INTR asserted */ 487 /* return 1 if Device INTR asserted */
488 if ((hwif->INB(addr) & 8) == 8) 488 if ((readb((void __iomem *)addr) & 8) == 8)
489 return 0; //return 1; 489 return 0; //return 1;
490 490
491 return 0; 491 return 0;
@@ -507,9 +507,9 @@ static int siimage_busproc (ide_drive_t * drive, int state)
507 u32 stat_config = 0; 507 u32 stat_config = 0;
508 unsigned long addr = siimage_selreg(hwif, 0); 508 unsigned long addr = siimage_selreg(hwif, 0);
509 509
510 if (hwif->mmio) { 510 if (hwif->mmio)
511 stat_config = hwif->INL(addr); 511 stat_config = readl((void __iomem *)addr);
512 } else 512 else
513 pci_read_config_dword(hwif->pci_dev, addr, &stat_config); 513 pci_read_config_dword(hwif->pci_dev, addr, &stat_config);
514 514
515 switch (state) { 515 switch (state) {
@@ -545,9 +545,10 @@ static int siimage_reset_poll (ide_drive_t *drive)
545 if (SATA_STATUS_REG) { 545 if (SATA_STATUS_REG) {
546 ide_hwif_t *hwif = HWIF(drive); 546 ide_hwif_t *hwif = HWIF(drive);
547 547
548 if ((hwif->INL(SATA_STATUS_REG) & 0x03) != 0x03) { 548 /* SATA_STATUS_REG is valid only when in MMIO mode */
549 if ((readl((void __iomem *)SATA_STATUS_REG) & 0x03) != 0x03) {
549 printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n", 550 printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n",
550 hwif->name, hwif->INL(SATA_STATUS_REG)); 551 hwif->name, readl((void __iomem *)SATA_STATUS_REG));
551 HWGROUP(drive)->polling = 0; 552 HWGROUP(drive)->polling = 0;
552 return ide_started; 553 return ide_started;
553 } 554 }
@@ -607,7 +608,8 @@ static void siimage_reset (ide_drive_t *drive)
607 } 608 }
608 609
609 if (SATA_STATUS_REG) { 610 if (SATA_STATUS_REG) {
610 u32 sata_stat = hwif->INL(SATA_STATUS_REG); 611 /* SATA_STATUS_REG is valid only when in MMIO mode */
612 u32 sata_stat = readl((void __iomem *)SATA_STATUS_REG);
611 printk(KERN_WARNING "%s: reset phy, status=0x%08x, %s\n", 613 printk(KERN_WARNING "%s: reset phy, status=0x%08x, %s\n",
612 hwif->name, sata_stat, __FUNCTION__); 614 hwif->name, sata_stat, __FUNCTION__);
613 if (!(sata_stat)) { 615 if (!(sata_stat)) {