summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-08-25 21:00:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-08-25 21:00:38 +0000
commited289beab17eb705994e0607310ff1f5dadd38c9 (patch)
tree772a1fd060fed287cf6f77b439100bd55209aaf0
parentf5006eba1c3736a687553bccba1f67cc6d21fb18 (diff)
Allow DMA transfers to be disabled through device flags; default is to enable
DMA.
-rw-r--r--share/man/man4/man4.hp300/spc.49
-rw-r--r--sys/arch/hp300/conf/GENERIC4
-rw-r--r--sys/arch/hp300/conf/RAMDISK4
-rw-r--r--sys/arch/hp300/dev/spc.c11
4 files changed, 18 insertions, 10 deletions
diff --git a/share/man/man4/man4.hp300/spc.4 b/share/man/man4/man4.hp300/spc.4
index 472c22fc9c0..cafc895c874 100644
--- a/share/man/man4/man4.hp300/spc.4
+++ b/share/man/man4/man4.hp300/spc.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: spc.4,v 1.1 2004/08/03 21:46:49 miod Exp $
+.\" $OpenBSD: spc.4,v 1.2 2004/08/25 21:00:34 miod Exp $
.\" $NetBSD: spc.4,v 1.1 2003/08/01 02:36:04 tsutsui Exp $
.\"
.\" Copyright (c) 2003 Izumi Tsutsui. All rights reserved.
@@ -25,14 +25,14 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd July 27, 2004
+.Dd August 25, 2004
.Dt SPC 4 hp300
.Os
.Sh NAME
.Nm spc
.Nd HP 98658 SCSI host adaptor driver
.Sh SYNOPSIS
-.Cd "spc* at dio? scode ?"
+.Cd "spc* at dio? scode ? flags 0x00"
.Pp
.Cd "scsibus* at spc?"
.Sh DESCRIPTION
@@ -45,6 +45,9 @@ MB87030/MB89352
Protocol Controller (SPC) chips, used as part of the
.Tn HP
98658 SCSI interface.
+If the device
+.Cm flags
+are specified with a value of 1, the driver will not attempt to use DMA.
.Sh SEE ALSO
.Xr cd 4 ,
.Xr ch 4 ,
diff --git a/sys/arch/hp300/conf/GENERIC b/sys/arch/hp300/conf/GENERIC
index 9ea6c96e91c..1fffdc7814d 100644
--- a/sys/arch/hp300/conf/GENERIC
+++ b/sys/arch/hp300/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.31 2004/08/03 21:46:54 miod Exp $
+# $OpenBSD: GENERIC,v 1.32 2004/08/25 21:00:37 miod Exp $
# $NetBSD: GENERIC,v 1.23 1997/01/31 06:12:57 thorpej Exp $
#
# Generic kernel - one size fits all.
@@ -110,7 +110,7 @@ ct* at hpibbus? slave ? punit ? # HP-IB cartridge tapes
mt* at hpibbus? slave ? punit ? # HP-IB 9-track tape
ppi0 at hpibbus0 slave 5 punit 0 # HP-IB plotter
-spc* at dio? scode ? # SCSI controller
+spc* at dio? scode ? flags 0x00 # SCSI controller
scsibus* at spc?
sd* at scsibus? target ? lun ? # SCSI disks
diff --git a/sys/arch/hp300/conf/RAMDISK b/sys/arch/hp300/conf/RAMDISK
index 41ee06bb3bb..57f8beb4967 100644
--- a/sys/arch/hp300/conf/RAMDISK
+++ b/sys/arch/hp300/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.18 2004/08/22 21:31:33 miod Exp $
+# $OpenBSD: RAMDISK,v 1.19 2004/08/25 21:00:37 miod Exp $
#
# Ram disk kernel.
#
@@ -117,7 +117,7 @@ hd* at hpibbus? slave ? punit ? # HP-IB disks
ct* at hpibbus? slave ? punit ? # HP-IB cartridge tapes
mt* at hpibbus? slave ? punit ? # HP-IB 9-track tape
-spc* at dio? scode ? # SCSI controller
+spc* at dio? scode ? flags 0x00 # SCSI controller
scsibus* at spc?
sd* at scsibus? target ? lun ? # SCSI disks
diff --git a/sys/arch/hp300/dev/spc.c b/sys/arch/hp300/dev/spc.c
index dc04a869107..7fa89855b19 100644
--- a/sys/arch/hp300/dev/spc.c
+++ b/sys/arch/hp300/dev/spc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spc.c,v 1.6 2004/08/25 20:57:38 miod Exp $ */
+/* $OpenBSD: spc.c,v 1.7 2004/08/25 21:00:37 miod Exp $ */
/* $NetBSD: spc.c,v 1.2 2003/11/17 14:37:59 tsutsui Exp $ */
/*
@@ -84,6 +84,9 @@ struct cfdriver spc_cd = {
NULL, "spc", DV_DULL
};
+/* cf_flags */
+#define SPC_NODMA 0x01
+
int
spc_dio_match(struct device *parent, void *vcf, void *aux)
{
@@ -140,8 +143,10 @@ spc_dio_attach(struct device *parent, struct device *self, void *aux)
sc->sc_initiator = id;
- sc->sc_dma_start = spc_dio_dmastart;
- sc->sc_dma_done = spc_dio_dmadone;
+ if ((sc->sc_dev.dv_cfdata->cf_flags & SPC_NODMA) == 0) {
+ sc->sc_dma_start = spc_dio_dmastart;
+ sc->sc_dma_done = spc_dio_dmadone;
+ }
sc->sc_reset = spc_dio_reset;
dsc->sc_dq.dq_softc = dsc;