Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/sys/arch/sparc64/dev Pullup rev 1.47 (requested by petr...
details: https://anonhg.NetBSD.org/src/rev/19807e9ee60f
branches: netbsd-2-0
changeset: 561357:19807e9ee60f
user: jmc <jmc%NetBSD.org@localhost>
date: Mon Jun 14 04:14:38 2004 +0000
description:
Pullup rev 1.47 (requested by petrov in ticket #469)
pci_find_ino: support pci-pci bridges.
diffstat:
sys/arch/sparc64/dev/pci_machdep.c | 43 ++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 18 deletions(-)
diffs (80 lines):
diff -r 4bb0bb8d5bfc -r 19807e9ee60f sys/arch/sparc64/dev/pci_machdep.c
--- a/sys/arch/sparc64/dev/pci_machdep.c Mon Jun 14 04:08:48 2004 +0000
+++ b/sys/arch/sparc64/dev/pci_machdep.c Mon Jun 14 04:14:38 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.c,v 1.45.2.1 2004/04/05 20:48:47 tron Exp $ */
+/* $NetBSD: pci_machdep.c,v 1.45.2.2 2004/06/14 04:14:38 jmc Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.45.2.1 2004/04/05 20:48:47 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.45.2.2 2004/06/14 04:14:38 jmc Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -62,7 +62,6 @@
#define SPDB_CONF 0x01
#define SPDB_INTR 0x04
#define SPDB_INTMAP 0x08
-#define SPDB_INTFIX 0x10
#define SPDB_PROBE 0x20
int sparc_pci_debug = 0x0;
#define DPRINTF(l, s) do { if (sparc_pci_debug & l) printf s; } while (0)
@@ -444,30 +443,38 @@
u_int dev;
u_int ino;
+ DPRINTF(SPDB_INTMAP, ("pci_find_ino: pa_tag: node %x, %d:%d:%d\n",
+ PCITAG_NODE(pa->pa_tag), (int)PCITAG_BUS(pa->pa_tag),
+ (int)PCITAG_DEV(pa->pa_tag),
+ (int)PCITAG_FUN(pa->pa_tag)));
+ DPRINTF(SPDB_INTMAP,
+ ("pci_find_ino: intrswiz %d, intrpin %d, intrline %d, rawintrpin %d\n",
+ pa->pa_intrswiz, pa->pa_intrpin, pa->pa_intrline, pa->pa_rawintrpin));
+ DPRINTF(SPDB_INTMAP, ("pci_find_ino: pa_intrtag: node %x, %d:%d:%d\n",
+ PCITAG_NODE(pa->pa_intrtag),
+ (int)PCITAG_BUS(pa->pa_intrtag),
+ (int)PCITAG_DEV(pa->pa_intrtag),
+ (int)PCITAG_FUN(pa->pa_intrtag)));
+
ino = *ihp;
if ((ino & ~INTMAP_PCIINT) == 0) {
+ if (pa->pa_intrswiz != 0 && PCITAG_NODE(pa->pa_intrtag) != 0)
+ dev = PCITAG_DEV(pa->pa_intrtag);
+ else
+ dev = pa->pa_device;
+
if (sc->sc_mode == PSYCHO_MODE_PSYCHO &&
pp->pp_id == PSYCHO_PBM_B)
- dev = pa->pa_device - 2;
+ dev -= 2;
else
- dev = pa->pa_device - 1;
-
- DPRINTF(SPDB_CONF, ("pci_find_ino: mode %d, pbm %d, dev %d\n",
- sc->sc_mode, pp->pp_id, dev));
+ dev--;
- if (ino == 0 || ino > 4) {
- u_int32_t intreg;
+ DPRINTF(SPDB_INTMAP, ("pci_find_ino: mode %d, pbm %d, dev %d, ino %d\n",
+ sc->sc_mode, pp->pp_id, dev, ino));
- intreg = pci_conf_read(pa->pa_pc, pa->pa_tag,
- PCI_INTERRUPT_REG);
-
- ino = PCI_INTERRUPT_PIN(intreg) - 1;
- } else
- ino -= 1;
-
- ino &= INTMAP_PCIINT;
+ ino = (pa->pa_intrpin - 1) & INTMAP_PCIINT;
ino |= sc->sc_ign;
ino |= ((pp->pp_id == PSYCHO_PBM_B) ? INTMAP_PCIBUS : 0);
Home |
Main Index |
Thread Index |
Old Index