diff options
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index f3229642c052..d98a9da2699c 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -377,9 +377,10 @@ void ide_dma_host_set(ide_drive_t *drive, int on) | |||
377 | dma_stat &= ~(1 << (5 + unit)); | 377 | dma_stat &= ~(1 << (5 + unit)); |
378 | 378 | ||
379 | if (hwif->host_flags & IDE_HFLAG_MMIO) | 379 | if (hwif->host_flags & IDE_HFLAG_MMIO) |
380 | writeb(dma_stat, (void __iomem *)hwif->dma_status); | 380 | writeb(dma_stat, |
381 | (void __iomem *)(hwif->dma_base + ATA_DMA_STATUS)); | ||
381 | else | 382 | else |
382 | outb(dma_stat, hwif->dma_status); | 383 | outb(dma_stat, hwif->dma_base + ATA_DMA_STATUS); |
383 | } | 384 | } |
384 | 385 | ||
385 | EXPORT_SYMBOL_GPL(ide_dma_host_set); | 386 | EXPORT_SYMBOL_GPL(ide_dma_host_set); |
@@ -475,18 +476,19 @@ int ide_dma_setup(ide_drive_t *drive) | |||
475 | 476 | ||
476 | /* specify r/w */ | 477 | /* specify r/w */ |
477 | if (mmio) | 478 | if (mmio) |
478 | writeb(reading, (void __iomem *)hwif->dma_command); | 479 | writeb(reading, (void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); |
479 | else | 480 | else |
480 | outb(reading, hwif->dma_command); | 481 | outb(reading, hwif->dma_base + ATA_DMA_CMD); |
481 | 482 | ||
482 | /* read DMA status for INTR & ERROR flags */ | 483 | /* read DMA status for INTR & ERROR flags */ |
483 | dma_stat = hwif->read_sff_dma_status(hwif); | 484 | dma_stat = hwif->read_sff_dma_status(hwif); |
484 | 485 | ||
485 | /* clear INTR & ERROR flags */ | 486 | /* clear INTR & ERROR flags */ |
486 | if (mmio) | 487 | if (mmio) |
487 | writeb(dma_stat | 6, (void __iomem *)hwif->dma_status); | 488 | writeb(dma_stat | 6, |
489 | (void __iomem *)(hwif->dma_base + ATA_DMA_STATUS)); | ||
488 | else | 490 | else |
489 | outb(dma_stat | 6, hwif->dma_status); | 491 | outb(dma_stat | 6, hwif->dma_base + ATA_DMA_STATUS); |
490 | 492 | ||
491 | drive->waiting_for_dma = 1; | 493 | drive->waiting_for_dma = 1; |
492 | return 0; | 494 | return 0; |
@@ -512,12 +514,13 @@ void ide_dma_start(ide_drive_t *drive) | |||
512 | * we do this part before issuing the drive cmd. | 514 | * we do this part before issuing the drive cmd. |
513 | */ | 515 | */ |
514 | if (hwif->host_flags & IDE_HFLAG_MMIO) { | 516 | if (hwif->host_flags & IDE_HFLAG_MMIO) { |
515 | dma_cmd = readb((void __iomem *)hwif->dma_command); | 517 | dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); |
516 | /* start DMA */ | 518 | /* start DMA */ |
517 | writeb(dma_cmd | 1, (void __iomem *)hwif->dma_command); | 519 | writeb(dma_cmd | 1, |
520 | (void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); | ||
518 | } else { | 521 | } else { |
519 | dma_cmd = inb(hwif->dma_command); | 522 | dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); |
520 | outb(dma_cmd | 1, hwif->dma_command); | 523 | outb(dma_cmd | 1, hwif->dma_base + ATA_DMA_CMD); |
521 | } | 524 | } |
522 | 525 | ||
523 | hwif->dma = 1; | 526 | hwif->dma = 1; |
@@ -537,12 +540,13 @@ int __ide_dma_end (ide_drive_t *drive) | |||
537 | 540 | ||
538 | if (mmio) { | 541 | if (mmio) { |
539 | /* get DMA command mode */ | 542 | /* get DMA command mode */ |
540 | dma_cmd = readb((void __iomem *)hwif->dma_command); | 543 | dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); |
541 | /* stop DMA */ | 544 | /* stop DMA */ |
542 | writeb(dma_cmd & ~1, (void __iomem *)hwif->dma_command); | 545 | writeb(dma_cmd & ~1, |
546 | (void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); | ||
543 | } else { | 547 | } else { |
544 | dma_cmd = inb(hwif->dma_command); | 548 | dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); |
545 | outb(dma_cmd & ~1, hwif->dma_command); | 549 | outb(dma_cmd & ~1, hwif->dma_base + ATA_DMA_CMD); |
546 | } | 550 | } |
547 | 551 | ||
548 | /* get DMA status */ | 552 | /* get DMA status */ |
@@ -550,9 +554,10 @@ int __ide_dma_end (ide_drive_t *drive) | |||
550 | 554 | ||
551 | if (mmio) | 555 | if (mmio) |
552 | /* clear the INTR & ERROR bits */ | 556 | /* clear the INTR & ERROR bits */ |
553 | writeb(dma_stat | 6, (void __iomem *)hwif->dma_status); | 557 | writeb(dma_stat | 6, |
558 | (void __iomem *)(hwif->dma_base + ATA_DMA_STATUS)); | ||
554 | else | 559 | else |
555 | outb(dma_stat | 6, hwif->dma_status); | 560 | outb(dma_stat | 6, hwif->dma_base + ATA_DMA_STATUS); |
556 | 561 | ||
557 | /* purge DMA mappings */ | 562 | /* purge DMA mappings */ |
558 | ide_destroy_dmatable(drive); | 563 | ide_destroy_dmatable(drive); |
@@ -888,11 +893,6 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base) | |||
888 | { | 893 | { |
889 | hwif->dma_base = base; | 894 | hwif->dma_base = base; |
890 | 895 | ||
891 | if (!hwif->dma_command) | ||
892 | hwif->dma_command = hwif->dma_base + 0; | ||
893 | if (!hwif->dma_status) | ||
894 | hwif->dma_status = hwif->dma_base + 2; | ||
895 | |||
896 | hwif->dma_ops = &sff_dma_ops; | 896 | hwif->dma_ops = &sff_dma_ops; |
897 | } | 897 | } |
898 | 898 | ||