summaryrefslogtreecommitdiff
path: root/sys/dev/eisa
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 22:33:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 22:33:19 +0000
commit67d88b0a9910a68bb666b448d2dac29cb4d3d8c2 (patch)
tree967b89f6e07398a22bd8c76d30179b648776542d /sys/dev/eisa
parentba95d3c1d69cdb251d15a12ebf70f50b0ea2019b (diff)
partial sync with netbsd 960418, more to come
Diffstat (limited to 'sys/dev/eisa')
-rw-r--r--sys/dev/eisa/aha1742.c24
-rw-r--r--sys/dev/eisa/devlist2h.awk6
-rw-r--r--sys/dev/eisa/eisa.c45
-rw-r--r--sys/dev/eisa/eisadevs31
-rw-r--r--sys/dev/eisa/eisadevs.h28
-rw-r--r--sys/dev/eisa/eisadevs_data.h20
-rw-r--r--sys/dev/eisa/eisareg.h9
-rw-r--r--sys/dev/eisa/eisavar.h69
-rw-r--r--sys/dev/eisa/files.eisa10
9 files changed, 138 insertions, 104 deletions
diff --git a/sys/dev/eisa/aha1742.c b/sys/dev/eisa/aha1742.c
index 8d01311a804..19bda5ff3b7 100644
--- a/sys/dev/eisa/aha1742.c
+++ b/sys/dev/eisa/aha1742.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: aha1742.c,v 1.4 1996/04/18 23:47:09 niklas Exp $ */
-/* $NetBSD: aha1742.c,v 1.57 1996/03/08 22:03:26 cgd Exp $ */
+/* $OpenBSD: aha1742.c,v 1.5 1996/04/21 22:20:12 deraadt Exp $ */
+/* $NetBSD: aha1742.c,v 1.59 1996/04/09 22:47:00 cgd Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -263,12 +263,12 @@ struct ahb_ecb {
struct ahb_softc {
struct device sc_dev;
- struct isadev sc_id;
- void *sc_ih;
bus_chipset_tag_t sc_bc;
- bus_io_handle_t sc_ioh;
+ eisa_chipset_tag_t sc_ec;
+ bus_io_handle_t sc_ioh;
int sc_irq;
+ void *sc_ih;
struct ahb_ecb *immed_ecb; /* an outstanding immediete command */
struct ahb_ecb *ecbhash[ECB_HASH_SIZE];
@@ -320,8 +320,12 @@ struct scsi_device ahb_dev = {
int ahbmatch __P((struct device *, void *, void *));
void ahbattach __P((struct device *, struct device *, void *));
-struct cfdriver ahbcd = {
- NULL, "ahb", ahbmatch, ahbattach, DV_DULL, sizeof(struct ahb_softc)
+struct cfattach ahb_ca = {
+ sizeof(struct ahb_softc), ahbmatch, ahbattach
+};
+
+struct cfdriver ahb_cd = {
+ NULL, "ahb", DV_DULL
};
/*
@@ -466,9 +470,13 @@ ahbattach(parent, self, aux)
struct ahb_softc *ahb = (void *)self;
bus_chipset_tag_t bc = ea->ea_bc;
bus_io_handle_t ioh;
- char *model;
+ eisa_chipset_tag_t ec = ea->ea_ec;
+ eisa_intr_handle_t ih;
+ const char *model, *intrstr;
ahb->sc_bc = bc;
+ ahb->sc_ec = ec;
+
if (bus_io_map(bc, EISA_SLOT_ADDR(ea->ea_slot), EISA_SLOT_SIZE, &ioh))
panic("ahbattach: could not map I/O addresses");
ahb->sc_ioh = ioh;
diff --git a/sys/dev/eisa/devlist2h.awk b/sys/dev/eisa/devlist2h.awk
index 475234b6435..159691c7923 100644
--- a/sys/dev/eisa/devlist2h.awk
+++ b/sys/dev/eisa/devlist2h.awk
@@ -1,6 +1,6 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.1 1996/04/18 23:47:10 niklas Exp $
-# $NetBSD: devlist2h.awk,v 1.1 1996/02/26 23:46:20 cgd Exp $
+# $OpenBSD: devlist2h.awk,v 1.2 1996/04/21 22:20:18 deraadt Exp $
+# $NetBSD: devlist2h.awk,v 1.2 1996/04/09 20:07:16 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
# All rights reserved.
@@ -91,7 +91,7 @@ $1 == "product" {
products[nproducts, 1] = $2; # vendor name
products[nproducts, 2] = $3; # product id
printf("#define\tEISA_PRODUCT_%s%s\t\"", products[nproducts, 1],
- products[nproducts, 2]) > hfile
+ products[nproducts, 2]) > hfile
i = vendorindex[products[nproducts, 1]]; j = 2;
needspace = 0;
diff --git a/sys/dev/eisa/eisa.c b/sys/dev/eisa/eisa.c
index 38a72a42d9b..770077bbf1d 100644
--- a/sys/dev/eisa/eisa.c
+++ b/sys/dev/eisa/eisa.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: eisa.c,v 1.1 1996/04/18 23:47:10 niklas Exp $ */
-/* $NetBSD: eisa.c,v 1.7 1996/03/14 04:02:58 cgd Exp $ */
+/* $OpenBSD: eisa.c,v 1.2 1996/04/21 22:20:23 deraadt Exp $ */
+/* $NetBSD: eisa.c,v 1.11 1996/04/09 22:46:11 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -52,8 +52,12 @@
int eisamatch __P((struct device *, void *, void *));
void eisaattach __P((struct device *, struct device *, void *));
-struct cfdriver eisacd = {
- NULL, "eisa", eisamatch, eisaattach, DV_DULL, sizeof(struct device)
+struct cfattach eisa_ca = {
+ sizeof(struct device), eisamatch, eisaattach
+};
+
+struct cfdriver eisa_cd = {
+ NULL, "eisa", DV_DULL
};
int eisasubmatch __P((struct device *, void *, void *));
@@ -62,8 +66,8 @@ void eisa_devinfo __P((const char *, char *));
int
eisamatch(parent, match, aux)
- struct device *parent;
- void *match, *aux;
+ struct device *parent;
+ void *match, *aux;
{
struct cfdata *cf = match;
struct eisabus_attach_args *eba = aux;
@@ -73,7 +77,7 @@ eisamatch(parent, match, aux)
/* XXX check other indicators */
- return (1);
+ return (1);
}
int
@@ -103,21 +107,24 @@ eisasubmatch(parent, match, aux)
if (cf->eisacf_slot != EISA_UNKNOWN_SLOT &&
cf->eisacf_slot != ea->ea_slot)
return 0;
- return ((*cf->cf_driver->cd_match)(parent, match, aux));
+ return ((*cf->cf_attach->ca_match)(parent, match, aux));
}
void
eisaattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+ struct device *parent, *self;
+ void *aux;
{
struct eisabus_attach_args *eba = aux;
bus_chipset_tag_t bc;
- int slot;
+ eisa_chipset_tag_t ec;
+ int slot, maxnslots;
+ eisa_attach_hook(parent, self, eba);
printf("\n");
bc = eba->eba_bc;
+ ec = eba->eba_ec;
/*
* Search for and attach subdevices.
@@ -125,14 +132,15 @@ eisaattach(parent, self, aux)
* Slot 0 is the "motherboard" slot, and the code attaching
* the EISA bus should have already attached an ISA bus there.
*/
- for (slot = 1; slot < EISA_MAX_SLOT; slot++) {
+ maxnslots = eisa_maxslots(ec);
+ for (slot = 1; slot < maxnslots; slot++) {
struct eisa_attach_args ea;
- struct cfdata *cf;
u_int slotaddr;
bus_io_handle_t slotioh;
int i;
ea.ea_bc = bc;
+ ea.ea_ec = ec;
ea.ea_slot = slot;
slotaddr = EISA_SLOT_ADDR(slot);
@@ -142,7 +150,8 @@ eisaattach(parent, self, aux)
* about it.
*/
if (bus_io_map(bc, slotaddr, EISA_SLOT_SIZE, &slotioh)) {
- printf("%s: can't map I/O space for slot %d\n", slot);
+ printf("%s: can't map I/O space for slot %d\n",
+ self->dv_xname, slot);
continue;
}
@@ -195,14 +204,14 @@ eisaattach(parent, self, aux)
}
#ifdef EISAVERBOSE
-/*
+/*
* Descriptions of of known vendors and devices ("products").
- */
+ */
struct eisa_knowndev {
int flags;
const char *id, *name;
-};
-#define EISA_KNOWNDEV_NOPROD 0x01 /* match on vendor only */
+};
+#define EISA_KNOWNDEV_NOPROD 0x01 /* match on vendor only */
#include <dev/eisa/eisadevs_data.h>
#endif /* EISAVERBOSE */
diff --git a/sys/dev/eisa/eisadevs b/sys/dev/eisa/eisadevs
index 8a1e3e9e035..dafdad6d457 100644
--- a/sys/dev/eisa/eisadevs
+++ b/sys/dev/eisa/eisadevs
@@ -1,4 +1,4 @@
-$OpenBSD: eisadevs,v 1.1 1996/04/18 23:47:11 niklas Exp $
+$OpenBSD: eisadevs,v 1.2 1996/04/21 22:20:29 deraadt Exp $
/* $NetBSD: eisadevs,v 1.1 1996/02/26 23:46:22 cgd Exp $ */
/*
@@ -37,6 +37,7 @@ $OpenBSD: eisadevs,v 1.1 1996/04/18 23:47:11 niklas Exp $
*/
vendor ADP Adaptec
+vendor AMI AMI
vendor BUS BusLogic
vendor DEC Digital Equipment
vendor TCM 3Com
@@ -46,22 +47,26 @@ vendor TCM 3Com
*/
/* Adaptec products */
-product ADP 0000 AHA-1740
-product ADP 0001 AHA-1740A
-product ADP 0002 AHA-1742A
-product ADP 0400 AHA-1744
-product ADP 7770 AIC-7770 (on motherboard)
-product ADP 7771 AHA-274x
-product ADP 7756 AHA-284x (BIOS enabled)
-product ADP 7757 AHA-284x (BIOS disabled)
+product ADP 0000 AHA-1740 SCSI
+product ADP 0001 AHA-1740A SCSI
+product ADP 0002 AHA-1742A SCSI
+product ADP 0400 AHA-1744 SCSI
+product ADP 7770 AIC-7770 SCSI (on motherboard)
+product ADP 7771 AHA-274x SCSI
+product ADP 7756 AHA-284x SCSI (BIOS enabled)
+product ADP 7757 AHA-284x SCSI (BIOS disabled)
+
+/* AMI products */
+product AMI 4801 Series 48 SCSI
/* BusLogic products */
-/* XXX */
+product BUS 4201 Bt74xB SCSI
+product BUS 4202 Bt74xC SCSI
/* Digital Equipment products */
-product DEC 4250 DE425
+product DEC 4250 DE425 Ethernet
/* ??? DEC DEFEA */
/* 3Com products */
-product TCM 5092 3C579-TP
-product TCM 5093 3C579
+product TCM 5092 3C579-TP Ethernet
+product TCM 5093 3C579 Ethernet
diff --git a/sys/dev/eisa/eisadevs.h b/sys/dev/eisa/eisadevs.h
index 0f8b7c3b9b9..b9042f4bb3e 100644
--- a/sys/dev/eisa/eisadevs.h
+++ b/sys/dev/eisa/eisadevs.h
@@ -42,22 +42,26 @@
*/
/* Adaptec products */
-#define EISA_PRODUCT_ADP0000 "Adaptec AHA-1740"
-#define EISA_PRODUCT_ADP0001 "Adaptec AHA-1740A"
-#define EISA_PRODUCT_ADP0002 "Adaptec AHA-1742A"
-#define EISA_PRODUCT_ADP0400 "Adaptec AHA-1744"
-#define EISA_PRODUCT_ADP7770 "Adaptec AIC-7770 (on motherboard)"
-#define EISA_PRODUCT_ADP7771 "Adaptec AHA-274x"
-#define EISA_PRODUCT_ADP7756 "Adaptec AHA-284x (BIOS enabled)"
-#define EISA_PRODUCT_ADP7757 "Adaptec AHA-284x (BIOS disabled)"
+#define EISA_PRODUCT_ADP0000 "Adaptec AHA-1740 SCSI"
+#define EISA_PRODUCT_ADP0001 "Adaptec AHA-1740A SCSI"
+#define EISA_PRODUCT_ADP0002 "Adaptec AHA-1742A SCSI"
+#define EISA_PRODUCT_ADP0400 "Adaptec AHA-1744 SCSI"
+#define EISA_PRODUCT_ADP7770 "Adaptec AIC-7770 SCSI (on motherboard)"
+#define EISA_PRODUCT_ADP7771 "Adaptec AHA-274x SCSI"
+#define EISA_PRODUCT_ADP7756 "Adaptec AHA-284x SCSI (BIOS enabled)"
+#define EISA_PRODUCT_ADP7757 "Adaptec AHA-284x SCSI (BIOS disabled)"
+
+/* AMI products */
+#define EISA_PRODUCT_AMI4801 "AMI Series 48 SCSI"
/* BusLogic products */
-/* XXX */
+#define EISA_PRODUCT_BUS4201 "BusLogic Bt74xB SCSI"
+#define EISA_PRODUCT_BUS4202 "BusLogic Bt74xC SCSI"
/* Digital Equipment products */
-#define EISA_PRODUCT_DEC4250 "Digital Equipment DE425"
+#define EISA_PRODUCT_DEC4250 "Digital Equipment DE425 Ethernet"
/* ??? DEC DEFEA */
/* 3Com products */
-#define EISA_PRODUCT_TCM5092 "3Com 3C579-TP"
-#define EISA_PRODUCT_TCM5093 "3Com 3C579"
+#define EISA_PRODUCT_TCM5092 "3Com 3C579-TP Ethernet"
+#define EISA_PRODUCT_TCM5093 "3Com 3C579 Ethernet"
diff --git a/sys/dev/eisa/eisadevs_data.h b/sys/dev/eisa/eisadevs_data.h
index 2ba485a4c45..e91b1f799b6 100644
--- a/sys/dev/eisa/eisadevs_data.h
+++ b/sys/dev/eisa/eisadevs_data.h
@@ -80,6 +80,21 @@ struct eisa_knowndev eisa_knowndevs[] = {
},
{
0,
+ "AMI4801",
+ EISA_PRODUCT_AMI4801,
+ },
+ {
+ 0,
+ "BUS4201",
+ EISA_PRODUCT_BUS4201,
+ },
+ {
+ 0,
+ "BUS4202",
+ EISA_PRODUCT_BUS4202,
+ },
+ {
+ 0,
"DEC4250",
EISA_PRODUCT_DEC4250,
},
@@ -100,6 +115,11 @@ struct eisa_knowndev eisa_knowndevs[] = {
},
{
EISA_KNOWNDEV_NOPROD,
+ "AMI",
+ "AMI",
+ },
+ {
+ EISA_KNOWNDEV_NOPROD,
"BUS",
"BusLogic",
},
diff --git a/sys/dev/eisa/eisareg.h b/sys/dev/eisa/eisareg.h
index b965dfeda3f..8d53ac05e87 100644
--- a/sys/dev/eisa/eisareg.h
+++ b/sys/dev/eisa/eisareg.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: eisareg.h,v 1.2 1996/04/18 23:47:12 niklas Exp $ */
-/* $NetBSD: eisareg.h,v 1.2 1996/02/27 00:21:02 cgd Exp $ */
+/* $OpenBSD: eisareg.h,v 1.3 1996/04/21 22:20:42 deraadt Exp $ */
+/* $NetBSD: eisareg.h,v 1.3 1996/04/09 22:46:13 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -43,11 +43,6 @@
*/
/*
- * Max number of EISA slots in a machine. 64K I/O space total.
- */
-#define EISA_MAX_SLOT 16 /* number of slots. 0 -> 0xf */
-
-/*
* Slot I/O space size, and I/O address of a given slot.
*/
#define EISA_SLOT_SIZE 0x1000
diff --git a/sys/dev/eisa/eisavar.h b/sys/dev/eisa/eisavar.h
index d0ddeeb1fbc..6b7b54ffe26 100644
--- a/sys/dev/eisa/eisavar.h
+++ b/sys/dev/eisa/eisavar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: eisavar.h,v 1.3 1996/04/18 23:47:13 niklas Exp $ */
-/* $NetBSD: eisavar.h,v 1.4 1996/03/08 20:25:22 cgd Exp $ */
+/* $OpenBSD: eisavar.h,v 1.4 1996/04/21 22:20:45 deraadt Exp $ */
+/* $NetBSD: eisavar.h,v 1.9 1996/04/12 06:34:36 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -32,22 +32,39 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __DEV_EISA_EISAVAR_H__
-#define __DEV_EISA_EISAVAR_H__
+#ifndef _DEV_EISA_EISAVAR_H_
+#define _DEV_EISA_EISAVAR_H_
/*
* Definitions for EISA autoconfiguration.
*
- * This file describes types, constants, and functions which are used
- * for EISA autoconfiguration.
+ * This file describes types and functions which are used for EISA
+ * configuration. Some of this information is machine-specific, and is
+ * separated into eisa_machdep.h.
*/
#include <machine/bus.h>
#include <dev/eisa/eisareg.h> /* For ID register & string info. */
+/*
+ * Structures and definitions needed by the machine-dependent header.
+ */
+struct eisabus_attach_args;
-typedef int eisa_slot_t; /* really only needs to be 4 bits */
+/*
+ * Machine-dependent definitions.
+ */
+#if (alpha + i386 != 1)
+ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
+#endif
+#if alpha
+#include <alpha/eisa/eisa_machdep.h>
+#endif
+#if i386
+#include <i386/eisa/eisa_machdep.h>
+#endif
+typedef int eisa_slot_t; /* really only needs to be 4 bits */
/*
* EISA bus attach arguments.
@@ -55,14 +72,15 @@ typedef int eisa_slot_t; /* really only needs to be 4 bits */
struct eisabus_attach_args {
char *eba_busname; /* XXX should be common */
bus_chipset_tag_t eba_bc; /* XXX should be common */
+ eisa_chipset_tag_t eba_ec;
};
-
/*
* EISA device attach arguments.
*/
struct eisa_attach_args {
bus_chipset_tag_t ea_bc;
+ eisa_chipset_tag_t ea_ec;
eisa_slot_t ea_slot;
u_int8_t ea_vid[EISA_NVIDREGS];
@@ -70,37 +88,10 @@ struct eisa_attach_args {
char ea_idstring[EISA_IDSTRINGLEN];
};
-
-/*
- * Easy to remember names for EISA device locators.
- */
-
-#define eisacf_slot cf_loc[0] /* slot */
-
-
-/*
- * EISA device locator values that mean "unknown" or "unspecified."
- * Note that not all are supplied by 'config' and should be filled
- * in by the device if appropriate.
- */
-
-#define EISA_UNKNOWN_SLOT ((eisa_slot_t)-1)
-
/*
- * The EISA bus cfdriver, so that subdevices can more easily tell
- * what bus they're on.
+ * Locators for EISA devices, as specified to config.
*/
+#define eisacf_slot cf_loc[0]
+#define EISA_UNKNOWN_SLOT -1 /* wildcarded 'slot' */
-extern struct cfdriver eisacd;
-
-/*
- * XXX interrupt attachment, etc., is done by using the ISA interfaces.
- * XXX THIS SHOULD CHANGE.
- */
-
-#include <dev/isa/isavar.h>
-
-#define eisa_intr_establish isa_intr_establish /* XXX */
-#define eisa_intr_disestablish isa_intr_disestablish /* XXX */
-
-#endif /* !__DEV_EISA_EISAVAR_H__ */
+#endif /* _DEV_EISA_EISAVAR_H_ */
diff --git a/sys/dev/eisa/files.eisa b/sys/dev/eisa/files.eisa
index 7db823d1a57..cc0b5443475 100644
--- a/sys/dev/eisa/files.eisa
+++ b/sys/dev/eisa/files.eisa
@@ -1,13 +1,15 @@
-# $OpenBSD: files.eisa,v 1.2 1996/04/18 23:47:14 niklas Exp $
-# $NetBSD: files.eisa,v 1.6 1996/03/04 03:29:12 cgd Exp $
+# $OpenBSD: files.eisa,v 1.3 1996/04/21 22:20:50 deraadt Exp $
+# $NetBSD: files.eisa,v 1.7 1996/03/17 00:47:21 thorpej Exp $
#
# Config.new file and device description for machine-independent EISA code.
# Included by ports that need it. Requires that the SCSI files be
# defined first.
-device eisa at eisabus {[slot = -1]}
+device eisa {[slot = -1]}
+attach eisa at eisabus
file dev/eisa/eisa.c eisa needs-flag
# Adaptec AHA-174x EISA SCSI Host Adapter family
-device ahb at eisa: scsi
+device ahb: scsi
+attach ahb at eisa
file dev/eisa/aha1742.c ahb