summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2001-01-28 01:20:01 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2001-01-28 01:20:01 +0000
commit510cfb6ae68dde2db477875ccf4295c299198f59 (patch)
tree2758480e82015d3d118e6ac55fa6d2eb9059c1f3 /sys
parentd66606dea9a8a402c14e115a566fcd42fa38e62a (diff)
Basic support for boardtype 1303 (Cheetah) machines.
Layout of the DZ's registers (among other things) determined by a massive amount of trial and error. Work by Brandon and me.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/vax/conf/GENERIC6
-rw-r--r--sys/arch/vax/conf/RAMDISK6
-rw-r--r--sys/arch/vax/conf/files.vax8
-rw-r--r--sys/arch/vax/include/ibus.h40
-rw-r--r--sys/arch/vax/qbus/dz.c4
-rw-r--r--sys/arch/vax/vax/ibus.c38
-rw-r--r--sys/arch/vax/vsa/dz_ibus.c70
7 files changed, 157 insertions, 15 deletions
diff --git a/sys/arch/vax/conf/GENERIC b/sys/arch/vax/conf/GENERIC
index e7ce22668fc..1418edc978a 100644
--- a/sys/arch/vax/conf/GENERIC
+++ b/sys/arch/vax/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.18 2000/10/24 01:50:19 hugh Exp $
+# $OpenBSD: GENERIC,v 1.19 2001/01/28 01:19:58 hugh Exp $
# $NetBSD: GENERIC,v 1.61 2000/04/19 06:50:36 itojun Exp $
machine vax # machine type; required
@@ -19,6 +19,7 @@ option VAX43 # VS 3100/76
option VAX46 # VS 4000/60
option VAX48 # VS 4000 VLC
option VAX49 # VS 4000/90
+option VAX53 # VAX 4000/10{0,5,6}
option UVM # VAX uses UVM; REQUIRED
@@ -79,7 +80,8 @@ asc0 at vsbus0 csr 0x26000080 # VS4000/90 SCSI-ctlr
uba0 at ibus0 # Qbus adapter
ze0 at ibus0 # SGEC on-board ethernet
#shac0 at ibus0 # DSSI controller
-le0 at ibus0 # LANCE ethernet
+le0 at ibus0 # LANCE ethernet
+dz0 at ibus0 # DZ serial controller
# Devices connected at VAXBI
#cpu* at bi? node? # KA820/KA825 cpu
diff --git a/sys/arch/vax/conf/RAMDISK b/sys/arch/vax/conf/RAMDISK
index 3f1b631eefa..050dff902bf 100644
--- a/sys/arch/vax/conf/RAMDISK
+++ b/sys/arch/vax/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.1 2000/10/31 02:30:56 hugh Exp $
+# $OpenBSD: RAMDISK,v 1.2 2001/01/28 01:19:58 hugh Exp $
machine vax # machine type
@@ -22,6 +22,7 @@ option VAX43 # VS 3100/76
option VAX46 # VS 4000/60
option VAX48 # VS 4000 VLC
option VAX49 # VS 4000/90
+option VAX53 # VAX 4000/10{0,5,6}
option UVM # VAX uses UVM; REQUIRED
@@ -94,7 +95,8 @@ asc0 at vsbus0 csr 0x26000080 # VS4000/90 SCSI-ctlr
uba0 at ibus0 # Qbus adapter
ze0 at ibus0 # SGEC on-board ethernet
#shac0 at ibus0 # DSSI controller
-le0 at ibus0 # LANCE ethernet
+le0 at ibus0 # LANCE ethernet
+dz0 at ibus0 # DZ serial controller
# Devices connected at VAXBI
#cpu* at bi? node? # KA820/KA825 cpu
diff --git a/sys/arch/vax/conf/files.vax b/sys/arch/vax/conf/files.vax
index dca62b7c803..fcb889ac492 100644
--- a/sys/arch/vax/conf/files.vax
+++ b/sys/arch/vax/conf/files.vax
@@ -1,4 +1,4 @@
-# $OpenBSD: files.vax,v 1.17 2000/11/24 19:14:03 hugh Exp $
+# $OpenBSD: files.vax,v 1.18 2001/01/28 01:19:58 hugh Exp $
# $NetBSD: files.vax,v 1.60 1999/08/27 20:04:32 ragge Exp $
#
# new style config file for vax architecture
@@ -111,7 +111,8 @@ attach ts at uba
file arch/vax/uba/ts.c ts needs-flag
attach dz at vsbus with dz_vsbus
-file arch/vax/vsa/dz_ibus.c dz_vsbus
+attach dz at ibus with dz_ibus
+file arch/vax/vsa/dz_ibus.c dz_vsbus | dz_ibus
# RD-type disks at VS2000's onboard MFM-controller
device hdc { drive = -1 }
@@ -295,7 +296,7 @@ file arch/vax/uba/dh.c dh needs-flag
# These are general files needed for compilation.
file dev/cons.c
file dev/cninit.c
-file dev/clock_subr.c vax8200|vax410|vax43|vax630|vax670|vax46|vax48|vax49
+file dev/clock_subr.c vax8200|vax410|vax43|vax630|vax670|vax46|vax48|vax49|vax53
file arch/vax/vax/locore.c
file arch/vax/vax/mem.c
file arch/vax/vax/clock.c
@@ -310,6 +311,7 @@ file arch/vax/vax/ka43.c vax43
file arch/vax/vax/ka46.c vax46
file arch/vax/vax/ka48.c vax48
file arch/vax/vax/ka49.c vax49
+file arch/vax/vax/ka53.c vax53
file arch/vax/vax/emulate.s insn_emulate
file arch/vax/vax/unimpl_emul.s insn_emulate
file arch/vax/vax/ka650.c vax650
diff --git a/sys/arch/vax/include/ibus.h b/sys/arch/vax/include/ibus.h
new file mode 100644
index 00000000000..fa533c6faad
--- /dev/null
+++ b/sys/arch/vax/include/ibus.h
@@ -0,0 +1,40 @@
+/* $OpenBSD: ibus.h,v 1.1 2001/01/28 01:19:57 hugh Exp $ */
+
+/*
+ * Copyright (c) 2001 Hugh Graham
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+struct ibus_edal {
+ vaddr_t edal_scsi_dma_addr;
+ vaddr_t edal_scsi_direction;
+ unsigned char edal_intmsk; /* interrupt mask */
+ unsigned char foo[3]; /* padding */
+ unsigned short edal_intpend; /* interrupt pending */
+ unsigned char bar[3]; /* padding */
+};
+
+#ifdef _KERNEL
+u_char ibus_ormask __P((unsigned char));
+u_char ibus_setmask __P((unsigned char));
+#endif
diff --git a/sys/arch/vax/qbus/dz.c b/sys/arch/vax/qbus/dz.c
index a22b0daeaba..e428e62165b 100644
--- a/sys/arch/vax/qbus/dz.c
+++ b/sys/arch/vax/qbus/dz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dz.c,v 1.1 2000/04/27 03:14:47 bjc Exp $ */
+/* $OpenBSD: dz.c,v 1.2 2001/01/28 01:19:59 hugh Exp $ */
/* $NetBSD: dz.c,v 1.19 2000/01/24 02:40:29 matt Exp $ */
/*
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
@@ -197,7 +197,7 @@ dzrint(arg)
if (c & DZ_RBUF_PARITY_ERR)
cc |= TTY_PE;
-#if defined(DDB) && (defined(VAX410) || defined(VAX43) || defined(VAX46))
+#if defined(DDB) && (defined(VAX410) || defined(VAX43) || defined(VAX46) || defined(VAX53))
if (tp->t_dev == cn_tab->cn_dev) {
int j = kdbrint(cc);
diff --git a/sys/arch/vax/vax/ibus.c b/sys/arch/vax/vax/ibus.c
index cd752d37842..ea3f7e4846f 100644
--- a/sys/arch/vax/vax/ibus.c
+++ b/sys/arch/vax/vax/ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibus.c,v 1.1 2000/04/27 01:10:10 bjc Exp $ */
+/* $OpenBSD: ibus.c,v 1.2 2001/01/28 01:19:59 hugh Exp $ */
/* $NetBSD: ibus.c,v 1.2 1999/08/14 18:42:46 ragge Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden.
@@ -39,6 +39,8 @@
#include <machine/cpu.h>
#include <machine/sid.h>
+#include <machine/ibus.h>
+
static int ibus_print __P((void *, const char *));
static int ibus_match __P((struct device *, struct cfdata *, void *));
static void ibus_attach __P((struct device *, struct device *, void*));
@@ -51,6 +53,8 @@ struct cfattach ibus_ca = {
sizeof(struct device), (cfmatch_t)ibus_match, ibus_attach
};
+struct ibus_edal *ibus_edal = NULL;
+
int
ibus_print(aux, name)
void *aux;
@@ -89,6 +93,10 @@ ibus_attach(parent, self, aux)
vaddr_t va;
printf("\n");
+
+ if (vax_boardtype == VAX_BTYP_1303)
+ ibus_edal = (struct ibus_edal *) vax_map_physmem(0x25c00000, 1);
+
/*
* There may be a SGEC. Is badaddr() enough here?
*/
@@ -115,6 +123,7 @@ ibus_attach(parent, self, aux)
if (badaddr((caddr_t)va + 0x48, 4) == 0)
config_found(self, &bp, ibus_print);
vax_unmap_physmem(va, 1);
+
/*
* All MV's have a Qbus.
*/
@@ -122,3 +131,30 @@ ibus_attach(parent, self, aux)
config_found(self, &bp, ibus_print);
}
+
+/*
+ * Bitwise OR bits into the interrupt mask.
+ * Returns the new mask.
+ */
+unsigned char
+ibus_ormask(mask)
+ unsigned char mask;
+{
+ ibus_edal->edal_intmsk |= mask;
+ return (ibus_edal->edal_intmsk);
+}
+
+/*
+ * Sets a new interrupt mask. Returns the old one.
+ * Works like spl functions.
+ */
+unsigned char
+ibus_setmask(mask)
+ unsigned char mask;
+{
+ unsigned char ch;
+
+ ch = ibus_edal->edal_intmsk;
+ ibus_edal->edal_intmsk = mask;
+ return ch;
+}
diff --git a/sys/arch/vax/vsa/dz_ibus.c b/sys/arch/vax/vsa/dz_ibus.c
index 24a54fa15c8..593089373bf 100644
--- a/sys/arch/vax/vsa/dz_ibus.c
+++ b/sys/arch/vax/vsa/dz_ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dz_ibus.c,v 1.1 2000/04/27 02:34:50 bjc Exp $ */
+/* $OpenBSD: dz_ibus.c,v 1.2 2001/01/28 01:20:00 hugh Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -49,6 +49,7 @@
#include <machine/sid.h>
#include <machine/uvax.h>
#include <machine/vsbus.h>
+#include <machine/ibus.h>
#include <machine/cpu.h>
#include <machine/scb.h>
@@ -61,6 +62,8 @@
static int dz_vsbus_match __P((struct device *, struct cfdata *, void *));
static void dz_vsbus_attach __P((struct device *, struct device *, void *));
+static int dz_ibus_match __P((struct device *, struct cfdata *, void *));
+static void dz_ibus_attach __P((struct device *, struct device *, void *));
static int dz_print __P((void *, const char *));
static vaddr_t dz_regs; /* Used for console */
@@ -69,6 +72,10 @@ struct cfattach dz_vsbus_ca = {
sizeof(struct dz_softc), (cfmatch_t)dz_vsbus_match, dz_vsbus_attach
};
+struct cfattach dz_ibus_ca = {
+ sizeof(struct dz_softc), (cfmatch_t)dz_ibus_match, dz_ibus_attach
+};
+
#define REG(name) short name; short X##name##X;
static volatile struct ss_dz {/* base address of DZ-controller: 0x200A0000 */
REG(csr); /* 00 Csr: control/status register */
@@ -165,6 +172,49 @@ dz_vsbus_attach(parent, self, aux)
config_found(self, 0, dz_print);
}
+static void
+dz_ibus_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ struct dz_softc *sc = (struct dz_softc *)self;
+
+ sc->sc_ioh = (vaddr_t)dz_regs;
+ sc->sc_dr.dr_csr = 0; /* correct */
+ sc->sc_dr.dr_rbuf = 4; /* correct */
+ sc->sc_dr.dr_dtr = 9; /* unknown */
+ sc->sc_dr.dr_break = 13; /* untested */
+ sc->sc_dr.dr_tbuf = 12; /* correct */
+ sc->sc_dr.dr_tcr = 8; /* correct */
+ sc->sc_dr.dr_dcd = 11; /* works */
+ sc->sc_dr.dr_ring = 13; /* untested */
+
+ sc->sc_type = DZ_DC;
+ scb_vecalloc(0x154, dzxint, sc, SCB_ISTACK);
+ scb_vecalloc(0x150, dzrint, sc, SCB_ISTACK);
+
+ dzattach(sc);
+
+ ibus_ormask(0x8);
+ DELAY(1000);
+
+ config_found(self, 0, dz_print);
+}
+
+static int
+dz_ibus_match(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ /* This function assumes all btype 1303 machines have a dz. */
+
+ if (vax_boardtype == VAX_BTYP_1303)
+ return (1);
+
+ return (0);
+}
+
int
dzcngetc(dev)
dev_t dev;
@@ -211,6 +261,7 @@ dzcnprobe(cndev)
break;
case VAX_BTYP_49:
+ case VAX_BTYP_1303:
ioaddr = 0x25000000;
diagcons = 3;
break;
@@ -280,10 +331,19 @@ dzcnpollc(dev, pollflag)
{
static u_char mask;
- if (pollflag)
- mask = vsbus_setmask(0);
- else
- vsbus_setmask(mask);
+ switch(vax_boardtype) {
+ case VAX_BTYP_1303:
+ if(pollflag)
+ mask = ibus_setmask(0);
+ else
+ ibus_setmask(mask);
+ break;
+ default:
+ if (pollflag)
+ mask = vsbus_setmask(0);
+ else
+ vsbus_setmask(mask);
+ }
}
#if NLKC