Apparently, new AlphaStation 500/600 firmware has the same problem with

PCI master aborts as eb164 firmware, so use the same workaround mechanism
on all system types (clear error register's master abort bit, and check
it after accessing configuration space), not just eb164's.

This also fixes a bug on eb164's - when making the Alpha port compile
again, I made an error that caused this to not be used on eb164 systems,
either.  Thanks to Matt Jacob for pointing out this goof.
This commit is contained in:
thorpej 1997-09-13 05:58:07 +00:00
parent f762783999
commit f784e8dc15
1 changed files with 17 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cia_pci.c,v 1.13 1997/09/02 20:05:28 thorpej Exp $ */
/* $NetBSD: cia_pci.c,v 1.14 1997/09/13 05:58:07 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.13 1997/09/02 20:05:28 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: cia_pci.c,v 1.14 1997/09/13 05:58:07 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -118,34 +118,27 @@ cia_conf_read(cpv, tag, offset)
pcireg_t *datap, data;
int s, secondary, ba;
int32_t old_haxr2; /* XXX */
#ifdef DEC_EB164
extern int cputype; /* XXX */
#endif
#ifdef DIAGNOSTIC
s = 0; /* XXX gcc -Wuninitialized */
old_haxr2 = 0; /* XXX gcc -Wuninitialized */
#endif
#ifdef DEC_EB164
/*
* Some (apparently-common) revisions of EB164 firmware do the
* Wrong thing with PCI master aborts, which are caused by
* accesing the configuration space of devices that don't
* exist (for example).
* Some (apparently-common) revisions of EB164 and AlphaStation
* firmware do the Wrong thing with PCI master aborts, which are
* caused by accesing the configuration space of devices that
* don't exist (for example).
*
* On EB164's we clear the CIA error register's PCI master
* abort bit before touching PCI configuration space and
* To work around this, we clear the CIA error register's PCI
* master abort bit before touching PCI configuration space and
* check it afterwards. If it indicates a master abort,
* the device wasn't there so we return 0xffffffff.
*/
if (cputype == ST_EB164) {
/* clear the PCI master abort bit in CIA error register */
REGVAL(CIA_CSR_CIA_ERR) = 0x00000080; /* XXX */
alpha_mb();
alpha_pal_draina();
}
#endif
/* clear the PCI master abort bit in CIA error register */
REGVAL(CIA_CSR_CIA_ERR) = 0x00000080; /* XXX */
alpha_mb();
alpha_pal_draina();
/* secondary if bus # != 0 */
alpha_pci_decompose_tag(&ccp->cc_pc, tag, &secondary, 0, 0);
@ -173,16 +166,12 @@ cia_conf_read(cpv, tag, offset)
splx(s);
}
#ifdef DEC_EB164
if (cputype == ST_EB164) {
alpha_pal_draina();
/* check CIA error register for PCI master abort */
if (REGVAL(CIA_CSR_CIA_ERR) & 0x00000080) { /* XXX */
ba = 1;
data = 0xffffffff;
}
alpha_pal_draina();
/* check CIA error register for PCI master abort */
if (REGVAL(CIA_CSR_CIA_ERR) & 0x00000080) { /* XXX */
ba = 1;
data = 0xffffffff;
}
#endif
#if 0
printf("cia_conf_read: tag 0x%lx, reg 0x%lx -> %x @ %p%s\n", tag, reg,