summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-27 01:11:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-27 01:11:50 +0000
commit1bd2f7cbffbf279dd27916345027bb36540c411c (patch)
treef9a68c3c12ef067a1d964ddffb750ddd780b96d9 /sys/dev
parent4e2e9714c65149d74c0d51f529869cbb80f91351 (diff)
"aha + bt" kernels work now.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/isa/aha.c12
-rw-r--r--sys/dev/isa/bt.c31
-rw-r--r--sys/dev/isa/files.isa18
3 files changed, 48 insertions, 13 deletions
diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c
index 94cf9130897..1cd5510d58e 100644
--- a/sys/dev/isa/aha.c
+++ b/sys/dev/isa/aha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aha.c,v 1.19 1996/05/26 00:27:09 deraadt Exp $ */
+/* $OpenBSD: aha.c,v 1.20 1996/05/27 01:11:44 deraadt Exp $ */
/* $NetBSD: aha.c,v 1.11 1996/05/12 23:51:23 mycroft Exp $ */
#define AHADIAG
@@ -185,6 +185,8 @@ struct cfdriver aha_cd = {
#define AHA_RESET_TIMEOUT 2000 /* time to wait for reset (mSec) */
#define AHA_ABORT_TIMEOUT 2000 /* time to wait for abort (mSec) */
+#include "bt.h"
+
/*
* aha_cmd(iobase, sc, icnt, ibuf, ocnt, obuf)
*
@@ -328,6 +330,14 @@ ahaprobe(parent, match, aux)
void *match, *aux;
{
register struct isa_attach_args *ia = aux;
+#if NBT > 0
+ extern int btports[], nbtports;
+ int i;
+
+ for (i = 0; i < nbtports; i++)
+ if (btports[i] == ia->ia_iobase)
+ return 0;
+#endif
#ifdef NEWCONFIG
if (ia->ia_iobase == IOBASEUNK)
diff --git a/sys/dev/isa/bt.c b/sys/dev/isa/bt.c
index 02be97419ab..d63c63edd75 100644
--- a/sys/dev/isa/bt.c
+++ b/sys/dev/isa/bt.c
@@ -100,6 +100,13 @@ struct bt_mbx {
#define KVTOPHYS(x) vtophys(x)
+#include "aha.h"
+#include "bt.h"
+#if NAHA > 0
+int btports[NBT];
+int nbtports;
+#endif
+
struct bt_softc {
struct device sc_dev;
struct isadev sc_id;
@@ -255,7 +262,8 @@ bt_cmd(iobase, sc, icnt, ibuf, ocnt, obuf)
delay(50);
}
if (!i) {
- if (opcode != BT_INQUIRE_REVISION)
+ if (opcode != BT_INQUIRE_REVISION &&
+ opcode != BT_INQUIRE_REVISION_3)
printf("%s: bt_cmd, cmd/data port full\n", name);
outb(iobase + BT_CTRL_PORT, BT_CTRL_SRST);
return ENXIO;
@@ -274,7 +282,8 @@ bt_cmd(iobase, sc, icnt, ibuf, ocnt, obuf)
delay(50);
}
if (!i) {
- if (opcode != BT_INQUIRE_REVISION)
+ if (opcode != BT_INQUIRE_REVISION &&
+ opcode != BT_INQUIRE_REVISION_3)
printf("%s: bt_cmd, cmd/data port empty %d\n",
name, ocnt);
outb(iobase + BT_CTRL_PORT, BT_CTRL_SRST);
@@ -817,6 +826,8 @@ bt_find(ia, sc)
u_char sts;
struct bt_extended_inquire inquire;
struct bt_config config;
+ struct bt_revision revision;
+ struct bt_digit digit;
int irq, drq;
/*
@@ -845,13 +856,13 @@ bt_find(ia, sc)
* Check that we actually know how to use this board.
*/
delay(1000);
+ bzero(&inquire, sizeof inquire);
inquire.cmd.opcode = BT_INQUIRE_EXTENDED;
inquire.cmd.len = sizeof(inquire.reply);
bt_cmd(iobase, sc, sizeof(inquire.cmd), (u_char *)&inquire.cmd,
sizeof(inquire.reply), (u_char *)&inquire.reply);
switch (inquire.reply.bus_type) {
case BT_BUS_TYPE_24BIT:
- /* XXXX How do we avoid conflicting with the aha1542 probe? */
case BT_BUS_TYPE_32BIT:
break;
case BT_BUS_TYPE_MCA:
@@ -862,6 +873,16 @@ bt_find(ia, sc)
return 1;
}
+#if NAHA > 0
+ /* Adaptec 1542 cards do not support this */
+ digit.reply.digit = '@';
+ digit.cmd.opcode = BT_INQUIRE_REVISION_3;
+ bt_cmd(iobase, sc, sizeof(digit.cmd), (u_char *)&digit.cmd,
+ sizeof(digit.reply), (u_char *)&digit.reply);
+ if (digit.reply.digit == '@')
+ return 1;
+#endif
+
/*
* Assume we have a board at this stage setup dma channel from
* jumpers and save int level
@@ -933,6 +954,10 @@ bt_find(ia, sc)
return 1;
}
+#if NAHA > 0
+ /* XXXX To avoid conflicting with the aha1542 probe */
+ btports[nbtports++] = iobase;
+#endif
return 0;
}
diff --git a/sys/dev/isa/files.isa b/sys/dev/isa/files.isa
index 6f240edf660..48ede3fa3ff 100644
--- a/sys/dev/isa/files.isa
+++ b/sys/dev/isa/files.isa
@@ -1,4 +1,4 @@
-# $OpenBSD: files.isa,v 1.17 1996/05/26 00:27:14 deraadt Exp $
+# $OpenBSD: files.isa,v 1.18 1996/05/27 01:11:49 deraadt Exp $
# $NetBSD: files.isa,v 1.21 1996/05/16 03:45:55 mycroft Exp $
#
# Config.new file and device description for machine-independent ISA code.
@@ -66,20 +66,20 @@ file dev/isa/lpt.c lpt needs-flag
# SCSI host adapters
#
-# Adaptec AHA-154x family
-device aha: scsi, isadma
-attach aha at isa
-file dev/isa/aha.c aha
+# BusLogic BT-74x EISA family (XXX; should be EISA. it's special)
+device bt: scsi, isadma
+attach bt at isa
+file dev/isa/bt.c bt needs-count
# Adaptec AIC-6[32]60 ICs
device aic: scsi, isadma
attach aic at isa
file dev/isa/aic6360.c aic
-# BusLogic BT-74x EISA family (XXX; should be EISA. it's special)
-device bt: scsi, isadma
-attach bt at isa
-file dev/isa/bt.c bt
+# Adaptec AHA-154x family
+device aha: scsi, isadma
+attach aha at isa
+file dev/isa/aha.c aha needs-count
# Seagate ST0[12] ICs
device sea: scsi, isadma