Commit b865c715 authored by Russell King's avatar Russell King

[ARM] Update ICS IDE driver.

Update ICS IDE driver with ide-dma and bio changes.
parent 26d5aa5a
/*
* linux/drivers/ide/arm/icside.c
*
* Copyright (c) 1996-2002 Russell King.
*
* Changelog:
* 08-Jun-1996 RMK Created
* 12-Sep-1997 RMK Added interrupt enable/disable
* 17-Apr-1999 RMK Added support for V6 EASI
* 22-May-1999 RMK Added support for V6 DMA
* Copyright (c) 1996-2003 Russell King.
*/
#include <linux/config.h>
......@@ -237,7 +231,7 @@ static void icside_build_sglist(ide_drive_t *drive, struct request *rq)
sg->length = rq->nr_sectors * SECTOR_SIZE;
nents = 1;
} else {
nents = blk_rq_map_sg(&drive->queue, rq, sg);
nents = blk_rq_map_sg(drive->queue, rq, sg);
if (rq_data_dir(rq) == READ)
hwif->sg_dma_direction = DMA_FROM_DEVICE;
......@@ -487,33 +481,31 @@ icside_dma_common(ide_drive_t *drive, struct request *rq,
set_dma_sg(hwif->hw.dma, hwif->sg_table, hwif->sg_nents);
set_dma_mode(hwif->hw.dma, dma_mode);
drive->waiting_for_dma = 1;
return 0;
}
static int icside_dma_read(ide_drive_t *drive)
{
struct request *rq = HWGROUP(drive)->rq;
task_ioreg_t cmd = WIN_NOP;
task_ioreg_t cmd;
if (icside_dma_common(drive, rq, DMA_MODE_READ))
return 1;
drive->waiting_for_dma = 1;
if (drive->media != ide_disk)
return 0;
BUG_ON(HWGROUP(drive)->handler != NULL);
ide_set_handler(drive, icside_dmaintr, 2*WAIT_CMD, NULL);
/*
* FIX ME to use only ACB ide_task_t args Struct
*/
#if 0
{
ide_task_t *args = rq->special;
command = args->tfRegister[IDE_COMMAND_OFFSET];
cmd = args->tfRegister[IDE_COMMAND_OFFSET];
}
#else
if (rq->flags & REQ_DRIVE_TASKFILE) {
......@@ -526,35 +518,31 @@ static int icside_dma_read(ide_drive_t *drive)
}
#endif
/* issue cmd to drive */
HWIF(drive)->OUTB(cmd, IDE_COMMAND_REG);
ide_execute_command(drive, cmd, icside_dmaintr, 2*WAIT_CMD, NULL);
return icside_dma_begin(drive);
}
int icside_dma_write(ide_drive_t *drive)
static int icside_dma_write(ide_drive_t *drive)
{
struct request *rq = HWGROUP(drive)->rq;
task_ioreg_t cmd = WIN_NOP;
task_ioreg_t cmd;
if (icside_dma_common(drive, rq, DMA_MODE_WRITE))
return 1;
drive->waiting_for_dma = 1;
if (drive->media != ide_disk)
return 0;
BUG_ON(HWGROUP(drive)->handler != NULL);
ide_set_handler(drive, icside_dmaintr, 2*WAIT_CMD, NULL);
/*
* FIX ME to use only ACB ide_task_t args Struct
*/
#if 0
{
ide_task_t *args = rq->special;
command = args->tfRegister[IDE_COMMAND_OFFSET];
cmd = args->tfRegister[IDE_COMMAND_OFFSET];
}
#else
if (rq->flags & REQ_DRIVE_TASKFILE) {
......@@ -566,8 +554,9 @@ int icside_dma_write(ide_drive_t *drive)
cmd = WIN_WRITEDMA;
}
#endif
/* issue cmd to drive */
HWIF(drive)->OUTB(cmd, IDE_COMMAND_REG);
ide_execute_command(drive, cmd, icside_dmaintr, 2*WAIT_CMD, NULL);
return icside_dma_begin(drive);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment