Quirk out the first test in the beginning of wdcprobe(); the Vaio

CD-ROM drive doesn't like it for some reason.
This commit is contained in:
kenh 1998-11-18 19:12:08 +00:00
parent f50fecdeaf
commit 58932a8415
1 changed files with 20 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc.c,v 1.39 1998/11/11 19:38:27 bouyer Exp $ */
/* $NetBSD: wdc.c,v 1.40 1998/11/18 19:12:08 kenh Exp $ */
/*
@ -181,26 +181,27 @@ wdcprobe(chp)
* Sanity check to see if the wdc channel responds at all.
*/
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM);
delay(1);
st0 = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM | 0x10);
delay(1);
st1 = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);
if ((chp->wdc->cap & WDC_CAPABILITY_NO_EXTRA_RESETS) == 0) {
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM);
delay(1);
st0 = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM | 0x10);
delay(1);
st1 = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);
WDCDEBUG_PRINT(("%s:%d: before reset, st0=0x%x, st1=0x%x\n",
chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe", chp->channel,
st0, st1), DEBUG_PROBE);
if (st0 == 0xff)
ret_value &= ~0x01;
if (st1 == 0xff)
ret_value &= ~0x02;
if (ret_value == 0)
return 0;
WDCDEBUG_PRINT(("%s:%d: before reset, st0=0x%x, st1=0x%x\n",
chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe", chp->channel,
st0, st1), DEBUG_PROBE);
if (st0 == 0xff)
ret_value &= ~0x01;
if (st1 == 0xff)
ret_value &= ~0x02;
if (ret_value == 0)
return 0;
}
/* assert SRST, wait for reset to complete */
bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
WDSD_IBM);