summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/tc/tcdsvar.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/alpha/tc/tcdsvar.h')
-rw-r--r--sys/arch/alpha/tc/tcdsvar.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/sys/arch/alpha/tc/tcdsvar.h b/sys/arch/alpha/tc/tcdsvar.h
new file mode 100644
index 00000000000..5bee7191694
--- /dev/null
+++ b/sys/arch/alpha/tc/tcdsvar.h
@@ -0,0 +1,108 @@
+/* $NetBSD: tcdsvar.h,v 1.1 1995/12/20 00:40:41 cgd Exp $ */
+
+/*
+ * Copyright (c) 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+struct tcds_slotconfig {
+ /*
+ * Bookkeeping information
+ */
+ int sc_slot;
+ struct tcds_softc *sc_tcds; /* to frob TCDS regs */
+ struct esp_softc *sc_esp; /* to frob child's regs */
+ int (*sc_intrhand) __P((void *)); /* intr. handler */
+ void *sc_intrarg; /* intr. handler arg. */
+
+ /*
+ * Sets of bits in TCDS CIR and IMER that enable/check
+ * various things.
+ */
+ u_int32_t sc_resetbits;
+ u_int32_t sc_intrmaskbits;
+ u_int32_t sc_intrbits;
+ u_int32_t sc_dmabits;
+ u_int32_t sc_errorbits;
+
+ /*
+ * Pointers to slot-specific DMA resources.
+ */
+ volatile u_int32_t *sc_sda;
+ volatile u_int32_t *sc_dic;
+ volatile u_int32_t *sc_dud0;
+ volatile u_int32_t *sc_dud1;
+
+ /*
+ * DMA bookkeeping information.
+ */
+ int sc_active; /* DMA active ? */
+ int sc_iswrite; /* DMA into main memory? */
+ size_t sc_dmasize;
+ caddr_t *sc_dmaaddr;
+ size_t *sc_dmalen;
+};
+
+struct tcdsdev_attach_args {
+ struct tcdev_attach_args tcdsda_tc;
+ struct tcds_slotconfig *tcdsda_sc;
+ u_int tcdsda_id;
+ u_int tcdsda_freq;
+};
+#define tcdsda_modname tcdsda_tc.tcda_modname
+#define tcdsda_slot tcdsda_tc.tcda_slot
+#define tcdsda_offset tcdsda_tc.tcda_offset
+#define tcdsda_addr tcdsda_tc.tcda_addr
+#define tcdsda_cookie tcdsda_tc.tcda_cookie
+
+#define TCDS_REG(base, off) \
+ (volatile u_int32_t *)TC_DENSE_TO_SPARSE((base) + (off))
+
+/*
+ * TCDS functions.
+ */
+void tcds_intr_establish __P((struct device *, void *, tc_intrlevel_t,
+ int (*)(void *), void *));
+void tcds_intr_disestablish __P((struct device *, void *));
+void tcds_dma_enable __P((struct tcds_slotconfig *, int));
+void tcds_scsi_enable __P((struct tcds_slotconfig *, int));
+int tcds_scsi_isintr __P((struct tcds_slotconfig *, int));
+void tcds_scsi_reset __P((struct tcds_slotconfig *));
+
+/*
+ * TCDS DMA functions (used the the 53c94 driver)
+ */
+void tcds_dma_reset __P((struct tcds_slotconfig *));
+void tcds_dma_enintr __P((struct tcds_slotconfig *));
+int tcds_dma_isintr __P((struct tcds_slotconfig *));
+void tcds_dma_start __P((struct tcds_slotconfig *, caddr_t *,
+ size_t *, int));
+int tcds_dmaintr __P((struct tcds_slotconfig *));
+
+/*
+ * The TCDS (bus) cfdriver, so that subdevices can more
+ * easily tell what bus they're on.
+ */
+extern struct cfdriver tcdscd;