Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Resurect the old register read/write test for non...



details:   https://anonhg.NetBSD.org/src/rev/f1200cc15baf
branches:  trunk
changeset: 473963:f1200cc15baf
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Jun 23 19:00:17 1999 +0000

description:
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).

diffstat:

 sys/dev/ic/wdc.c |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r c288367dc1a2 -r f1200cc15baf sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Wed Jun 23 17:42:11 1999 +0000
+++ b/sys/dev/ic/wdc.c  Wed Jun 23 19:00:17 1999 +0000
@@ -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 @@
                            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);



Home | Main Index | Thread Index | Old Index