aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_bf54x.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2012-01-06 12:45:45 -0500
committerJeff Garzik <jgarzik@redhat.com>2012-01-08 19:24:02 -0500
commit909fefc2511120ec71178f752c195c7b0b30269e (patch)
tree706b2981d230533e135ba6d431b8922a81a302e4 /drivers/ata/pata_bf54x.c
parent33574d68ae41ccbc6686cfabd965c685285c58a0 (diff)
pata_bf54x: fix BMIDE status register emulation
The author of this driver clearly wasn't familiar with the BMIDE specification (also known as SFF-8038i) when he implemented the bmdma_status() method: first, the interrupt bit of the BMIDE status register corresponds to nothing else but INTRQ signal (ATAPI_DEV_INT here); second, the error bit is only set if the controller encounters issue doing the bus master transfers, not on the IDE DMA burst termination interrupts like here (moreover, setting the error bit doesn't cause an interrupt). We now need to disable all those unused interrupts... (The only thing I couldn't figure out is how to flush the FIFO to memory once the interrupt happens as required by the mentioned spec.) Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_bf54x.c')
-rw-r--r--drivers/ata/pata_bf54x.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index bd987bb082eb..d6a4677fdf71 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -418,14 +418,6 @@ static void bfin_set_dmamode(struct ata_port *ap, struct ata_device *adev)
418 (tcyc_tdvs<<8 | tdvs)); 418 (tcyc_tdvs<<8 | tdvs));
419 ATAPI_SET_ULTRA_TIM_2(base, (tmli<<8 | tss)); 419 ATAPI_SET_ULTRA_TIM_2(base, (tmli<<8 | tss));
420 ATAPI_SET_ULTRA_TIM_3(base, (trp<<8 | tzah)); 420 ATAPI_SET_ULTRA_TIM_3(base, (trp<<8 | tzah));
421
422 /* Enable host ATAPI Untra DMA interrupts */
423 ATAPI_SET_INT_MASK(base,
424 ATAPI_GET_INT_MASK(base)
425 | UDMAIN_DONE_MASK
426 | UDMAOUT_DONE_MASK
427 | UDMAIN_TERM_MASK
428 | UDMAOUT_TERM_MASK);
429 } 421 }
430 } 422 }
431 } 423 }
@@ -470,10 +462,6 @@ static void bfin_set_dmamode(struct ata_port *ap, struct ata_device *adev)
470 ATAPI_SET_MULTI_TIM_0(base, (tm<<8 | td)); 462 ATAPI_SET_MULTI_TIM_0(base, (tm<<8 | td));
471 ATAPI_SET_MULTI_TIM_1(base, (tkr<<8 | tkw)); 463 ATAPI_SET_MULTI_TIM_1(base, (tkr<<8 | tkw));
472 ATAPI_SET_MULTI_TIM_2(base, (teoc<<8 | th)); 464 ATAPI_SET_MULTI_TIM_2(base, (teoc<<8 | th));
473
474 /* Enable host ATAPI Multi DMA interrupts */
475 ATAPI_SET_INT_MASK(base, ATAPI_GET_INT_MASK(base)
476 | MULTI_DONE_MASK | MULTI_TERM_MASK);
477 SSYNC(); 465 SSYNC();
478 } 466 }
479 } 467 }
@@ -1153,15 +1141,11 @@ static unsigned char bfin_bmdma_status(struct ata_port *ap)
1153{ 1141{
1154 unsigned char host_stat = 0; 1142 unsigned char host_stat = 0;
1155 void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; 1143 void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr;
1156 unsigned short int_status = ATAPI_GET_INT_STATUS(base);
1157 1144
1158 if (ATAPI_GET_STATUS(base) & (MULTI_XFER_ON|ULTRA_XFER_ON)) 1145 if (ATAPI_GET_STATUS(base) & (MULTI_XFER_ON | ULTRA_XFER_ON))
1159 host_stat |= ATA_DMA_ACTIVE; 1146 host_stat |= ATA_DMA_ACTIVE;
1160 if (int_status & (MULTI_DONE_INT|UDMAIN_DONE_INT|UDMAOUT_DONE_INT| 1147 if (ATAPI_GET_INT_STATUS(base) & ATAPI_DEV_INT)
1161 ATAPI_DEV_INT))
1162 host_stat |= ATA_DMA_INTR; 1148 host_stat |= ATA_DMA_INTR;
1163 if (int_status & (MULTI_TERM_INT|UDMAIN_TERM_INT|UDMAOUT_TERM_INT))
1164 host_stat |= ATA_DMA_ERR|ATA_DMA_INTR;
1165 1149
1166 dev_dbg(ap->dev, "ATAPI: host_stat=0x%x\n", host_stat); 1150 dev_dbg(ap->dev, "ATAPI: host_stat=0x%x\n", host_stat);
1167 1151