summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2010-04-20 20:21:54 +0000
committermiod <miod@openbsd.org>2010-04-20 20:21:54 +0000
commitc0c65d081259f138caaf3025c247ba75a0f9bb3a (patch)
tree59c59947a3f36d8b2e23e32dca79da37985d55f3
parentDocument the ``alias <map>'' parameter. (diff)
downloadwireguard-openbsd-c0c65d081259f138caaf3025c247ba75a0f9bb3a.tar.xz
wireguard-openbsd-c0c65d081259f138caaf3025c247ba75a0f9bb3a.zip
Allow MD oosiop(4) attachment to override default values for a few of the
chip initialization values (SCNTL0, DMODE, DWT, CTEST7). No functional change on hppa; required by another upcoming attachment.
-rw-r--r--sys/arch/hppa/gsc/oosiop_gsc.c8
-rw-r--r--sys/dev/ic/oosiop.c10
-rw-r--r--sys/dev/ic/oosiopreg.h3
-rw-r--r--sys/dev/ic/oosiopvar.h7
4 files changed, 20 insertions, 8 deletions
diff --git a/sys/arch/hppa/gsc/oosiop_gsc.c b/sys/arch/hppa/gsc/oosiop_gsc.c
index 9b72ecc6d04..10002805bc1 100644
--- a/sys/arch/hppa/gsc/oosiop_gsc.c
+++ b/sys/arch/hppa/gsc/oosiop_gsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: oosiop_gsc.c,v 1.2 2005/12/13 23:13:45 mickey Exp $ */
+/* $OpenBSD: oosiop_gsc.c,v 1.3 2010/04/20 20:21:54 miod Exp $ */
/* $NetBSD: oosiop_gsc.c,v 1.2 2003/07/15 02:29:25 lukem Exp $ */
/*
@@ -125,6 +125,12 @@ oosiop_gsc_attach(parent, self, aux)
sc->sc_chip = OOSIOP_700;
sc->sc_id = 7; /* XXX */
+ /* default values */
+ sc->sc_scntl0 = OOSIOP_SCNTL0_EPG;
+ sc->sc_dmode = OOSIOP_DMODE_BL_8;
+ sc->sc_dwt = 0xff; /* Enable DMA timeout */
+ sc->sc_ctest7 = 0;
+
/*
* Reset the SCSI subsystem.
*/
diff --git a/sys/dev/ic/oosiop.c b/sys/dev/ic/oosiop.c
index e417c83541c..db263a09af4 100644
--- a/sys/dev/ic/oosiop.c
+++ b/sys/dev/ic/oosiop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: oosiop.c,v 1.14 2010/03/23 01:57:19 krw Exp $ */
+/* $OpenBSD: oosiop.c,v 1.15 2010/04/20 20:21:56 miod Exp $ */
/* $NetBSD: oosiop.c,v 1.4 2003/10/29 17:45:55 tsutsui Exp $ */
/*
@@ -1044,13 +1044,13 @@ oosiop_reset(struct oosiop_softc *sc)
delay(10000);
/* Set up various chip parameters */
- oosiop_write_1(sc, OOSIOP_SCNTL0, OOSIOP_ARB_FULL | OOSIOP_SCNTL0_EPG);
+ oosiop_write_1(sc, OOSIOP_SCNTL0, OOSIOP_ARB_FULL | sc->sc_scntl0);
oosiop_write_1(sc, OOSIOP_SCNTL1, OOSIOP_SCNTL1_ESR);
oosiop_write_1(sc, OOSIOP_DCNTL, sc->sc_dcntl);
- oosiop_write_1(sc, OOSIOP_DMODE, OOSIOP_DMODE_BL_8);
+ oosiop_write_1(sc, OOSIOP_DMODE, sc->sc_dmode);
oosiop_write_1(sc, OOSIOP_SCID, OOSIOP_SCID_VALUE(sc->sc_id));
- oosiop_write_1(sc, OOSIOP_DWT, 0xff); /* Enable DMA timeout */
- oosiop_write_1(sc, OOSIOP_CTEST7, 0);
+ oosiop_write_1(sc, OOSIOP_DWT, sc->sc_dwt);
+ oosiop_write_1(sc, OOSIOP_CTEST7, sc->sc_ctest7);
oosiop_write_1(sc, OOSIOP_SXFER, 0);
/* Clear all interrupts */
diff --git a/sys/dev/ic/oosiopreg.h b/sys/dev/ic/oosiopreg.h
index f924a2f0877..7f794a96412 100644
--- a/sys/dev/ic/oosiopreg.h
+++ b/sys/dev/ic/oosiopreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: oosiopreg.h,v 1.1 2004/03/12 00:04:57 miod Exp $ */
+/* $OpenBSD: oosiopreg.h,v 1.2 2010/04/20 20:21:56 miod Exp $ */
/* $NetBSD: oosiopreg.h,v 1.3 2003/11/02 11:07:45 wiz Exp $ */
/*
@@ -266,6 +266,7 @@
#define OOSIOP_CTEST7_STD 0x10 /* Selection timeout disable */
#define OOSIOP_CTEST7_DFP 0x08 /* DMA FIFO parity bit */
#define OOSIOP_CTEST7_EVP 0x04 /* Even parity (to host bus) */
+#define OOSIOP_CTEST7_DC 0x02 /* DC output signal low */
#define OOSIOP_CTEST7_DIFF 0x01 /* Differential mode */
/* DMA FIFO register (dfifo) */
diff --git a/sys/dev/ic/oosiopvar.h b/sys/dev/ic/oosiopvar.h
index 6d670aeabd7..85837139e5b 100644
--- a/sys/dev/ic/oosiopvar.h
+++ b/sys/dev/ic/oosiopvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: oosiopvar.h,v 1.3 2007/09/22 09:57:40 martin Exp $ */
+/* $OpenBSD: oosiopvar.h,v 1.4 2010/04/20 20:21:56 miod Exp $ */
/* $NetBSD: oosiopvar.h,v 1.2 2003/05/03 18:11:23 wiz Exp $ */
/*
@@ -147,6 +147,11 @@ struct oosiop_softc {
int sc_active;
int sc_nextdsp;
+
+ uint8_t sc_scntl0;
+ uint8_t sc_dmode;
+ uint8_t sc_dwt;
+ uint8_t sc_ctest7;
};
#define oosiop_read_1(sc, addr) \