diff options
Diffstat (limited to 'sys/arch/alpha/pci')
39 files changed, 277 insertions, 192 deletions
diff --git a/sys/arch/alpha/pci/apecs.c b/sys/arch/alpha/pci/apecs.c index 9c57dbb14a8..fee67e04274 100644 --- a/sys/arch/alpha/pci/apecs.c +++ b/sys/arch/alpha/pci/apecs.c @@ -1,5 +1,5 @@ -/* $OpenBSD: apecs.c,v 1.4 1996/07/29 23:00:01 niklas Exp $ */ -/* $NetBSD: apecs.c,v 1.7 1996/04/12 06:08:01 cgd Exp $ */ +/* $OpenBSD: apecs.c,v 1.5 1996/10/30 22:39:46 niklas Exp $ */ +/* $NetBSD: apecs.c,v 1.12 1996/10/13 03:00:00 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -45,7 +45,10 @@ #include <dev/pci/pcivar.h> #include <alpha/pci/apecsreg.h> #include <alpha/pci/apecsvar.h> +#include <alpha/pci/apecs_lca.h> +#if defined(DEC_2100_A50) #include <alpha/pci/pci_2100_a50.h> +#endif int apecsmatch __P((struct device *, void *, void *)); void apecsattach __P((struct device *, struct device *, void *)); @@ -58,7 +61,7 @@ struct cfdriver apecs_cd = { NULL, "apecs", DV_DULL, }; -static int apecsprint __P((void *, char *pnp)); +int apecsprint __P((void *, /* const */ char *pnp)); /* There can be only one. */ int apecsfound; @@ -69,7 +72,6 @@ apecsmatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct confargs *ca = aux; /* Make sure that we're looking for an APECS. */ @@ -107,7 +109,7 @@ apecs_init(acp) /* Turn off DMA window enables in PCI Base Reg 1. */ REGVAL(EPIC_PCI_BASE_1) = 0; - wbflush(); + alpha_mb(); /* XXX SGMAP? */ } @@ -161,10 +163,10 @@ apecsattach(parent, self, aux) config_found(self, &pba, apecsprint); } -static int +int apecsprint(aux, pnp) void *aux; - char *pnp; + /* const */ char *pnp; { register struct pcibus_attach_args *pba = aux; diff --git a/sys/arch/alpha/pci/apecs_lca.h b/sys/arch/alpha/pci/apecs_lca.h new file mode 100644 index 00000000000..5fd663e8ad4 --- /dev/null +++ b/sys/arch/alpha/pci/apecs_lca.h @@ -0,0 +1,35 @@ +/* $OpenBSD: apecs_lca.h,v 1.1 1996/10/30 22:39:47 niklas Exp $ */ + +/* + * Copyright (c) 1996 Niklas Hallqvist + * 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 Niklas Hallqvist. + * 4. Neither the name of the University nor the names of its contributors + * may 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. + */ + +void apecs_lca_bus_io_init __P((bus_chipset_tag_t, void *)); +void apecs_lca_bus_mem_init __P((bus_chipset_tag_t, void *)); diff --git a/sys/arch/alpha/pci/apecs_lca_bus_io.c b/sys/arch/alpha/pci/apecs_lca_bus_io.c index 4aa40d80ab2..8b2fa459a34 100644 --- a/sys/arch/alpha/pci/apecs_lca_bus_io.c +++ b/sys/arch/alpha/pci/apecs_lca_bus_io.c @@ -1,5 +1,5 @@ -/* $OpenBSD: apecs_lca_bus_io.c,v 1.2 1996/07/29 23:00:04 niklas Exp $ */ -/* $NetBSD: apecs_lca_bus_io.c,v 1.2.4.1 1996/06/13 18:14:55 cgd Exp $ */ +/* $OpenBSD: apecs_lca_bus_io.c,v 1.3 1996/10/30 22:39:48 niklas Exp $ */ +/* $NetBSD: apecs_lca_bus_io.c,v 1.4 1996/08/27 16:29:23 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -29,6 +29,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/device.h> @@ -38,6 +39,7 @@ #include <alpha/pci/apecsreg.h> #include <alpha/pci/lcareg.h> +#include <alpha/pci/apecs_lca.h> #if (APECS_PCI_SIO != LCA_PCI_SIO) #error Sparse I/O addresses do not match up? diff --git a/sys/arch/alpha/pci/apecs_lca_bus_mem.c b/sys/arch/alpha/pci/apecs_lca_bus_mem.c index 6d03c167530..e06744504ac 100644 --- a/sys/arch/alpha/pci/apecs_lca_bus_mem.c +++ b/sys/arch/alpha/pci/apecs_lca_bus_mem.c @@ -1,5 +1,5 @@ -/* $OpenBSD: apecs_lca_bus_mem.c,v 1.2 1996/07/29 23:00:06 niklas Exp $ */ -/* $NetBSD: apecs_lca_bus_mem.c,v 1.2.4.2 1996/06/13 18:14:58 cgd Exp $ */ +/* $OpenBSD: apecs_lca_bus_mem.c,v 1.3 1996/10/30 22:39:48 niklas Exp $ */ +/* $NetBSD: apecs_lca_bus_mem.c,v 1.5 1996/08/27 16:29:24 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -29,6 +29,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/device.h> @@ -38,6 +39,7 @@ #include <alpha/pci/apecsreg.h> #include <alpha/pci/lcareg.h> +#include <alpha/pci/apecs_lca.h> #if (APECS_PCI_SPARSE != LCA_PCI_SPARSE) || (APECS_PCI_DENSE != LCA_PCI_DENSE) #error Memory addresses do not match up? diff --git a/sys/arch/alpha/pci/apecs_pci.c b/sys/arch/alpha/pci/apecs_pci.c index 6086b9807b5..c61fed79b98 100644 --- a/sys/arch/alpha/pci/apecs_pci.c +++ b/sys/arch/alpha/pci/apecs_pci.c @@ -1,5 +1,5 @@ -/* $OpenBSD: apecs_pci.c,v 1.4 1996/07/29 23:00:07 niklas Exp $ */ -/* $NetBSD: apecs_pci.c,v 1.6 1996/04/12 06:08:09 cgd Exp $ */ +/* $OpenBSD: apecs_pci.c,v 1.5 1996/10/30 22:39:49 niklas Exp $ */ +/* $NetBSD: apecs_pci.c,v 1.9 1996/10/13 03:00:02 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -34,6 +34,8 @@ #include <sys/device.h> #include <vm/vm.h> +#include <machine/autoconf.h> /* badaddr() proto */ + #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> #include <alpha/pci/apecsreg.h> @@ -119,12 +121,12 @@ apecs_conf_read(cpv, tag, offset) if (secondary) { s = splhigh(); old_haxr2 = REGVAL(EPIC_HAXR2); - wbflush(); + alpha_mb(); REGVAL(EPIC_HAXR2) = old_haxr2 | 0x1; - wbflush(); + alpha_mb(); } - datap = (pcireg_t *)phystok0seg(APECS_PCI_CONF | + datap = (pcireg_t *)ALPHA_PHYS_TO_K0SEG(APECS_PCI_CONF | tag << 5UL | /* XXX */ (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ @@ -134,9 +136,9 @@ apecs_conf_read(cpv, tag, offset) data = *datap; if (secondary) { - wbflush(); + alpha_mb(); REGVAL(EPIC_HAXR2) = old_haxr2; - wbflush(); + alpha_mb(); splx(s); } @@ -165,12 +167,12 @@ apecs_conf_write(cpv, tag, offset, data) if (secondary) { s = splhigh(); old_haxr2 = REGVAL(EPIC_HAXR2); - wbflush(); + alpha_mb(); REGVAL(EPIC_HAXR2) = old_haxr2 | 0x1; - wbflush(); + alpha_mb(); } - datap = (pcireg_t *)phystok0seg(APECS_PCI_CONF | + datap = (pcireg_t *)ALPHA_PHYS_TO_K0SEG(APECS_PCI_CONF | tag << 5UL | /* XXX */ (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ @@ -178,9 +180,9 @@ apecs_conf_write(cpv, tag, offset, data) *datap = data; if (secondary) { - wbflush(); + alpha_mb(); REGVAL(EPIC_HAXR2) = old_haxr2; - wbflush(); + alpha_mb(); splx(s); } diff --git a/sys/arch/alpha/pci/apecsreg.h b/sys/arch/alpha/pci/apecsreg.h index 5bf5eab8dc6..169faaf6cf1 100644 --- a/sys/arch/alpha/pci/apecsreg.h +++ b/sys/arch/alpha/pci/apecsreg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: apecsreg.h,v 1.3 1996/07/29 23:00:10 niklas Exp $ */ -/* $NetBSD: apecsreg.h,v 1.3 1995/11/23 02:37:19 cgd Exp $ */ +/* $OpenBSD: apecsreg.h,v 1.4 1996/10/30 22:39:51 niklas Exp $ */ +/* $NetBSD: apecsreg.h,v 1.4 1996/07/09 00:54:34 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -35,7 +35,7 @@ * Sheet'' (DEC order number EC-QAEMA-TE), pages 4-1 - 4-27, 10-21 - 10-38. */ -#define REGVAL(r) (*(int32_t *)phystok0seg(r)) +#define REGVAL(r) (*(int32_t *)ALPHA_PHYS_TO_K0SEG(r)) /* * Base addresses diff --git a/sys/arch/alpha/pci/apecsvar.h b/sys/arch/alpha/pci/apecsvar.h index 1b9d71b799e..7028f9cb039 100644 --- a/sys/arch/alpha/pci/apecsvar.h +++ b/sys/arch/alpha/pci/apecsvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: apecsvar.h,v 1.3 1996/07/29 23:00:11 niklas Exp $ */ +/* $OpenBSD: apecsvar.h,v 1.4 1996/10/30 22:39:51 niklas Exp $ */ /* $NetBSD: apecsvar.h,v 1.3 1996/04/12 06:08:14 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/bt485reg.h b/sys/arch/alpha/pci/bt485reg.h index 4cc8f30bb1c..fcd1b16fc21 100644 --- a/sys/arch/alpha/pci/bt485reg.h +++ b/sys/arch/alpha/pci/bt485reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bt485reg.h,v 1.3 1996/07/29 23:00:13 niklas Exp $ */ +/* $OpenBSD: bt485reg.h,v 1.4 1996/10/30 22:39:52 niklas Exp $ */ /* $NetBSD: bt485reg.h,v 1.4 1996/04/12 06:08:17 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/cia.c b/sys/arch/alpha/pci/cia.c index 1b2a5dec748..8337d47c48c 100644 --- a/sys/arch/alpha/pci/cia.c +++ b/sys/arch/alpha/pci/cia.c @@ -1,5 +1,5 @@ -/* $OpenBSD: cia.c,v 1.3 1996/07/29 23:00:15 niklas Exp $ */ -/* $NetBSD: cia.c,v 1.5.4.1 1996/06/10 00:02:39 cgd Exp $ */ +/* $OpenBSD: cia.c,v 1.4 1996/10/30 22:39:53 niklas Exp $ */ +/* $NetBSD: cia.c,v 1.11 1996/10/13 03:00:03 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -60,9 +60,7 @@ struct cfdriver cia_cd = { NULL, "cia", DV_DULL, }; -static int ciaprint __P((void *, char *pnp)); - -#define REGVAL(r) (*(int32_t *)phystok0seg(r)) +int ciaprint __P((void *, /* const */ char *pnp)); /* There can be only one. */ int ciafound; @@ -73,7 +71,6 @@ ciamatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct confargs *ca = aux; /* Make sure that we're looking for a CIA. */ @@ -111,7 +108,6 @@ ciaattach(parent, self, aux) struct device *parent, *self; void *aux; { - struct confargs *ca = aux; struct cia_softc *sc = (struct cia_softc *)self; struct cia_config *ccp; struct pcibus_attach_args pba; @@ -149,10 +145,10 @@ ciaattach(parent, self, aux) config_found(self, &pba, ciaprint); } -static int +int ciaprint(aux, pnp) void *aux; - char *pnp; + /* const */ char *pnp; { register struct pcibus_attach_args *pba = aux; diff --git a/sys/arch/alpha/pci/cia_bus_io.c b/sys/arch/alpha/pci/cia_bus_io.c index 0416a519c36..75f7d27fc1e 100644 --- a/sys/arch/alpha/pci/cia_bus_io.c +++ b/sys/arch/alpha/pci/cia_bus_io.c @@ -1,5 +1,5 @@ -/* $OpenBSD: cia_bus_io.c,v 1.2 1996/07/29 23:00:17 niklas Exp $ */ -/* $NetBSD: cia_bus_io.c,v 1.2.4.2 1996/06/13 18:14:59 cgd Exp $ */ +/* $OpenBSD: cia_bus_io.c,v 1.3 1996/10/30 22:39:54 niklas Exp $ */ +/* $NetBSD: cia_bus_io.c,v 1.5 1996/08/27 16:29:25 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -29,6 +29,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/device.h> diff --git a/sys/arch/alpha/pci/cia_bus_mem.c b/sys/arch/alpha/pci/cia_bus_mem.c index 63760ad8fc2..47d83a467fc 100644 --- a/sys/arch/alpha/pci/cia_bus_mem.c +++ b/sys/arch/alpha/pci/cia_bus_mem.c @@ -1,5 +1,5 @@ -/* $OpenBSD: cia_bus_mem.c,v 1.2 1996/07/29 23:00:19 niklas Exp $ */ -/* $NetBSD: cia_bus_mem.c,v 1.2.4.2 1996/06/13 18:15:01 cgd Exp $ */ +/* $OpenBSD: cia_bus_mem.c,v 1.3 1996/10/30 22:39:55 niklas Exp $ */ +/* $NetBSD: cia_bus_mem.c,v 1.5 1996/08/27 16:29:26 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -29,6 +29,7 @@ */ #include <sys/param.h> +#include <sys/systm.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/device.h> diff --git a/sys/arch/alpha/pci/cia_pci.c b/sys/arch/alpha/pci/cia_pci.c index 03f98709a24..ac66d48a0ea 100644 --- a/sys/arch/alpha/pci/cia_pci.c +++ b/sys/arch/alpha/pci/cia_pci.c @@ -1,5 +1,5 @@ -/* $OpenBSD: cia_pci.c,v 1.3 1996/07/29 23:00:21 niklas Exp $ */ -/* $NetBSD: cia_pci.c,v 1.2 1996/04/12 23:37:10 cgd Exp $ */ +/* $OpenBSD: cia_pci.c,v 1.4 1996/10/30 22:39:56 niklas Exp $ */ +/* $NetBSD: cia_pci.c,v 1.5 1996/10/13 03:00:04 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -34,6 +34,8 @@ #include <sys/device.h> #include <vm/vm.h> +#include <machine/autoconf.h> /* badaddr proto */ + #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> #include <alpha/pci/ciareg.h> @@ -119,12 +121,12 @@ cia_conf_read(cpv, tag, offset) if (secondary) { s = splhigh(); old_haxr2 = REGVAL(CIA_CSRS + 0x480); /* XXX */ - wbflush(); + alpha_mb(); REGVAL(CIA_CSRS + 0x480) = old_haxr2 | 0x1; /* XXX */ - wbflush(); + alpha_mb(); } - datap = (pcireg_t *)phystok0seg(CIA_PCI_CONF | + datap = (pcireg_t *)ALPHA_PHYS_TO_K0SEG(CIA_PCI_CONF | tag << 5UL | /* XXX */ (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ @@ -134,9 +136,9 @@ cia_conf_read(cpv, tag, offset) data = *datap; if (secondary) { - wbflush(); + alpha_mb(); REGVAL(CIA_CSRS + 0x480) = old_haxr2; /* XXX */ - wbflush(); + alpha_mb(); splx(s); } @@ -165,12 +167,12 @@ cia_conf_write(cpv, tag, offset, data) if (secondary) { s = splhigh(); old_haxr2 = REGVAL(CIA_CSRS + 0x480); /* XXX */ - wbflush(); + alpha_mb(); REGVAL(CIA_CSRS + 0x480) = old_haxr2 | 0x1; /* XXX */ - wbflush(); + alpha_mb(); } - datap = (pcireg_t *)phystok0seg(CIA_PCI_CONF | + datap = (pcireg_t *)ALPHA_PHYS_TO_K0SEG(CIA_PCI_CONF | tag << 5UL | /* XXX */ (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ @@ -178,9 +180,9 @@ cia_conf_write(cpv, tag, offset, data) *datap = data; if (secondary) { - wbflush(); + alpha_mb(); REGVAL(CIA_CSRS + 0x480) = old_haxr2; /* XXX */ - wbflush(); + alpha_mb(); splx(s); } diff --git a/sys/arch/alpha/pci/ciareg.h b/sys/arch/alpha/pci/ciareg.h index b3cf98b78f3..aa33bf767ae 100644 --- a/sys/arch/alpha/pci/ciareg.h +++ b/sys/arch/alpha/pci/ciareg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ciareg.h,v 1.3 1996/07/29 23:00:23 niklas Exp $ */ -/* $NetBSD: ciareg.h,v 1.1.4.3 1996/06/13 18:35:27 cgd Exp $ */ +/* $OpenBSD: ciareg.h,v 1.4 1996/10/30 22:39:57 niklas Exp $ */ +/* $NetBSD: ciareg.h,v 1.5 1996/07/09 00:54:44 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -34,7 +34,7 @@ * Taken from XXX */ -#define REGVAL(r) (*(int32_t *)phystok0seg(r)) +#define REGVAL(r) (*(int32_t *)ALPHA_PHYS_TO_K0SEG(r)) /* * Base addresses diff --git a/sys/arch/alpha/pci/ciavar.h b/sys/arch/alpha/pci/ciavar.h index 31f9b18b158..a0b5e82be37 100644 --- a/sys/arch/alpha/pci/ciavar.h +++ b/sys/arch/alpha/pci/ciavar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ciavar.h,v 1.3 1996/07/29 23:00:24 niklas Exp $ */ -/* $NetBSD: ciavar.h,v 1.3.4.1 1996/06/10 00:04:12 cgd Exp $ */ +/* $OpenBSD: ciavar.h,v 1.4 1996/10/30 22:39:58 niklas Exp $ */ +/* $NetBSD: ciavar.h,v 1.4 1996/06/10 00:03:59 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. diff --git a/sys/arch/alpha/pci/lca.c b/sys/arch/alpha/pci/lca.c index 264cab0ec6b..64994855849 100644 --- a/sys/arch/alpha/pci/lca.c +++ b/sys/arch/alpha/pci/lca.c @@ -1,5 +1,5 @@ -/* $OpenBSD: lca.c,v 1.3 1996/07/29 23:00:26 niklas Exp $ */ -/* $NetBSD: lca.c,v 1.5 1996/04/23 14:00:53 cgd Exp $ */ +/* $OpenBSD: lca.c,v 1.4 1996/10/30 22:39:59 niklas Exp $ */ +/* $NetBSD: lca.c,v 1.10 1996/10/13 03:00:07 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -45,6 +45,10 @@ #include <dev/pci/pcivar.h> #include <alpha/pci/lcareg.h> #include <alpha/pci/lcavar.h> +#include <alpha/pci/apecs_lca.h> +#if defined(DEC_AXPPCI_33) +#include <alpha/pci/pci_axppci_33.h> +#endif int lcamatch __P((struct device *, void *, void *)); void lcaattach __P((struct device *, struct device *, void *)); @@ -57,7 +61,7 @@ struct cfdriver lca_cd = { NULL, "lca", DV_DULL, }; -static int lcaprint __P((void *, char *pnp)); +int lcaprint __P((void *, /* const */ char *pnp)); /* There can be only one. */ int lcafound; @@ -68,7 +72,6 @@ lcamatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct confargs *ca = aux; /* Make sure that we're looking for a LCA. */ @@ -125,7 +128,7 @@ lca_init(lcp) /* Turn off DMA window enables in Window Base Registers */ /* REGVAL(LCA_IOC_W_BASE0) = 0; REGVAL(LCA_IOC_W_BASE1) = 0; */ - wbflush(); + alpha_mb(); } #ifdef notdef @@ -139,7 +142,7 @@ lca_init_sgmap(lcp) bzero(lcp->lc_sgmap, 1024 * 8); /* clear all entries. */ REGVAL(LCA_IOC_W_BASE0) = 0; - wbflush(); + alpha_mb(); /* Set up Translated Base Register 1; translate to sybBus addr 0. */ /* check size against APEC XXX JH */ @@ -150,7 +153,7 @@ lca_init_sgmap(lcp) /* Enable window 1; from PCI address 8MB, direct mapped. */ REGVAL(LCA_IOC_W_BASE0) = 0x300800000; - wbflush(); + alpha_mb(); } #endif @@ -197,10 +200,10 @@ lcaattach(parent, self, aux) config_found(self, &pba, lcaprint); } -static int +int lcaprint(aux, pnp) void *aux; - char *pnp; + /* const */ char *pnp; { register struct pcibus_attach_args *pba = aux; diff --git a/sys/arch/alpha/pci/lca_pci.c b/sys/arch/alpha/pci/lca_pci.c index cdee66d1396..837fbec97be 100644 --- a/sys/arch/alpha/pci/lca_pci.c +++ b/sys/arch/alpha/pci/lca_pci.c @@ -1,5 +1,5 @@ -/* $OpenBSD: lca_pci.c,v 1.3 1996/07/29 23:00:28 niklas Exp $ */ -/* $NetBSD: lca_pci.c,v 1.3 1996/04/23 14:01:00 cgd Exp $ */ +/* $OpenBSD: lca_pci.c,v 1.4 1996/10/30 22:40:00 niklas Exp $ */ +/* $NetBSD: lca_pci.c,v 1.6 1996/10/13 03:00:08 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -34,6 +34,8 @@ #include <sys/device.h> #include <vm/vm.h> +#include <machine/autoconf.h> /* badaddr proto */ + #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> #include <alpha/pci/lcareg.h> @@ -120,9 +122,9 @@ lca_conf_read(cpv, tag, offset) pci_decompose_tag(&lcp->lc_pc, tag, &secondary, &device, 0); if (secondary) { s = splhigh(); - wbflush(); + alpha_mb(); REGVAL(LCA_IOC_CONF) = 0x01; - wbflush(); + alpha_mb(); } else { /* * on the LCA, must frob the tag used for @@ -133,7 +135,7 @@ lca_conf_read(cpv, tag, offset) tag = (1 << (device + 11)) | (tag & 0x7ff); } - datap = (pcireg_t *)phystok0seg(LCA_PCI_CONF | + datap = (pcireg_t *)ALPHA_PHYS_TO_K0SEG(LCA_PCI_CONF | tag << 5UL | /* XXX */ (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ @@ -143,9 +145,9 @@ lca_conf_read(cpv, tag, offset) data = *datap; if (secondary) { - wbflush(); + alpha_mb(); REGVAL(LCA_IOC_CONF) = 0x00; - wbflush(); + alpha_mb(); splx(s); } @@ -172,9 +174,9 @@ lca_conf_write(cpv, tag, offset, data) pci_decompose_tag(&lcp->lc_pc, tag, &secondary, &device, 0); if (secondary) { s = splhigh(); - wbflush(); + alpha_mb(); REGVAL(LCA_IOC_CONF) = 0x01; - wbflush(); + alpha_mb(); } else { /* * on the LCA, must frob the tag used for @@ -185,7 +187,7 @@ lca_conf_write(cpv, tag, offset, data) tag = (1 << (device + 11)) | (tag & 0x7ff); } - datap = (pcireg_t *)phystok0seg(LCA_PCI_CONF | + datap = (pcireg_t *)ALPHA_PHYS_TO_K0SEG(LCA_PCI_CONF | tag << 5UL | /* XXX */ (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ @@ -193,9 +195,9 @@ lca_conf_write(cpv, tag, offset, data) *datap = data; if (secondary) { - wbflush(); + alpha_mb(); REGVAL(LCA_IOC_CONF) = 0x00; - wbflush(); + alpha_mb(); splx(s); } diff --git a/sys/arch/alpha/pci/lcareg.h b/sys/arch/alpha/pci/lcareg.h index 0542039990f..d9e9bffd448 100644 --- a/sys/arch/alpha/pci/lcareg.h +++ b/sys/arch/alpha/pci/lcareg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: lcareg.h,v 1.3 1996/07/29 23:00:30 niklas Exp $ */ -/* $NetBSD: lcareg.h,v 1.2 1996/04/23 14:03:46 cgd Exp $ */ +/* $OpenBSD: lcareg.h,v 1.4 1996/10/30 22:40:00 niklas Exp $ */ +/* $NetBSD: lcareg.h,v 1.3 1996/07/09 00:54:51 cgd Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -32,7 +32,7 @@ * 21066 chip registers */ -#define REGVAL(r) (*(int32_t *)phystok0seg(r)) +#define REGVAL(r) (*(int32_t *)ALPHA_PHYS_TO_K0SEG(r)) /* * Base addresses diff --git a/sys/arch/alpha/pci/lcavar.h b/sys/arch/alpha/pci/lcavar.h index 7ebd8e751a9..25762783af6 100644 --- a/sys/arch/alpha/pci/lcavar.h +++ b/sys/arch/alpha/pci/lcavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lcavar.h,v 1.3 1996/07/29 23:00:32 niklas Exp $ */ +/* $OpenBSD: lcavar.h,v 1.4 1996/10/30 22:40:02 niklas Exp $ */ /* $NetBSD: lcavar.h,v 1.3 1996/04/12 06:08:35 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/pci_2100_a50.c b/sys/arch/alpha/pci/pci_2100_a50.c index d396695ef09..1fa315bd8ae 100644 --- a/sys/arch/alpha/pci/pci_2100_a50.c +++ b/sys/arch/alpha/pci/pci_2100_a50.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pci_2100_a50.c,v 1.6 1996/07/29 23:00:34 niklas Exp $ */ -/* $NetBSD: pci_2100_a50.c,v 1.7 1996/04/23 14:15:55 cgd Exp $ */ +/* $OpenBSD: pci_2100_a50.c,v 1.7 1996/10/30 22:40:03 niklas Exp $ */ +/* $NetBSD: pci_2100_a50.c,v 1.10 1996/10/13 03:00:09 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -36,6 +36,7 @@ #include <sys/device.h> #include <vm/vm.h> +#include <machine/autoconf.h> #include <machine/bus.h> #include <machine/intr.h> @@ -191,8 +192,6 @@ dec_2100_a50_intr_string(acv, ih) void *acv; pci_intr_handle_t ih; { - struct apecs_config *acp = acv; - return sio_intr_string(NULL /*XXX*/, ih); } @@ -204,8 +203,6 @@ dec_2100_a50_intr_establish(acv, ih, level, func, arg, name) int (*func) __P((void *)); char *name; { - struct apecs_config *acp = acv; - return sio_intr_establish(NULL /*XXX*/, ih, IST_LEVEL, level, func, arg, name); } @@ -214,7 +211,5 @@ void dec_2100_a50_intr_disestablish(acv, cookie) void *acv, *cookie; { - struct apecs_config *acp = acv; - sio_intr_disestablish(NULL /*XXX*/, cookie); } diff --git a/sys/arch/alpha/pci/pci_2100_a50.h b/sys/arch/alpha/pci/pci_2100_a50.h index 48f02de1d39..adee2d737cb 100644 --- a/sys/arch/alpha/pci/pci_2100_a50.h +++ b/sys/arch/alpha/pci/pci_2100_a50.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_2100_a50.h,v 1.3 1996/07/29 23:00:35 niklas Exp $ */ +/* $OpenBSD: pci_2100_a50.h,v 1.4 1996/10/30 22:40:04 niklas Exp $ */ /* $NetBSD: pci_2100_a50.h,v 1.3 1996/04/12 06:08:42 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/pci_axppci_33.c b/sys/arch/alpha/pci/pci_axppci_33.c index 7c70243290c..2cf58634136 100644 --- a/sys/arch/alpha/pci/pci_axppci_33.c +++ b/sys/arch/alpha/pci/pci_axppci_33.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pci_axppci_33.c,v 1.5 1996/07/29 23:00:37 niklas Exp $ */ -/* $NetBSD: pci_axppci_33.c,v 1.5 1996/04/23 14:15:28 cgd Exp $ */ +/* $OpenBSD: pci_axppci_33.c,v 1.6 1996/10/30 22:40:05 niklas Exp $ */ +/* $NetBSD: pci_axppci_33.c,v 1.8 1996/10/13 03:00:11 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -36,6 +36,7 @@ #include <sys/device.h> #include <vm/vm.h> +#include <machine/autoconf.h> #include <machine/bus.h> #include <machine/intr.h> @@ -195,8 +196,6 @@ dec_axppci_33_intr_string(lcv, ih) void *lcv; pci_intr_handle_t ih; { - struct lca_config *lcp = lcv; - return sio_intr_string(NULL /*XXX*/, ih); } @@ -208,8 +207,6 @@ dec_axppci_33_intr_establish(lcv, ih, level, func, arg, name) int (*func) __P((void *)); char *name; { - struct lca_config *lcp = lcv; - return sio_intr_establish(NULL /*XXX*/, ih, IST_LEVEL, level, func, arg, name); } @@ -218,7 +215,5 @@ void dec_axppci_33_intr_disestablish(lcv, cookie) void *lcv, *cookie; { - struct lca_config *lcp = lcv; - sio_intr_disestablish(NULL /*XXX*/, cookie); } diff --git a/sys/arch/alpha/pci/pci_axppci_33.h b/sys/arch/alpha/pci/pci_axppci_33.h index 9f669510798..ef9a3856111 100644 --- a/sys/arch/alpha/pci/pci_axppci_33.h +++ b/sys/arch/alpha/pci/pci_axppci_33.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_axppci_33.h,v 1.3 1996/07/29 23:00:39 niklas Exp $ */ +/* $OpenBSD: pci_axppci_33.h,v 1.4 1996/10/30 22:40:05 niklas Exp $ */ /* $NetBSD: pci_axppci_33.h,v 1.3 1996/04/12 06:08:47 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c index 179d7c56b1b..1106261c1cf 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.c +++ b/sys/arch/alpha/pci/pci_kn20aa.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pci_kn20aa.c,v 1.6 1996/10/04 03:06:04 deraadt Exp $ */ -/* $NetBSD: pci_kn20aa.c,v 1.3.4.2 1996/06/13 18:35:31 cgd Exp $ */ +/* $OpenBSD: pci_kn20aa.c,v 1.7 1996/10/30 22:40:06 niklas Exp $ */ +/* $NetBSD: pci_kn20aa.c,v 1.18 1996/10/13 03:00:12 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -39,6 +39,8 @@ #include <vm/vm.h> +#include <machine/autoconf.h> + #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> @@ -69,7 +71,7 @@ void dec_kn20aa_intr_disestablish __P((void *, void *)); struct kn20aa_intrhand { TAILQ_ENTRY(kn20aa_intrhand) ih_q; - int (*ih_fun)(); + int (*ih_fun) __P((void *)); void *ih_arg; u_long ih_count; int ih_level; @@ -83,7 +85,7 @@ struct evcnt kn20aa_intr_evcnt; #endif void kn20aa_pci_strayintr __P((int irq)); -void kn20aa_iointr __P((void *framep, int vec)); +void kn20aa_iointr __P((void *framep, unsigned long vec)); void kn20aa_enable_intr __P((int irq)); void kn20aa_disable_intr __P((int irq)); struct kn20aa_intrhand *kn20aa_attach_intr __P((struct kn20aa_intrchain *, @@ -94,7 +96,6 @@ pci_kn20aa_pickintr(ccp) struct cia_config *ccp; { int i; - struct kn20aa_intrhand *nintrhand; bus_chipset_tag_t bc = &ccp->cc_bc; pci_chipset_tag_t pc = &ccp->cc_pc; @@ -132,7 +133,6 @@ dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp) pci_chipset_tag_t pc = &ccp->cc_pc; int device; int kn20aa_irq; - void *ih; if (buspin == 0) { /* No IRQ used. */ @@ -174,6 +174,12 @@ dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp) break; default: +#ifdef KN20AA_BOGUS_IRQ_FROB + *ihp = 0xdeadbeef; + printf("\n\n BOGUS INTERRUPT MAPPING: dev %d, pin %d\n", + device, buspin); + return (0); +#endif panic("pci_kn20aa_map_int: invalid device number %d\n", device); } @@ -192,9 +198,14 @@ dec_kn20aa_intr_string(ccv, ih) void *ccv; pci_intr_handle_t ih; { - struct cia_config *ccp = ccv; static char irqstr[15]; /* 11 + 2 + NULL + sanity */ +#ifdef KN20AA_BOGUS_IRQ_FROB + if (ih == 0xdeadbeef) { + sprintf(irqstr, "BOGUS"); + return (irqstr); + } +#endif if (ih > KN20AA_MAX_IRQ) panic("dec_kn20aa_a50_intr_string: bogus kn20aa IRQ 0x%x\n", ih); @@ -211,9 +222,24 @@ dec_kn20aa_intr_establish(ccv, ih, level, func, arg, name) int (*func) __P((void *)); char *name; { - struct cia_config *ccp = ccv; void *cookie; +#ifdef KN20AA_BOGUS_IRQ_FROB + if (ih == 0xdeadbeef) { + int i; + char chars[10]; + + printf("dec_kn20aa_intr_establish: BOGUS IRQ\n"); + do { + printf("IRQ to enable? "); + getstr(chars, 10); + i = atoi(chars); + } while (i < 0 || i > 32); + printf("ENABLING IRQ %d\n", i); + kn20aa_enable_intr(i); + return ((void *)0xbabefacedeadbeef); + } +#endif if (ih > KN20AA_MAX_IRQ) panic("dec_kn20aa_intr_establish: bogus kn20aa IRQ 0x%x\n", ih); @@ -227,8 +253,6 @@ void dec_kn20aa_intr_disestablish(ccv, cookie) void *ccv, *cookie; { - struct cia_config *ccp = ccv; - panic("dec_kn20aa_intr_disestablish not implemented"); /* XXX */ } @@ -252,7 +276,7 @@ kn20aa_pci_strayintr(irq) void kn20aa_iointr(framep, vec) void *framep; - int vec; + unsigned long vec; { struct kn20aa_intrhand *ih; int irq, handled; @@ -303,9 +327,9 @@ kn20aa_enable_intr(irq) * "blech." I'd give valuable body parts for better docs or * for a good decompiler. */ - wbflush(); + alpha_mb(); REGVAL(0x8780000000L + 0x40L) |= (1 << irq); /* XXX */ - wbflush(); + alpha_mb(); } void @@ -313,9 +337,9 @@ kn20aa_disable_intr(irq) int irq; { - wbflush(); + alpha_mb(); REGVAL(0x8780000000L + 0x40L) &= ~(1 << irq); /* XXX */ - wbflush(); + alpha_mb(); } struct kn20aa_intrhand * diff --git a/sys/arch/alpha/pci/pci_kn20aa.h b/sys/arch/alpha/pci/pci_kn20aa.h index beaa93248a4..f4abae0c91a 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.h +++ b/sys/arch/alpha/pci/pci_kn20aa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_kn20aa.h,v 1.3 1996/07/29 23:00:42 niklas Exp $ */ +/* $OpenBSD: pci_kn20aa.h,v 1.4 1996/10/30 22:40:07 niklas Exp $ */ /* $NetBSD: pci_kn20aa.h,v 1.2 1996/04/13 00:24:35 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/pci_machdep.c b/sys/arch/alpha/pci/pci_machdep.c index bc163c277f0..7e6573e0fbb 100644 --- a/sys/arch/alpha/pci/pci_machdep.c +++ b/sys/arch/alpha/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.4 1996/07/29 23:00:43 niklas Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.5 1996/10/30 22:40:08 niklas Exp $ */ /* $NetBSD: pci_machdep.c,v 1.5 1996/04/12 06:08:49 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/pci_machdep.h b/sys/arch/alpha/pci/pci_machdep.h index 3dd29d4c87c..928a78f09a5 100644 --- a/sys/arch/alpha/pci/pci_machdep.h +++ b/sys/arch/alpha/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.4 1996/07/29 23:00:45 niklas Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.5 1996/10/30 22:40:09 niklas Exp $ */ /* $NetBSD: pci_machdep.h,v 1.4 1996/04/12 06:08:52 cgd Exp $ */ /* @@ -86,3 +86,8 @@ struct alpha_pci_chipset { (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (nm)) #define pci_intr_disestablish(c, iv) \ (*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv)) + +#ifdef _KERNEL +void pci_display_console + __P((bus_chipset_tag_t, pci_chipset_tag_t, int, int, int)); +#endif /* _KERNEL */ diff --git a/sys/arch/alpha/pci/pcivga.c b/sys/arch/alpha/pci/pcivga.c index 68b5f2d4814..1cbcabde789 100644 --- a/sys/arch/alpha/pci/pcivga.c +++ b/sys/arch/alpha/pci/pcivga.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcivga.c,v 1.6 1996/07/29 23:00:46 niklas Exp $ */ -/* $NetBSD: pcivga.c,v 1.8 1996/04/17 21:49:58 cgd Exp $ */ +/* $OpenBSD: pcivga.c,v 1.7 1996/10/30 22:40:10 niklas Exp $ */ +/* $NetBSD: pcivga.c,v 1.11 1996/10/13 03:00:13 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -49,7 +49,7 @@ int pcivgamatch __P((struct device *, void *, void *)); void pcivgaattach __P((struct device *, struct device *, void *)); -int pcivgaprint __P((void *, char *)); +int pcivgaprint __P((void *, /* const */ char *)); struct cfattach pcivga_ca = { sizeof(struct pcivga_softc), pcivgamatch, pcivgaattach, @@ -89,7 +89,6 @@ pcivgamatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct pci_attach_args *pa = aux; /* @@ -222,7 +221,7 @@ pcivgaattach(parent, self, aux) int pcivgaprint(aux, pnp) void *aux; - char *pnp; + /* const */ char *pnp; { if (pnp) @@ -248,7 +247,9 @@ pcivgammap(dev, offset, prot) off_t offset; int prot; { +#if 0 struct pcivga_softc *sc = (struct pcivga_softc *)dev; +#endif int rv; rv = -1; @@ -335,7 +336,6 @@ pcivga_putstr(id, row, col, cp, len) struct pcivga_devconfig *dc = id; bus_chipset_tag_t bc = dc->dc_bc; bus_mem_handle_t memh = dc->dc_memh; - char *dcp; int i, off; off = (row * dc->dc_ncol + col) * 2; diff --git a/sys/arch/alpha/pci/pcivgavar.h b/sys/arch/alpha/pci/pcivgavar.h index f306534cf91..c8a947a98dd 100644 --- a/sys/arch/alpha/pci/pcivgavar.h +++ b/sys/arch/alpha/pci/pcivgavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcivgavar.h,v 1.4 1996/07/29 23:00:48 niklas Exp $ */ +/* $OpenBSD: pcivgavar.h,v 1.5 1996/10/30 22:40:11 niklas Exp $ */ /* $NetBSD: pcivgavar.h,v 1.5 1996/04/12 06:08:58 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/pcs_bus_io_common.c b/sys/arch/alpha/pci/pcs_bus_io_common.c index 8c995d30915..59626ded968 100644 --- a/sys/arch/alpha/pci/pcs_bus_io_common.c +++ b/sys/arch/alpha/pci/pcs_bus_io_common.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcs_bus_io_common.c,v 1.2 1996/07/29 23:00:50 niklas Exp $ */ -/* $NetBSD: pcs_bus_io_common.c,v 1.2.4.2 1996/06/13 18:16:59 cgd Exp $ */ +/* $OpenBSD: pcs_bus_io_common.c,v 1.3 1996/10/30 22:40:12 niklas Exp $ */ +/* $NetBSD: pcs_bus_io_common.c,v 1.8 1996/10/13 03:00:15 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -123,14 +123,14 @@ __C(CHIP,_io_map)(v, ioaddr, iosize, iohp) #ifdef CHIP_IO_W1_START if (ioaddr >= CHIP_IO_W1_START(v) && ioaddr <= CHIP_IO_W1_END(v)) { - *iohp = (phystok0seg(CHIP_IO_W1_BASE(v)) >> 5) + + *iohp = (ALPHA_PHYS_TO_K0SEG(CHIP_IO_W1_BASE(v)) >> 5) + (ioaddr & CHIP_IO_W1_MASK(v)); } else #endif #ifdef CHIP_IO_W2_START if (ioaddr >= CHIP_IO_W2_START(v) && ioaddr <= CHIP_IO_W2_END(v)) { - *iohp = (phystok0seg(CHIP_IO_W2_BASE(v)) >> 5) + + *iohp = (ALPHA_PHYS_TO_K0SEG(CHIP_IO_W2_BASE(v)) >> 5) + (ioaddr & CHIP_IO_W2_MASK(v)); } else #endif @@ -185,7 +185,7 @@ __C(CHIP,_io_read_1)(v, ioh, off) register u_int8_t rval; register int offset; - wbflush(); + alpha_mb(); tmpioh = ioh + off; offset = tmpioh & 3; @@ -207,7 +207,7 @@ __C(CHIP,_io_read_2)(v, ioh, off) register u_int16_t rval; register int offset; - wbflush(); + alpha_mb(); tmpioh = ioh + off; offset = tmpioh & 3; @@ -229,7 +229,7 @@ __C(CHIP,_io_read_4)(v, ioh, off) register u_int32_t rval; register int offset; - wbflush(); + alpha_mb(); tmpioh = ioh + off; offset = tmpioh & 3; @@ -266,7 +266,7 @@ __C(CHIP,_io_read_multi_1)(v, ioh, off, addr, count) register u_int32_t *port, val; register int offset; - wbflush(); + alpha_mb(); while (count--) { tmpioh = ioh + off; @@ -289,7 +289,7 @@ __C(CHIP,_io_read_multi_2)(v, ioh, off, addr, count) register u_int32_t *port, val; register int offset; - wbflush(); + alpha_mb(); while (count--) { tmpioh = ioh + off; @@ -312,7 +312,7 @@ __C(CHIP,_io_read_multi_4)(v, ioh, off, addr, count) register u_int32_t *port, val; register int offset; - wbflush(); + alpha_mb(); while (count--) { tmpioh = ioh + off; @@ -356,7 +356,7 @@ __C(CHIP,_io_write_1)(v, ioh, off, val) nval = val << (8 * offset); port = (u_int32_t *)((tmpioh << 5) | (0 << 3)); *port = nval; - wbflush(); + alpha_mb(); } void @@ -375,7 +375,7 @@ __C(CHIP,_io_write_2)(v, ioh, off, val) nval = val << (8 * offset); port = (u_int32_t *)((tmpioh << 5) | (1 << 3)); *port = nval; - wbflush(); + alpha_mb(); } void @@ -394,7 +394,7 @@ __C(CHIP,_io_write_4)(v, ioh, off, val) nval = val /*<< (8 * offset)*/; port = (u_int32_t *)((tmpioh << 5) | (3 << 3)); *port = nval; - wbflush(); + alpha_mb(); } void @@ -407,7 +407,7 @@ __C(CHIP,_io_write_8)(v, ioh, off, val) /* XXX XXX XXX */ panic("%s not implemented\n", __S(__C(CHIP,_io_write_8))); - wbflush(); + alpha_mb(); } void @@ -429,7 +429,7 @@ __C(CHIP,_io_write_multi_1)(v, ioh, off, addr, count) *port = nval; off++; } - wbflush(); + alpha_mb(); } void @@ -451,7 +451,7 @@ __C(CHIP,_io_write_multi_2)(v, ioh, off, addr, count) *port = nval; off++; } - wbflush(); + alpha_mb(); } void @@ -473,7 +473,7 @@ __C(CHIP,_io_write_multi_4)(v, ioh, off, addr, count) *port = nval; off++; } - wbflush(); + alpha_mb(); } void diff --git a/sys/arch/alpha/pci/pcs_bus_mem_common.c b/sys/arch/alpha/pci/pcs_bus_mem_common.c index 79833a1f9da..3eb14c01f0c 100644 --- a/sys/arch/alpha/pci/pcs_bus_mem_common.c +++ b/sys/arch/alpha/pci/pcs_bus_mem_common.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcs_bus_mem_common.c,v 1.2 1996/07/29 23:00:51 niklas Exp $ */ -/* $NetBSD: pcs_bus_mem_common.c,v 1.1.4.4 1996/06/13 18:17:01 cgd Exp $ */ +/* $OpenBSD: pcs_bus_mem_common.c,v 1.3 1996/10/30 22:40:13 niklas Exp $ */ +/* $NetBSD: pcs_bus_mem_common.c,v 1.9 1996/10/13 03:00:17 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -106,7 +106,7 @@ __C(CHIP,_mem_map)(v, memaddr, memsize, cacheable, memhp) #ifdef CHIP_D_MEM_W1_START if (memaddr >= CHIP_D_MEM_W1_START(v) && memaddr <= CHIP_D_MEM_W1_END(v)) { - *memhp = phystok0seg(CHIP_D_MEM_W1_BASE(v)) + + *memhp = ALPHA_PHYS_TO_K0SEG(CHIP_D_MEM_W1_BASE(v)) + (memaddr & CHIP_D_MEM_W1_MASK(v)); } else #endif @@ -124,21 +124,21 @@ __C(CHIP,_mem_map)(v, memaddr, memsize, cacheable, memhp) #ifdef CHIP_S_MEM_W1_START if (memaddr >= CHIP_S_MEM_W1_START(v) && memaddr <= CHIP_S_MEM_W1_END(v)) { - *memhp = (phystok0seg(CHIP_S_MEM_W1_BASE(v)) >> 5) + + *memhp = (ALPHA_PHYS_TO_K0SEG(CHIP_S_MEM_W1_BASE(v)) >> 5) + (memaddr & CHIP_S_MEM_W1_MASK(v)); } else #endif #ifdef CHIP_S_MEM_W2_START if (memaddr >= CHIP_S_MEM_W2_START(v) && memaddr <= CHIP_S_MEM_W2_END(v)) { - *memhp = (phystok0seg(CHIP_S_MEM_W2_BASE(v)) >> 5) + + *memhp = (ALPHA_PHYS_TO_K0SEG(CHIP_S_MEM_W2_BASE(v)) >> 5) + (memaddr & CHIP_S_MEM_W2_MASK(v)); } else #endif #ifdef CHIP_S_MEM_W3_START if (memaddr >= CHIP_S_MEM_W3_START(v) && memaddr <= CHIP_S_MEM_W3_END(v)) { - *memhp = (phystok0seg(CHIP_S_MEM_W3_BASE(v)) >> 5) + + *memhp = (ALPHA_PHYS_TO_K0SEG(CHIP_S_MEM_W3_BASE(v)) >> 5) + (memaddr & CHIP_S_MEM_W3_MASK(v)); } else #endif @@ -199,7 +199,7 @@ __C(CHIP,_mem_read_1)(v, memh, off) register u_int8_t rval; register int offset; - wbflush(); + alpha_mb(); if ((memh >> 63) != 0) return (*(u_int8_t *)(memh + off)); @@ -224,7 +224,7 @@ __C(CHIP,_mem_read_2)(v, memh, off) register u_int16_t rval; register int offset; - wbflush(); + alpha_mb(); if ((memh >> 63) != 0) return (*(u_int16_t *)(memh + off)); @@ -249,7 +249,7 @@ __C(CHIP,_mem_read_4)(v, memh, off) register u_int32_t rval; register int offset; - wbflush(); + alpha_mb(); if ((memh >> 63) != 0) return (*(u_int32_t *)(memh + off)); @@ -274,7 +274,7 @@ __C(CHIP,_mem_read_8)(v, memh, off) bus_mem_size_t off; { - wbflush(); + alpha_mb(); if ((memh >> 63) != 0) return (*(u_int64_t *)(memh + off)); @@ -303,7 +303,7 @@ __C(CHIP,_mem_write_1)(v, memh, off, val) port = (u_int32_t *)((tmpmemh << 5) | (0 << 3)); *port = nval; } - wbflush(); + alpha_mb(); } void @@ -326,7 +326,7 @@ __C(CHIP,_mem_write_2)(v, memh, off, val) port = (u_int32_t *)((tmpmemh << 5) | (1 << 3)); *port = nval; } - wbflush(); + alpha_mb(); } void @@ -349,7 +349,7 @@ __C(CHIP,_mem_write_4)(v, memh, off, val) port = (u_int32_t *)((tmpmemh << 5) | (3 << 3)); *port = nval; } - wbflush(); + alpha_mb(); } void @@ -367,7 +367,7 @@ __C(CHIP,_mem_write_8)(v, memh, off, val) panic("%s not implemented\n", __S(__C(CHIP,_mem_write_8))); } - wbflush(); + alpha_mb(); } vm_offset_t @@ -375,5 +375,5 @@ __C(CHIP,_XXX_dmamap)(addr) void *addr; { - return (vtophys(addr) | 0x40000000); + return (vtophys((vm_offset_t)addr) | 0x40000000); } diff --git a/sys/arch/alpha/pci/sio.c b/sys/arch/alpha/pci/sio.c index 6a4e6901fd2..0923402ac7f 100644 --- a/sys/arch/alpha/pci/sio.c +++ b/sys/arch/alpha/pci/sio.c @@ -1,5 +1,5 @@ -/* $OpenBSD: sio.c,v 1.4 1996/07/29 23:00:53 niklas Exp $ */ -/* $NetBSD: sio.c,v 1.8 1996/04/13 00:23:34 cgd Exp $ */ +/* $OpenBSD: sio.c,v 1.5 1996/10/30 22:40:14 niklas Exp $ */ +/* $NetBSD: sio.c,v 1.11 1996/10/13 03:00:18 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -72,7 +72,7 @@ union sio_attach_args { struct eisabus_attach_args sa_eba; }; -int sioprint __P((void *, char *pnp)); +int sioprint __P((void *, /* const */ char *pnp)); void sio_isa_attach_hook __P((struct device *, struct device *, struct isabus_attach_args *)); void sio_eisa_attach_hook __P((struct device *, struct device *, @@ -85,7 +85,6 @@ siomatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct pci_attach_args *pa = aux; if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL || @@ -100,7 +99,6 @@ pcebmatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct pci_attach_args *pa = aux; if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL || @@ -172,7 +170,7 @@ sioattach(parent, self, aux) int sioprint(aux, pnp) void *aux; - char *pnp; + /* const */ char *pnp; { register union sio_attach_args *sa = aux; diff --git a/sys/arch/alpha/pci/sio_pic.c b/sys/arch/alpha/pci/sio_pic.c index 585c14edab6..0a6952ea2a3 100644 --- a/sys/arch/alpha/pci/sio_pic.c +++ b/sys/arch/alpha/pci/sio_pic.c @@ -1,5 +1,5 @@ -/* $OpenBSD: sio_pic.c,v 1.5 1996/07/29 23:00:55 niklas Exp $ */ -/* $NetBSD: sio_pic.c,v 1.7.4.3 1996/06/05 22:50:23 cgd Exp $ */ +/* $OpenBSD: sio_pic.c,v 1.6 1996/10/30 22:40:15 niklas Exp $ */ +/* $NetBSD: sio_pic.c,v 1.13 1996/10/13 03:00:20 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -70,7 +70,7 @@ bus_io_handle_t sio_ioh_icu1, sio_ioh_icu2, sio_ioh_elcr; * the list. The handler is called with its (single) argument. */ struct intrhand { - int (*ih_fun)(); + int (*ih_fun) __P((void *)); void *ih_arg; u_long ih_count; struct intrhand *ih_next; @@ -115,6 +115,8 @@ u_int8_t initial_elcr[2]; #define INITIALLY_LEVEL_TRIGGERED(irq) 0 #endif +void sio_setirqstat __P((int, int, int)); + void sio_setirqstat(irq, enabled, type) int irq, enabled; @@ -358,16 +360,27 @@ sio_strayintr(irq) int irq; { - if (++sio_strayintrcnt[irq] <= STRAY_MAX) - log(LOG_ERR, "stray interrupt %d%s\n", irq, + sio_strayintrcnt[irq]++; + +#ifdef notyet + if (sio_strayintrcnt[irq] == STRAY_MAX) + sio_disable_intr(irq); + + log(LOG_ERR, "stray isa irq %d\n", irq); + if (sio_strayintrcnt[irq] == STRAY_MAX) + log(LOG_ERR, "disabling interrupts on isa irq %d\n", irq); +#else + if (sio_strayintrcnt[irq] <= STRAY_MAX) + log(LOG_ERR, "stray isa irq %d%s\n", irq, sio_strayintrcnt[irq] >= STRAY_MAX ? "; stopped logging" : ""); +#endif } void sio_iointr(framep, vec) void *framep; - int vec; + unsigned long vec; { int irq, handled; struct intrhand *ih; diff --git a/sys/arch/alpha/pci/sioreg.h b/sys/arch/alpha/pci/sioreg.h index c678b3b6f76..277a60dcdac 100644 --- a/sys/arch/alpha/pci/sioreg.h +++ b/sys/arch/alpha/pci/sioreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sioreg.h,v 1.2 1996/07/29 23:00:57 niklas Exp $ */ +/* $OpenBSD: sioreg.h,v 1.3 1996/10/30 22:40:16 niklas Exp $ */ /* $NetBSD: sioreg.h,v 1.1 1996/04/23 14:10:53 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/siovar.h b/sys/arch/alpha/pci/siovar.h index 0537724dc0c..288341d293a 100644 --- a/sys/arch/alpha/pci/siovar.h +++ b/sys/arch/alpha/pci/siovar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: siovar.h,v 1.3 1996/07/29 23:00:58 niklas Exp $ */ -/* $NetBSD: siovar.h,v 1.3 1996/04/12 06:09:06 cgd Exp $ */ +/* $OpenBSD: siovar.h,v 1.4 1996/10/30 22:40:17 niklas Exp $ */ +/* $NetBSD: siovar.h,v 1.4 1996/07/14 04:08:42 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ */ void sio_intr_setup __P((bus_chipset_tag_t)); -void sio_iointr __P((void *framep, int vec)); +void sio_iointr __P((void *framep, unsigned long vec)); const char *sio_intr_string __P((void *, int)); void *sio_intr_establish __P((void *, int, int, int, int (*)(void *), diff --git a/sys/arch/alpha/pci/tga.c b/sys/arch/alpha/pci/tga.c index e70ddbab10d..7f5b1a12560 100644 --- a/sys/arch/alpha/pci/tga.c +++ b/sys/arch/alpha/pci/tga.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tga.c,v 1.4 1996/07/29 23:01:00 niklas Exp $ */ -/* $NetBSD: tga.c,v 1.6 1996/04/12 06:09:08 cgd Exp $ */ +/* $OpenBSD: tga.c,v 1.5 1996/10/30 22:40:19 niklas Exp $ */ +/* $NetBSD: tga.c,v 1.10 1996/10/13 03:00:22 christos Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -57,7 +57,7 @@ int tgamatch __P((struct device *, void *, void *)); void tgaattach __P((struct device *, struct device *, void *)); -int tgaprint __P((void *, char *)); +int tgaprint __P((void *, /* const */ char *)); struct cfattach tga_ca = { sizeof(struct tga_softc), tgamatch, tgaattach, @@ -94,7 +94,6 @@ tgamatch(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; struct pci_attach_args *pa = aux; if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_DEC || @@ -132,7 +131,7 @@ tga_getdevconfig(bc, pc, tag, dc) /* XXX XXX XXX */ if (bus_mem_map(bc, dc->dc_pcipaddr, pcisize, 1, &dc->dc_vaddr)) return; - dc->dc_paddr = k0segtophys(dc->dc_vaddr); /* XXX */ + dc->dc_paddr = ALPHA_K0SEG_TO_PHYS(dc->dc_vaddr); /* XXX */ dc->dc_regs = (tga_reg_t *)(dc->dc_vaddr + TGA_MEM_CREGS); dc->dc_tga_type = tga_identify(dc->dc_regs); @@ -242,6 +241,7 @@ tgaattach(parent, self, aux) } /* XXX say what's going on. */ + intrstr = NULL; if (sc->sc_dc->dc_tgaconf->tgac_ramdac->tgar_intr != NULL) { if (pci_intr_map(pa->pa_pc, pa->pa_intrtag, pa->pa_intrpin, pa->pa_intrline, &intrh)) { @@ -312,7 +312,7 @@ tgaattach(parent, self, aux) int tgaprint(aux, pnp) void *aux; - char *pnp; + /* const */ char *pnp; { if (pnp) @@ -465,7 +465,10 @@ tga_builtin_set_cursor(dc, fbc) struct tga_devconfig *dc; struct fbcursor *fbc; { - int v, count; + int v; +#if 0 + int count; +#endif v = fbc->set; #if 0 @@ -544,6 +547,7 @@ tga_builtin_set_curpos(dc, fbp) dc->dc_regs[TGA_REG_CXYR] = ((fbp->y & 0xfff) << 12) | (fbp->x & 0xfff); + return (0); } int @@ -554,6 +558,7 @@ tga_builtin_get_curpos(dc, fbp) fbp->x = dc->dc_regs[TGA_REG_CXYR] & 0xfff; fbp->y = (dc->dc_regs[TGA_REG_CXYR] >> 12) & 0xfff; + return (0); } int @@ -563,4 +568,5 @@ tga_builtin_get_curmax(dc, fbp) { fbp->x = fbp->y = 64; + return (0); } diff --git a/sys/arch/alpha/pci/tga_bt463.c b/sys/arch/alpha/pci/tga_bt463.c index 54ecdf8087a..b628a0ead93 100644 --- a/sys/arch/alpha/pci/tga_bt463.c +++ b/sys/arch/alpha/pci/tga_bt463.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga_bt463.c,v 1.2 1996/07/29 23:01:02 niklas Exp $ */ +/* $OpenBSD: tga_bt463.c,v 1.3 1996/10/30 22:40:19 niklas Exp $ */ /* $NetBSD: tga_bt463.c,v 1.2 1996/04/12 06:09:13 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/tga_bt485.c b/sys/arch/alpha/pci/tga_bt485.c index 11e9d46e9c3..cefd7d05ed1 100644 --- a/sys/arch/alpha/pci/tga_bt485.c +++ b/sys/arch/alpha/pci/tga_bt485.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tga_bt485.c,v 1.2 1996/07/29 23:01:04 niklas Exp $ */ -/* $NetBSD: tga_bt485.c,v 1.2 1996/04/12 06:09:16 cgd Exp $ */ +/* $OpenBSD: tga_bt485.c,v 1.3 1996/10/30 22:40:21 niklas Exp $ */ +/* $NetBSD: tga_bt485.c,v 1.3 1996/07/09 00:55:05 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -33,6 +33,9 @@ #include <sys/buf.h> #include <sys/kernel.h> #include <sys/malloc.h> +#include <sys/systm.h> +#include <vm/vm.h> +#include <vm/vm_extern.h> #include <dev/pci/pcivar.h> #include <machine/tgareg.h> @@ -199,7 +202,7 @@ tga_bt485_set_cmap(dc, fbc) struct fbcmap *fbc; { struct bt485data *data = dc->dc_ramdac_private; - int error, count, index, s; + int count, index, s; if ((u_int)fbc->index >= 256 || ((u_int)fbc->index + (u_int)fbc->count) > 256) @@ -256,7 +259,7 @@ tga_bt485_set_cursor(dc, fbc) struct fbcursor *fbc; { struct bt485data *data = dc->dc_ramdac_private; - int error, count, index, v, s; + int count, index, v, s; v = fbc->set; @@ -398,8 +401,6 @@ tga_bt485_get_curmax(dc, fbp) struct tga_devconfig *dc; struct fbcurpos *fbp; { - struct bt485data *data = dc->dc_ramdac_private; - fbp->x = fbp->y = CURSOR_MAX_SIZE; return (0); } @@ -434,7 +435,7 @@ tga_bt485_wr_d(tgaregs, btreg, val) panic("tga_bt485_wr_d: reg %d out of range\n", btreg); tgaregs[TGA_REG_EPDR] = (btreg << 9) | (0 << 8 ) | val; /* XXX */ - wbflush(); + alpha_mb(); } inline u_int8_t @@ -448,7 +449,7 @@ tga_bt485_rd_d(tgaregs, btreg) panic("tga_bt485_rd_d: reg %d out of range\n", btreg); tgaregs[TGA_REG_EPSR] = (btreg << 1) | 0x1; /* XXX */ - wbflush(); + alpha_mb(); rdval = tgaregs[TGA_REG_EPDR]; return (rdval >> 16) & 0xff; /* XXX */ diff --git a/sys/arch/alpha/pci/tga_conf.c b/sys/arch/alpha/pci/tga_conf.c index abc1fd1b86a..73a65a85a23 100644 --- a/sys/arch/alpha/pci/tga_conf.c +++ b/sys/arch/alpha/pci/tga_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga_conf.c,v 1.2 1996/07/29 23:01:05 niklas Exp $ */ +/* $OpenBSD: tga_conf.c,v 1.3 1996/10/30 22:40:22 niklas Exp $ */ /* $NetBSD: tga_conf.c,v 1.2 1996/04/12 06:09:18 cgd Exp $ */ /* diff --git a/sys/arch/alpha/pci/tgavar.h b/sys/arch/alpha/pci/tgavar.h index 2b01f701f92..9b833436a97 100644 --- a/sys/arch/alpha/pci/tgavar.h +++ b/sys/arch/alpha/pci/tgavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tgavar.h,v 1.4 1996/07/29 23:01:07 niklas Exp $ */ +/* $OpenBSD: tgavar.h,v 1.5 1996/10/30 22:40:22 niklas Exp $ */ /* $NetBSD: tgavar.h,v 1.5 1996/04/12 06:09:21 cgd Exp $ */ /* |