diff options
Diffstat (limited to 'sys/arch/alpha/pci')
-rw-r--r-- | sys/arch/alpha/pci/apecs.c | 104 | ||||
-rw-r--r-- | sys/arch/alpha/pci/apecs_bus_io.c | 3 | ||||
-rw-r--r-- | sys/arch/alpha/pci/apecs_bus_mem.c | 3 | ||||
-rw-r--r-- | sys/arch/alpha/pci/apecs_pci.c | 15 | ||||
-rw-r--r-- | sys/arch/alpha/pci/apecsreg.h | 4 |
5 files changed, 116 insertions, 13 deletions
diff --git a/sys/arch/alpha/pci/apecs.c b/sys/arch/alpha/pci/apecs.c index e33608f6165..1b384f8d19b 100644 --- a/sys/arch/alpha/pci/apecs.c +++ b/sys/arch/alpha/pci/apecs.c @@ -1,6 +1,42 @@ -/* $OpenBSD: apecs.c,v 1.10 2001/02/16 05:17:31 jason Exp $ */ +/* $OpenBSD: apecs.c,v 1.11 2001/02/16 08:23:38 jason Exp $ */ /* $NetBSD: apecs.c,v 1.16 1996/12/05 01:39:34 cgd Exp $ */ +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * 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 the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``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 FOUNDATION OR CONTRIBUTORS + * 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. + */ + /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. * All rights reserved. @@ -48,6 +84,15 @@ #ifdef DEC_2100_A50 #include <alpha/pci/pci_2100_a50.h> #endif +#ifdef DEC_EB64PLUS +#include <alpha/pci/pci_eb64plus.h> +#endif +#ifdef DEC_1000A +#include <alpha/pci/pci_1000a.h> +#endif +#ifdef DEC_1000 +#include <alpha/pci/pci_1000.h> +#endif int apecsmatch __P((struct device *, void *, void *)); void apecsattach __P((struct device *, struct device *, void *)); @@ -106,6 +151,15 @@ apecs_init(acp, mallocsafe) /* don't do these twice since they set up extents */ acp->ac_iot = apecs_bus_io_init(acp); acp->ac_memt = apecs_bus_mem_init(acp); + +#if 0 + /* + * We have two I/O windows and 3 MEM windows. + */ + alpha_bus_window_count[ALPHA_BUS_TYPE_PCI_IO] = 2; + alpha_bus_window_count[ALPHA_BUS_TYPE_PCI_MEM] = 3; + alpha_bus_get_window = apecs_bus_get_window; +#endif } acp->ac_mallocsafe = mallocsafe; @@ -146,13 +200,33 @@ apecsattach(parent, self, aux) if (!acp->ac_epic_pass2) printf("WARNING: 21071-DA NOT PASS2... NO BETS...\n"); - switch (hwrpb->rpb_type) { + switch (cputype) { #ifdef DEC_2100_A50 case ST_DEC_2100_A50: pci_2100_a50_pickintr(acp); break; #endif +#ifdef DEC_EB64PLUS + case ST_EB64P: + pci_eb64plus_pickintr(acp); + break; +#endif + +#ifdef DEC_1000A + case ST_DEC_1000A: + pci_1000a_pickintr(acp, &acp->ac_iot, &acp->ac_memt, + &acp->ac_pc); + break; +#endif + +#ifdef DEC_1000 + case ST_DEC_1000: + pci_1000_pickintr(acp, &acp->ac_iot, &acp->ac_memt, + &acp->ac_pc); + break; +#endif + default: panic("apecsattach: shouldn't be here, really..."); } @@ -184,3 +258,29 @@ apecsprint(aux, pnp) printf(" bus %d", pba->pba_bus); return (UNCONF); } + +#if 0 +int +apecs_bus_get_window(type, window, abst) + int type, window; + struct alpha_bus_space_translation *abst; +{ + struct apecs_config *acp = &apecs_configuration; + bus_space_tag_t st; + + switch (type) { + case ALPHA_BUS_TYPE_PCI_IO: + st = &acp->ac_iot; + break; + + case ALPHA_BUS_TYPE_PCI_MEM: + st = &acp->ac_memt; + break; + + default: + panic("apecs_bus_get_window"); + } + + return (alpha_bus_space_get_window(st, window, abst)); +} +#endif diff --git a/sys/arch/alpha/pci/apecs_bus_io.c b/sys/arch/alpha/pci/apecs_bus_io.c index aaa6580181f..18dfb3459de 100644 --- a/sys/arch/alpha/pci/apecs_bus_io.c +++ b/sys/arch/alpha/pci/apecs_bus_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apecs_bus_io.c,v 1.3 2001/02/06 19:26:38 art Exp $ */ +/* $OpenBSD: apecs_bus_io.c,v 1.4 2001/02/16 08:23:38 jason Exp $ */ /* $NetBSD: apecs_bus_io.c,v 1.1 1996/11/25 03:42:09 cgd Exp $ */ /* @@ -33,6 +33,7 @@ #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/device.h> + #include <vm/vm.h> #include <machine/bus.h> diff --git a/sys/arch/alpha/pci/apecs_bus_mem.c b/sys/arch/alpha/pci/apecs_bus_mem.c index 327ac0cb368..caa638e6041 100644 --- a/sys/arch/alpha/pci/apecs_bus_mem.c +++ b/sys/arch/alpha/pci/apecs_bus_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apecs_bus_mem.c,v 1.3 2001/02/06 19:26:39 art Exp $ */ +/* $OpenBSD: apecs_bus_mem.c,v 1.4 2001/02/16 08:23:38 jason Exp $ */ /* $NetBSD: apecs_bus_mem.c,v 1.1 1996/11/25 03:42:11 cgd Exp $ */ /* @@ -33,6 +33,7 @@ #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/device.h> + #include <vm/vm.h> #include <machine/bus.h> diff --git a/sys/arch/alpha/pci/apecs_pci.c b/sys/arch/alpha/pci/apecs_pci.c index 6fd68da1cdd..c181d34d6fa 100644 --- a/sys/arch/alpha/pci/apecs_pci.c +++ b/sys/arch/alpha/pci/apecs_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apecs_pci.c,v 1.6 1997/01/24 19:57:34 niklas Exp $ */ +/* $OpenBSD: apecs_pci.c,v 1.7 2001/02/16 08:23:39 jason Exp $ */ /* $NetBSD: apecs_pci.c,v 1.10 1996/11/13 21:13:25 cgd Exp $ */ /* @@ -32,6 +32,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/device.h> + #include <vm/vm.h> #include <machine/autoconf.h> /* badaddr() proto */ @@ -116,13 +117,11 @@ apecs_conf_read(cpv, tag, offset) int s, secondary, ba; int32_t old_haxr2; /* XXX */ -#ifdef DIAGNOSTIC s = 0; /* XXX gcc -Wuninitialized */ old_haxr2 = 0; /* XXX gcc -Wuninitialized */ -#endif /* secondary if bus # != 0 */ - pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); + alpha_pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); if (secondary) { s = splhigh(); old_haxr2 = REGVAL(EPIC_HAXR2); @@ -167,13 +166,11 @@ apecs_conf_write(cpv, tag, offset, data) int s, secondary; int32_t old_haxr2; /* XXX */ -#ifdef DIAGNOSTIC s = 0; /* XXX gcc -Wuninitialized */ old_haxr2 = 0; /* XXX gcc -Wuninitialized */ -#endif /* secondary if bus # != 0 */ - pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); + alpha_pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); if (secondary) { s = splhigh(); old_haxr2 = REGVAL(EPIC_HAXR2); @@ -187,7 +184,11 @@ apecs_conf_write(cpv, tag, offset, data) (offset & ~0x03) << 5 | /* XXX */ 0 << 5 | /* XXX */ 0x3 << 3); /* XXX */ + + alpha_mb(); *datap = data; + alpha_mb(); + alpha_mb(); if (secondary) { alpha_mb(); diff --git a/sys/arch/alpha/pci/apecsreg.h b/sys/arch/alpha/pci/apecsreg.h index aa920ea5064..796ce75c935 100644 --- a/sys/arch/alpha/pci/apecsreg.h +++ b/sys/arch/alpha/pci/apecsreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: apecsreg.h,v 1.5 2001/02/16 05:17:31 jason Exp $ */ +/* $OpenBSD: apecsreg.h,v 1.6 2001/02/16 08:23:39 jason Exp $ */ /* $NetBSD: apecsreg.h,v 1.5.2.2 1997/06/06 20:26:53 thorpej Exp $ */ /* @@ -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 *)ALPHA_PHYS_TO_K0SEG(r)) +#define REGVAL(r) (*(volatile int32_t *)ALPHA_PHYS_TO_K0SEG(r)) /* * Base addresses |