aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/cris/ide-cris.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/cris/ide-cris.c')
-rw-r--r--drivers/ide/cris/ide-cris.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 5797e0b5a132..6b2d152351b3 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -682,9 +682,12 @@ static void cris_ide_input_data (ide_drive_t *drive, void *, unsigned int);
682static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int); 682static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int);
683static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int); 683static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int);
684static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int); 684static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int);
685static int cris_dma_off (ide_drive_t *drive);
686static int cris_dma_on (ide_drive_t *drive); 685static int cris_dma_on (ide_drive_t *drive);
687 686
687static void cris_dma_off(ide_drive_t *drive)
688{
689}
690
688static void tune_cris_ide(ide_drive_t *drive, u8 pio) 691static void tune_cris_ide(ide_drive_t *drive, u8 pio)
689{ 692{
690 int setup, strobe, hold; 693 int setup, strobe, hold;
@@ -795,7 +798,7 @@ init_e100_ide (void)
795 0, 0, cris_ide_ack_intr, 798 0, 0, cris_ide_ack_intr,
796 ide_default_irq(0)); 799 ide_default_irq(0));
797 ide_register_hw(&hw, &hwif); 800 ide_register_hw(&hw, &hwif);
798 hwif->mmio = 2; 801 hwif->mmio = 1;
799 hwif->chipset = ide_etrax100; 802 hwif->chipset = ide_etrax100;
800 hwif->tuneproc = &tune_cris_ide; 803 hwif->tuneproc = &tune_cris_ide;
801 hwif->speedproc = &speed_cris_ide; 804 hwif->speedproc = &speed_cris_ide;
@@ -814,13 +817,16 @@ init_e100_ide (void)
814 hwif->OUTBSYNC = &cris_ide_outbsync; 817 hwif->OUTBSYNC = &cris_ide_outbsync;
815 hwif->INB = &cris_ide_inb; 818 hwif->INB = &cris_ide_inb;
816 hwif->INW = &cris_ide_inw; 819 hwif->INW = &cris_ide_inw;
817 hwif->ide_dma_host_off = &cris_dma_off; 820 hwif->dma_host_off = &cris_dma_off;
818 hwif->ide_dma_host_on = &cris_dma_on; 821 hwif->dma_host_on = &cris_dma_on;
819 hwif->ide_dma_off_quietly = &cris_dma_off; 822 hwif->dma_off_quietly = &cris_dma_off;
820 hwif->udma_four = 0; 823 hwif->udma_four = 0;
821 hwif->ultra_mask = cris_ultra_mask; 824 hwif->ultra_mask = cris_ultra_mask;
822 hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */ 825 hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
823 hwif->swdma_mask = 0x07; /* Singleword DMA 0-2 */ 826 hwif->swdma_mask = 0x07; /* Singleword DMA 0-2 */
827 hwif->autodma = 1;
828 hwif->drives[0].autodma = 1;
829 hwif->drives[1].autodma = 1;
824 } 830 }
825 831
826 /* Reset pulse */ 832 /* Reset pulse */
@@ -835,11 +841,6 @@ init_e100_ide (void)
835 cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0); 841 cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0);
836} 842}
837 843
838static int cris_dma_off (ide_drive_t *drive)
839{
840 return 0;
841}
842
843static int cris_dma_on (ide_drive_t *drive) 844static int cris_dma_on (ide_drive_t *drive)
844{ 845{
845 return 0; 846 return 0;
@@ -1045,17 +1046,10 @@ static ide_startstop_t cris_dma_intr (ide_drive_t *drive)
1045 1046
1046static int cris_dma_check(ide_drive_t *drive) 1047static int cris_dma_check(ide_drive_t *drive)
1047{ 1048{
1048 ide_hwif_t *hwif = drive->hwif; 1049 if (ide_use_dma(drive) && cris_config_drive_for_dma(drive))
1049 struct hd_driveid* id = drive->id; 1050 return 0;
1050
1051 if (id && (id->capability & 1)) {
1052 if (ide_use_dma(drive)) {
1053 if (cris_config_drive_for_dma(drive))
1054 return hwif->ide_dma_on(drive);
1055 }
1056 }
1057 1051
1058 return hwif->ide_dma_off_quietly(drive); 1052 return -1;
1059} 1053}
1060 1054
1061static int cris_dma_end(ide_drive_t *drive) 1055static int cris_dma_end(ide_drive_t *drive)