aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 0e62698146b6..0caca342802d 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -306,6 +306,7 @@ int ide_driveid_update(ide_drive_t *drive)
306 drive->id[ATA_ID_UDMA_MODES] = id[ATA_ID_UDMA_MODES]; 306 drive->id[ATA_ID_UDMA_MODES] = id[ATA_ID_UDMA_MODES];
307 drive->id[ATA_ID_MWDMA_MODES] = id[ATA_ID_MWDMA_MODES]; 307 drive->id[ATA_ID_MWDMA_MODES] = id[ATA_ID_MWDMA_MODES];
308 drive->id[ATA_ID_SWDMA_MODES] = id[ATA_ID_SWDMA_MODES]; 308 drive->id[ATA_ID_SWDMA_MODES] = id[ATA_ID_SWDMA_MODES];
309 drive->id[ATA_ID_CFA_MODES] = id[ATA_ID_CFA_MODES];
309 /* anything more ? */ 310 /* anything more ? */
310 311
311 kfree(id); 312 kfree(id);
@@ -390,7 +391,10 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
390 id[ATA_ID_UDMA_MODES] &= ~0xFF00; 391 id[ATA_ID_UDMA_MODES] &= ~0xFF00;
391 id[ATA_ID_MWDMA_MODES] &= ~0x0700; 392 id[ATA_ID_MWDMA_MODES] &= ~0x0700;
392 id[ATA_ID_SWDMA_MODES] &= ~0x0700; 393 id[ATA_ID_SWDMA_MODES] &= ~0x0700;
393 } 394 if (ata_id_is_cfa(id))
395 id[ATA_ID_CFA_MODES] &= ~0x0E00;
396 } else if (ata_id_is_cfa(id))
397 id[ATA_ID_CFA_MODES] &= ~0x01C0;
394 398
395 skip: 399 skip:
396#ifdef CONFIG_BLK_DEV_IDEDMA 400#ifdef CONFIG_BLK_DEV_IDEDMA
@@ -403,12 +407,18 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
403 if (speed >= XFER_UDMA_0) { 407 if (speed >= XFER_UDMA_0) {
404 i = 1 << (speed - XFER_UDMA_0); 408 i = 1 << (speed - XFER_UDMA_0);
405 id[ATA_ID_UDMA_MODES] |= (i << 8 | i); 409 id[ATA_ID_UDMA_MODES] |= (i << 8 | i);
410 } else if (ata_id_is_cfa(id) && speed >= XFER_MW_DMA_3) {
411 i = speed - XFER_MW_DMA_2;
412 id[ATA_ID_CFA_MODES] |= i << 9;
406 } else if (speed >= XFER_MW_DMA_0) { 413 } else if (speed >= XFER_MW_DMA_0) {
407 i = 1 << (speed - XFER_MW_DMA_0); 414 i = 1 << (speed - XFER_MW_DMA_0);
408 id[ATA_ID_MWDMA_MODES] |= (i << 8 | i); 415 id[ATA_ID_MWDMA_MODES] |= (i << 8 | i);
409 } else if (speed >= XFER_SW_DMA_0) { 416 } else if (speed >= XFER_SW_DMA_0) {
410 i = 1 << (speed - XFER_SW_DMA_0); 417 i = 1 << (speed - XFER_SW_DMA_0);
411 id[ATA_ID_SWDMA_MODES] |= (i << 8 | i); 418 id[ATA_ID_SWDMA_MODES] |= (i << 8 | i);
419 } else if (ata_id_is_cfa(id) && speed >= XFER_PIO_5) {
420 i = speed - XFER_PIO_4;
421 id[ATA_ID_CFA_MODES] |= i << 6;
412 } 422 }
413 423
414 if (!drive->init_speed) 424 if (!drive->init_speed)