summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-05-03 05:44:53 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-05-03 05:44:53 +0000
commit8c63691c80ecd1e97f0e5d10ff3b5d80bb14d208 (patch)
tree1524a499efd82828030e1152dc24e1eeb75f81ff /sys
parent8ab891c5ba16dbf352b8218a72e10761388ef9f5 (diff)
downloadFreeBSD-src-8c63691c80ecd1e97f0e5d10ff3b5d80bb14d208.zip
FreeBSD-src-8c63691c80ecd1e97f0e5d10ff3b5d80bb14d208.tar.gz
>From BETA_1_1 branch:
---------------------------- revision 1.20.2.2 date: 1994/05/03 05:16:50; author: rgrimes; state: Exp; lines: +39 -16 Do a board reset if the AHA_INQUIRE command fails. This is needed for the DTC3290. Change the messages about the BT545 to be generic to non adaptec boards, since it appears that most vendors do not implement the AHA_INQUIRE command in thier compatibility mode. ----------------------------
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/isa/aha1542.c55
1 files changed, 39 insertions, 16 deletions
diff --git a/sys/i386/isa/aha1542.c b/sys/i386/isa/aha1542.c
index 9ab6128..f6cebc9 100644
--- a/sys/i386/isa/aha1542.c
+++ b/sys/i386/isa/aha1542.c
@@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
- * $Id: aha1542.c,v 1.23 1994/03/23 09:15:26 davidg Exp $
+ * $Id: aha1542.c,v 1.24 1994/04/21 22:14:43 wollman Exp $
*/
/*
@@ -848,40 +848,63 @@ aha_init(unit)
for (i = AHA_RESET_TIMEOUT; i; i--) {
sts = inb(AHA_CTRL_STAT_PORT);
- if (sts == (AHA_IDLE | AHA_INIT))
+ if (sts == (AHA_IDLE | AHA_INIT)) {
break;
+ }
DELAY(1000); /* calibrated in msec */
}
+#ifdef AHADEBUG
+ printf("aha_init: AHA_RESET_TIMEOUT went to %d\n", i);
+#endif /* AHADEBUG */
if (i == 0) {
#ifdef AHADEBUG
if (aha_debug)
- printf("aha_init: No answer from adaptec board\n");
+ printf("aha_init: No answer from board\n");
#endif /*AHADEBUG */
return (ENXIO);
}
/*
* Assume we have a board at this stage, do an adapter inquire
- * to find out what type of controller it is
+ * to find out what type of controller it is. If the AHA_INQUIRE
+ * command fails, blatter about it, nuke the boardid so the 1542C
+ * stuff gets skipped over, and reset the board again.
*/
- aha_cmd(unit, 0, sizeof(inquire), 1 ,&inquire, AHA_INQUIRE);
+ if(aha_cmd(unit, 0, sizeof(inquire), 1 ,&inquire, AHA_INQUIRE)) {
+ /*
+ * Blah.. not a real adaptec board!!!
+ * Seems that the Buslogic 545S and the DTC3290 both get
+ * this wrong.
+ */
+ printf ("aha%d: not a REAL adaptec board, may cause warnings\n",
+ unit);
+ inquire.boardid = 0;
+ outb(AHA_CTRL_STAT_PORT, AHA_HRST | AHA_SRST);
+ for (i = AHA_RESET_TIMEOUT; i; i--) {
+ sts = inb(AHA_CTRL_STAT_PORT);
+ if (sts == (AHA_IDLE | AHA_INIT)) {
+ break;
+ }
+ DELAY(1000); /* calibrated in msec */
+ }
+#ifdef AHADEBUG
+ printf("aha_init2: AHA_RESET_TIMEOUT went to %d\n", i);
+#endif /* AHADEBUG */
+ if (i == 0) {
+#ifdef AHADEBUG
+ if (aha_debug)
+ printf("aha_init2: No answer from board\n");
+#endif /*AHADEBUG */
+ return (ENXIO);
+ }
+ }
#ifdef AHADEBUG
printf("aha%d: inquire %x, %x, %x, %x\n",
unit,
inquire.boardid, inquire.spec_opts,
inquire.revision_1, inquire.revision_2);
#endif /* AHADEBUG */
- /*
- * XXX The Buslogic 545S gets the AHA_INQUIRE command wrong,
- * they only return one byte which causes us to print an error,
- * so if the boardid comes back as 0x20, tell the user why they
- * get the "cmd/data port empty" message
- */
- if (inquire.boardid == 0x20) {
- /* looks like a Buslogic 545 */
- printf ("aha%d: above cmd/data port empty do to Buslogic 545\n",
- unit);
- }
+
/*
* If we are a 1542C or 1542CF disable the extended bios so that the
* mailbox interface is unlocked.
OpenPOWER on IntegriCloud