diff options
Diffstat (limited to 'drivers/ide/mips')
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 41 | ||||
-rw-r--r-- | drivers/ide/mips/swarm.c | 2 |
2 files changed, 16 insertions, 27 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index c7854ea57b52..0a59d5ef1599 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -181,12 +181,6 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) | |||
181 | { | 181 | { |
182 | int mem_sttime; | 182 | int mem_sttime; |
183 | int mem_stcfg; | 183 | int mem_stcfg; |
184 | unsigned long mode; | ||
185 | |||
186 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
187 | if (ide_use_dma(drive)) | ||
188 | mode = ide_dma_speed(drive, 0); | ||
189 | #endif | ||
190 | 184 | ||
191 | mem_sttime = 0; | 185 | mem_sttime = 0; |
192 | mem_stcfg = au_readl(MEM_STCFG2); | 186 | mem_stcfg = au_readl(MEM_STCFG2); |
@@ -195,7 +189,7 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) | |||
195 | auide_tune_drive(drive, speed - XFER_PIO_0); | 189 | auide_tune_drive(drive, speed - XFER_PIO_0); |
196 | return 0; | 190 | return 0; |
197 | } | 191 | } |
198 | 192 | ||
199 | switch(speed) { | 193 | switch(speed) { |
200 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | 194 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA |
201 | case XFER_MW_DMA_2: | 195 | case XFER_MW_DMA_2: |
@@ -207,7 +201,6 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) | |||
207 | mem_stcfg &= ~TOECS_MASK; | 201 | mem_stcfg &= ~TOECS_MASK; |
208 | mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS; | 202 | mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS; |
209 | 203 | ||
210 | mode = XFER_MW_DMA_2; | ||
211 | break; | 204 | break; |
212 | case XFER_MW_DMA_1: | 205 | case XFER_MW_DMA_1: |
213 | mem_sttime = SBC_IDE_TIMING(MDMA1); | 206 | mem_sttime = SBC_IDE_TIMING(MDMA1); |
@@ -218,7 +211,6 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) | |||
218 | mem_stcfg &= ~TOECS_MASK; | 211 | mem_stcfg &= ~TOECS_MASK; |
219 | mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS; | 212 | mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS; |
220 | 213 | ||
221 | mode = XFER_MW_DMA_1; | ||
222 | break; | 214 | break; |
223 | case XFER_MW_DMA_0: | 215 | case XFER_MW_DMA_0: |
224 | mem_sttime = SBC_IDE_TIMING(MDMA0); | 216 | mem_sttime = SBC_IDE_TIMING(MDMA0); |
@@ -229,14 +221,13 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) | |||
229 | mem_stcfg &= ~TOECS_MASK; | 221 | mem_stcfg &= ~TOECS_MASK; |
230 | mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS; | 222 | mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS; |
231 | 223 | ||
232 | mode = XFER_MW_DMA_0; | ||
233 | break; | 224 | break; |
234 | #endif | 225 | #endif |
235 | default: | 226 | default: |
236 | return 1; | 227 | return 1; |
237 | } | 228 | } |
238 | 229 | ||
239 | if (ide_config_drive_speed(drive, mode)) | 230 | if (ide_config_drive_speed(drive, speed)) |
240 | return 1; | 231 | return 1; |
241 | 232 | ||
242 | au_writel(mem_sttime,MEM_STTIME2); | 233 | au_writel(mem_sttime,MEM_STTIME2); |
@@ -423,9 +414,9 @@ static int auide_dma_check(ide_drive_t *drive) | |||
423 | speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA); | 414 | speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA); |
424 | 415 | ||
425 | if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) | 416 | if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) |
426 | return HWIF(drive)->ide_dma_on(drive); | 417 | return 0; |
427 | 418 | ||
428 | return HWIF(drive)->ide_dma_off_quietly(drive); | 419 | return -1; |
429 | } | 420 | } |
430 | 421 | ||
431 | static int auide_dma_test_irq(ide_drive_t *drive) | 422 | static int auide_dma_test_irq(ide_drive_t *drive) |
@@ -447,27 +438,24 @@ static int auide_dma_test_irq(ide_drive_t *drive) | |||
447 | return 0; | 438 | return 0; |
448 | } | 439 | } |
449 | 440 | ||
450 | static int auide_dma_host_on(ide_drive_t *drive) | 441 | static void auide_dma_host_on(ide_drive_t *drive) |
451 | { | 442 | { |
452 | return 0; | ||
453 | } | 443 | } |
454 | 444 | ||
455 | static int auide_dma_on(ide_drive_t *drive) | 445 | static int auide_dma_on(ide_drive_t *drive) |
456 | { | 446 | { |
457 | drive->using_dma = 1; | 447 | drive->using_dma = 1; |
458 | return auide_dma_host_on(drive); | ||
459 | } | ||
460 | 448 | ||
449 | return 0; | ||
450 | } | ||
461 | 451 | ||
462 | static int auide_dma_host_off(ide_drive_t *drive) | 452 | static void auide_dma_host_off(ide_drive_t *drive) |
463 | { | 453 | { |
464 | return 0; | ||
465 | } | 454 | } |
466 | 455 | ||
467 | static int auide_dma_off_quietly(ide_drive_t *drive) | 456 | static void auide_dma_off_quietly(ide_drive_t *drive) |
468 | { | 457 | { |
469 | drive->using_dma = 0; | 458 | drive->using_dma = 0; |
470 | return auide_dma_host_off(drive); | ||
471 | } | 459 | } |
472 | 460 | ||
473 | static int auide_dma_lostirq(ide_drive_t *drive) | 461 | static int auide_dma_lostirq(ide_drive_t *drive) |
@@ -717,7 +705,8 @@ static int au_ide_probe(struct device *dev) | |||
717 | 705 | ||
718 | /* hold should be on in all cases */ | 706 | /* hold should be on in all cases */ |
719 | hwif->hold = 1; | 707 | hwif->hold = 1; |
720 | hwif->mmio = 2; | 708 | |
709 | hwif->mmio = 1; | ||
721 | 710 | ||
722 | /* If the user has selected DDMA assisted copies, | 711 | /* If the user has selected DDMA assisted copies, |
723 | then set up a few local I/O function entry points | 712 | then set up a few local I/O function entry points |
@@ -732,7 +721,7 @@ static int au_ide_probe(struct device *dev) | |||
732 | hwif->speedproc = &auide_tune_chipset; | 721 | hwif->speedproc = &auide_tune_chipset; |
733 | 722 | ||
734 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | 723 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA |
735 | hwif->ide_dma_off_quietly = &auide_dma_off_quietly; | 724 | hwif->dma_off_quietly = &auide_dma_off_quietly; |
736 | hwif->ide_dma_timeout = &auide_dma_timeout; | 725 | hwif->ide_dma_timeout = &auide_dma_timeout; |
737 | 726 | ||
738 | hwif->ide_dma_check = &auide_dma_check; | 727 | hwif->ide_dma_check = &auide_dma_check; |
@@ -741,8 +730,8 @@ static int au_ide_probe(struct device *dev) | |||
741 | hwif->ide_dma_end = &auide_dma_end; | 730 | hwif->ide_dma_end = &auide_dma_end; |
742 | hwif->dma_setup = &auide_dma_setup; | 731 | hwif->dma_setup = &auide_dma_setup; |
743 | hwif->ide_dma_test_irq = &auide_dma_test_irq; | 732 | hwif->ide_dma_test_irq = &auide_dma_test_irq; |
744 | hwif->ide_dma_host_off = &auide_dma_host_off; | 733 | hwif->dma_host_off = &auide_dma_host_off; |
745 | hwif->ide_dma_host_on = &auide_dma_host_on; | 734 | hwif->dma_host_on = &auide_dma_host_on; |
746 | hwif->ide_dma_lostirq = &auide_dma_lostirq; | 735 | hwif->ide_dma_lostirq = &auide_dma_lostirq; |
747 | hwif->ide_dma_on = &auide_dma_on; | 736 | hwif->ide_dma_on = &auide_dma_on; |
748 | 737 | ||
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c index 09c9e7936b0d..81fa06851b27 100644 --- a/drivers/ide/mips/swarm.c +++ b/drivers/ide/mips/swarm.c | |||
@@ -115,7 +115,7 @@ static int __devinit swarm_ide_probe(struct device *dev) | |||
115 | /* Setup MMIO ops. */ | 115 | /* Setup MMIO ops. */ |
116 | default_hwif_mmiops(hwif); | 116 | default_hwif_mmiops(hwif); |
117 | /* Prevent resource map manipulation. */ | 117 | /* Prevent resource map manipulation. */ |
118 | hwif->mmio = 2; | 118 | hwif->mmio = 1; |
119 | hwif->noprobe = 0; | 119 | hwif->noprobe = 0; |
120 | 120 | ||
121 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) | 121 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) |