X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fide%2Fmips%2Fau1xxx-ide.c;h=0d5e4c67fa54ae126f6047309683280930f9510f;hb=a8028fcb485522c0d7de9c5423812de9224b37c9;hp=b2dc028dc8ca17d424cc5677e070cdcf374f9e87;hpb=0ce3c83a9c22f59937b86c80b478dfbffe54dbab;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index b2dc028dc8ca..0d5e4c67fa54 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c @@ -106,7 +106,7 @@ static void auide_tune_drive(ide_drive_t *drive, byte pio) u8 speed; /* get the best pio mode for the drive */ - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); + pio = ide_get_best_pio_mode(drive, pio, 4); printk(KERN_INFO "%s: setting Au1XXX IDE to PIO mode%d\n", drive->name, pio); @@ -180,6 +180,8 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) int mem_sttime; int mem_stcfg; + speed = ide_rate_filter(drive, speed); + mem_sttime = 0; mem_stcfg = au_readl(MEM_STCFG2); @@ -381,9 +383,7 @@ static int auide_dma_setup(ide_drive_t *drive) static int auide_dma_check(ide_drive_t *drive) { - u8 speed; - -#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA + u8 speed = ide_max_dma_mode(drive); if( dbdma_init_done == 0 ){ auide_hwif.white_list = ide_in_drive_list(drive->id, @@ -394,7 +394,6 @@ static int auide_dma_check(ide_drive_t *drive) auide_ddma_init(&auide_hwif); dbdma_init_done = 1; } -#endif /* Is the drive in our DMA black list? */ @@ -409,8 +408,6 @@ static int auide_dma_check(ide_drive_t *drive) else drive->using_dma = 1; - speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA); - if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) return 0; @@ -456,10 +453,9 @@ static void auide_dma_off_quietly(ide_drive_t *drive) drive->using_dma = 0; } -static int auide_dma_lostirq(ide_drive_t *drive) +static void auide_dma_lost_irq(ide_drive_t *drive) { printk(KERN_ERR "%s: IRQ lost\n", drive->name); - return 0; } static void auide_ddma_tx_callback(int irq, void *param) @@ -489,16 +485,16 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) -static int auide_dma_timeout(ide_drive_t *drive) +static void auide_dma_timeout(ide_drive_t *drive) { -// printk("%s\n", __FUNCTION__); + ide_hwif_t *hwif = HWIF(drive); printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); - if (HWIF(drive)->ide_dma_test_irq(drive)) - return 0; + if (hwif->ide_dma_test_irq(drive)) + return; - return HWIF(drive)->ide_dma_end(drive); + hwif->ide_dma_end(drive); } @@ -639,6 +635,7 @@ static int au_ide_probe(struct device *dev) _auide_hwif *ahwif = &auide_hwif; ide_hwif_t *hwif; struct resource *res; + hw_regs_t *hw; int ret = 0; #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) @@ -681,7 +678,7 @@ static int au_ide_probe(struct device *dev) /* FIXME: This might possibly break PCMCIA IDE devices */ hwif = &ide_hwifs[pdev->id]; - hw_regs_t *hw = &hwif->hw; + hw = &hwif->hw; hwif->irq = hw->irq = ahwif->irq; hwif->chipset = ide_au1xxx; @@ -697,6 +694,8 @@ static int au_ide_probe(struct device *dev) hwif->swdma_mask = 0x0; #endif + hwif->pio_mask = ATA_PIO4; + hwif->noprobe = 0; hwif->drives[0].unmask = 1; hwif->drives[1].unmask = 1; @@ -720,7 +719,7 @@ static int au_ide_probe(struct device *dev) #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA hwif->dma_off_quietly = &auide_dma_off_quietly; - hwif->ide_dma_timeout = &auide_dma_timeout; + hwif->dma_timeout = &auide_dma_timeout; hwif->ide_dma_check = &auide_dma_check; hwif->dma_exec_cmd = &auide_dma_exec_cmd; @@ -730,7 +729,7 @@ static int au_ide_probe(struct device *dev) hwif->ide_dma_test_irq = &auide_dma_test_irq; hwif->dma_host_off = &auide_dma_host_off; hwif->dma_host_on = &auide_dma_host_on; - hwif->ide_dma_lostirq = &auide_dma_lostirq; + hwif->dma_lost_irq = &auide_dma_lost_irq; hwif->ide_dma_on = &auide_dma_on; hwif->autodma = 1; @@ -759,6 +758,9 @@ static int au_ide_probe(struct device *dev) #endif probe_hwif_init(hwif); + + ide_proc_register_port(hwif); + dev_set_drvdata(dev, hwif); printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode );