From 58932a8415d4df59cae34286a5cf7e3803ea87ca Mon Sep 17 00:00:00 2001 From: kenh Date: Wed, 18 Nov 1998 19:12:08 +0000 Subject: [PATCH] Quirk out the first test in the beginning of wdcprobe(); the Vaio CD-ROM drive doesn't like it for some reason. --- sys/dev/ic/wdc.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 62717b3bd0ee..dd761b7020e8 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -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);