Home | History | Annotate | Line # | Download | only in pci
dwlpx.c revision 1.14
      1  1.13  thorpej /* $NetBSD: dwlpx.c,v 1.14 1998/03/23 06:38:10 mjacob Exp $ */
      2   1.1      cgd 
      3   1.1      cgd /*
      4   1.2      cgd  * Copyright (c) 1997 by Matthew Jacob
      5   1.1      cgd  * NASA AMES Research Center.
      6   1.1      cgd  * All rights reserved.
      7   1.1      cgd  *
      8   1.1      cgd  * Redistribution and use in source and binary forms, with or without
      9   1.1      cgd  * modification, are permitted provided that the following conditions
     10   1.1      cgd  * are met:
     11   1.1      cgd  * 1. Redistributions of source code must retain the above copyright
     12   1.1      cgd  *    notice immediately at the beginning of the file, without modification,
     13   1.1      cgd  *    this list of conditions, and the following disclaimer.
     14   1.1      cgd  * 2. Redistributions in binary form must reproduce the above copyright
     15   1.1      cgd  *    notice, this list of conditions and the following disclaimer in the
     16   1.1      cgd  *    documentation and/or other materials provided with the distribution.
     17   1.1      cgd  * 3. The name of the author may not be used to endorse or promote products
     18   1.1      cgd  *    derived from this software without specific prior written permission.
     19   1.1      cgd  *
     20   1.1      cgd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     21   1.1      cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22   1.1      cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23   1.1      cgd  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
     24   1.1      cgd  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25   1.1      cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26   1.1      cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27   1.1      cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28   1.1      cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29   1.1      cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30   1.1      cgd  * SUCH DAMAGE.
     31   1.1      cgd  */
     32   1.3      cgd 
     33   1.4      cgd #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
     34   1.4      cgd 
     35  1.13  thorpej __KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.14 1998/03/23 06:38:10 mjacob Exp $");
     36   1.1      cgd 
     37   1.1      cgd #include <sys/param.h>
     38   1.1      cgd #include <sys/systm.h>
     39   1.1      cgd #include <sys/kernel.h>
     40   1.1      cgd #include <sys/device.h>
     41   1.1      cgd #include <vm/vm.h>
     42   1.1      cgd 
     43   1.1      cgd #include <machine/autoconf.h>
     44   1.1      cgd #include <dev/pci/pcireg.h>
     45   1.1      cgd #include <dev/pci/pcivar.h>
     46   1.1      cgd #include <alpha/tlsb/tlsbreg.h>
     47   1.1      cgd #include <alpha/tlsb/kftxxvar.h>
     48   1.1      cgd #include <alpha/tlsb/kftxxreg.h>
     49   1.1      cgd #include <alpha/pci/dwlpxreg.h>
     50   1.1      cgd #include <alpha/pci/dwlpxvar.h>
     51   1.1      cgd #include <alpha/pci/pci_kn8ae.h>
     52   1.1      cgd 
     53   1.1      cgd #include <alpha/include/pmap.old.h>
     54   1.1      cgd 
     55   1.1      cgd #define	KV(_addr)	((caddr_t)ALPHA_PHYS_TO_K0SEG((_addr)))
     56  1.14   mjacob #define	DWLPX_SYSBASE(sc)	\
     57  1.14   mjacob 	    ((((unsigned long)((sc)->dwlpx_node - 4))	<< 36) |	\
     58  1.14   mjacob 	     (((unsigned long) (sc)->dwlpx_hosenum)	<< 34) |	\
     59  1.14   mjacob 	     (1LL					<< 39))
     60  1.14   mjacob 
     61   1.1      cgd 
     62   1.1      cgd static int	dwlpxmatch __P((struct device *, struct cfdata *, void *));
     63   1.1      cgd static void	dwlpxattach __P((struct device *, struct device *, void *));
     64   1.1      cgd struct cfattach dwlpx_ca = {
     65   1.1      cgd 	sizeof(struct dwlpx_softc), dwlpxmatch, dwlpxattach
     66   1.1      cgd };
     67   1.1      cgd 
     68  1.13  thorpej extern struct cfdriver dwlpx_cd;
     69   1.1      cgd 
     70   1.1      cgd static int	dwlpxprint __P((void *, const char *));
     71  1.14   mjacob static struct dwlpx_softc *dwlps[DWLPX_NIONODE][DWLPX_NHOSE];
     72   1.1      cgd 
     73   1.1      cgd static int
     74   1.1      cgd dwlpxprint(aux, pnp)
     75   1.1      cgd 	void *aux;
     76   1.1      cgd 	const char *pnp;
     77   1.1      cgd {
     78   1.1      cgd 	register struct pcibus_attach_args *pba = aux;
     79   1.1      cgd 	/* only PCIs can attach to DWLPX's; easy. */
     80   1.1      cgd 	if (pnp)
     81   1.1      cgd 		printf("%s at %s", pba->pba_busname, pnp);
     82   1.1      cgd 	printf(" bus %d", pba->pba_bus);
     83   1.1      cgd 	return (UNCONF);
     84   1.1      cgd }
     85   1.1      cgd 
     86   1.1      cgd static int
     87   1.1      cgd dwlpxmatch(parent, cf, aux)
     88   1.1      cgd 	struct device *parent;
     89   1.1      cgd 	struct cfdata *cf;
     90   1.1      cgd 	void *aux;
     91   1.1      cgd {
     92   1.1      cgd 	struct kft_dev_attach_args *ka = aux;
     93   1.1      cgd 
     94   1.1      cgd 	if (strcmp(ka->ka_name, dwlpx_cd.cd_name) != 0)
     95   1.1      cgd 		return (0);
     96   1.1      cgd 	return (1);
     97   1.1      cgd }
     98   1.1      cgd 
     99   1.1      cgd static void
    100   1.1      cgd dwlpxattach(parent, self, aux)
    101   1.1      cgd 	struct device *parent;
    102   1.1      cgd 	struct device *self;
    103   1.1      cgd 	void *aux;
    104   1.1      cgd {
    105   1.1      cgd 	static int once = 0;
    106   1.1      cgd 	struct dwlpx_softc *sc = (struct dwlpx_softc *)self;
    107   1.8  thorpej 	struct dwlpx_config *ccp = &sc->dwlpx_cc;
    108   1.1      cgd 	struct kft_dev_attach_args *ka = aux;
    109   1.1      cgd 	struct pcibus_attach_args pba;
    110   1.8  thorpej 	u_int32_t pcia_present;
    111   1.1      cgd 
    112   1.1      cgd 	sc->dwlpx_node = ka->ka_node;
    113   1.1      cgd 	sc->dwlpx_dtype = ka->ka_dtype;
    114   1.1      cgd 	sc->dwlpx_hosenum = ka->ka_hosenum;
    115  1.14   mjacob 	dwlps[sc->dwlpx_node - 4][sc->dwlpx_hosenum] = sc;
    116   1.1      cgd 	dwlpx_init(sc);
    117   1.8  thorpej 
    118   1.8  thorpej 	pcia_present = REGVAL(PCIA_PRESENT + ccp->cc_sysbase);
    119  1.14   mjacob 	printf(": PCIA rev. %d, STD I/O %spresent, %s DMA maps.\n",
    120  1.14   mjacob 	    (pcia_present >> PCIA_PRESENT_REVSHIFT) & PCIA_PRESENT_REVMASK,
    121  1.14   mjacob 	    (pcia_present & PCIA_PRESENT_STDIO) == 0 ? "not " : "",
    122  1.14   mjacob #ifdef	MSS3_DEBUG_SG
    123  1.14   mjacob 	    (sc->dwlpx_sgmapsz == DWLPX_SG128K)? "128K S/G" : "32K S/G");
    124  1.14   mjacob #else
    125  1.14   mjacob 	    (physmem <= btoc(2048LL << 20LL))? "Direct" :
    126  1.14   mjacob 	        (sc->dwlpx_sgmapsz == DWLPX_SG128K)? "128K S/G" : "32K S/G");
    127  1.14   mjacob #endif
    128   1.8  thorpej 
    129   1.8  thorpej 
    130  1.14   mjacob #if	0
    131   1.8  thorpej 	{
    132   1.8  thorpej 		int hpc, slot, slotval;
    133   1.8  thorpej 		const char *str;
    134  1.14   mjacob 		printf("%s: %sK Scatter/Gather RAM Entries Available.\n",
    135  1.14   mjacob 			sc->dwlpx_dev.dv_xname,
    136  1.14   mjacob 			sc->dwlpx_sgmapsz == DWLPX_SG32K?  "32" : "128");
    137   1.8  thorpej 		for (hpc = 0; hpc < sc->dwlpx_nhpc; hpc++) {
    138   1.8  thorpej 			for (slot = 0; slot < 4; slot++) {
    139   1.8  thorpej 				slotval = (pcia_present >>
    140   1.8  thorpej 				    PCIA_PRESENT_SLOTSHIFT(hpc, slot)) &
    141   1.8  thorpej 				    PCIA_PRESENT_SLOT_MASK;
    142   1.8  thorpej 				if (slotval == PCIA_PRESENT_SLOT_NONE)
    143   1.8  thorpej 					continue;
    144   1.8  thorpej 				switch (slotval) {
    145   1.8  thorpej 				case PCIA_PRESENT_SLOT_25W:
    146   1.8  thorpej 					str = "25";
    147   1.8  thorpej 					break;
    148   1.8  thorpej 				case PCIA_PRESENT_SLOT_15W:
    149   1.8  thorpej 					str = "15";
    150   1.8  thorpej 					break;
    151   1.8  thorpej 				case PCIA_PRESENT_SLOW_7W:
    152   1.8  thorpej 				default:		/* XXX gcc */
    153   1.8  thorpej 					str = "7.5";
    154   1.8  thorpej 					break;
    155   1.8  thorpej 				}
    156   1.8  thorpej 				printf("%s: hpc %d slot %d: %s watt module\n",
    157   1.8  thorpej 				    sc->dwlpx_dev.dv_xname, hpc, slot, str);
    158   1.8  thorpej 			}
    159   1.8  thorpej 		}
    160   1.8  thorpej 	}
    161   1.8  thorpej #endif
    162   1.8  thorpej 
    163   1.1      cgd 	if (once == 0) {
    164   1.1      cgd 		/*
    165   1.1      cgd 		 * Set up interrupts
    166   1.1      cgd 		 */
    167   1.1      cgd 		pci_kn8ae_pickintr(&sc->dwlpx_cc, 1);
    168   1.1      cgd #ifdef	EVCNT_COUNTERS
    169   1.1      cgd 		evcnt_attach(self, "intr", kn8ae_intr_evcnt);
    170   1.1      cgd #endif
    171   1.1      cgd 		once++;
    172   1.1      cgd 	} else {
    173   1.1      cgd 		pci_kn8ae_pickintr(&sc->dwlpx_cc, 0);
    174   1.1      cgd 	}
    175   1.1      cgd 
    176   1.1      cgd 	/*
    177   1.1      cgd 	 * Attach PCI bus
    178   1.1      cgd 	 */
    179   1.1      cgd 	pba.pba_busname = "pci";
    180  1.11  thorpej 	pba.pba_iot = &sc->dwlpx_cc.cc_iot;
    181  1.11  thorpej 	pba.pba_memt = &sc->dwlpx_cc.cc_memt;
    182   1.6  thorpej 	pba.pba_dmat =	/* start with direct, may change... */
    183   1.6  thorpej 	    alphabus_dma_get_tag(&sc->dwlpx_cc.cc_dmat_direct, ALPHA_BUS_PCI);
    184   1.1      cgd 	pba.pba_pc = &sc->dwlpx_cc.cc_pc;
    185   1.1      cgd 	pba.pba_bus = 0;
    186   1.5      cgd 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
    187   1.1      cgd 	config_found(self, &pba, dwlpxprint);
    188   1.1      cgd }
    189   1.1      cgd 
    190   1.1      cgd void
    191   1.1      cgd dwlpx_init(sc)
    192   1.1      cgd 	struct dwlpx_softc *sc;
    193   1.1      cgd {
    194   1.1      cgd 	int i;
    195  1.14   mjacob 	u_int32_t ctl;
    196   1.1      cgd 	struct dwlpx_config *ccp = &sc->dwlpx_cc;
    197  1.14   mjacob 	unsigned long ls = DWLPX_SYSBASE(sc);
    198   1.1      cgd 
    199   1.1      cgd 	if (ccp->cc_initted == 0) {
    200  1.14   mjacob 		/*
    201  1.14   mjacob 		 * On reads, you get a fault if you read a nonexisted HPC.
    202  1.14   mjacob 		 * We know the internal KFTIA hose (hose 0) has only 2 HPCs,
    203  1.14   mjacob 		 * but we can also actually probe for HPCs.
    204  1.14   mjacob 		 * Assume at least one.
    205  1.14   mjacob 		 */
    206  1.14   mjacob 		for (sc->dwlpx_nhpc = 1; sc->dwlpx_nhpc < NHPC;
    207  1.14   mjacob 		    sc->dwlpx_nhpc++) {
    208  1.14   mjacob 			if (badaddr(KV(PCIA_CTL(sc->dwlpx_nhpc) + ls),
    209  1.14   mjacob 			    sizeof (ctl)) != 0) {
    210  1.14   mjacob 				break;
    211  1.14   mjacob 			}
    212  1.14   mjacob 		}
    213  1.14   mjacob 		if (sc->dwlpx_nhpc != NHPC) {
    214  1.14   mjacob 			/* clear (potential) Illegal CSR Address Error */
    215  1.14   mjacob 			REGVAL(PCIA_ERR(0) + DWLPX_SYSBASE(sc)) =
    216  1.14   mjacob 				PCIA_ERR_ALLERR;
    217  1.14   mjacob 		}
    218  1.14   mjacob 
    219  1.10  thorpej 		dwlpx_bus_io_init(&ccp->cc_iot, ccp);
    220  1.10  thorpej 		dwlpx_bus_mem_init(&ccp->cc_memt, ccp);
    221   1.1      cgd 	}
    222   1.1      cgd 	dwlpx_pci_init(&ccp->cc_pc, ccp);
    223   1.1      cgd 	ccp->cc_sc = sc;
    224   1.1      cgd 
    225   1.1      cgd 	/*
    226   1.1      cgd 	 * Establish a precalculated base for convenience's sake.
    227   1.1      cgd 	 */
    228  1.14   mjacob 	ccp->cc_sysbase = ls;
    229   1.1      cgd 
    230   1.1      cgd 	/*
    231   1.6  thorpej 	 * Set up DMA stuff for this DWLPX.
    232   1.1      cgd 	 */
    233   1.6  thorpej 	dwlpx_dma_init(ccp);
    234   1.1      cgd 
    235   1.1      cgd 	/*
    236  1.14   mjacob 	 * If there are only 2 HPCs, then the 'present' register is not
    237  1.14   mjacob 	 * implemented, so there will only ever be 32K SG entries. Otherwise
    238  1.14   mjacob 	 * any revision greater than zero will have 128K entries.
    239  1.14   mjacob 	 */
    240  1.14   mjacob 	ctl = REGVAL(PCIA_PRESENT + ccp->cc_sysbase);
    241  1.14   mjacob 	if (sc->dwlpx_nhpc == 2) {
    242  1.14   mjacob 		sc->dwlpx_sgmapsz = DWLPX_SG32K;
    243  1.14   mjacob #if	0
    244  1.14   mjacob 	/*
    245  1.14   mjacob 	 * As of 2/25/98- When I enable SG128K, and then have to flip
    246  1.14   mjacob 	 * TBIT below, I get bad SGRAM errors. We'll fix this later
    247  1.14   mjacob 	 * if this gets important.
    248  1.14   mjacob 	 */
    249  1.14   mjacob 	} else if ((ctl >> PCIA_PRESENT_REVSHIFT) & PCIA_PRESENT_REVMASK) {
    250  1.14   mjacob 		sc->dwlpx_sgmapsz = DWLPX_SG128K;
    251  1.14   mjacob #endif
    252  1.14   mjacob 	} else {
    253  1.14   mjacob 		sc->dwlpx_sgmapsz = DWLPX_SG32K;
    254  1.14   mjacob 	}
    255  1.14   mjacob 
    256  1.14   mjacob 	/*
    257   1.1      cgd 	 * Set up interrupt stuff for this DWLPX.
    258   1.1      cgd 	 *
    259   1.1      cgd 	 * Note that all PCI interrupt pins are disabled at this time.
    260   1.1      cgd 	 *
    261   1.1      cgd 	 * Do this even for all HPCs- even for the nonexistent
    262   1.1      cgd 	 * one on hose zero of a KFTIA.
    263   1.1      cgd 	 */
    264   1.1      cgd 	for (i = 0; i < NHPC; i++) {
    265   1.1      cgd 		REGVAL(PCIA_IMASK(i) + ccp->cc_sysbase) = DWLPX_IMASK_DFLT;
    266   1.1      cgd 		REGVAL(PCIA_ERRVEC(i) + ccp->cc_sysbase) =
    267   1.1      cgd 		    DWLPX_ERRVEC((sc->dwlpx_node - 4), sc->dwlpx_hosenum);
    268   1.1      cgd 	}
    269   1.1      cgd 	for (i = 0; i < DWLPX_MAXDEV; i++) {
    270   1.1      cgd 		u_int16_t vec;
    271   1.1      cgd 		int ss, hpc;
    272   1.1      cgd 
    273   1.1      cgd 		vec = DWLPX_MVEC((sc->dwlpx_node - 4), sc->dwlpx_hosenum, i);
    274   1.1      cgd 		ss = i;
    275   1.1      cgd 		if (i < 4) {
    276   1.1      cgd 			hpc = 0;
    277   1.1      cgd 		} else if (i < 8) {
    278   1.1      cgd 			ss -= 4;
    279   1.1      cgd 			hpc = 1;
    280   1.1      cgd 		} else {
    281   1.1      cgd 			ss -= 8;
    282   1.1      cgd 			hpc = 2;
    283   1.1      cgd 		}
    284   1.1      cgd 		REGVAL(PCIA_DEVVEC(hpc, ss, 1) + ccp->cc_sysbase) = vec;
    285   1.1      cgd 		REGVAL(PCIA_DEVVEC(hpc, ss, 2) + ccp->cc_sysbase) = vec;
    286   1.1      cgd 		REGVAL(PCIA_DEVVEC(hpc, ss, 3) + ccp->cc_sysbase) = vec;
    287   1.1      cgd 		REGVAL(PCIA_DEVVEC(hpc, ss, 4) + ccp->cc_sysbase) = vec;
    288   1.1      cgd 	}
    289   1.1      cgd 	/*
    290   1.1      cgd 	 * Establish HAE values, as well as make sure of sanity elsewhere.
    291   1.1      cgd 	 */
    292   1.1      cgd 	for (i = 0; i < sc->dwlpx_nhpc; i++) {
    293  1.14   mjacob 		ctl = REGVAL(PCIA_CTL(i) + ccp->cc_sysbase);
    294   1.1      cgd 		ctl &= 0x0fffffff;
    295   1.9   mjacob 		ctl &= ~(PCIA_CTL_MHAE(0x1f) | PCIA_CTL_IHAE(0x1f));
    296   1.9   mjacob 		/*
    297   1.9   mjacob 		 * I originally also had it or'ing in 3, which makes no sense.
    298   1.9   mjacob 		 */
    299   1.9   mjacob 
    300   1.9   mjacob 		ctl |= PCIA_CTL_RMMENA | PCIA_CTL_RMMARB;
    301   1.9   mjacob 
    302   1.9   mjacob 		/*
    303   1.9   mjacob 		 * Only valid if we're attached to a KFTIA or a KTHA.
    304   1.9   mjacob 		 */
    305   1.9   mjacob 		ctl |= PCIA_CTL_3UP;
    306   1.9   mjacob 
    307   1.9   mjacob 		ctl |= PCIA_CTL_CUTENA;
    308   1.9   mjacob 
    309  1.14   mjacob 		/*
    310  1.14   mjacob 		 * Fit in appropriate S/G Map Ram size.
    311  1.14   mjacob 		 */
    312  1.14   mjacob 		if (sc->dwlpx_sgmapsz == DWLPX_SG32K)
    313  1.14   mjacob 			ctl |= PCIA_CTL_SG32K;
    314  1.14   mjacob 		else if (sc->dwlpx_sgmapsz == DWLPX_SG128K)
    315  1.14   mjacob 			ctl |= PCIA_CTL_SG128K;
    316  1.14   mjacob 		else
    317  1.14   mjacob 			ctl |= PCIA_CTL_SG32K;
    318  1.14   mjacob 
    319   1.1      cgd 		REGVAL(PCIA_CTL(i) + ccp->cc_sysbase) = ctl;
    320   1.1      cgd 	}
    321  1.14   mjacob 	/*
    322  1.14   mjacob 	 * Enable TBIT if required
    323  1.14   mjacob 	 */
    324  1.14   mjacob 	if (sc->dwlpx_sgmapsz == DWLPX_SG128K)
    325  1.14   mjacob 		REGVAL(PCIA_TBIT + ccp->cc_sysbase) = 1;
    326  1.14   mjacob 	alpha_mb();
    327   1.1      cgd 	ccp->cc_initted = 1;
    328  1.14   mjacob }
    329  1.14   mjacob 
    330  1.14   mjacob void
    331  1.14   mjacob dwlpx_iointr(framep, vec)
    332  1.14   mjacob 	void *framep;
    333  1.14   mjacob 	unsigned long vec;
    334  1.14   mjacob {
    335  1.14   mjacob 	struct dwlpx_softc *sc;
    336  1.14   mjacob 	struct dwlpx_config *ccp;
    337  1.14   mjacob 	int ionode, hosenum, i;
    338  1.14   mjacob 	struct {
    339  1.14   mjacob 		u_int32_t err;
    340  1.14   mjacob 		u_int32_t addr;
    341  1.14   mjacob 	} hpcs[NHPC];
    342  1.14   mjacob 
    343  1.14   mjacob 	ionode = (vec >> 8) & 0xf;
    344  1.14   mjacob 	hosenum = (vec >> 4) & 0x7;
    345  1.14   mjacob 	if (ionode >= DWLPX_NIONODE || hosenum >= DWLPX_NHOSE) {
    346  1.14   mjacob 		panic("dwlpx_iointr: mangled vector %x", vec);
    347  1.14   mjacob 		/* NOTREACHED */
    348  1.14   mjacob 	}
    349  1.14   mjacob 	sc = dwlps[ionode][hosenum];
    350  1.14   mjacob 	ccp = &sc->dwlpx_cc;
    351  1.14   mjacob 	for (i = 0; i < sc->dwlpx_nhpc; i++) {
    352  1.14   mjacob 		hpcs[i].err = REGVAL(PCIA_ERR(i) + ccp->cc_sysbase);
    353  1.14   mjacob 		hpcs[i].addr = REGVAL(PCIA_FADR(i) + ccp->cc_sysbase);
    354  1.14   mjacob 	}
    355  1.14   mjacob 	printf("%s: node %d hose %d error interrupt\n",
    356  1.14   mjacob 		sc->dwlpx_dev.dv_xname, ionode + 4, hosenum);
    357  1.14   mjacob 
    358  1.14   mjacob 	for (i = 0; i < sc->dwlpx_nhpc; i++) {
    359  1.14   mjacob 		if ((hpcs[i].err & PCIA_ERR_ERROR) == 0)
    360  1.14   mjacob 			continue;
    361  1.14   mjacob 		printf("\tHPC %d: ERR=0x%08x; DMA %s Memory, "
    362  1.14   mjacob 			"Failing Address 0x%x\n",
    363  1.14   mjacob 			i, hpcs[i].err, hpcs[i].addr & 0x1? "write to" :
    364  1.14   mjacob 			"read from", hpcs[i].addr & ~3);
    365  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_SERR_L)
    366  1.14   mjacob 			printf("\t       PCI device asserted SERR_L\n");
    367  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_ILAT)
    368  1.14   mjacob 			printf("\t       Incremental Latency Exceeded\n");
    369  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_SGPRTY)
    370  1.14   mjacob 			printf("\t       CPU access of SG RAM Parity Error\n");
    371  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_ILLCSR)
    372  1.14   mjacob 			printf("\t       Illegal CSR Address Error\n");
    373  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_PCINXM)
    374  1.14   mjacob 			printf("\t       Nonexistent PCI Address Error\n");
    375  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_DSCERR)
    376  1.14   mjacob 			printf("\t       PCI Target Disconnect Error\n");
    377  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_ABRT)
    378  1.14   mjacob 			printf("\t       PCI Target Abort Error\n");
    379  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_WPRTY)
    380  1.14   mjacob 			printf("\t       PCI Write Parity Error\n");
    381  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_DPERR)
    382  1.14   mjacob 			printf("\t       PCI Data Parity Error\n");
    383  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_APERR)
    384  1.14   mjacob 			printf("\t       PCI Address Parity Error\n");
    385  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_DFLT)
    386  1.14   mjacob 			printf("\t       SG Map RAM Invalid Entry Error\n");
    387  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_DPRTY)
    388  1.14   mjacob 			printf("\t       DMA access of SG RAM Parity Error\n");
    389  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_DRPERR)
    390  1.14   mjacob 			printf("\t       DMA Read Return Parity Error\n");
    391  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_MABRT)
    392  1.14   mjacob 			printf("\t       PCI Master Abort Error\n");
    393  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_CPRTY)
    394  1.14   mjacob 			printf("\t       CSR Parity Error\n");
    395  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_COVR)
    396  1.14   mjacob 			printf("\t       CSR Overrun Error\n");
    397  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_MBPERR)
    398  1.14   mjacob 			printf("\t       Mailbox Parity Error\n");
    399  1.14   mjacob 		if (hpcs[i].err & PCIA_ERR_MBILI)
    400  1.14   mjacob 			printf("\t       Mailbox Illegal Length Error\n");
    401  1.14   mjacob 		REGVAL(PCIA_ERR(i) + ccp->cc_sysbase) = hpcs[i].err;
    402  1.14   mjacob 	}
    403   1.1      cgd }
    404