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.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index c8ffbaf29a88..31266d278095 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -228,7 +228,10 @@ cris_ide_fill_descriptor(cris_dma_descr_type *d, void* buf, unsigned int len, in
228static void 228static void
229cris_ide_start_dma(ide_drive_t *drive, cris_dma_descr_type *d, int dir,int type,int len) 229cris_ide_start_dma(ide_drive_t *drive, cris_dma_descr_type *d, int dir,int type,int len)
230{ 230{
231 reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int, IDE_DATA_REG); 231 ide_hwif_t *hwif = drive->hwif;
232
233 reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int,
234 hwif->io_ports[IDE_DATA_OFFSET]);
232 reg_ata_rw_trf_cnt trf_cnt = {0}; 235 reg_ata_rw_trf_cnt trf_cnt = {0};
233 236
234 mycontext.saved_data = (dma_descr_data*)virt_to_phys(d); 237 mycontext.saved_data = (dma_descr_data*)virt_to_phys(d);
@@ -264,8 +267,12 @@ cris_ide_wait_dma(int dir)
264 267
265static int cris_dma_test_irq(ide_drive_t *drive) 268static int cris_dma_test_irq(ide_drive_t *drive)
266{ 269{
270 ide_hwif_t *hwif = drive->hwif;
267 int intr = REG_RD_INT(ata, regi_ata, r_intr); 271 int intr = REG_RD_INT(ata, regi_ata, r_intr);
268 reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int, IDE_DATA_REG); 272
273 reg_ata_rw_ctrl2 ctrl2 = REG_TYPE_CONV(reg_ata_rw_ctrl2, int,
274 hwif->io_ports[IDE_DATA_OFFSET]);
275
269 return intr & (1 << ctrl2.sel) ? 1 : 0; 276 return intr & (1 << ctrl2.sel) ? 1 : 0;
270} 277}
271 278
@@ -523,7 +530,8 @@ static void cris_ide_start_dma(ide_drive_t *drive, cris_dma_descr_type *d, int d
523 IO_STATE(R_ATA_CTRL_DATA, handsh, dma); 530 IO_STATE(R_ATA_CTRL_DATA, handsh, dma);
524 *R_ATA_CTRL_DATA = 531 *R_ATA_CTRL_DATA =
525 cmd | 532 cmd |
526 IO_FIELD(R_ATA_CTRL_DATA, data, IDE_DATA_REG) | 533 IO_FIELD(R_ATA_CTRL_DATA, data,
534 drive->hwif->io_ports[IDE_DATA_OFFSET]) |
527 IO_STATE(R_ATA_CTRL_DATA, src_dst, dma) | 535 IO_STATE(R_ATA_CTRL_DATA, src_dst, dma) |
528 IO_STATE(R_ATA_CTRL_DATA, multi, on) | 536 IO_STATE(R_ATA_CTRL_DATA, multi, on) |
529 IO_STATE(R_ATA_CTRL_DATA, dma_size, word); 537 IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
@@ -541,7 +549,9 @@ cris_ide_wait_dma(int dir)
541static int cris_dma_test_irq(ide_drive_t *drive) 549static int cris_dma_test_irq(ide_drive_t *drive)
542{ 550{
543 int intr = *R_IRQ_MASK0_RD; 551 int intr = *R_IRQ_MASK0_RD;
544 int bus = IO_EXTRACT(R_ATA_CTRL_DATA, sel, IDE_DATA_REG); 552 int bus = IO_EXTRACT(R_ATA_CTRL_DATA, sel,
553 drive->hwif->io_ports[IDE_DATA_OFFSET]);
554
545 return intr & (1 << (bus + IO_BITNR(R_IRQ_MASK0_RD, ata_irq0))) ? 1 : 0; 555 return intr & (1 << (bus + IO_BITNR(R_IRQ_MASK0_RD, ata_irq0))) ? 1 : 0;
546} 556}
547 557