summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/sbus.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1998-11-11 00:26:02 +0000
committerJason Wright <jason@cvs.openbsd.org>1998-11-11 00:26:02 +0000
commit777b7ad5376b715f1c9f137f1b1cf6d7345dc634 (patch)
tree3594b8e48c738c3130b511593e51a5a1b8700405 /sys/arch/sparc/dev/sbus.c
parentdad9cda7d59a7eebcce55a30abe7e270a54af10e (diff)
Detect cards that require dma that are in non-dma slots and don't allow
them to be attach'd.
Diffstat (limited to 'sys/arch/sparc/dev/sbus.c')
-rw-r--r--sys/arch/sparc/dev/sbus.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/sbus.c b/sys/arch/sparc/dev/sbus.c
index aee7de7fbf8..d82e7da864f 100644
--- a/sys/arch/sparc/dev/sbus.c
+++ b/sys/arch/sparc/dev/sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbus.c,v 1.5 1997/08/08 08:25:27 downsj Exp $ */
+/* $OpenBSD: sbus.c,v 1.6 1998/11/11 00:26:00 jason Exp $ */
/* $NetBSD: sbus.c,v 1.17 1997/06/01 22:10:39 pk Exp $ */
/*
@@ -87,9 +87,13 @@ sbus_print(args, sbus)
const char *sbus;
{
register struct confargs *ca = args;
+ static char *sl = "slave-only";
if (sbus)
printf("%s at %s", ca->ca_ra.ra_name, sbus);
+ /* Check root node for 'slave-only' property */
+ if (getpropint(0, sl, 0) & (1 << ca->ca_slot))
+ printf(" %s", sl);
printf(" slot %d offset 0x%x", ca->ca_slot, ca->ca_offset);
return (UNCONF);
}
@@ -287,3 +291,26 @@ sbusreset(sbus)
}
}
}
+
+/*
+ * Returns true if this sbus slot is capable of dma
+ */
+int
+sbus_testdma(sc, ca)
+ struct sbus_softc *sc;
+ struct confargs *ca;
+{
+ struct romaux *ra = &ca->ca_ra;
+
+ /*
+ * XXX how to handle more then one sbus?
+ */
+
+ if (getpropint(0, "slave-only", 0) & (1 << ca->ca_slot)) {
+ printf("%s: dma card found in non-dma sbus slot %d"
+ ": not supported\n", ra->ra_name, ca->ca_slot);
+ return (0);
+ }
+
+ return (1);
+}