Resurect the old register read/write test for non-ATA/ATAPI drives, to avoid
false matches on controllers which properly respond to a WDCC_RECAL command. Should close PR port-i386/7702 (the author tested this patch, and said it solves his problem).
This commit is contained in:
parent
b9b5f1fc26
commit
4fd8325ec6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wdc.c,v 1.67 1999/04/11 20:50:28 bouyer Exp $ */
|
||||
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -321,7 +321,28 @@ wdcattach(chp)
|
|||
chp->channel, i), DEBUG_PROBE);
|
||||
if ((chp->ch_drive[i].drive_flags & DRIVE_OLD) == 0)
|
||||
continue;
|
||||
/* Pre-ATA drive ? */
|
||||
/*
|
||||
* Pre-ATA drive ?
|
||||
* Test registers writability (Error register not
|
||||
* writable, but cyllo is), then try an ATA command.
|
||||
*/
|
||||
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
|
||||
WDSD_IBM | (i << 4));
|
||||
delay(10);
|
||||
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh,
|
||||
wd_error, 0x58);
|
||||
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh,
|
||||
wd_cyl_lo, 0xa5);
|
||||
if (bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
|
||||
wd_error == 0x58) ||
|
||||
bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
|
||||
wd_cyl_lo) != 0xa5) {
|
||||
WDCDEBUG_PRINT(("%s:%d:%d: register "
|
||||
"writability failed\n",
|
||||
chp->wdc->sc_dev.dv_xname,
|
||||
chp->channel, i), DEBUG_PROBE);
|
||||
chp->ch_drive[i].drive_flags &= ~DRIVE_OLD;
|
||||
}
|
||||
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
|
||||
WDSD_IBM | (i << 4));
|
||||
delay(100);
|
||||
|
|
Loading…
Reference in New Issue