diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-03-31 14:15:28 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:28 -0400 |
commit | 74638c84821c066d02c158bc843c84499ddc9764 (patch) | |
tree | cd6f79f34d87d25a621aaf1369ce226923de3c14 /drivers/ide/ide-iops.c | |
parent | c4199930b119eb9c1ffb102ed57eaac4d4424d08 (diff) |
ide: add support for CFA specified transfer modes (take 3)
Add support for the CompactFlash specific PIO modes 5/6 and MWDMA modes 3/4.
Since there were no PIO5 capable hard drives produced and one would also need
66 MHz IDE clock to actually get the difference WRT the address setup timings
programmed, I decided to simply replace the old non-standard PIO mode 5 timings
with the CFA specified ones.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: stf_xl@wp.pl
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 12 |
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) |