diff options
Diffstat (limited to 'sys/dev/tc')
-rw-r--r-- | sys/dev/tc/Makefile | 8 | ||||
-rw-r--r-- | sys/dev/tc/devlist2h.awk | 138 | ||||
-rw-r--r-- | sys/dev/tc/files.tc | 8 | ||||
-rw-r--r-- | sys/dev/tc/if_le.c | 58 | ||||
-rw-r--r-- | sys/dev/tc/tc.c | 148 | ||||
-rw-r--r-- | sys/dev/tc/tcdevs | 49 | ||||
-rw-r--r-- | sys/dev/tc/tcdevs.h | 80 | ||||
-rw-r--r-- | sys/dev/tc/tcdevs_data.h | 112 | ||||
-rw-r--r-- | sys/dev/tc/tcvar.h | 59 |
9 files changed, 583 insertions, 77 deletions
diff --git a/sys/dev/tc/Makefile b/sys/dev/tc/Makefile new file mode 100644 index 00000000000..dc3b4cbef74 --- /dev/null +++ b/sys/dev/tc/Makefile @@ -0,0 +1,8 @@ +# $OpenBSD: Makefile,v 1.1 1996/04/18 23:48:19 niklas Exp $ +# $NetBSD: Makefile,v 1.1 1996/03/02 01:16:47 cgd Exp $ + +AWK= awk + +tcdevs.h tcdevs_data.h: tcdevs devlist2h.awk + /bin/rm -f tcdevs.h tcdevs_data.h + ${AWK} -f devlist2h.awk tcdevs diff --git a/sys/dev/tc/devlist2h.awk b/sys/dev/tc/devlist2h.awk new file mode 100644 index 00000000000..5caea9ad296 --- /dev/null +++ b/sys/dev/tc/devlist2h.awk @@ -0,0 +1,138 @@ +#! /usr/bin/awk -f +# $OpenBSD: devlist2h.awk,v 1.1 1996/04/18 23:48:20 niklas Exp $ +# $NetBSD: devlist2h.awk,v 1.2 1996/03/05 23:15:05 cgd Exp $ +# +# Copyright (c) 1995, 1996 Christopher G. Demetriou +# 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. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission +# +# 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. +# +BEGIN { + nproducts = 0 + dfile="tcdevs_data.h" + hfile="tcdevs.h" +} +NR == 1 { + VERSION = $0 + gsub("\\$", "", VERSION) + + printf("/*\n") > dfile + printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ + > dfile + printf(" *\n") > dfile + printf(" * generated from:\n") > dfile + printf(" *\t%s\n", VERSION) > dfile + printf(" */\n") > dfile + + printf("/*\n") > hfile + printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ + > hfile + printf(" *\n") > hfile + printf(" * generated from:\n") > hfile + printf(" *\t%s\n", VERSION) > hfile + printf(" */\n") > hfile + + next +} +$1 == "device" { + ndevices++ + + devices[ndevices, 0] = $2; # devices id + devices[ndevices, 1] = $2; # C identifier for device + gsub("-", "_", devices[ndevices, 1]); + + devices[ndevices, 2] = $3; /* driver name */ + + printf("\n") > hfile + printf("#define\tTC_DEVICE_%s\t\"%s\"\n", devices[ndevices, 1], + devices[ndevices, 2]) > hfile + + printf("#define\tTC_DESCRIPTION_%s\t\"", devices[ndevices, 1]) > hfile + + f = 4; + i = 3; + + # comments + ocomment = oparen = 0 + if (f <= NF) { + ocomment = 1; + } + while (f <= NF) { + if ($f == "#") { + printf("(") > hfile + oparen = 1 + f++ + continue + } + if (oparen) { + printf("%s", $f) > hfile + if (f < NF) + printf(" ") > hfile + f++ + continue + } + devices[ndevices, i] = $f + printf("%s", devices[ndevices, i]) > hfile + if (f < NF) + printf(" ") > hfile + i++; f++; + } + if (oparen) + printf(")") > hfile + if (ocomment) + printf("\"") > hfile + printf("\n") > hfile + + next +} +{ + if ($0 == "") + blanklines++ + if (blanklines < 2) + print $0 > hfile + if (blanklines < 2) + print $0 > dfile +} +END { + # print out the match tables + + printf("\n") > dfile + + printf("struct tc_knowndev tc_knowndevs[] = {\n") > dfile + for (i = 1; i <= ndevices; i++) { + printf("\t{\n") > dfile + printf("\t \"%-8s\",\n", devices[i, 0]) \ + > dfile + printf("\t TC_DEVICE_%s,\n", devices[i, 1]) \ + > dfile + printf("\t TC_DESCRIPTION_%s,\n", devices[i, 1]) \ + > dfile + + printf("\t},\n") > dfile + } + printf("\t{ NULL, NULL, NULL, }\n") > dfile + printf("};\n") > dfile +} diff --git a/sys/dev/tc/files.tc b/sys/dev/tc/files.tc index 73943d2a92e..e0e77a12141 100644 --- a/sys/dev/tc/files.tc +++ b/sys/dev/tc/files.tc @@ -1,13 +1,9 @@ -# $NetBSD: files.tc,v 1.1 1995/12/20 00:54:18 cgd Exp $ +# $OpenBSD: files.tc,v 1.2 1996/04/18 23:48:21 niklas Exp $ +# $NetBSD: files.tc,v 1.2 1996/02/27 22:00:04 cgd Exp $ # # Config.new file and device description for machine-independent # TurboChannel code. Included by ports that need it. -# ports should define "chipsets" which have the tcbus attribute -# and attach their TC bus subdevices - -define tcbus { } - device tc at tcbus {[slot = -1], [offset = -1]} file dev/tc/tc.c tc needs-flag diff --git a/sys/dev/tc/if_le.c b/sys/dev/tc/if_le.c index 0d8f7f83bca..b7909dfabbb 100644 --- a/sys/dev/tc/if_le.c +++ b/sys/dev/tc/if_le.c @@ -1,4 +1,5 @@ -/* $NetBSD: if_le.c,v 1.1 1995/12/20 00:52:16 cgd Exp $ */ +/* $OpenBSD: if_le.c,v 1.2 1996/04/18 23:48:21 niklas Exp $ */ +/* $NetBSD: if_le.c,v 1.3 1996/02/26 23:38:38 cgd Exp $ */ /*- * Copyright (c) 1995 Charles M. Hannum. All rights reserved. @@ -44,13 +45,15 @@ #define CAN_HAVE_TC 1 #endif #ifdef pmax -/* XXX PMAX BASEBOARD OPTIONS? */ #define CAN_HAVE_IOASIC 1 #define CAN_HAVE_TC 1 +#define CAN_HAVE_MAINBUS 1 #endif #include "bpfilter.h" -/* XXX PMAX BASEBOARD OPTIONS? */ +#ifdef CAN_HAVE_MAINBUS +/*XXX TEST FOR KN01 OR MIPSFAIR? */ +#endif #ifdef CAN_HAVE_TC #include "tc.h" #endif @@ -74,13 +77,16 @@ #include <machine/autoconf.h> -/* XXX PMAX BASEBOARD OPTIONS? */ #if CAN_HAVE_TC && (NTC > 0) #include <dev/tc/tcvar.h> #endif #if CAN_HAVE_IOASIC && (NIOASIC > 0) #include <dev/tc/ioasicvar.h> #endif +#if CAN_HAVE_MAINBUS +#include <pmax/pmax/kn01.h> +extern struct cfdriver mainbuscd; /* XXX */ +#endif #include <dev/tc/if_levar.h> #include <dev/ic/am7990reg.h> @@ -141,7 +147,6 @@ lematch(parent, match, aux) void *match, *aux; { - /* XXX VARIOUS PMAX BASEBOARD CASES? */ #if CAN_HAVE_IOASIC && (NIOASIC > 0) if (parent->dv_cfdata->cf_driver == &ioasiccd) { struct ioasicdev_attach_args *d = aux; @@ -156,13 +161,16 @@ lematch(parent, match, aux) if (parent->dv_cfdata->cf_driver == &tccd) { struct tcdev_attach_args *d = aux; - if (!tc_submatch(match, aux)) - return (0); if (strncmp("PMAD-AA ", d->tcda_modname, TC_ROM_LLEN) && strncmp("PMAD-BA ", d->tcda_modname, TC_ROM_LLEN)) return (0); } else #endif /* TC */ +#if CAN_HAVE_MAINBUS /* XXX TEST FOR KN01 OR MIPSFAIR? */ + if (parent->dv_cfdata->cf_driver == &mainbuscd) { + /* XXX VARIOUS PMAX BASEBOARD CASES? */ + } else +#endif /* MAINBUS */ return (0); return (1); @@ -179,7 +187,6 @@ leattach(parent, self, aux) u_char *cp; /* pointer to MAC address */ int i; - /* XXX VARIOUS PMAX BASEBOARD CASES? */ #if CAN_HAVE_IOASIC && (NIOASIC > 0) if (parent->dv_cfdata->cf_driver == &ioasiccd) { struct ioasicdev_attach_args *d = aux; @@ -198,14 +205,16 @@ leattach(parent, self, aux) ioasic_lance_dma_setup(le_iomem); /* XXX more thought */ ie_fn = ioasic_intr_establish; + sc->sc_cookie = (void*)d->iada_cookie; } else #endif /* IOASIC */ -#if CAN_HAVE_TC && (NTC > 0) /* XXX KN02 BASEBOARD CASE? */ +#if CAN_HAVE_TC && (NTC > 0) if (parent->dv_cfdata->cf_driver == &tccd) { struct tcdev_attach_args *d = aux; /* - * It's on the turbochannel proper. + * It's on the turbochannel proper, or a kn02 + * baseboard implementation of a TC option card. */ sc->sc_r1 = (struct lereg1 *)(d->tcda_addr + LE_OFFSET_LANCE); sc->sc_mem = (void *)(d->tcda_addr + LE_OFFSET_RAM); @@ -217,10 +226,37 @@ leattach(parent, self, aux) sc->sc_copyfrombuf = copyfrombuf_contig; sc->sc_zerobuf = zerobuf_contig; - /* XXX DMA setup fn? */ + sc->sc_cookie = d->tcda_cookie; + /* + * TC lance boards have onboard SRAM buffers. DMA + * between the onbard RAM and main memory is not possible, + * so DMA setup is not required. + */ ie_fn = tc_intr_establish; } else #endif /* TC */ +#if CAN_HAVE_MAINBUS /* XXX TEST FOR KN01 OR MIPSFAIR? */ + if (parent->dv_cfdata->cf_driver == &mainbuscd) { + struct confargs *ca = aux; + + /* + * It's on the baseboeard, with a dedicated interrupt line. + */ +/*XXX*/ sc->sc_r1 = (struct lereg1 *)(ca->ca_addr); +/*XXX*/ sc->sc_mem = (void *)TC_PHYS_TO_UNCACHED(0x19000000); +/*XXX*/ cp = (u_char *)(TC_PHYS_TO_UNCACHED(KN01_SYS_CLOCK) + 1); + + sc->sc_copytodesc = copytobuf_gap2; + sc->sc_copyfromdesc = copyfrombuf_gap2; + sc->sc_copytobuf = copytobuf_gap2; + sc->sc_copyfrombuf = copyfrombuf_gap2; + sc->sc_zerobuf = zerobuf_gap2; + + sc->sc_cookie = (void *)ca->ca_slotpri; /*XXX more thought */ + /* XXX BASEBOARD INTERRUPT ESTABLISH FUNCTION? */ + } else +#endif /* MAINBUS */ + panic("leattach: can't be here"); sc->sc_conf3 = 0; diff --git a/sys/dev/tc/tc.c b/sys/dev/tc/tc.c index 7fcf37ec49d..ba5d3b5b8ed 100644 --- a/sys/dev/tc/tc.c +++ b/sys/dev/tc/tc.c @@ -1,4 +1,5 @@ -/* $NetBSD: tc.c,v 1.1 1995/12/20 00:48:32 cgd Exp $ */ +/* $OpenBSD: tc.c,v 1.2 1996/04/18 23:48:22 niklas Exp $ */ +/* $NetBSD: tc.c,v 1.10 1996/03/05 23:15:07 cgd Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -32,10 +33,12 @@ #include <dev/tc/tcreg.h> #include <dev/tc/tcvar.h> +#include <dev/tc/tcdevs.h> struct tc_softc { struct device sc_dv; + int sc_speed; int sc_nslots; struct tc_slotdesc *sc_slots; @@ -51,7 +54,9 @@ struct cfdriver tccd = { NULL, "tc", tcmatch, tcattach, DV_DULL, sizeof (struct tc_softc) }; int tcprint __P((void *, char *)); +int tcsubmatch __P((struct device *, void *, void *)); int tc_checkslot __P((tc_addr_t, char *)); +void tc_devinfo __P((const char *, char *)); int tcmatch(parent, cfdata, aux) @@ -59,6 +64,13 @@ tcmatch(parent, cfdata, aux) void *cfdata; void *aux; { + struct cfdata *cf = cfdata; + struct tcbus_attach_args *tba = aux; + + if (strcmp(tba->tba_busname, cf->cf_driver->cd_name)) + return (0); + + /* XXX check other indicators */ return (1); } @@ -70,28 +82,31 @@ tcattach(parent, self, aux) void *aux; { struct tc_softc *sc = (struct tc_softc *)self; - struct tc_attach_args *tc = aux; - struct tcdev_attach_args tcdev; + struct tcbus_attach_args *tba = aux; + struct tc_attach_args ta; const struct tc_builtin *builtin; struct tc_slotdesc *slot; tc_addr_t tcaddr; + void *match; int i; - printf("\n"); + printf("%s MHz clock\n", + tba->tba_speed == TC_SPEED_25_MHZ ? "25" : "12.5"); /* * Save important CPU/chipset information. */ - sc->sc_nslots = tc->tca_nslots; - sc->sc_slots = tc->tca_slots; - sc->sc_intr_establish = tc->tca_intr_establish; - sc->sc_intr_disestablish = tc->tca_intr_disestablish; + sc->sc_speed = tba->tba_speed; + sc->sc_nslots = tba->tba_nslots; + sc->sc_slots = tba->tba_slots; + sc->sc_intr_establish = tba->tba_intr_establish; + sc->sc_intr_disestablish = tba->tba_intr_disestablish; /* * Try to configure each built-in device */ - for (i = 0; i < tc->tca_nbuiltins; i++) { - builtin = &tc->tca_builtins[i]; + for (i = 0; i < tba->tba_nbuiltins; i++) { + builtin = &tba->tba_builtins[i]; /* sanity check! */ if (builtin->tcb_slot > sc->sc_nslots) @@ -109,12 +124,13 @@ tcattach(parent, self, aux) /* * Set up the device attachment information. */ - strncpy(tcdev.tcda_modname, builtin->tcb_modname, TC_ROM_LLEN); - tcdev.tcda_modname[TC_ROM_LLEN] = '\0'; - tcdev.tcda_slot = builtin->tcb_slot; - tcdev.tcda_offset = builtin->tcb_offset; - tcdev.tcda_addr = tcaddr; - tcdev.tcda_cookie = builtin->tcb_cookie; + strncpy(ta.ta_modname, builtin->tcb_modname, TC_ROM_LLEN); + ta.ta_modname[TC_ROM_LLEN] = '\0'; + ta.ta_slot = builtin->tcb_slot; + ta.ta_offset = builtin->tcb_offset; + ta.ta_addr = tcaddr; + ta.ta_cookie = builtin->tcb_cookie; + ta.ta_busspeed = sc->sc_speed; /* * Mark the slot as used, so we don't check it later. @@ -124,7 +140,7 @@ tcattach(parent, self, aux) /* * Attach the device. */ - config_found(self, &tcdev, tcprint); + config_found_sm(self, &ta, tcprint, tcsubmatch); } /* @@ -143,16 +159,16 @@ tcattach(parent, self, aux) tcaddr = slot->tcs_addr; if (tc_badaddr(tcaddr)) continue; - if (tc_checkslot(tcaddr, tcdev.tcda_modname) == 0) + if (tc_checkslot(tcaddr, ta.ta_modname) == 0) continue; /* * Set up the rest of the attachment information. */ - tcdev.tcda_slot = i; - tcdev.tcda_offset = 0; - tcdev.tcda_addr = tcaddr; - tcdev.tcda_cookie = slot->tcs_cookie; + ta.ta_slot = i; + ta.ta_offset = 0; + ta.ta_addr = tcaddr; + ta.ta_cookie = slot->tcs_cookie; /* * Mark the slot as used. @@ -162,7 +178,7 @@ tcattach(parent, self, aux) /* * Attach the device. */ - config_found(self, &tcdev, tcprint); + config_found_sm(self, &ta, tcprint, tcsubmatch); } } @@ -171,25 +187,34 @@ tcprint(aux, pnp) void *aux; char *pnp; { - struct tcdev_attach_args *tcdev = aux; + struct tc_attach_args *ta = aux; + char devinfo[256]; - if (pnp) - printf("%s at %s", tcdev->tcda_modname, pnp); /* XXX */ - printf(" slot %d offset 0x%lx", tcdev->tcda_slot, - (long)tcdev->tcda_offset); - return (UNCONF); + if (pnp) { + tc_devinfo(ta->ta_modname, devinfo); + printf("%s at %s", devinfo, pnp); + } + printf(" slot %d offset 0x%lx", ta->ta_slot, + (long)ta->ta_offset); + return (UNCONF); } -int -tc_submatch(match, d) - struct cfdata *match; - struct tcdev_attach_args *d; +int +tcsubmatch(parent, match, aux) + struct device *parent; + void *match, *aux; { + struct cfdata *cf = match; + struct tc_attach_args *d = aux; - return (((match->tccf_slot == d->tcda_slot) || - (match->tccf_slot == TCCF_SLOT_UNKNOWN)) && - ((match->tccf_offset == d->tcda_offset) || - (match->tccf_offset == TCCF_OFFSET_UNKNOWN))); + if ((cf->tccf_slot != TCCF_SLOT_UNKNOWN) && + (cf->tccf_slot != d->ta_slot)) + return 0; + if ((cf->tccf_offset != TCCF_SLOT_UNKNOWN) && + (cf->tccf_offset != d->ta_offset)) + return 0; + + return ((*cf->cf_driver->cd_match)(parent, match, aux)); } @@ -261,3 +286,52 @@ tc_intr_disestablish(dev, cookie) (*sc->sc_intr_disestablish)(sc->sc_dv.dv_parent, cookie); } + +#ifdef TCVERBOSE +/* + * Descriptions of of known devices. + */ +struct tc_knowndev { + const char *id, *driver, *description; +}; + +#include <dev/tc/tcdevs_data.h> +#endif /* TCVERBOSE */ + +void +tc_devinfo(id, cp) + const char *id; + char *cp; +{ + const char *driver, *description; +#ifdef TCVERBOSE + struct tc_knowndev *tdp; + int match; + const char *unmatched = "unknown "; +#else + const char *unmatched = ""; +#endif + + driver = NULL; + description = id; + +#ifdef TCVERBOSE + /* find the device in the table, if possible. */ + tdp = tc_knowndevs; + while (tdp->id != NULL) { + /* check this entry for a match */ + match = !strcmp(tdp->id, id); + if (match) { + driver = tdp->driver; + description = tdp->description; + break; + } + tdp++; + } +#endif + + if (driver == NULL) + cp += sprintf(cp, "%sdevice %s", unmatched, id); + else + cp += sprintf(cp, "%s (%s)", driver, description); +} diff --git a/sys/dev/tc/tcdevs b/sys/dev/tc/tcdevs new file mode 100644 index 00000000000..6329ec0b4dd --- /dev/null +++ b/sys/dev/tc/tcdevs @@ -0,0 +1,49 @@ +$OpenBSD: tcdevs,v 1.1 1996/04/18 23:48:23 niklas Exp $ +/* $NetBSD: tcdevs,v 1.3 1996/03/05 23:15:59 cgd Exp $ */ + +/* + * Copyright (c) 1996 Christopher G. Demetriou + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * 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. + */ + +device KZTSA-AA tza TZA FWD SCSI +device PMAD-AA le LANCE Ethernet +device PMAF-AA fza FZA FDDI +device PMAG-AA mfb Monochrome Frame Buffer +device PMAG-BA cfb Color Frame Buffer +device PMAG-CA ga 2D Graphic Board +device PMAG-DA gq 3D Graphic Board (LM) +device PMAG-FA gq 3D Graphic Board (HE) +# the following entry may be incorrect +device PMAG-DV xcfb Maxine Color Frame Buffer +device PMAGB-BA sfb Smart Frame Buffer +device PMAZ-AA asc 53c94 SCSI +device T3PKT tt DECWRL Turbochannel T3 +device T1D4PKT ds DECWRL Turbochannel T1 +device FORE_ATM fa Fore TCA-100 ATM diff --git a/sys/dev/tc/tcdevs.h b/sys/dev/tc/tcdevs.h new file mode 100644 index 00000000000..aed04ddf028 --- /dev/null +++ b/sys/dev/tc/tcdevs.h @@ -0,0 +1,80 @@ +/* + * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. + * + * generated from: + * OpenBSD + */ +/* $NetBSD: tcdevs,v 1.3 1996/03/05 23:15:59 cgd Exp $ */ + +/* + * Copyright (c) 1996 Christopher G. Demetriou + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * 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. + */ + +#define TC_DEVICE_KZTSA_AA "tza" +#define TC_DESCRIPTION_KZTSA_AA "TZA FWD SCSI" + +#define TC_DEVICE_PMAD_AA "le" +#define TC_DESCRIPTION_PMAD_AA "LANCE Ethernet" + +#define TC_DEVICE_PMAF_AA "fza" +#define TC_DESCRIPTION_PMAF_AA "FZA FDDI" + +#define TC_DEVICE_PMAG_AA "mfb" +#define TC_DESCRIPTION_PMAG_AA "Monochrome Frame Buffer" + +#define TC_DEVICE_PMAG_BA "cfb" +#define TC_DESCRIPTION_PMAG_BA "Color Frame Buffer" + +#define TC_DEVICE_PMAG_CA "ga" +#define TC_DESCRIPTION_PMAG_CA "2D Graphic Board" + +#define TC_DEVICE_PMAG_DA "gq" +#define TC_DESCRIPTION_PMAG_DA "3D Graphic Board (LM)" + +#define TC_DEVICE_PMAG_FA "gq" +#define TC_DESCRIPTION_PMAG_FA "3D Graphic Board (HE)" + +#define TC_DEVICE_PMAG_DV "xcfb" +#define TC_DESCRIPTION_PMAG_DV "Maxine Color Frame Buffer" + +#define TC_DEVICE_PMAGB_BA "sfb" +#define TC_DESCRIPTION_PMAGB_BA "Smart Frame Buffer" + +#define TC_DEVICE_PMAZ_AA "asc" +#define TC_DESCRIPTION_PMAZ_AA "53c94 SCSI" + +#define TC_DEVICE_T3PKT "tt" +#define TC_DESCRIPTION_T3PKT "DECWRL Turbochannel T3" + +#define TC_DEVICE_T1D4PKT "ds" +#define TC_DESCRIPTION_T1D4PKT "DECWRL Turbochannel T1" + +#define TC_DEVICE_FORE_ATM "fa" +#define TC_DESCRIPTION_FORE_ATM "Fore TCA-100 ATM" diff --git a/sys/dev/tc/tcdevs_data.h b/sys/dev/tc/tcdevs_data.h new file mode 100644 index 00000000000..ac4391f366d --- /dev/null +++ b/sys/dev/tc/tcdevs_data.h @@ -0,0 +1,112 @@ +/* + * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. + * + * generated from: + * OpenBSD + */ +/* $NetBSD: tcdevs,v 1.3 1996/03/05 23:15:59 cgd Exp $ */ + +/* + * Copyright (c) 1996 Christopher G. Demetriou + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * 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. + */ + +struct tc_knowndev tc_knowndevs[] = { + { + "KZTSA-AA", + TC_DEVICE_KZTSA_AA, + TC_DESCRIPTION_KZTSA_AA, + }, + { + "PMAD-AA ", + TC_DEVICE_PMAD_AA, + TC_DESCRIPTION_PMAD_AA, + }, + { + "PMAF-AA ", + TC_DEVICE_PMAF_AA, + TC_DESCRIPTION_PMAF_AA, + }, + { + "PMAG-AA ", + TC_DEVICE_PMAG_AA, + TC_DESCRIPTION_PMAG_AA, + }, + { + "PMAG-BA ", + TC_DEVICE_PMAG_BA, + TC_DESCRIPTION_PMAG_BA, + }, + { + "PMAG-CA ", + TC_DEVICE_PMAG_CA, + TC_DESCRIPTION_PMAG_CA, + }, + { + "PMAG-DA ", + TC_DEVICE_PMAG_DA, + TC_DESCRIPTION_PMAG_DA, + }, + { + "PMAG-FA ", + TC_DEVICE_PMAG_FA, + TC_DESCRIPTION_PMAG_FA, + }, + { + "PMAG-DV ", + TC_DEVICE_PMAG_DV, + TC_DESCRIPTION_PMAG_DV, + }, + { + "PMAGB-BA", + TC_DEVICE_PMAGB_BA, + TC_DESCRIPTION_PMAGB_BA, + }, + { + "PMAZ-AA ", + TC_DEVICE_PMAZ_AA, + TC_DESCRIPTION_PMAZ_AA, + }, + { + "T3PKT ", + TC_DEVICE_T3PKT, + TC_DESCRIPTION_T3PKT, + }, + { + "T1D4PKT ", + TC_DEVICE_T1D4PKT, + TC_DESCRIPTION_T1D4PKT, + }, + { + "FORE_ATM", + TC_DEVICE_FORE_ATM, + TC_DESCRIPTION_FORE_ATM, + }, + { NULL, NULL, NULL, } +}; diff --git a/sys/dev/tc/tcvar.h b/sys/dev/tc/tcvar.h index 5f36aeea8f5..e8473dcb5b5 100644 --- a/sys/dev/tc/tcvar.h +++ b/sys/dev/tc/tcvar.h @@ -1,4 +1,5 @@ -/* $NetBSD: tcvar.h,v 1.1 1995/12/20 00:48:36 cgd Exp $ */ +/* $OpenBSD: tcvar.h,v 1.2 1996/04/18 23:48:24 niklas Exp $ */ +/* $NetBSD: tcvar.h,v 1.3 1996/02/27 01:37:33 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -51,27 +52,33 @@ typedef enum { /* * Arguments used to attach TurboChannel busses. */ -struct tc_attach_args { - u_int tca_nslots; - struct tc_slotdesc *tca_slots; - - u_int tca_nbuiltins; - const struct tc_builtin *tca_builtins; - - void (*tca_intr_establish) __P((struct device *, void *, +struct tcbus_attach_args { + char *tba_busname; /* XXX should be common */ + + /* Bus information */ + u_int tba_speed; /* see TC_SPEED_* below */ + u_int tba_nslots; + struct tc_slotdesc *tba_slots; + u_int tba_nbuiltins; + const struct tc_builtin *tba_builtins; + + + /* TC bus resource management; XXX will move elsewhere eventually. */ + void (*tba_intr_establish) __P((struct device *, void *, tc_intrlevel_t, int (*)(void *), void *)); - void (*tca_intr_disestablish) __P((struct device *, void *)); + void (*tba_intr_disestablish) __P((struct device *, void *)); }; /* * Arguments used to attach TurboChannel devices. */ -struct tcdev_attach_args { - char tcda_modname[TC_ROM_LLEN+1]; - u_int tcda_slot; - tc_offset_t tcda_offset; - tc_addr_t tcda_addr; - void *tcda_cookie; +struct tc_attach_args { + char ta_modname[TC_ROM_LLEN+1]; + u_int ta_slot; + tc_offset_t ta_offset; + tc_addr_t ta_addr; + void *ta_cookie; + u_int ta_busspeed; /* see TC_SPEED_* below */ }; /* @@ -79,9 +86,9 @@ struct tcdev_attach_args { * code to the TurboChannel bus driver. */ struct tc_slotdesc { - tc_addr_t tcs_addr; - void *tcs_cookie; - int tcs_used; + tc_addr_t tcs_addr; + void *tcs_cookie; + int tcs_used; }; /* @@ -89,10 +96,10 @@ struct tc_slotdesc { * machine-dependent code to the TurboChannel bus driver. */ struct tc_builtin { - char *tcb_modname; - u_int tcb_slot; - tc_offset_t tcb_offset; - void *tcb_cookie; + char *tcb_modname; + u_int tcb_slot; + tc_offset_t tcb_offset; + void *tcb_cookie; }; /* @@ -112,6 +119,12 @@ void tc_intr_disestablish __P((struct device *, void *)); #define TCCF_OFFSET_UNKNOWN -1 /* + * Miscellaneous definitions. + */ +#define TC_SPEED_12_5_MHZ 0 /* 12.5MHz TC bus */ +#define TC_SPEED_25_MHZ 1 /* 25MHz TC bus */ + +/* * The TurboChannel bus cfdriver, so that subdevices can more * easily tell what bus they're on. */ |