mcpcia.c revision 1.4.8.2       1  1.4.8.2       he /* $NetBSD: mcpcia.c,v 1.4.8.2 1999/12/16 23:16:54 he Exp $ */
      2  1.4.8.1  thorpej 
      3  1.4.8.1  thorpej /*-
      4  1.4.8.1  thorpej  * Copyright (c) 1999 The NetBSD Foundation, Inc.
      5  1.4.8.1  thorpej  * All rights reserved.
      6  1.4.8.1  thorpej  *
      7  1.4.8.1  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8  1.4.8.1  thorpej  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
      9  1.4.8.1  thorpej  * NASA Ames Research Center.
     10  1.4.8.1  thorpej  *
     11  1.4.8.1  thorpej  * Redistribution and use in source and binary forms, with or without
     12  1.4.8.1  thorpej  * modification, are permitted provided that the following conditions
     13  1.4.8.1  thorpej  * are met:
     14  1.4.8.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     15  1.4.8.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     16  1.4.8.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     17  1.4.8.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     18  1.4.8.1  thorpej  *    documentation and/or other materials provided with the distribution.
     19  1.4.8.1  thorpej  * 3. All advertising materials mentioning features or use of this software
     20  1.4.8.1  thorpej  *    must display the following acknowledgement:
     21  1.4.8.1  thorpej  *	This product includes software developed by the NetBSD
     22  1.4.8.1  thorpej  *	Foundation, Inc. and its contributors.
     23  1.4.8.1  thorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
     24  1.4.8.1  thorpej  *    contributors may be used to endorse or promote products derived
     25  1.4.8.1  thorpej  *    from this software without specific prior written permission.
     26  1.4.8.1  thorpej  *
     27  1.4.8.1  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     28  1.4.8.1  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     29  1.4.8.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     30  1.4.8.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     31  1.4.8.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     32  1.4.8.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     33  1.4.8.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     34  1.4.8.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     35  1.4.8.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     36  1.4.8.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     37  1.4.8.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     38  1.4.8.1  thorpej  */
     39      1.1   mjacob 
     40      1.1   mjacob /*
     41      1.1   mjacob  * Copyright (c) 1998 by Matthew Jacob
     42      1.1   mjacob  * NASA AMES Research Center.
     43      1.1   mjacob  * All rights reserved.
     44      1.1   mjacob  *
     45      1.1   mjacob  * Redistribution and use in source and binary forms, with or without
     46      1.1   mjacob  * modification, are permitted provided that the following conditions
     47      1.1   mjacob  * are met:
     48      1.1   mjacob  * 1. Redistributions of source code must retain the above copyright
     49      1.1   mjacob  *    notice immediately at the beginning of the file, without modification,
     50      1.1   mjacob  *    this list of conditions, and the following disclaimer.
     51      1.1   mjacob  * 2. Redistributions in binary form must reproduce the above copyright
     52      1.1   mjacob  *    notice, this list of conditions and the following disclaimer in the
     53      1.1   mjacob  *    documentation and/or other materials provided with the distribution.
     54      1.1   mjacob  * 3. The name of the author may not be used to endorse or promote products
     55      1.1   mjacob  *    derived from this software without specific prior written permission.
     56      1.1   mjacob  *
     57      1.1   mjacob  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     58      1.1   mjacob  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     59      1.1   mjacob  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     60      1.1   mjacob  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
     61      1.1   mjacob  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     62      1.1   mjacob  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     63      1.1   mjacob  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     64      1.1   mjacob  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     65      1.1   mjacob  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     66      1.1   mjacob  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     67      1.1   mjacob  * SUCH DAMAGE.
     68      1.1   mjacob  */
     69      1.1   mjacob 
     70      1.1   mjacob /*
     71      1.1   mjacob  * MCPCIA mcbus to PCI bus adapter
     72      1.1   mjacob  * found on AlphaServer 4100 systems.
     73      1.1   mjacob  */
     74      1.1   mjacob 
     75      1.1   mjacob #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
     76      1.1   mjacob 
     77  1.4.8.2       he __KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.4.8.2 1999/12/16 23:16:54 he Exp $");
     78      1.1   mjacob 
     79      1.1   mjacob #include <sys/param.h>
     80      1.1   mjacob #include <sys/systm.h>
     81      1.1   mjacob #include <sys/device.h>
     82      1.1   mjacob #include <sys/malloc.h>
     83      1.1   mjacob 
     84      1.1   mjacob #include <machine/autoconf.h>
     85      1.1   mjacob #include <machine/rpb.h>
     86      1.1   mjacob #include <machine/pte.h>
     87      1.1   mjacob 
     88      1.1   mjacob #include <alpha/mcbus/mcbusreg.h>
     89      1.1   mjacob #include <alpha/mcbus/mcbusvar.h>
     90      1.1   mjacob #include <alpha/pci/mcpciareg.h>
     91      1.1   mjacob #include <alpha/pci/mcpciavar.h>
     92      1.1   mjacob #include <alpha/pci/pci_kn300.h>
     93      1.1   mjacob 
     94      1.1   mjacob #define KV(_addr)	((caddr_t)ALPHA_PHYS_TO_K0SEG((_addr)))
     95  1.4.8.1  thorpej #define	MCPCIA_SYSBASE(mc)	\
     96  1.4.8.1  thorpej 	((((unsigned long) (mc)->cc_gid) << MCBUS_GID_SHIFT) | \
     97  1.4.8.1  thorpej 	 (((unsigned long) (mc)->cc_mid) << MCBUS_MID_SHIFT) | \
     98      1.1   mjacob 	 (MCBUS_IOSPACE))
     99      1.1   mjacob 
    100  1.4.8.2       he #define	MCPCIA_PROBE(mid, gid)	\
    101  1.4.8.2       he 	badaddr((void *)KV(((((unsigned long) gid) << MCBUS_GID_SHIFT) | \
    102  1.4.8.2       he 	 (((unsigned long) mid) << MCBUS_MID_SHIFT) | \
    103  1.4.8.2       he 	 (MCBUS_IOSPACE) | MCPCIA_PCI_BRIDGE | _MCPCIA_PCI_REV)), \
    104  1.4.8.2       he 	sizeof(u_int32_t))
    105  1.4.8.2       he 
    106      1.1   mjacob static int	mcpciamatch __P((struct device *, struct cfdata *, void *));
    107      1.1   mjacob static void	mcpciaattach __P((struct device *, struct device *, void *));
    108      1.1   mjacob struct cfattach mcpcia_ca = {
    109      1.1   mjacob 	sizeof(struct mcpcia_softc), mcpciamatch, mcpciaattach
    110      1.1   mjacob };
    111      1.1   mjacob 
    112      1.1   mjacob static int	mcpciaprint __P((void *, const char *));
    113      1.1   mjacob 
    114  1.4.8.1  thorpej void	mcpcia_init0 __P((struct mcpcia_config *, int));
    115  1.4.8.1  thorpej 
    116  1.4.8.1  thorpej /*
    117  1.4.8.1  thorpej  * We have one statically-allocated mcpcia_config structure; this is
    118  1.4.8.1  thorpej  * the one used for the console (which, coincidentally, is the only
    119  1.4.8.1  thorpej  * MCPCIA with an EISA adapter attached to it).
    120  1.4.8.1  thorpej  */
    121  1.4.8.1  thorpej struct mcpcia_config mcpcia_console_configuration;
    122  1.4.8.1  thorpej 
    123      1.1   mjacob static int
    124      1.1   mjacob mcpciaprint(aux, pnp)
    125      1.1   mjacob 	void *aux;
    126      1.1   mjacob 	const char *pnp;
    127      1.1   mjacob {
    128      1.1   mjacob 	register struct pcibus_attach_args *pba = aux;
    129      1.1   mjacob 	/* only PCIs can attach to MCPCIA for now */
    130      1.1   mjacob 	if (pnp)
    131      1.1   mjacob 		printf("%s at %s", pba->pba_busname, pnp);
    132      1.1   mjacob 	printf(" bus %d", pba->pba_bus);
    133      1.1   mjacob 	return (UNCONF);
    134      1.1   mjacob }
    135      1.1   mjacob 
    136      1.1   mjacob static int
    137      1.1   mjacob mcpciamatch(parent, cf, aux)
    138      1.1   mjacob 	struct device *parent;
    139      1.1   mjacob 	struct cfdata *cf;
    140      1.1   mjacob 	void *aux;
    141      1.1   mjacob {
    142      1.1   mjacob 	struct mcbus_dev_attach_args *ma = aux;
    143      1.1   mjacob 	if (ma->ma_type == MCBUS_TYPE_PCI)
    144      1.1   mjacob 		return (1);
    145      1.1   mjacob 	return (0);
    146      1.1   mjacob }
    147      1.1   mjacob 
    148      1.1   mjacob static void
    149      1.1   mjacob mcpciaattach(parent, self, aux)
    150      1.1   mjacob 	struct device *parent;
    151      1.1   mjacob 	struct device *self;
    152      1.1   mjacob 	void *aux;
    153      1.1   mjacob {
    154      1.1   mjacob 	static int first = 1;
    155      1.1   mjacob 	struct mcbus_dev_attach_args *ma = aux;
    156      1.1   mjacob 	struct mcpcia_softc *mcp = (struct mcpcia_softc *)self;
    157  1.4.8.1  thorpej 	struct mcpcia_config *ccp;
    158      1.1   mjacob 	struct pcibus_attach_args pba;
    159  1.4.8.1  thorpej 	u_int32_t ctl;
    160      1.1   mjacob 
    161  1.4.8.2       he 	/*
    162  1.4.8.2       he 	 * Make sure this MCPCIA exists...
    163  1.4.8.2       he 	 */
    164  1.4.8.2       he 	if (MCPCIA_PROBE(ma->ma_mid, ma->ma_gid)) {
    165  1.4.8.2       he 		mcp->mcpcia_cc = NULL;
    166  1.4.8.2       he 		printf(" (not present)\n");
    167  1.4.8.2       he 		return;
    168  1.4.8.2       he 	}
    169      1.1   mjacob 	printf("\n");
    170      1.1   mjacob 
    171  1.4.8.1  thorpej 	/*
    172  1.4.8.1  thorpej 	 * Determine if we're the console's MCPCIA.
    173  1.4.8.1  thorpej 	 */
    174  1.4.8.1  thorpej 	if (ma->ma_mid == mcpcia_console_configuration.cc_mid &&
    175  1.4.8.1  thorpej 	    ma->ma_gid == mcpcia_console_configuration.cc_gid)
    176  1.4.8.1  thorpej 		ccp = &mcpcia_console_configuration;
    177  1.4.8.1  thorpej 	else {
    178  1.4.8.1  thorpej 		ccp = malloc(sizeof(struct mcpcia_config), M_DEVBUF, M_WAITOK);
    179  1.4.8.1  thorpej 		memset(ccp, 0, sizeof(struct mcpcia_config));
    180      1.1   mjacob 
    181  1.4.8.1  thorpej 		ccp->cc_mid = ma->ma_mid;
    182  1.4.8.1  thorpej 		ccp->cc_gid = ma->ma_gid;
    183      1.1   mjacob 	}
    184  1.4.8.1  thorpej 
    185  1.4.8.1  thorpej 	mcp->mcpcia_cc = ccp;
    186  1.4.8.1  thorpej 	ccp->cc_sc = mcp;
    187  1.4.8.1  thorpej 
    188  1.4.8.1  thorpej 	/* This initializes cc_sysbase so we can do register access. */
    189  1.4.8.1  thorpej 	mcpcia_init0(ccp, 1);
    190  1.4.8.1  thorpej 
    191  1.4.8.1  thorpej 	ctl = REGVAL(MCPCIA_PCI_REV(ccp));
    192  1.4.8.1  thorpej 	printf("%s: Horse Revision %d, %s Handed Saddle Revision %d,"
    193  1.4.8.1  thorpej 	    " CAP Revision %d\n", mcp->mcpcia_dev.dv_xname, HORSE_REV(ctl),
    194  1.4.8.1  thorpej 	    (SADDLE_TYPE(ctl) & 1)? "Right": "Left", SADDLE_REV(ctl),
    195  1.4.8.1  thorpej 	    CAP_REV(ctl));
    196  1.4.8.1  thorpej 
    197  1.4.8.1  thorpej 	mcpcia_dma_init(ccp);
    198      1.1   mjacob 
    199      1.1   mjacob 	/*
    200      1.1   mjacob 	 * Set up interrupts
    201      1.1   mjacob 	 */
    202  1.4.8.1  thorpej 	pci_kn300_pickintr(ccp, first);
    203  1.4.8.1  thorpej #ifdef EVCNT_COUNTERS
    204      1.1   mjacob 	if (first == 1) {
    205      1.1   mjacob 		evcnt_attach(self, "intr", kn300_intr_evcnt);
    206      1.1   mjacob 		first = 0;
    207      1.1   mjacob 	}
    208      1.1   mjacob #else
    209      1.1   mjacob 	first = 0;
    210      1.1   mjacob #endif
    211      1.1   mjacob 
    212      1.1   mjacob 	/*
    213      1.1   mjacob 	 * Attach PCI bus
    214      1.1   mjacob 	 */
    215      1.1   mjacob 	pba.pba_busname = "pci";
    216  1.4.8.1  thorpej 	pba.pba_iot = &ccp->cc_iot;
    217  1.4.8.1  thorpej 	pba.pba_memt = &ccp->cc_memt;
    218      1.1   mjacob 	pba.pba_dmat =	/* start with direct, may change... */
    219  1.4.8.1  thorpej 	    alphabus_dma_get_tag(&ccp->cc_dmat_direct, ALPHA_BUS_PCI);
    220  1.4.8.1  thorpej 	pba.pba_pc = &ccp->cc_pc;
    221      1.1   mjacob 	pba.pba_bus = 0;
    222      1.1   mjacob 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
    223  1.4.8.1  thorpej 	(void) config_found(self, &pba, mcpciaprint);
    224  1.4.8.1  thorpej 
    225  1.4.8.1  thorpej 	/*
    226  1.4.8.1  thorpej 	 * Clear any errors that may have occurred during the probe
    227  1.4.8.1  thorpej 	 * sequence.
    228  1.4.8.1  thorpej 	 */
    229  1.4.8.1  thorpej 	REGVAL(MCPCIA_CAP_ERR(ccp)) = 0xFFFFFFFF;
    230  1.4.8.1  thorpej 	alpha_mb();
    231      1.1   mjacob }
    232      1.1   mjacob 
    233      1.1   mjacob void
    234  1.4.8.1  thorpej mcpcia_init()
    235  1.4.8.1  thorpej {
    236  1.4.8.1  thorpej 	struct mcpcia_config *ccp = &mcpcia_console_configuration;
    237  1.4.8.1  thorpej 	int i;
    238  1.4.8.1  thorpej 
    239  1.4.8.1  thorpej 	/*
    240  1.4.8.1  thorpej 	 * Look for all of the MCPCIAs on the system.  One of them
    241  1.4.8.1  thorpej 	 * will have an EISA attached to it.  This MCPCIA is the
    242  1.4.8.1  thorpej 	 * only one that can be used for the console.  Once we find
    243  1.4.8.1  thorpej 	 * that one, initialize it.
    244  1.4.8.1  thorpej 	 */
    245  1.4.8.1  thorpej 
    246  1.4.8.1  thorpej 	for (i = 0; i < MCPCIA_PER_MCBUS; i++) {
    247  1.4.8.1  thorpej 		ccp->cc_mid = mcbus_mcpcia_probe_order[i];
    248  1.4.8.1  thorpej 		/*
    249  1.4.8.1  thorpej 		 * XXX If we ever support more than one MCBUS, we'll
    250  1.4.8.1  thorpej 		 * XXX have to probe for them, and map them to unit
    251  1.4.8.1  thorpej 		 * XXX numbers.
    252  1.4.8.1  thorpej 		 */
    253  1.4.8.1  thorpej 		ccp->cc_gid = MCBUS_GID_FROM_INSTANCE(0);
    254  1.4.8.1  thorpej 		ccp->cc_sysbase = MCPCIA_SYSBASE(ccp);
    255  1.4.8.1  thorpej 
    256  1.4.8.1  thorpej 		if (badaddr((void *)ALPHA_PHYS_TO_K0SEG(MCPCIA_PCI_REV(ccp)),
    257  1.4.8.1  thorpej 		    sizeof(u_int32_t)))
    258  1.4.8.1  thorpej 			continue;
    259  1.4.8.1  thorpej 
    260  1.4.8.1  thorpej 		if (EISA_PRESENT(REGVAL(MCPCIA_PCI_REV(ccp)))) {
    261  1.4.8.1  thorpej 			mcpcia_init0(ccp, 0);
    262  1.4.8.1  thorpej 			return;
    263  1.4.8.1  thorpej 		}
    264  1.4.8.1  thorpej 	}
    265  1.4.8.1  thorpej 
    266  1.4.8.1  thorpej 	panic("mcpcia_init: unable to find EISA bus");
    267  1.4.8.1  thorpej }
    268  1.4.8.1  thorpej 
    269  1.4.8.1  thorpej void
    270  1.4.8.1  thorpej mcpcia_init0(ccp, mallocsafe)
    271  1.4.8.1  thorpej 	struct mcpcia_config *ccp;
    272  1.4.8.1  thorpej 	int mallocsafe;
    273      1.1   mjacob {
    274      1.1   mjacob 	u_int32_t ctl;
    275      1.1   mjacob 
    276      1.1   mjacob 	if (ccp->cc_initted == 0) {
    277  1.4.8.1  thorpej 		/* don't do these twice since they set up extents */
    278      1.1   mjacob 		mcpcia_bus_io_init(&ccp->cc_iot, ccp);
    279      1.1   mjacob 		mcpcia_bus_mem_init(&ccp->cc_memt, ccp);
    280      1.1   mjacob 	}
    281  1.4.8.1  thorpej 	ccp->cc_mallocsafe = mallocsafe;
    282  1.4.8.1  thorpej 
    283      1.1   mjacob 	mcpcia_pci_init(&ccp->cc_pc, ccp);
    284      1.1   mjacob 
    285      1.1   mjacob 	/*
    286      1.1   mjacob 	 * Establish a precalculated base for convenience's sake.
    287      1.1   mjacob 	 */
    288  1.4.8.1  thorpej 	ccp->cc_sysbase = MCPCIA_SYSBASE(ccp);
    289      1.1   mjacob 
    290      1.1   mjacob 	/*
    291      1.1   mjacob  	 * Disable interrupts and clear errors prior to probing
    292      1.1   mjacob 	 */
    293  1.4.8.1  thorpej 	REGVAL(MCPCIA_INT_MASK0(ccp)) = 0;
    294  1.4.8.1  thorpej 	REGVAL(MCPCIA_INT_MASK1(ccp)) = 0;
    295  1.4.8.1  thorpej 	REGVAL(MCPCIA_CAP_ERR(ccp)) = 0xFFFFFFFF;
    296      1.1   mjacob 	alpha_mb();
    297      1.1   mjacob 
    298      1.1   mjacob 	/*
    299      1.1   mjacob 	 * Use this opportunity to also find out the MID and CPU
    300      1.1   mjacob 	 * type of the currently running CPU (that's us, billybob....)
    301      1.1   mjacob 	 */
    302  1.4.8.1  thorpej 	ctl = REGVAL(MCPCIA_WHOAMI(ccp));
    303      1.1   mjacob 	mcbus_primary.mcbus_cpu_mid = MCBUS_CPU_MID(ctl);
    304      1.4   mjacob 	if ((MCBUS_CPU_INFO(ctl) & CPU_Fill_Err) == 0 &&
    305      1.4   mjacob 	    mcbus_primary.mcbus_valid == 0) {
    306      1.1   mjacob 		mcbus_primary.mcbus_bcache =
    307      1.1   mjacob 		    MCBUS_CPU_INFO(ctl) & CPU_BCacheMask;
    308      1.1   mjacob 		mcbus_primary.mcbus_valid = 1;
    309      1.1   mjacob 	}
    310      1.1   mjacob 	alpha_mb();
    311  1.4.8.1  thorpej 
    312      1.1   mjacob 	ccp->cc_initted = 1;
    313      1.1   mjacob }
    314      1.1   mjacob 
    315  1.4.8.1  thorpej #ifdef TEST_PROBE_DEATH
    316      1.4   mjacob static void
    317  1.4.8.1  thorpej die_heathen_dog(arg)
    318  1.4.8.1  thorpej 	void *arg;
    319      1.4   mjacob {
    320  1.4.8.1  thorpej 	struct mcpcia_config *ccp = arg;
    321  1.4.8.1  thorpej 
    322      1.4   mjacob 	/* this causes a fatal machine check (0x670) */
    323  1.4.8.1  thorpej 	REGVAL(MCPCIA_CAP_DIAG(ccp)) |= CAP_DIAG_MC_ADRPE;
    324      1.4   mjacob }
    325      1.4   mjacob #endif
    326      1.4   mjacob 
    327      1.1   mjacob void
    328      1.1   mjacob mcpcia_config_cleanup()
    329      1.1   mjacob {
    330      1.1   mjacob 	volatile u_int32_t ctl;
    331      1.1   mjacob 	struct mcpcia_softc *mcp;
    332  1.4.8.1  thorpej 	struct mcpcia_config *ccp;
    333  1.4.8.1  thorpej 	int i;
    334  1.4.8.1  thorpej 	extern struct cfdriver mcpcia_cd;
    335      1.1   mjacob 
    336      1.1   mjacob 	/*
    337      1.1   mjacob 	 * Turn on Hard, Soft error interrupts. Maybe i2c too.
    338      1.1   mjacob 	 */
    339  1.4.8.1  thorpej 	for (i = 0; i < mcpcia_cd.cd_ndevs; i++) {
    340  1.4.8.1  thorpej 		if ((mcp = mcpcia_cd.cd_devs[i]) == NULL)
    341  1.4.8.1  thorpej 			continue;
    342  1.4.8.1  thorpej 
    343  1.4.8.1  thorpej 		ccp = mcp->mcpcia_cc;
    344  1.4.8.2       he 		if (ccp == NULL)
    345  1.4.8.2       he 			continue;
    346  1.4.8.1  thorpej 
    347  1.4.8.1  thorpej 		ctl = REGVAL(MCPCIA_INT_MASK0(ccp));
    348      1.1   mjacob 		ctl |= MCPCIA_GEN_IENABL;
    349  1.4.8.1  thorpej 		REGVAL(MCPCIA_INT_MASK0(ccp)) = ctl;
    350      1.1   mjacob 		alpha_mb();
    351  1.4.8.1  thorpej 
    352      1.1   mjacob 		/* force stall while write completes */
    353  1.4.8.1  thorpej 		ctl = REGVAL(MCPCIA_INT_MASK0(ccp));
    354      1.4   mjacob 	}
    355  1.4.8.1  thorpej #ifdef TEST_PROBE_DEATH
    356  1.4.8.1  thorpej 	(void) timeout (die_heathen_dog, &mcpcia_console_configuration,
    357  1.4.8.1  thorpej 	    30 * hz);
    358      1.4   mjacob #endif
    359      1.1   mjacob }
    360