diff options
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 92578b6832e9..f4cd2700cae5 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -565,6 +565,36 @@ int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, u8 good, u8 b | |||
565 | 565 | ||
566 | EXPORT_SYMBOL(ide_wait_stat); | 566 | EXPORT_SYMBOL(ide_wait_stat); |
567 | 567 | ||
568 | /** | ||
569 | * ide_in_drive_list - look for drive in black/white list | ||
570 | * @id: drive identifier | ||
571 | * @drive_table: list to inspect | ||
572 | * | ||
573 | * Look for a drive in the blacklist and the whitelist tables | ||
574 | * Returns 1 if the drive is found in the table. | ||
575 | */ | ||
576 | |||
577 | int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) | ||
578 | { | ||
579 | for ( ; drive_table->id_model; drive_table++) | ||
580 | if ((!strcmp(drive_table->id_model, id->model)) && | ||
581 | (!drive_table->id_firmware || | ||
582 | strstr(id->fw_rev, drive_table->id_firmware))) | ||
583 | return 1; | ||
584 | return 0; | ||
585 | } | ||
586 | |||
587 | EXPORT_SYMBOL_GPL(ide_in_drive_list); | ||
588 | |||
589 | /* | ||
590 | * Early UDMA66 devices don't set bit14 to 1, only bit13 is valid. | ||
591 | * We list them here and depend on the device side cable detection for them. | ||
592 | */ | ||
593 | static const struct drive_list_entry ivb_list[] = { | ||
594 | { "QUANTUM FIREBALLlct10 05" , "A03.0900" }, | ||
595 | { NULL , NULL } | ||
596 | }; | ||
597 | |||
568 | /* | 598 | /* |
569 | * All hosts that use the 80c ribbon must use! | 599 | * All hosts that use the 80c ribbon must use! |
570 | * The name is derived from upper byte of word 93 and the 80c ribbon. | 600 | * The name is derived from upper byte of word 93 and the 80c ribbon. |
@@ -573,11 +603,16 @@ u8 eighty_ninty_three (ide_drive_t *drive) | |||
573 | { | 603 | { |
574 | ide_hwif_t *hwif = drive->hwif; | 604 | ide_hwif_t *hwif = drive->hwif; |
575 | struct hd_driveid *id = drive->id; | 605 | struct hd_driveid *id = drive->id; |
606 | int ivb = ide_in_drive_list(id, ivb_list); | ||
576 | 607 | ||
577 | if (hwif->cbl == ATA_CBL_PATA40_SHORT) | 608 | if (hwif->cbl == ATA_CBL_PATA40_SHORT) |
578 | return 1; | 609 | return 1; |
579 | 610 | ||
580 | if (hwif->cbl != ATA_CBL_PATA80) | 611 | if (ivb) |
612 | printk(KERN_DEBUG "%s: skipping word 93 validity check\n", | ||
613 | drive->name); | ||
614 | |||
615 | if (hwif->cbl != ATA_CBL_PATA80 && !ivb) | ||
581 | goto no_80w; | 616 | goto no_80w; |
582 | 617 | ||
583 | /* Check for SATA but only if we are ATA5 or higher */ | 618 | /* Check for SATA but only if we are ATA5 or higher */ |
@@ -587,11 +622,11 @@ u8 eighty_ninty_three (ide_drive_t *drive) | |||
587 | /* | 622 | /* |
588 | * FIXME: | 623 | * FIXME: |
589 | * - change master/slave IDENTIFY order | 624 | * - change master/slave IDENTIFY order |
590 | * - force bit13 (80c cable present) check | 625 | * - force bit13 (80c cable present) check also for !ivb devices |
591 | * (unless the slave device is pre-ATA3) | 626 | * (unless the slave device is pre-ATA3) |
592 | */ | 627 | */ |
593 | #ifndef CONFIG_IDEDMA_IVB | 628 | #ifndef CONFIG_IDEDMA_IVB |
594 | if (id->hw_config & 0x4000) | 629 | if ((id->hw_config & 0x4000) || (ivb && (id->hw_config & 0x2000))) |
595 | #else | 630 | #else |
596 | if (id->hw_config & 0x6000) | 631 | if (id->hw_config & 0x6000) |
597 | #endif | 632 | #endif |
@@ -795,7 +830,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed) | |||
795 | hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); | 830 | hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); |
796 | hwif->OUTB(speed, IDE_NSECTOR_REG); | 831 | hwif->OUTB(speed, IDE_NSECTOR_REG); |
797 | hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); | 832 | hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); |
798 | hwif->OUTB(WIN_SETFEATURES, IDE_COMMAND_REG); | 833 | hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG); |
799 | if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) | 834 | if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) |
800 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); | 835 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); |
801 | udelay(1); | 836 | udelay(1); |
@@ -822,7 +857,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed) | |||
822 | */ | 857 | */ |
823 | for (i = 0; i < 10; i++) { | 858 | for (i = 0; i < 10; i++) { |
824 | udelay(1); | 859 | udelay(1); |
825 | if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), DRIVE_READY, BUSY_STAT|DRQ_STAT|ERR_STAT)) { | 860 | if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), drive->ready_stat, BUSY_STAT|DRQ_STAT|ERR_STAT)) { |
826 | error = 0; | 861 | error = 0; |
827 | break; | 862 | break; |
828 | } | 863 | } |