aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_old.c
diff options
context:
space:
mode:
authorTobias Oed <tobiasoed@hotmail.com>2006-10-03 04:14:17 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:07 -0400
commitf3d5b34caae393f13a9486036f98c81cac1595c4 (patch)
tree372f0d9dad137549450553c6e5ba483ce05d246a /drivers/ide/pci/pdc202xx_old.c
parent0750508ae6479d4ac6154b35c5b82929f31efb03 (diff)
[PATCH] Enable cdrom dma access with pdc20265_old
This patch allows me to use dma with my cd/dvd attached to my on board pdc20265 ide controller Alan sayeth: Looks sane. Would be nice to know if there is any documentation supporting this hack being safe but the logic makes sense. The LBA48 case faces the same problem - the state machine gets confused about the transfer length and needs kicking Signed-off-by: Tobias Oed <tobiasoed@hotmail.com> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Cc: Jens Axboe <axboe@suse.de> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r--drivers/ide/pci/pdc202xx_old.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index b46022a11bef..184cdacddeb6 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -154,7 +154,8 @@ static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
154 u8 AP, BP, CP, DP; 154 u8 AP, BP, CP, DP;
155 u8 TA = 0, TB = 0, TC = 0; 155 u8 TA = 0, TB = 0, TC = 0;
156 156
157 if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) 157 if (drive->media != ide_disk &&
158 drive->media != ide_cdrom && speed < XFER_SW_DMA_0)
158 return -1; 159 return -1;
159 160
160 pci_read_config_dword(dev, drive_pci, &drive_conf); 161 pci_read_config_dword(dev, drive_pci, &drive_conf);
@@ -330,14 +331,12 @@ static int config_chipset_for_dma (ide_drive_t *drive)
330 331
331chipset_is_set: 332chipset_is_set:
332 333
333 if (drive->media == ide_disk) { 334 pci_read_config_byte(dev, (drive_pci), &AP);
334 pci_read_config_byte(dev, (drive_pci), &AP); 335 if (id->capability & 4) /* IORDY_EN */
335 if (id->capability & 4) /* IORDY_EN */ 336 pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN);
336 pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN); 337 pci_read_config_byte(dev, (drive_pci), &AP);
337 pci_read_config_byte(dev, (drive_pci), &AP); 338 if (drive->media == ide_disk) /* PREFETCH_EN */
338 if (drive->media == ide_disk) /* PREFETCH_EN */ 339 pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN);
339 pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN);
340 }
341 340
342 speed = ide_dma_speed(drive, pdc202xx_ratemask(drive)); 341 speed = ide_dma_speed(drive, pdc202xx_ratemask(drive));
343 342
@@ -385,7 +384,7 @@ static void pdc202xx_old_ide_dma_start(ide_drive_t *drive)
385{ 384{
386 if (drive->current_speed > XFER_UDMA_2) 385 if (drive->current_speed > XFER_UDMA_2)
387 pdc_old_enable_66MHz_clock(drive->hwif); 386 pdc_old_enable_66MHz_clock(drive->hwif);
388 if (drive->addressing == 1) { 387 if (drive->media != ide_disk || drive->addressing == 1) {
389 struct request *rq = HWGROUP(drive)->rq; 388 struct request *rq = HWGROUP(drive)->rq;
390 ide_hwif_t *hwif = HWIF(drive); 389 ide_hwif_t *hwif = HWIF(drive);
391 unsigned long high_16 = hwif->dma_master; 390 unsigned long high_16 = hwif->dma_master;
@@ -405,7 +404,7 @@ static void pdc202xx_old_ide_dma_start(ide_drive_t *drive)
405 404
406static int pdc202xx_old_ide_dma_end(ide_drive_t *drive) 405static int pdc202xx_old_ide_dma_end(ide_drive_t *drive)
407{ 406{
408 if (drive->addressing == 1) { 407 if (drive->media != ide_disk || drive->addressing == 1) {
409 ide_hwif_t *hwif = HWIF(drive); 408 ide_hwif_t *hwif = HWIF(drive);
410 unsigned long high_16 = hwif->dma_master; 409 unsigned long high_16 = hwif->dma_master;
411 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); 410 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
@@ -519,6 +518,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
519 hwif->ultra_mask = 0x3f; 518 hwif->ultra_mask = 0x3f;
520 hwif->mwdma_mask = 0x07; 519 hwif->mwdma_mask = 0x07;
521 hwif->swdma_mask = 0x07; 520 hwif->swdma_mask = 0x07;
521 hwif->atapi_dma = 1;
522 522
523 hwif->err_stops_fifo = 1; 523 hwif->err_stops_fifo = 1;
524 524