diff options
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/conf/GENERIC | 8 | ||||
-rw-r--r-- | sys/arch/sparc/conf/GENERIC_SCSI3 | 8 | ||||
-rw-r--r-- | sys/arch/sparc/conf/SUN4C | 8 | ||||
-rw-r--r-- | sys/arch/sparc/conf/SUN4M | 8 | ||||
-rw-r--r-- | sys/arch/sparc/conf/files.sparc | 8 | ||||
-rw-r--r-- | sys/arch/sparc/dev/sbus.c | 54 | ||||
-rw-r--r-- | sys/arch/sparc/dev/xbox.c | 207 | ||||
-rw-r--r-- | sys/arch/sparc/dev/xboxreg.h | 92 | ||||
-rw-r--r-- | sys/arch/sparc/dev/xboxvar.h | 43 | ||||
-rw-r--r-- | sys/arch/sparc/include/autoconf.h | 3 |
10 files changed, 413 insertions, 26 deletions
diff --git a/sys/arch/sparc/conf/GENERIC b/sys/arch/sparc/conf/GENERIC index 50aec35cbbe..b4148070dcc 100644 --- a/sys/arch/sparc/conf/GENERIC +++ b/sys/arch/sparc/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.40 1999/03/17 18:45:08 deraadt Exp $ +# $OpenBSD: GENERIC,v 1.41 1999/04/18 03:24:22 jason Exp $ # $NetBSD: GENERIC,v 1.48 1997/08/23 19:19:01 mjacob Exp $ # Machine architecture; required by config(8) @@ -107,6 +107,10 @@ sbpp* at spif? bpp* at sbus? slot ? offset ? # parallel port +# SUNW,xbox SBus Expansion Subsystem +xbox* at sbus? slot ? offset ? # SBus Expansion box +sbus* at xbox? + # # Note the flags on the esp entries below, that work around # deficiencies in the current driver: @@ -171,7 +175,7 @@ nsphy* at mii? phy ? # NS and compatible PHYs qsphy* at mii? phy ? # Quality Semi QS6612 PHYs # Quad-ethernet glue device, and sub-devices -qec* at sbus0 slot ? offset ? +qec* at sbus? slot ? offset ? qe* at qec? be* at qec? diff --git a/sys/arch/sparc/conf/GENERIC_SCSI3 b/sys/arch/sparc/conf/GENERIC_SCSI3 index b492755dcfd..16fa695365e 100644 --- a/sys/arch/sparc/conf/GENERIC_SCSI3 +++ b/sys/arch/sparc/conf/GENERIC_SCSI3 @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC_SCSI3,v 1.27 1999/03/01 04:56:04 jason Exp $ +# $OpenBSD: GENERIC_SCSI3,v 1.28 1999/04/18 03:24:22 jason Exp $ # $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $ # Machine architecture; required by config(8) @@ -106,6 +106,10 @@ sbpp* at spif? bpp* at sbus? slot ? offset ? # parallel port +# SUNW,xbox SBus Expansion Subsystem +xbox* at sbus? slot ? offset ? # SBus Expansion box +sbus* at xbox? + # # Note the flags on the esp entries below, that work around # deficiencies in the current driver: @@ -167,7 +171,7 @@ nsphy* at mii? phy ? # NS and compatible PHYs qsphy* at mii? phy ? # Quality Semi QS6612 PHYs # Quad-ethernet glue device, and sub-devices -qec* at sbus0 slot ? offset ? +qec* at sbus? slot ? offset ? qe* at qec? be* at qec? diff --git a/sys/arch/sparc/conf/SUN4C b/sys/arch/sparc/conf/SUN4C index d5bc6cec5b2..1cffd9e966f 100644 --- a/sys/arch/sparc/conf/SUN4C +++ b/sys/arch/sparc/conf/SUN4C @@ -1,4 +1,4 @@ -# $OpenBSD: SUN4C,v 1.26 1999/02/01 00:31:57 jason Exp $ +# $OpenBSD: SUN4C,v 1.27 1999/04/18 03:24:22 jason Exp $ # $NetBSD: GENERIC,v 1.19 1995/10/08 11:45:39 pk Exp $ machine sparc @@ -98,6 +98,10 @@ spif* at sbus? slot ? offset ? # spif serial cards stty* at spif? sbpp* at spif? +# SUNW,xbox SBus Expansion Subsystem +xbox* at sbus? slot ? offset ? # SBus Expansion box +sbus* at xbox? + # FSBE/S or sun4m #espdma0 at sbus0 slot ? offset ? #espdma* at sbus0 slot ? offset ? @@ -124,7 +128,7 @@ nsphy* at mii? phy ? # NS and compatible PHYs qsphy* at mii? phy ? # Quality Semi QS6612 PHYs # Quad-ethernet glue device, and sub-devices -qec* at sbus0 slot ? offset ? +qec* at sbus? slot ? offset ? qe* at qec? be* at qec? diff --git a/sys/arch/sparc/conf/SUN4M b/sys/arch/sparc/conf/SUN4M index 174a37157eb..cdfa783b6d6 100644 --- a/sys/arch/sparc/conf/SUN4M +++ b/sys/arch/sparc/conf/SUN4M @@ -1,4 +1,4 @@ -# $OpenBSD: SUN4M,v 1.29 1999/03/17 05:34:15 mjacob Exp $ +# $OpenBSD: SUN4M,v 1.30 1999/04/18 03:24:22 jason Exp $ # $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $ # Machine architecture; required by config(8) @@ -68,6 +68,10 @@ spif* at sbus? slot ? offset ? # spif serial cards stty* at spif? sbpp* at spif? +# SUNW,xbox SBus Expansion Subsystem +xbox* at sbus? slot ? offset ? # SBus Expansion box +sbus* at xbox? + # # Note the flags on the esp entries below, that work around # deficiencies in the current driver: @@ -110,7 +114,7 @@ nsphy* at mii? phy ? # NS and compatible PHYs qsphy* at mii? phy ? # Quality Semi QS6612 PHYs # Quad-ethernet glue device, and sub-devices -qec* at sbus0 slot ? offset ? +qec* at sbus? slot ? offset ? qe* at qec? be* at qec? diff --git a/sys/arch/sparc/conf/files.sparc b/sys/arch/sparc/conf/files.sparc index 54ac4b3a638..6504c77553c 100644 --- a/sys/arch/sparc/conf/files.sparc +++ b/sys/arch/sparc/conf/files.sparc @@ -1,4 +1,4 @@ -# $OpenBSD: files.sparc,v 1.28 1999/03/17 05:34:14 mjacob Exp $ +# $OpenBSD: files.sparc,v 1.29 1999/04/18 03:24:23 jason Exp $ # $NetBSD: files.sparc,v 1.44 1997/08/31 21:29:16 pk Exp $ # @(#)files.sparc 8.1 (Berkeley) 7/19/93 @@ -72,8 +72,9 @@ attach fd at fdc file arch/sparc/dev/fd.c fdc | fd needs-flag file arch/sparc/sparc/bsd_fdintr.s fdc +device xbox {} device sbus { slot = -1, offset = -1 } -attach sbus at mainbus, iommu +attach sbus at mainbus, iommu, sbus, xbox file arch/sparc/dev/sbus.c sbus # @@ -299,3 +300,6 @@ file arch/sparc/dev/spif.c spif | stty | sbpp needs-flag device bpp {} attach bpp at sbus file arch/sparc/dev/bpp.c bpp needs-flag + +attach xbox at sbus +file arch/sparc/dev/xbox.c xbox diff --git a/sys/arch/sparc/dev/sbus.c b/sys/arch/sparc/dev/sbus.c index 8041246d595..a52f40da98f 100644 --- a/sys/arch/sparc/dev/sbus.c +++ b/sys/arch/sparc/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.7 1998/12/14 17:51:35 deraadt Exp $ */ +/* $OpenBSD: sbus.c,v 1.8 1999/04/18 03:24:25 jason Exp $ */ /* $NetBSD: sbus.c,v 1.17 1997/06/01 22:10:39 pk Exp $ */ /* @@ -59,6 +59,8 @@ #include <sparc/dev/sbusreg.h> #include <sparc/dev/sbusvar.h> +#include <sparc/dev/xboxreg.h> +#include <sparc/dev/xboxvar.h> #include <sparc/dev/dmareg.h> int sbus_print __P((void *, const char *)); @@ -111,6 +113,18 @@ sbus_match(parent, vcf, aux) if (CPU_ISSUN4) return (0); + if (ca->ca_bustype == BUS_XBOX) { + struct xbox_softc *xsc = (struct xbox_softc *)parent; + + /* Prevent multiple attachments */ + if (xsc->sc_attached == 0) { + xsc->sc_attached = 1; + return (1); + } + + return (0); + } + return (strcmp(cf->cf_driver->cd_name, ra->ra_name) == 0); } @@ -135,7 +149,7 @@ sbus_attach(parent, self, aux) * XXX there is only one Sbus, for now -- do not know how to * address children on others */ - if (sc->sc_dev.dv_unit > 0) { + if (sc->sc_dev.dv_unit > 0 && ca->ca_bustype != BUS_XBOX) { printf(" unsupported\n"); return; } @@ -154,19 +168,29 @@ sbus_attach(parent, self, aux) sc->sc_burst = getpropint(node, "burst-sizes", 0); sc->sc_burst = sc->sc_burst & ~SBUS_BURST_64; - if (ra->ra_bp != NULL && strcmp(ra->ra_bp->name, "sbus") == 0) - oca.ca_ra.ra_bp = ra->ra_bp + 1; - else - oca.ca_ra.ra_bp = NULL; - - rlen = getproplen(node, "ranges"); - if (rlen > 0) { - sc->sc_nrange = rlen / sizeof(struct rom_range); - sc->sc_range = - (struct rom_range *)malloc(rlen, M_DEVBUF, M_NOWAIT); - if (sc->sc_range == 0) - panic("sbus: PROM ranges too large: %d", rlen); - (void)getprop(node, "ranges", sc->sc_range, rlen); + if (ca->ca_bustype == BUS_XBOX) { + struct xbox_softc *xsc = (struct xbox_softc *)parent; + + /* Parent has already done the leg work */ + sc->sc_nrange = xsc->sc_nrange; + sc->sc_range = xsc->sc_range; + xsc->sc_attached = 2; + } + else { + if (ra->ra_bp != NULL && strcmp(ra->ra_bp->name, "sbus") == 0) + oca.ca_ra.ra_bp = ra->ra_bp + 1; + else + oca.ca_ra.ra_bp = NULL; + + rlen = getproplen(node, "ranges"); + if (rlen > 0) { + sc->sc_nrange = rlen / sizeof(struct rom_range); + sc->sc_range = + (struct rom_range *)malloc(rlen, M_DEVBUF, M_NOWAIT); + if (sc->sc_range == 0) + panic("sbus: PROM ranges too large: %d", rlen); + (void)getprop(node, "ranges", sc->sc_range, rlen); + } } /* diff --git a/sys/arch/sparc/dev/xbox.c b/sys/arch/sparc/dev/xbox.c new file mode 100644 index 00000000000..a534e0c4b2e --- /dev/null +++ b/sys/arch/sparc/dev/xbox.c @@ -0,0 +1,207 @@ +/* $OpenBSD: xbox.c,v 1.1 1999/04/18 03:24:26 jason Exp $ */ + +/* + * Copyright (c) 1999 Jason L. Wright (jason@thought.net) + * 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 Jason L. Wright + * 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. + */ + +/* + * Driver for the Sun SBus Expansion Subsystem + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/errno.h> +#include <sys/ioctl.h> +#include <sys/syslog.h> +#include <sys/device.h> +#include <sys/malloc.h> + +#include <machine/autoconf.h> +#include <sparc/cpu.h> +#include <sparc/sparc/cpuvar.h> +#include <sparc/dev/sbusvar.h> +#include <sparc/dev/dmareg.h> /* for SBUS_BURST_* */ + +#include <sparc/dev/xboxreg.h> +#include <sparc/dev/xboxvar.h> + +int xboxmatch __P((struct device *, void *, void *)); +void xboxattach __P((struct device *, struct device *, void *)); +int xboxprint __P((void *, const char *)); +void xbox_fix_range __P((struct xbox_softc *sc, struct sbus_softc *sbp)); + +struct cfattach xbox_ca = { + sizeof (struct xbox_softc), xboxmatch, xboxattach +}; + +struct cfdriver xbox_cd = { + NULL, "xbox", DV_IFNET +}; + +int +xboxmatch(parent, vcf, aux) + struct device *parent; + void *vcf, *aux; +{ + struct confargs *ca = aux; + register struct romaux *ra = &ca->ca_ra; + + if (strcmp("SUNW,xbox", ra->ra_name)) + return (0); + + if (!sbus_testdma((struct sbus_softc *)parent, ca)) + return(0); + return (1); +} + +void +xboxattach(parent, self, aux) + struct device *parent, *self; + void *aux; +{ + struct xbox_softc *sc = (struct xbox_softc *)self; + struct confargs *ca = aux; + struct romaux *ra = &ca->ca_ra; + int node = ca->ca_ra.ra_node; + struct confargs oca; + char *s; + + s = getpropstring(node, "model"); + printf(": model %s", s); + + s = getpropstring(node, "child-present"); + if (strcmp(s, "false") == 0) { + printf(": no devices\n"); + return; + } + + sc->sc_regs.xa_write0 = mapiodev(&ca->ca_ra.ra_reg[0], 0, + sizeof(*sc->sc_regs.xa_write0)); + sc->sc_regs.xa_errs = mapiodev(&ca->ca_ra.ra_reg[1], 0, + sizeof(*sc->sc_regs.xa_errs)); + sc->sc_regs.xa_ctl0 = mapiodev(&ca->ca_ra.ra_reg[2], 0, + sizeof(*sc->sc_regs.xa_ctl0)); + sc->sc_regs.xa_ctl1 = mapiodev(&ca->ca_ra.ra_reg[3], 0, + sizeof(*sc->sc_regs.xa_ctl1)); + sc->sc_regs.xa_elua = mapiodev(&ca->ca_ra.ra_reg[4], 0, + sizeof(*sc->sc_regs.xa_elua)); + sc->sc_regs.xa_ella = mapiodev(&ca->ca_ra.ra_reg[5], 0, + sizeof(*sc->sc_regs.xa_ella)); + sc->sc_regs.xa_rsrv = mapiodev(&ca->ca_ra.ra_reg[6], 0, + sizeof(*sc->sc_regs.xa_rsrv)); + sc->sc_regs.xb_errs = mapiodev(&ca->ca_ra.ra_reg[7], 0, + sizeof(*sc->sc_regs.xb_errs)); + sc->sc_regs.xb_ctl0 = mapiodev(&ca->ca_ra.ra_reg[8], 0, + sizeof(*sc->sc_regs.xb_ctl0)); + sc->sc_regs.xb_ctl1 = mapiodev(&ca->ca_ra.ra_reg[9], 0, + sizeof(*sc->sc_regs.xb_ctl1)); + sc->sc_regs.xb_elua = mapiodev(&ca->ca_ra.ra_reg[10], 0, + sizeof(*sc->sc_regs.xb_elua)); + sc->sc_regs.xb_ella = mapiodev(&ca->ca_ra.ra_reg[11], 0, + sizeof(*sc->sc_regs.xb_ella)); + sc->sc_regs.xb_rsrv = mapiodev(&ca->ca_ra.ra_reg[12], 0, + sizeof(*sc->sc_regs.xb_rsrv)); + + if (ra->ra_bp != NULL && strcmp(ra->ra_bp->name, "SUNW,xbox") == 0) + oca.ca_ra.ra_bp = ca->ca_ra.ra_bp + 1; + else + oca.ca_ra.ra_bp = NULL; + + sc->sc_key = getpropint(node, "write0-key", -1); + sc->sc_node = node; + + *sc->sc_regs.xa_write0 = (sc->sc_key << 24) | XAC_CTL1_OFFSET | + XBOX_CTL1_CSIE | XBOX_CTL1_TRANSPARENT; + *sc->sc_regs.xa_write0 = (sc->sc_key << 24) | XBC_CTL1_OFFSET | + XBOX_CTL1_XSIE | XBOX_CTL1_XSBRE | XBOX_CTL1_XSSE; + DELAY(100); + + xbox_fix_range(sc, (struct sbus_softc *)parent); + + sbus_establish(&sc->sc_sd, &sc->sc_dv); + + printf("\n"); + + oca = (*ca); + oca.ca_bustype = BUS_XBOX; + if (ca->ca_ra.ra_bp != NULL) + oca.ca_ra.ra_bp = ca->ca_ra.ra_bp + 1; + else + oca.ca_ra.ra_bp = NULL; + + (void)config_found(&sc->sc_dv, (void *)&oca, xboxprint); +} + +/* + * Fix up our address ranges based on parent address spaces. + */ +void +xbox_fix_range(sc, sbp) + struct xbox_softc *sc; + struct sbus_softc *sbp; +{ + int rlen, i, j; + + rlen = getproplen(sc->sc_node, "ranges"); + sc->sc_range = + (struct rom_range *)malloc(rlen, M_DEVBUF, M_NOWAIT); + if (sc->sc_range == NULL) { + printf("%s: PROM ranges too large: %d\n", + sc->sc_dv.dv_xname, rlen); + return; + } + sc->sc_nrange = rlen / sizeof(struct rom_range); + (void)getprop(sc->sc_node, "ranges", sc->sc_range, rlen); + + for (i = 0; i < sc->sc_nrange; i++) { + for (j = 0; j < sbp->sc_nrange; j++) { + if (sc->sc_range[i].pspace == sbp->sc_range[j].cspace) { + sc->sc_range[i].poffset += + sbp->sc_range[j].poffset; + sc->sc_range[i].pspace = + sbp->sc_range[j].pspace; + break; + } + } + } +} + +int +xboxprint(args, sbus) + void *args; + const char *sbus; +{ + struct confargs *ca = args; + + if (sbus) + printf("%s at %s", ca->ca_ra.ra_name, sbus); + return (UNCONF); +} diff --git a/sys/arch/sparc/dev/xboxreg.h b/sys/arch/sparc/dev/xboxreg.h new file mode 100644 index 00000000000..f506b236785 --- /dev/null +++ b/sys/arch/sparc/dev/xboxreg.h @@ -0,0 +1,92 @@ +/* $OpenBSD: xboxreg.h,v 1.1 1999/04/18 03:24:26 jason Exp $ */ + +/* + * Copyright (c) 1999 Jason L. Wright (jason@thought.net) + * 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 Jason L. Wright + * 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 xbox_errs { + volatile u_int32_t xe_errd; /* error descriptor */ + volatile u_int32_t xe_errva; /* error virtual addr */ + volatile u_int32_t xe_stat; /* status */ + volatile u_int32_t xe_ctl0; /* control reg 0 */ +}; + +struct xbox_regs { + /* XA space */ + volatile u_int32_t *xa_write0; /* write0 reg */ + struct xbox_errs *xa_errs; /* errors */ + volatile u_int32_t *xa_ctl0; /* ctl0 reg */ + volatile u_int32_t *xa_ctl1; /* ctl1 reg */ + volatile u_int32_t *xa_elua; + volatile u_int32_t *xa_ella; + volatile u_int32_t *xa_rsrv; /* reserved */ + + /* XB space */ + struct xbox_errs *xb_errs; /* errors */ + volatile u_int32_t *xb_ctl0; /* ctl0 reg */ + volatile u_int32_t *xb_ctl1; /* ctl1 reg */ + volatile u_int32_t *xb_elua; + volatile u_int32_t *xb_ella; + volatile u_int32_t *xb_rsrv; /* reserved */ +}; + +#define XAC_CTL0_OFFSET 0x100000 /* control reg 0 */ +#define XAC_CTL1_OFFSET 0x110000 /* control reg 1 */ +#define XAC_ELUA_OFFSET 0x120000 +#define XAC_ELLA_OFFSET 0x130000 +#define XAC_ERR_EN_OFFSET 0x140000 /* error enable */ + +#define XBC_CTL0_OFFSET 0x500000 /* control reg 0 */ +#define XBC_CTL1_OFFSET 0x510000 /* control reg 1 */ +#define XBC_ELUA_OFFSET 0x520000 +#define XBC_ELLA_OFFSET 0x530000 +#define XBC_ERR_EN_OFFSET 0x540000 /* error enable */ + + +/* + * Control register 1 + */ +#define XBOX_CTL1_CDPTE1 0x8000 /* cable data parity test enb */ +#define XBOX_CTL1_CRTE 0x4000 /* cable rerun test enb */ +#define XBOX_CTL1_SRST 0x3000 /* software reset mask */ +#define XBOX_CTL1_SRST_XARS 0x1000 +#define XBOX_CTL1_SRST_CRES 0x2000 +#define XBOX_CTL1_SRST_HRES 0x3000 +#define XBOX_CTL1_DTE 0x0800 /* dvma test enb */ +#define XBOX_CTL1_CDPTE 0x0400 /* cable data parity test enb */ +#define XBOX_CTL1_ITE 0x0200 /* interrupt test enb */ +#define XBOX_CTL1_CDPTE0 0x0100 /* cable data parity test enb, dpr0 */ +#define XBOX_CTL1_ELDS 0x00c0 /* error log dvma size */ +#define XBOX_CTL1_XSSE 0x0020 /* expansion sbus slot select enb */ +#define XBOX_CTL1_XSBRE 0x0010 /* expansion sbus bus request enb */ +#define XBOX_CTL1_XSIE 0x0008 /* expansion sbus interrupt enb */ +#define XBOX_CTL1_ELDE 0x0004 /* error log dvma enable */ +#define XBOX_CTL1_CSIE 0x0002 /* cable serial interrupt enb */ +#define XBOX_CTL1_TRANSPARENT 0x0001 /* transparent mode enb */ diff --git a/sys/arch/sparc/dev/xboxvar.h b/sys/arch/sparc/dev/xboxvar.h new file mode 100644 index 00000000000..9ddf4c1096d --- /dev/null +++ b/sys/arch/sparc/dev/xboxvar.h @@ -0,0 +1,43 @@ +/* $OpenBSD: xboxvar.h,v 1.1 1999/04/18 03:24:27 jason Exp $ */ + +/* + * Copyright (c) 1999 Jason L. Wright (jason@thought.net) + * 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 Jason L. Wright + * 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 xbox_softc { + struct device sc_dv; /* base device */ + struct sbusdev sc_sd; /* sbus device */ + u_int32_t sc_key; /* device key */ + int sc_node; /* sbus node */ + int sc_attached; /* has sbus attached? */ + int sc_nrange; /* number of ranges */ + struct rom_range *sc_range; /* address ranges */ + struct xbox_regs sc_regs; /* register pointers */ +}; diff --git a/sys/arch/sparc/include/autoconf.h b/sys/arch/sparc/include/autoconf.h index 0e56dee8093..c940919b78c 100644 --- a/sys/arch/sparc/include/autoconf.h +++ b/sys/arch/sparc/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.5 1997/08/08 08:26:03 downsj Exp $ */ +/* $OpenBSD: autoconf.h,v 1.6 1999/04/18 03:24:27 jason Exp $ */ /* $NetBSD: autoconf.h,v 1.20 1997/05/24 20:03:03 pk Exp $ */ /* @@ -108,6 +108,7 @@ struct confargs { #define BUS_VME16 2 #define BUS_VME32 3 #define BUS_SBUS 4 +#define BUS_XBOX 5 /* * mapiodev maps an I/O device to a virtual address, returning the address. |