summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-10-29 20:23:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-10-29 20:23:38 +0000
commit7df1f6efaaac8dbaf9fd280c9c7a00309d61ac91 (patch)
treee0f1631166876685aaf4a0195aa29f7a553147d1 /sys
parent591dd1a0abf50503e7ec3dbb32ac2a5804f11f58 (diff)
Split mongoose and add a gscbus attachment, for the eisa slots in B series.
This is still a work in progress. feedback and ok mickey@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/conf/files.hppa7
-rw-r--r--sys/arch/hppa/dev/mongoose.c269
-rw-r--r--sys/arch/hppa/dev/mongoose_gsc.c95
-rw-r--r--sys/arch/hppa/dev/mongoosereg.h140
-rw-r--r--sys/arch/hppa/dev/mongoosevar.h72
5 files changed, 374 insertions, 209 deletions
diff --git a/sys/arch/hppa/conf/files.hppa b/sys/arch/hppa/conf/files.hppa
index b5b1a28f4dc..dda7b6737d1 100644
--- a/sys/arch/hppa/conf/files.hppa
+++ b/sys/arch/hppa/conf/files.hppa
@@ -1,4 +1,4 @@
-# $OpenBSD: files.hppa,v 1.56 2004/10/14 19:46:35 mickey Exp $
+# $OpenBSD: files.hppa,v 1.57 2004/10/29 20:23:35 miod Exp $
#
# hppa-specific configuration info
@@ -133,7 +133,7 @@ attach wax at gedoens
file arch/hppa/dev/wax.c wax
device mongoose: isabus, eisabus
-attach mongoose at gedoens
+attach mongoose at gedoens with mg_gedoens
file arch/hppa/dev/mongoose.c mongoose
define dinobus {[offset = -1], [irq = -1]}
@@ -180,6 +180,9 @@ file arch/hppa/gsc/com_gsc.c com_gsc
attach lpt at gsc with lpt_gsc
file arch/hppa/gsc/lpt_gsc.c lpt_gsc
+attach mongoose at gsc with mg_gsc
+file arch/hppa/gsc/mongoose_gsc.c mg_gsc
+
#include "dev/fdc/files.fdc"
#major { fd = 7 }
#major { ft = 8 }
diff --git a/sys/arch/hppa/dev/mongoose.c b/sys/arch/hppa/dev/mongoose.c
index 450dce8172b..31633301e05 100644
--- a/sys/arch/hppa/dev/mongoose.c
+++ b/sys/arch/hppa/dev/mongoose.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mongoose.c,v 1.15 2004/04/07 18:24:19 mickey Exp $ */
+/* $OpenBSD: mongoose.c,v 1.16 2004/10/29 20:23:37 miod Exp $ */
/*
* Copyright (c) 1998-2003 Michael Shalayeff
@@ -26,9 +26,6 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-
-#define MONGOOSE_DEBUG 9
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
@@ -47,166 +44,14 @@
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
-/* EISA Bus Adapter registers definitions */
-#define MONGOOSE_MONGOOSE 0x10000
-struct mongoose_regs {
- u_int8_t version;
- u_int8_t lock;
- u_int8_t liowait;
- u_int8_t clock;
- u_int8_t reserved[0xf000 - 4];
- u_int8_t intack;
-};
-
-#define MONGOOSE_CTRL 0x00000
-#define MONGOOSE_NINTS 16
-struct mongoose_ctrl {
- struct dma0 {
- struct {
- u_int32_t addr : 8;
- u_int32_t count: 8;
- } ch[4];
- u_int8_t command;
- u_int8_t request;
- u_int8_t mask_channel;
- u_int8_t mode;
- u_int8_t clr_byte_ptr;
- u_int8_t master_clear;
- u_int8_t mask_clear;
- u_int8_t master_write;
- u_int8_t pad[8];
- } dma0;
-
- u_int8_t irr0; /* 0x20 */
- u_int8_t imr0;
- u_int8_t iack; /* 0x22 -- 2 b2b reads generate
- (e)isa Iack cycle & returns int level */
- u_int8_t pad0[29];
-
- struct timers {
- u_int8_t sysclk;
- u_int8_t refresh;
- u_int8_t spkr;
- u_int8_t ctrl;
- u_int32_t pad;
- } tmr[2]; /* 0x40 -- timers control */
- u_int8_t pad1[16];
-
- u_int16_t inmi; /* 0x60 NMI control */
- u_int8_t pad2[30];
- struct {
- u_int8_t pad0;
- u_int8_t ch2;
- u_int8_t ch3;
- u_int8_t ch1;
- u_int8_t pad1;
- u_int8_t pad2[3];
- u_int8_t ch0;
- u_int8_t pad4;
- u_int8_t ch6;
- u_int8_t ch7;
- u_int8_t ch5;
- u_int8_t pad5[3];
- u_int8_t pad6[16];
- } pr; /* 0x80 */
-
- u_int8_t irr1; /* 0xa0 */
- u_int8_t imr1;
- u_int8_t pad3[30];
-
- struct dma1 {
- struct {
- u_int32_t addr : 8;
- u_int32_t pad0 : 8;
- u_int32_t count: 8;
- u_int32_t pad1 : 8;
- } ch[4];
- u_int8_t command;
- u_int8_t pad0;
- u_int8_t request;
- u_int8_t pad1;
- u_int8_t mask_channel;
- u_int8_t pad2;
- u_int8_t mode;
- u_int8_t pad3;
- u_int8_t clr_byte_ptr;
- u_int8_t pad4;
- u_int8_t master_clear;
- u_int8_t pad5;
- u_int8_t mask_clear;
- u_int8_t pad6;
- u_int8_t master_write;
- u_int8_t pad7;
- } dma1; /* 0xc0 */
-
- u_int8_t master_req; /* 0xe0 master request register */
- u_int8_t pad4[31];
-
- u_int8_t pad5[0x3d0]; /* 0x4d0 */
- u_int8_t pic0; /* 0 - edge, 1 - level */
- u_int8_t pic1;
- u_int8_t pad6[0x460];
- u_int8_t nmi;
- u_int8_t nmi_ext;
-#define MONGOOSE_NMI_BUSRESET 0x01
-#define MONGOOSE_NMI_IOPORT_EN 0x02
-#define MONGOOSE_NMI_EN 0x04
-#define MONGOOSE_NMI_MTMO_EN 0x08
-#define MONGOOSE_NMI_RES4 0x10
-#define MONGOOSE_NMI_IOPORT_INT 0x20
-#define MONGOOSE_NMI_MASTER_INT 0x40
-#define MONGOOSE_NMI_INT 0x80
-};
-
-#define MONGOOSE_IOMAP 0x100000
-
-struct hppa_isa_iv {
- const char *iv_name;
- int (*iv_handler)(void *arg);
- void *iv_arg;
- int iv_pri;
-
- struct evcnt iv_evcnt;
- /* don't do sharing, we won't have many slots anyway
- struct hppa_isa_iv *iv_next;
- */
-};
-
-struct mongoose_softc {
- struct device sc_dev;
- void *sc_ih;
-
- bus_space_tag_t sc_bt;
- volatile struct mongoose_regs *sc_regs;
- volatile struct mongoose_ctrl *sc_ctrl;
- bus_addr_t sc_iomap;
-
- /* interrupts section */
- struct hppa_eisa_chipset sc_ec;
- struct hppa_isa_chipset sc_ic;
- struct hppa_isa_iv sc_iv[MONGOOSE_NINTS];
-
- /* isa/eisa bus guts */
- struct hppa_bus_space_tag sc_eiot;
- struct hppa_bus_space_tag sc_ememt;
- struct hppa_bus_dma_tag sc_edmat;
- struct hppa_bus_space_tag sc_iiot;
- struct hppa_bus_space_tag sc_imemt;
- struct hppa_bus_dma_tag sc_idmat;
-};
-
-union mongoose_attach_args {
- char *mongoose_name;
- struct eisabus_attach_args mongoose_eisa;
- struct isabus_attach_args mongoose_isa;
-};
+#include <hppa/dev/mongoosereg.h>
+#include <hppa/dev/mongoosevar.h>
-int mgmatch(struct device *, void *, void *);
-void mgattach(struct device *, struct device *, void *);
-int mgprint(void *aux, const char *pnp);
+void mgattach_gedoens(struct device *, struct device *, void *);
+int mgmatch_gedoens(struct device *, void *, void *);
-struct cfattach mongoose_ca = {
- sizeof(struct mongoose_softc), mgmatch, mgattach
+struct cfattach mg_gedoens_ca = {
+ sizeof(struct mongoose_softc), mgmatch_gedoens, mgattach_gedoens
};
struct cfdriver mongoose_cd = {
@@ -519,48 +364,13 @@ mg_isa_sr_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv, bus_size_
}
int
-mgmatch(parent, cfdata, aux)
- struct device *parent;
- void *cfdata;
- void *aux;
-{
- register struct confargs *ca = aux;
- /* struct cfdata *cf = cfdata; */
- bus_space_handle_t ioh;
-
- if (ca->ca_type.iodc_type != HPPA_TYPE_BHA ||
- (ca->ca_type.iodc_sv_model != HPPA_BHA_EISA &&
- ca->ca_type.iodc_sv_model != HPPA_BHA_WEISA))
- return 0;
-
- if (bus_space_map(ca->ca_iot, ca->ca_hpa + MONGOOSE_MONGOOSE,
- IOMOD_HPASIZE, 0, &ioh))
- return 0;
-
- /* XXX check EISA signature */
-
- bus_space_unmap(ca->ca_iot, ioh, IOMOD_HPASIZE);
-
- return 1;
-}
-
-void
-mgattach(parent, self, aux)
- struct device *parent;
- struct device *self;
- void *aux;
+mgattach_common(sc)
+ struct mongoose_softc *sc;
{
- register struct confargs *ca = aux;
- register struct mongoose_softc *sc = (struct mongoose_softc *)self;
struct hppa_bus_space_tag *bt;
union mongoose_attach_args ea;
char brid[EISA_IDSTRINGLEN];
- sc->sc_bt = ca->ca_iot;
- sc->sc_iomap = ca->ca_hpa;
- sc->sc_regs = (struct mongoose_regs *)(ca->ca_hpa + MONGOOSE_MONGOOSE);
- sc->sc_ctrl = (struct mongoose_ctrl *)(ca->ca_hpa + MONGOOSE_CTRL);
-
viper_eisa_en();
/* BUS RESET */
@@ -572,7 +382,7 @@ mgattach(parent, self, aux)
/* determine eisa board id */
{
u_int8_t id[4], *p;
- p = (u_int8_t *)(ca->ca_hpa + EISA_SLOTOFF_VID);
+ p = (u_int8_t *)(sc->sc_iomap + EISA_SLOTOFF_VID);
id[0] = *p++;
id[1] = *p++;
id[2] = *p++;
@@ -602,7 +412,7 @@ mgattach(parent, self, aux)
sc->sc_ec.ec_intr_map = mg_intr_map;
/* inherit the bus tags for eisa from the mainbus */
bt = &sc->sc_eiot;
- bcopy(ca->ca_iot, bt, sizeof(*bt));
+ bcopy(sc->sc_bt, bt, sizeof(*bt));
bt->hbt_cookie = sc;
bt->hbt_map = mg_eisa_iomap;
#define R(n) bt->__CONCAT(hbt_,n) = &__CONCAT(mg_isa_,n)
@@ -612,7 +422,7 @@ mgattach(parent, self, aux)
R(rr_2);R(rr_4);R(wr_2);R(wr_4);R(sr_2);R(sr_4);
bt = &sc->sc_ememt;
- bcopy(ca->ca_iot, bt, sizeof(*bt));
+ bcopy(sc->sc_bt, bt, sizeof(*bt));
bt->hbt_cookie = sc;
bt->hbt_map = mg_eisa_memmap;
bt->hbt_unmap = mg_eisa_memunmap;
@@ -622,7 +432,7 @@ mgattach(parent, self, aux)
ea.mongoose_eisa.eba_memt = &sc->sc_ememt;
ea.mongoose_eisa.eba_dmat = NULL /* &sc->sc_edmat */;
ea.mongoose_eisa.eba_ec = &sc->sc_ec;
- config_found(self, &ea.mongoose_eisa, mgprint);
+ config_found((struct device *)sc, &ea.mongoose_eisa, mgprint);
sc->sc_ic.ic_v = sc;
sc->sc_ic.ic_attach_hook = mg_isa_attach_hook;
@@ -643,12 +453,10 @@ mgattach(parent, self, aux)
ea.mongoose_isa.iba_dmat = &sc->sc_idmat;
#endif
ea.mongoose_isa.iba_ic = &sc->sc_ic;
- config_found(self, &ea.mongoose_isa, mgprint);
+ config_found((struct device *)sc, &ea.mongoose_isa, mgprint);
#undef R
- /* attach interrupt */
- sc->sc_ih = cpu_intr_establish(IPL_HIGH, ca->ca_irq,
- mg_intr, sc, sc->sc_dev.dv_xname);
+ return (0);
}
int
@@ -664,3 +472,50 @@ mgprint(aux, pnp)
return (UNCONF);
}
+int
+mgmatch_gedoens(parent, cfdata, aux)
+ struct device *parent;
+ void *cfdata;
+ void *aux;
+{
+ register struct confargs *ca = aux;
+ /* struct cfdata *cf = cfdata; */
+ bus_space_handle_t ioh;
+
+ if (ca->ca_type.iodc_type != HPPA_TYPE_BHA ||
+ (ca->ca_type.iodc_sv_model != HPPA_BHA_EISA &&
+ ca->ca_type.iodc_sv_model != HPPA_BHA_WEISA))
+ return 0;
+
+ if (bus_space_map(ca->ca_iot, ca->ca_hpa + MONGOOSE_MONGOOSE,
+ IOMOD_HPASIZE, 0, &ioh))
+ return 0;
+
+ /* XXX check EISA signature */
+
+ bus_space_unmap(ca->ca_iot, ioh, IOMOD_HPASIZE);
+
+ return 1;
+}
+
+void
+mgattach_gedoens(parent, self, aux)
+ struct device *parent;
+ struct device *self;
+ void *aux;
+{
+ register struct confargs *ca = aux;
+ register struct mongoose_softc *sc = (struct mongoose_softc *)self;
+
+ sc->sc_bt = ca->ca_iot;
+ sc->sc_iomap = ca->ca_hpa;
+ sc->sc_regs = (struct mongoose_regs *)(ca->ca_hpa + MONGOOSE_MONGOOSE);
+ sc->sc_ctrl = (struct mongoose_ctrl *)(ca->ca_hpa + MONGOOSE_CTRL);
+
+ if (mgattach_common(sc) != 0)
+ return;
+
+ /* attach interrupt */
+ sc->sc_ih = cpu_intr_establish(IPL_HIGH, ca->ca_irq,
+ mg_intr, sc, sc->sc_dev.dv_xname);
+}
diff --git a/sys/arch/hppa/dev/mongoose_gsc.c b/sys/arch/hppa/dev/mongoose_gsc.c
new file mode 100644
index 00000000000..c432c5d448a
--- /dev/null
+++ b/sys/arch/hppa/dev/mongoose_gsc.c
@@ -0,0 +1,95 @@
+/* $OpenBSD: mongoose_gsc.c,v 1.1 2004/10/29 20:23:37 miod Exp $ */
+
+/*
+ * Copyright (c) 2004, Miodrag Vallat.
+ *
+ * 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 BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <machine/bus.h>
+#include <machine/autoconf.h>
+
+#include <hppa/dev/cpudevs.h>
+
+#include <dev/eisa/eisavar.h>
+#include <dev/isa/isavar.h>
+
+#include <hppa/dev/mongoosereg.h>
+#include <hppa/dev/mongoosevar.h>
+
+#include <hppa/gsc/gscbusvar.h>
+
+void mgattach_gsc(struct device *, struct device *, void *);
+int mgmatch_gsc(struct device *, void *, void *);
+
+struct cfattach mg_gsc_ca = {
+ sizeof(struct mongoose_softc), mgmatch_gsc, mgattach_gsc
+};
+
+int
+mgmatch_gsc(struct device *parent, void *cfdata, void *aux)
+{
+ struct gsc_attach_args *ga = aux;
+
+ if (ga->ga_type.iodc_type != HPPA_TYPE_BHA ||
+ ga->ga_type.iodc_sv_model != HPPA_BHA_WEISA)
+ return (0);
+
+ return (1);
+}
+
+void
+mgattach_gsc(struct device *parent, struct device *self, void *aux)
+{
+ struct mongoose_softc *sc = (struct mongoose_softc *)self;
+ struct gsc_attach_args *ga = aux;
+ bus_space_handle_t ioh;
+
+ sc->sc_bt = ga->ga_iot;
+ sc->sc_iomap = ga->ga_hpa;
+
+ if (bus_space_map(ga->ga_iot, ga->ga_hpa + MONGOOSE_MONGOOSE,
+ sizeof(struct mongoose_regs), 0, &ioh) != 0) {
+ printf(": can't map IO space\n");
+ return;
+ }
+ sc->sc_regs = (struct mongoose_regs *)ioh;
+
+ if (bus_space_map(ga->ga_iot, ga->ga_hpa + MONGOOSE_CTRL,
+ sizeof(struct mongoose_ctrl), 0, &ioh) != 0) {
+ printf(": can't map control registers\n");
+ bus_space_unmap(ga->ga_iot, (bus_space_handle_t)sc->sc_regs,
+ sizeof(struct mongoose_regs));
+ return;
+ }
+ sc->sc_ctrl = (struct mongoose_ctrl *)ioh;
+
+ if (mgattach_common(sc) != 0)
+ return;
+
+ sc->sc_ih = gsc_intr_establish((struct gsc_softc *)parent,
+ ga->ga_irq, IPL_HIGH, mg_intr, sc, sc->sc_dev.dv_xname);
+}
diff --git a/sys/arch/hppa/dev/mongoosereg.h b/sys/arch/hppa/dev/mongoosereg.h
new file mode 100644
index 00000000000..dc3a02a3732
--- /dev/null
+++ b/sys/arch/hppa/dev/mongoosereg.h
@@ -0,0 +1,140 @@
+/* $OpenBSD: mongoosereg.h,v 1.1 2004/10/29 20:23:37 miod Exp $ */
+
+/*
+ * Copyright (c) 1998-2003 Michael Shalayeff
+ * All rights reserved.
+ *
+ * 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 BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES 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 MIND, 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.
+ */
+
+/* EISA Bus Adapter registers definitions */
+#define MONGOOSE_MONGOOSE 0x10000
+struct mongoose_regs {
+ u_int8_t version;
+ u_int8_t lock;
+ u_int8_t liowait;
+ u_int8_t clock;
+ u_int8_t reserved[0xf000 - 4];
+ u_int8_t intack;
+};
+
+#define MONGOOSE_CTRL 0x00000
+#define MONGOOSE_NINTS 16
+struct mongoose_ctrl {
+ struct dma0 {
+ struct {
+ u_int32_t addr : 8;
+ u_int32_t count: 8;
+ } ch[4];
+ u_int8_t command;
+ u_int8_t request;
+ u_int8_t mask_channel;
+ u_int8_t mode;
+ u_int8_t clr_byte_ptr;
+ u_int8_t master_clear;
+ u_int8_t mask_clear;
+ u_int8_t master_write;
+ u_int8_t pad[8];
+ } dma0;
+
+ u_int8_t irr0; /* 0x20 */
+ u_int8_t imr0;
+ u_int8_t iack; /* 0x22 -- 2 b2b reads generate
+ (e)isa Iack cycle & returns int level */
+ u_int8_t pad0[29];
+
+ struct timers {
+ u_int8_t sysclk;
+ u_int8_t refresh;
+ u_int8_t spkr;
+ u_int8_t ctrl;
+ u_int32_t pad;
+ } tmr[2]; /* 0x40 -- timers control */
+ u_int8_t pad1[16];
+
+ u_int16_t inmi; /* 0x60 NMI control */
+ u_int8_t pad2[30];
+ struct {
+ u_int8_t pad0;
+ u_int8_t ch2;
+ u_int8_t ch3;
+ u_int8_t ch1;
+ u_int8_t pad1;
+ u_int8_t pad2[3];
+ u_int8_t ch0;
+ u_int8_t pad4;
+ u_int8_t ch6;
+ u_int8_t ch7;
+ u_int8_t ch5;
+ u_int8_t pad5[3];
+ u_int8_t pad6[16];
+ } pr; /* 0x80 */
+
+ u_int8_t irr1; /* 0xa0 */
+ u_int8_t imr1;
+ u_int8_t pad3[30];
+
+ struct dma1 {
+ struct {
+ u_int32_t addr : 8;
+ u_int32_t pad0 : 8;
+ u_int32_t count: 8;
+ u_int32_t pad1 : 8;
+ } ch[4];
+ u_int8_t command;
+ u_int8_t pad0;
+ u_int8_t request;
+ u_int8_t pad1;
+ u_int8_t mask_channel;
+ u_int8_t pad2;
+ u_int8_t mode;
+ u_int8_t pad3;
+ u_int8_t clr_byte_ptr;
+ u_int8_t pad4;
+ u_int8_t master_clear;
+ u_int8_t pad5;
+ u_int8_t mask_clear;
+ u_int8_t pad6;
+ u_int8_t master_write;
+ u_int8_t pad7;
+ } dma1; /* 0xc0 */
+
+ u_int8_t master_req; /* 0xe0 master request register */
+ u_int8_t pad4[31];
+
+ u_int8_t pad5[0x3d0]; /* 0x4d0 */
+ u_int8_t pic0; /* 0 - edge, 1 - level */
+ u_int8_t pic1;
+ u_int8_t pad6[0x460];
+ u_int8_t nmi;
+ u_int8_t nmi_ext;
+#define MONGOOSE_NMI_BUSRESET 0x01
+#define MONGOOSE_NMI_IOPORT_EN 0x02
+#define MONGOOSE_NMI_EN 0x04
+#define MONGOOSE_NMI_MTMO_EN 0x08
+#define MONGOOSE_NMI_RES4 0x10
+#define MONGOOSE_NMI_IOPORT_INT 0x20
+#define MONGOOSE_NMI_MASTER_INT 0x40
+#define MONGOOSE_NMI_INT 0x80
+};
+
+#define MONGOOSE_IOMAP 0x100000
diff --git a/sys/arch/hppa/dev/mongoosevar.h b/sys/arch/hppa/dev/mongoosevar.h
new file mode 100644
index 00000000000..e512dbcd71a
--- /dev/null
+++ b/sys/arch/hppa/dev/mongoosevar.h
@@ -0,0 +1,72 @@
+/* $OpenBSD: mongoosevar.h,v 1.1 2004/10/29 20:23:37 miod Exp $ */
+
+/*
+ * Copyright (c) 1998-2003 Michael Shalayeff
+ * All rights reserved.
+ *
+ * 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 BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES 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 MIND, 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 hppa_isa_iv {
+ const char *iv_name;
+ int (*iv_handler)(void *arg);
+ void *iv_arg;
+ int iv_pri;
+
+ struct evcnt iv_evcnt;
+ /* don't do sharing, we won't have many slots anyway
+ struct hppa_isa_iv *iv_next;
+ */
+};
+
+struct mongoose_softc {
+ struct device sc_dev;
+ void *sc_ih;
+
+ bus_space_tag_t sc_bt;
+ volatile struct mongoose_regs *sc_regs;
+ volatile struct mongoose_ctrl *sc_ctrl;
+ bus_addr_t sc_iomap;
+
+ /* interrupts section */
+ struct hppa_eisa_chipset sc_ec;
+ struct hppa_isa_chipset sc_ic;
+ struct hppa_isa_iv sc_iv[MONGOOSE_NINTS];
+
+ /* isa/eisa bus guts */
+ struct hppa_bus_space_tag sc_eiot;
+ struct hppa_bus_space_tag sc_ememt;
+ struct hppa_bus_dma_tag sc_edmat;
+ struct hppa_bus_space_tag sc_iiot;
+ struct hppa_bus_space_tag sc_imemt;
+ struct hppa_bus_dma_tag sc_idmat;
+};
+
+union mongoose_attach_args {
+ char *mongoose_name;
+ struct eisabus_attach_args mongoose_eisa;
+ struct isabus_attach_args mongoose_isa;
+};
+
+int mgattach_common(struct mongoose_softc *);
+int mgprint(void *, const char *);
+int mg_intr(void *);