aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ppc/scc_pata.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/ppc/scc_pata.c
index de64b022478b..f84bf791f72e 100644
--- a/drivers/ide/ppc/scc_pata.c
+++ b/drivers/ide/ppc/scc_pata.c
@@ -509,6 +509,32 @@ static int scc_ide_dma_end(ide_drive_t * drive)
509 return __ide_dma_end(drive); 509 return __ide_dma_end(drive);
510} 510}
511 511
512/* returns 1 if dma irq issued, 0 otherwise */
513static int scc_dma_test_irq(ide_drive_t *drive)
514{
515 ide_hwif_t *hwif = HWIF(drive);
516 u8 dma_stat = hwif->INB(hwif->dma_status);
517
518 /* return 1 if INTR asserted */
519 if ((dma_stat & 4) == 4)
520 return 1;
521
522 /* Workaround for PTERADD: emulate DMA_INTR when
523 * - IDE_STATUS[ERR] = 1
524 * - INT_STATUS[INTRQ] = 1
525 * - DMA_STATUS[IORACTA] = 1
526 */
527 if (in_be32((void __iomem *)IDE_ALTSTATUS_REG) & ERR_STAT &&
528 in_be32((void __iomem *)(hwif->dma_base + 0x014)) & INTSTS_INTRQ &&
529 dma_stat & 1)
530 return 1;
531
532 if (!drive->waiting_for_dma)
533 printk(KERN_WARNING "%s: (%s) called while not waiting\n",
534 drive->name, __FUNCTION__);
535 return 0;
536}
537
512/** 538/**
513 * setup_mmio_scc - map CTRL/BMID region 539 * setup_mmio_scc - map CTRL/BMID region
514 * @dev: PCI device we are configuring 540 * @dev: PCI device we are configuring
@@ -712,6 +738,7 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
712 hwif->speedproc = scc_tune_chipset; 738 hwif->speedproc = scc_tune_chipset;
713 hwif->tuneproc = scc_tuneproc; 739 hwif->tuneproc = scc_tuneproc;
714 hwif->ide_dma_check = scc_config_drive_for_dma; 740 hwif->ide_dma_check = scc_config_drive_for_dma;
741 hwif->ide_dma_test_irq = scc_dma_test_irq;
715 742
716 hwif->drives[0].autotune = IDE_TUNE_AUTO; 743 hwif->drives[0].autotune = IDE_TUNE_AUTO;
717 hwif->drives[1].autotune = IDE_TUNE_AUTO; 744 hwif->drives[1].autotune = IDE_TUNE_AUTO;