Subject: Re: sparc64 PCI issues.
To: None <tech-kern@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 05/15/2002 14:48:35
--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, May 14, 2002 at 04:13:37PM -0700, Jason R Thorpe wrote:

 > I suppose a "pcitag_t *pa_bridgetag" member could be added to pci_attach_args.
 > If non-NULL, it points to the tag for the bridge that is the PCI's parent,
 > and it would obviously be NULL for the root bus.
 > 
 > I'd like to get comments from other people on that, though.

Ok, so as some of you may have notices, I went ahead and did a bunch
of this.  The code that splits bus enumeration from device probing is
checked in, and machine-dependent code can specify the enumeration
routine to use.

The last 2 steps are:

	* The "bridgetag" thing.

	* Make the sparc64 port use it, and garbage-collect ofpci/ofppb.

The changes that implement these last two steps are attached.  It works
on my CP1500:

console is /pci@1f,0/pci@1,1/ebus@1/su@14,3803f8
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.5ZC (SHAG-CP1500) #9: Wed May 15 14:11:24 PDT 2002
    thorpej@yeah-baby.shagadelic.org:/u1/netbsd/src/sys/arch/sparc64/compile/SHAG-CP1500
total memory = 65536 KB
avail memory = 52840 KB
using 422 buffers containing 3376 KB of memory
bootpath: /pci@1f,0/pci@1,1/network@1,1
mainbus0 (root): SUNW,UltraSPARC-IIi-cEngine
cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 333.016 MHz, version 0 FPU
cpu0: physical 32K instruction (32 b/l), 16K data (32 b/l), 1024K external (64 b/l)
psycho0 at mainbus0 addr 0xfffc0000
SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 3; PCI bus 0
DVMA map: c0000000 to e0000000
IOTSB: 502000 to 582000
pci0 at psycho0
pci0: i/o space, memory space enabled
ppb0 at pci0 dev 1 function 1: Sun Microsystems Simba PCI bridge (rev. 0x11)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
ebus0 at pci1 dev 1 function 0
ebus0: Sun Microsystems PCIO Ebus2, revision 0x01
auxio0 at ebus0 addr 726000-726003, 728000-728003, 72a000-72a003, 72c000-72c003, 72f000-72f003
power at ebus0 addr 724000-724003 ipl 37 not configured
SUNW,pll at ebus0 addr 504000-504002 not configured
com0 at ebus0 addr 3803f8-3803ff ipl 28: ns16550a, working fifo
com0: console
com1 at ebus0 addr 3602f8-3602ff ipl 20: ns16550a, working fifo
lpt0 at ebus0 addr 340278-340287, 30015c-30015d, 700000-70000f ipl 34
fdthree at ebus0 addr 3203f0-3203f7, 706000-70600f, 720000-720003 ipl 39 not configured
clock0 at ebus0 addr 0-1fff: mk48t59: hostid 809f1c9a
flashprom at ebus0 addr 400000-5fffff not configured
flashprom at ebus0 addr 800000-9fffff not configured
flashprom at ebus0 addr 0-fffff not configured
watchdog at ebus0 addr 200000-20003f ipl 4 not configured
display7seg at ebus0 addr 200040-200040 not configured
beeper at ebus0 addr 722000-722003 not configured
i2c at ebus0 addr 600000-600003 ipl 40 not configured
hme0 at pci1 dev 1 function 1: Sun Happy Meal Ethernet, rev. 1
hme0: interrupting at ivec 3021
hme0: Ethernet address 08:00:20:9f:1c:9a
nsphy0 at hme0 phy 1: DP83840 10/100 media interface, rev. 1
nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
siop0 at pci1 dev 2 function 0: Symbios Logic 53c875 (ultra-wide scsi)
siop0: using on-board RAM
siop0: interrupting at ivec 20
scsibus0 at siop0: 16 targets, 8 luns per target
ppb1 at pci0 dev 1 function 0: Sun Microsystems Simba PCI bridge (rev. 0x11)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
ppb2 at pci2 dev 1 function 0: Digital Equipment DECchip 21150 PCI-PCI Bridge (rev. 0x04)
pci3 at ppb2 bus 3
pci3: i/o space, memory space enabled
pcons at mainbus0 not configured
No counter-timer -- using %tick at 333MHz as system clock.
scsibus0: waiting 2 seconds for devices to settle...
IPsec: Initialized Security Association Processing.
root on hme0
nfs_boot: trying RARP (and RPC/bootparam)
nfs_boot: client_addr=192.168.2.3 (RARP from 192.168.2.1)
nfs_boot: server_addr=192.168.2.1
nfs_boot: hostname=cp1500-1.fast-100.shagadelic.org
nfs_boot: timeout...
nfs_boot: timeout...
nfs_boot: timeout...
root on gw-fast-100.fast-100.shagadelic.org:/u1/diskless/cp1500-1
root file system type: nfs

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=pci-patch

Index: dev/cardbus/rbus_ppb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/cardbus/rbus_ppb.c,v
retrieving revision 1.2
diff -u -r1.2 rbus_ppb.c
--- dev/cardbus/rbus_ppb.c	2001/11/13 12:51:13	1.2
+++ dev/cardbus/rbus_ppb.c	2002/05/15 21:46:56
@@ -125,6 +125,7 @@
 
 struct ppb_cardbus_softc {
   struct device sc_dev;
+  pcitag_t sc_tag;
   int foo;
 };
 
@@ -704,6 +705,8 @@
 	pci_devinfo(ca->ca_id, ca->ca_class, 0, devinfo);
 	printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(ca->ca_class));
 
+	sc->sc_tag = ca->ca_tag;	/* XXX cardbustag_t == pcitag_t */
+
 	busdata = cardbus_conf_read(cc, cf, ca->ca_tag, PPB_REG_BUSINFO);
 	minbus = pcibios_max_bus;
 
@@ -777,6 +780,7 @@
 	pba.pba_pc   = psc->sc_pc;
 	pba.pba_flags    = PCI_FLAGS_IO_ENABLED|PCI_FLAGS_MEM_ENABLED;
 	pba.pba_bus      = PPB_BUSINFO_SECONDARY(busdata);
+	pba.pba_bridgetag = &sc->sc_tag;
 	/*pba.pba_intrswiz = parent_sc->sc_intrswiz; */
 	pba.pba_intrtag  = psc->sc_pa.pa_intrtag;
Index: dev/pci/pci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pci.c,v
retrieving revision 1.61
diff -u -r1.61 pci.c
--- dev/pci/pci.c	2002/05/15 19:23:51	1.61
+++ dev/pci/pci.c	2002/05/15 21:21:19
@@ -170,6 +170,7 @@
 	sc->sc_dmat = pba->pba_dmat;
 	sc->sc_pc = pba->pba_pc;
 	sc->sc_bus = pba->pba_bus;
+	sc->sc_bridgetag = pba->pba_bridgetag;
 	sc->sc_maxndevs = pci_bus_maxdevs(pba->pba_pc, pba->pba_bus);
 	sc->sc_intrswiz = pba->pba_intrswiz;
 	sc->sc_intrtag = pba->pba_intrtag;
Index: dev/pci/pcivar.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pcivar.h,v
retrieving revision 1.49
diff -u -r1.49 pcivar.h
--- dev/pci/pcivar.h	2002/05/15 18:13:01	1.49
+++ dev/pci/pcivar.h	2002/05/15 21:21:19
@@ -50,6 +50,7 @@
  */
 typedef u_int32_t pcireg_t;		/* configuration space register XXX */
 struct pcibus_attach_args;
+struct pci_softc;
 
 #ifdef _KERNEL
 /*
@@ -71,6 +72,12 @@
 	int		pba_bus;	/* PCI bus number */
 
 	/*
+	 * Pointer to the pcitag of our parent bridge.  If there is no
+	 * parent bridge, then we assume we are a root bus.
+	 */
+	pcitag_t	*pba_bridgetag;
+
+	/*
 	 * Interrupt swizzling information.  These fields
 	 * are only used by secondary busses.
 	 */
@@ -143,6 +150,7 @@
 	bus_dma_tag_t sc_dmat; 
 	pci_chipset_tag_t sc_pc; 
 	int sc_bus, sc_maxndevs;
+	pcitag_t *sc_bridgetag;
 	u_int sc_intrswiz;
 	pcitag_t sc_intrtag;
 	int sc_flags;
Index: dev/pci/ppb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/ppb.c,v
retrieving revision 1.20
diff -u -r1.20 ppb.c
--- dev/pci/ppb.c	2001/11/13 07:48:48	1.20
+++ dev/pci/ppb.c	2002/05/15 21:21:19
@@ -42,11 +42,17 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/ppbreg.h>
 
+struct ppb_softc {
+	struct device sc_dev;		/* generic device glue */
+	pci_chipset_tag_t sc_pc;	/* our PCI chipset... */
+	pcitag_t sc_tag;		/* ...and tag. */
+};
+
 int	ppbmatch __P((struct device *, struct cfdata *, void *));
 void	ppbattach __P((struct device *, struct device *, void *));
 
 struct cfattach ppb_ca = {
-	sizeof(struct device), ppbmatch, ppbattach
+	sizeof(struct ppb_softc), ppbmatch, ppbattach
 };
 
 int	ppbprint __P((void *, const char *pnp));
@@ -76,6 +82,7 @@
 	struct device *parent, *self;
 	void *aux;
 {
+	struct ppb_softc *sc = (void *) self;
 	struct pci_attach_args *pa = aux;
 	pci_chipset_tag_t pc = pa->pa_pc;
 	struct pcibus_attach_args pba;
@@ -85,6 +92,9 @@
 	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
 	printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
 
+	sc->sc_pc = pc;
+	sc->sc_tag = pa->pa_tag;
+
 	busdata = pci_conf_read(pc, pa->pa_tag, PPB_REG_BUSINFO);
 
 	if (PPB_BUSINFO_SECONDARY(busdata) == 0) {
@@ -118,6 +128,7 @@
 	pba.pba_pc = pc;
 	pba.pba_flags = pa->pa_flags & ~PCI_FLAGS_MRM_OKAY;
 	pba.pba_bus = PPB_BUSINFO_SECONDARY(busdata);
+	pba.pba_bridgetag = &sc->sc_tag;
 	pba.pba_intrswiz = pa->pa_intrswiz;
 	pba.pba_intrtag = pa->pa_intrtag;
 
Index: arch/algor/dev/bonito_mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/algor/dev/bonito_mainbus.c,v
retrieving revision 1.1
diff -u -r1.1 bonito_mainbus.c
--- arch/algor/dev/bonito_mainbus.c	2001/06/25 20:15:57	1.1
+++ arch/algor/dev/bonito_mainbus.c	2002/05/15 21:21:22
@@ -105,6 +105,7 @@
 	pba.pba_busname = "pci";
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 
 #if defined(ALGOR_P6032)
 	    {
Index: arch/algor/dev/vtpbc_mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/algor/dev/vtpbc_mainbus.c,v
retrieving revision 1.5
diff -u -r1.5 vtpbc_mainbus.c
--- arch/algor/dev/vtpbc_mainbus.c	2001/06/22 03:45:24	1.5
+++ arch/algor/dev/vtpbc_mainbus.c	2002/05/15 21:21:22
@@ -110,6 +110,7 @@
 	pba.pba_busname = "pci";
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 
 	if (vt->vt_pci_iobase == (bus_addr_t) -1)
 		pba.pba_flags &= ~PCI_FLAGS_IO_ENABLED;
Index: arch/alpha/pci/a12c.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/a12c.c,v
retrieving revision 1.9
diff -u -r1.9 a12c.c
--- arch/alpha/pci/a12c.c	2001/07/12 23:25:40	1.9
+++ arch/alpha/pci/a12c.c	2002/05/15 21:21:24
@@ -157,6 +157,7 @@
 	pba.pba_dmat = &ccp->ac_dmat_direct;
 	pba.pba_pc = &ccp->ac_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
Index: arch/alpha/pci/apecs.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/apecs.c,v
retrieving revision 1.38
diff -u -r1.38 apecs.c
--- arch/alpha/pci/apecs.c	2000/06/29 08:58:45	1.38
+++ arch/alpha/pci/apecs.c	2002/05/15 21:21:25
@@ -248,6 +248,7 @@
 	    alphabus_dma_get_tag(&acp->ac_dmat_direct, ALPHA_BUS_PCI);
 	pba.pba_pc = &acp->ac_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	config_found(self, &pba, apecsprint);
Index: arch/alpha/pci/cia.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/cia.c,v
retrieving revision 1.57
diff -u -r1.57 cia.c
--- arch/alpha/pci/cia.c	2001/04/26 03:10:46	1.57
+++ arch/alpha/pci/cia.c	2002/05/15 21:21:26
@@ -418,6 +418,7 @@
 	    alphabus_dma_get_tag(&ccp->cc_dmat_direct, ALPHA_BUS_PCI);
 	pba.pba_pc = &ccp->cc_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	if ((ccp->cc_flags & CCF_PYXISBUG) == 0)
 		pba.pba_flags |= PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY |
Index: arch/alpha/pci/dwlpx.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/dwlpx.c,v
retrieving revision 1.23
diff -u -r1.23 dwlpx.c
--- arch/alpha/pci/dwlpx.c	2001/07/27 00:25:20	1.23
+++ arch/alpha/pci/dwlpx.c	2002/05/15 21:21:27
@@ -174,6 +174,7 @@
 	    alphabus_dma_get_tag(&sc->dwlpx_cc.cc_dmat_direct, ALPHA_BUS_PCI);
 	pba.pba_pc = &sc->dwlpx_cc.cc_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	config_found(self, &pba, dwlpxprint);
Index: arch/alpha/pci/irongate.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/irongate.c,v
retrieving revision 1.6
diff -u -r1.6 irongate.c
--- arch/alpha/pci/irongate.c	2001/10/06 02:51:42	1.6
+++ arch/alpha/pci/irongate.c	2002/05/15 21:21:28
@@ -186,6 +186,7 @@
 	    alphabus_dma_get_tag(&icp->ic_dmat_pci, ALPHA_BUS_PCI);
 	pba.pba_pc = &icp->ic_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
Index: arch/alpha/pci/lca.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/lca.c,v
retrieving revision 1.36
diff -u -r1.36 lca.c
--- arch/alpha/pci/lca.c	2000/06/29 08:58:47	1.36
+++ arch/alpha/pci/lca.c	2002/05/15 21:21:28
@@ -252,6 +252,7 @@
 	    alphabus_dma_get_tag(&lcp->lc_dmat_direct, ALPHA_BUS_PCI);
 	pba.pba_pc = &lcp->lc_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	config_found(self, &pba, lcaprint);
Index: arch/alpha/pci/mcpcia.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/mcpcia.c,v
retrieving revision 1.12
diff -u -r1.12 mcpcia.c
--- arch/alpha/pci/mcpcia.c	2001/05/02 01:24:30	1.12
+++ arch/alpha/pci/mcpcia.c	2002/05/15 21:21:29
@@ -215,6 +215,7 @@
 	    alphabus_dma_get_tag(&ccp->cc_dmat_direct, ALPHA_BUS_PCI);
 	pba.pba_pc = &ccp->cc_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	(void) config_found(self, &pba, mcpciaprint);
Index: arch/alpha/pci/tsc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/tsc.c,v
retrieving revision 1.6
diff -u -r1.6 tsc.c
--- arch/alpha/pci/tsc.c	2001/07/12 23:25:40	1.6
+++ arch/alpha/pci/tsc.c	2002/05/15 21:21:29
@@ -199,6 +199,7 @@
 	    alphabus_dma_get_tag(&pcp->pc_dmat_direct, ALPHA_BUS_PCI);
 	pba.pba_pc = &pcp->pc_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	config_found(self, &pba, tspprint);
Index: arch/alpha/pci/ttwoga.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/ttwoga.c,v
retrieving revision 1.1
diff -u -r1.1 ttwoga.c
--- arch/alpha/pci/ttwoga.c	2000/12/21 20:51:54	1.1
+++ arch/alpha/pci/ttwoga.c	2002/05/15 21:21:29
@@ -268,6 +268,7 @@
 	    alphabus_dma_get_tag(&tcp->tc_dmat_direct, ALPHA_BUS_PCI);
 	npba.pba_pc = &tcp->tc_pc;
 	npba.pba_bus = 0;
+	npba.pba_bridgetag = NULL;
 	npba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 
 	/*
Index: arch/arc/pci/necpb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arc/pci/necpb.c,v
retrieving revision 1.10
diff -u -r1.10 necpb.c
--- arch/arc/pci/necpb.c	2002/05/15 17:15:18	1.10
+++ arch/arc/pci/necpb.c	2002/05/15 21:21:33
@@ -244,6 +244,7 @@
 	pba.pba_pc = &sc->sc_ncp->nc_pc;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 
 	config_found(self, &pba, necpbprint);
 }
Index: arch/arm/footbridge/footbridge.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm/footbridge/footbridge.c,v
retrieving revision 1.6
diff -u -r1.6 footbridge.c
--- arch/arm/footbridge/footbridge.c	2002/05/04 10:04:42	1.6
+++ arch/arm/footbridge/footbridge.c	2002/05/15 21:21:43
@@ -213,6 +213,7 @@
 	fba.fba_pba.pba_dmat = &footbridge_pci_bus_dma_tag;
 	fba.fba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	fba.fba_pba.pba_bus = 0;
+	fba.fba_pba.pba_bridgetag = NULL;
 	config_found(self, &fba.fba_pba, footbridge_print);
 
 	/* Attach a time-of-day clock device */
Index: arch/arm/xscale/i80312.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm/xscale/i80312.c,v
retrieving revision 1.8
diff -u -r1.8 i80312.c
--- arch/arm/xscale/i80312.c	2002/02/14 02:38:22	1.8
+++ arch/arm/xscale/i80312.c	2002/05/15 21:21:44
@@ -273,6 +273,7 @@
 	pba.pba_dmat = &sc->sc_pci_dmat;
 	pba.pba_pc = &sc->sc_pci_chipset;
 	pba.pba_bus = PPB_BUSINFO_SECONDARY(preg);
+	pba.pba_bridgetag = NULL;
 	pba.pba_intrswiz = 3;
 	pba.pba_intrtag = 0;
 	/* XXX MRL/MRM/MWI seem to have problems, at the moment. */
Index: arch/arm/xscale/i80321.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm/xscale/i80321.c,v
retrieving revision 1.1
diff -u -r1.1 i80321.c
--- arch/arm/xscale/i80321.c	2002/03/27 21:45:47	1.1
+++ arch/arm/xscale/i80321.c	2002/05/15 21:21:45
@@ -201,6 +214,7 @@
 	pba.pba_dmat = &sc->sc_pci_dmat;
 	pba.pba_pc = &sc->sc_pci_chipset;
 	pba.pba_bus = preg;
+	pba.pba_bridgetag = NULL;
 	pba.pba_intrswiz = 0;	/* XXX what if busno != 0? */
 	pba.pba_intrtag = 0;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
Index: arch/atari/pci/pci_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/atari/pci/pci_machdep.c,v
retrieving revision 1.34
diff -u -r1.34 pci_machdep.c
--- arch/atari/pci/pci_machdep.c	2002/05/15 17:30:04	1.34
+++ arch/atari/pci/pci_machdep.c	2002/05/15 21:21:48
@@ -171,6 +171,7 @@
 	pba.pba_busname = "pci";
 	pba.pba_pc      = NULL;
 	pba.pba_bus     = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags	= PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pba.pba_dmat	= &pci_bus_dma_tag;
 	pba.pba_iot     = leb_alloc_bus_space_tag(&bs_storage[0]);
Index: arch/bebox/bebox/mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/bebox/bebox/mainbus.c,v
retrieving revision 1.10
diff -u -r1.10 mainbus.c
--- arch/bebox/bebox/mainbus.c	2001/11/28 23:48:35	1.10
+++ arch/bebox/bebox/mainbus.c	2002/05/15 21:21:48
@@ -111,6 +111,7 @@
 	mba.mba_pba.pba_memt = &bebox_mem_bs_tag;
 	mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
 	mba.mba_pba.pba_bus = 0;
+	mba.mba_pba.pba_bridgetag = NULL;
 	mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	config_found(self, &mba.mba_pba, mainbus_print);
 #endif
Index: arch/cobalt/dev/gt.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/cobalt/dev/gt.c,v
retrieving revision 1.4
diff -u -r1.4 gt.c
--- arch/cobalt/dev/gt.c	2000/05/29 15:43:32	1.4
+++ arch/cobalt/dev/gt.c	2002/05/15 21:21:50
@@ -86,6 +86,7 @@
 	pba.pba_dmat = &pci_bus_dma_tag;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 		PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY;
 	config_found(self, &pba, gt_print);
Index: arch/dreamcast/dev/g2/gapspci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/dreamcast/dev/g2/gapspci.c,v
retrieving revision 1.2
diff -u -r1.2 gapspci.c
--- arch/dreamcast/dev/g2/gapspci.c	2001/02/01 19:35:04	1.2
+++ arch/dreamcast/dev/g2/gapspci.c	2002/05/15 21:21:51
@@ -132,6 +132,7 @@
 	pba.pba_memt = sc->sc_memt;
 	pba.pba_dmat = &sc->sc_dmat;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_MEM_ENABLED;
 	pba.pba_pc = &sc->sc_pc;
 
Index: arch/evbarm/ifpga/ifpga.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/evbarm/ifpga/ifpga.c,v
retrieving revision 1.7
diff -u -r1.7 ifpga.c
--- arch/evbarm/ifpga/ifpga.c	2002/04/12 18:50:32	1.7
+++ arch/evbarm/ifpga/ifpga.c	2002/05/15 21:21:53
@@ -342,6 +342,7 @@
 	pci_pba.pba_dmat = &ifpga_pci_bus_dma_tag;
 	pci_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pci_pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	
 	config_found(self, &pci_pba, ifpga_pci_print);
 #endif
Index: arch/evbmips/malta/dev/gt.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/evbmips/malta/dev/gt.c,v
retrieving revision 1.1
diff -u -r1.1 gt.c
--- arch/evbmips/malta/dev/gt.c	2002/03/07 14:44:05	1.1
+++ arch/evbmips/malta/dev/gt.c	2002/05/15 21:21:58
@@ -116,6 +116,7 @@
 	pba.pba_busname = "pci";
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_iot = &mcp->mc_iot;
 	pba.pba_memt = &mcp->mc_memt;
 	pba.pba_dmat = &mcp->mc_pci_dmat;	/* pci_bus_dma_tag */
Index: arch/hpcmips/vr/vrc4172pci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hpcmips/vr/vrc4172pci.c,v
retrieving revision 1.4
diff -u -r1.4 vrc4172pci.c
--- arch/hpcmips/vr/vrc4172pci.c	2002/05/11 08:56:40	1.4
+++ arch/hpcmips/vr/vrc4172pci.c	2002/05/15 21:22:02
@@ -198,6 +198,7 @@
 	pba.pba_memt = sc->sc_iot;
 	pba.pba_dmat = &hpcmips_default_bus_dma_tag.bdt;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY;
 	pba.pba_pc = pc;
Index: arch/hpcmips/vr/vrpciu.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hpcmips/vr/vrpciu.c,v
retrieving revision 1.8
diff -u -r1.8 vrpciu.c
--- arch/hpcmips/vr/vrpciu.c	2002/04/14 07:34:20	1.8
+++ arch/hpcmips/vr/vrpciu.c	2002/05/15 21:22:04
@@ -299,6 +299,7 @@
 	pba.pba_memt = sc->sc_iot;
 	pba.pba_dmat = &hpcmips_default_bus_dma_tag.bdt;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 
 	if (platid_match(&platid, &platid_mask_MACH_LASER5_L_BOARD)) {
 		/*
Index: arch/i386/i386/mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/i386/mainbus.c,v
retrieving revision 1.37
diff -u -r1.37 mainbus.c
--- arch/i386/i386/mainbus.c	2002/02/28 21:48:05	1.37
+++ arch/i386/i386/mainbus.c	2002/05/15 21:22:06
@@ -199,6 +199,7 @@
 		mba.mba_pba.pba_pc = NULL;
 		mba.mba_pba.pba_flags = pci_bus_flags();
 		mba.mba_pba.pba_bus = 0;
+		mba.mba_pba.pba_bridgetag = NULL;
 		config_found(self, &mba.mba_pba, mainbus_print);
 	}
 #endif
Index: arch/i386/pci/pchb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pchb.c,v
retrieving revision 1.32
diff -u -r1.32 pchb.c
--- arch/i386/pci/pchb.c	2002/03/16 22:17:27	1.32
+++ arch/i386/pci/pchb.c	2002/05/15 21:22:06
@@ -303,6 +303,7 @@
 		pba.pba_memt = pa->pa_memt;
 		pba.pba_dmat = pa->pa_dmat;
 		pba.pba_bus = pbnum;
+		pba.pba_bridgetag = NULL;
 		pba.pba_flags = attachflags;
 		pba.pba_pc = pa->pa_pc;
 		config_found(self, &pba, pchb_print);
Index: arch/macppc/pci/bandit.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/macppc/pci/bandit.c,v
retrieving revision 1.17
diff -u -r1.17 bandit.c
--- arch/macppc/pci/bandit.c	2001/09/14 21:04:58	1.17
+++ arch/macppc/pci/bandit.c	2002/05/15 21:22:08
@@ -124,6 +124,7 @@
 	pba.pba_iot = pc->iot;
 	pba.pba_dmat = &pci_bus_dma_tag;
 	pba.pba_bus = pc->bus;
+	pba.pba_bridgetag = NULL;
 	pba.pba_pc = pc;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 
Index: arch/macppc/pci/grackle.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/macppc/pci/grackle.c,v
retrieving revision 1.2
diff -u -r1.2 grackle.c
--- arch/macppc/pci/grackle.c	2001/07/22 11:29:48	1.2
+++ arch/macppc/pci/grackle.c	2002/05/15 21:22:08
@@ -124,6 +124,7 @@
 	pba.pba_iot = pc->iot;
 	pba.pba_dmat = &pci_bus_dma_tag;
 	pba.pba_bus = pc->bus;
+	pba.pba_bridgetag = NULL;
 	pba.pba_pc = pc;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 
Index: arch/macppc/pci/uninorth.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/macppc/pci/uninorth.c,v
retrieving revision 1.3
diff -u -r1.3 uninorth.c
--- arch/macppc/pci/uninorth.c	2001/09/14 21:04:58	1.3
+++ arch/macppc/pci/uninorth.c	2002/05/15 21:22:08
@@ -136,6 +136,7 @@
 	pba.pba_iot = pc->iot;
 	pba.pba_dmat = &pci_bus_dma_tag;
 	pba.pba_bus = pc->bus;
+	pba.pba_bridgetag = NULL;
 	pba.pba_pc = pc;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 
Index: arch/mvmeppc/mvmeppc/mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mvmeppc/mvmeppc/mainbus.c,v
retrieving revision 1.1
diff -u -r1.1 mainbus.c
--- arch/mvmeppc/mvmeppc/mainbus.c	2002/02/27 21:02:24	1.1
+++ arch/mvmeppc/mvmeppc/mainbus.c	2002/05/15 21:22:11
@@ -123,6 +123,7 @@
 	mba.mba_pba.pba_memt = &mvmeppc_pci_mem_bs_tag;
 	mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
 	mba.mba_pba.pba_bus = 0;
+	mba.mba_pba.pba_bridgetag = NULL;
 	mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	config_found(self, &mba.mba_pba, mainbus_print);
 #endif
Index: arch/ofppc/firepower/firepower.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/ofppc/firepower/firepower.c,v
retrieving revision 1.1
diff -u -r1.1 firepower.c
--- arch/ofppc/firepower/firepower.c	2001/10/29 22:28:38	1.1
+++ arch/ofppc/firepower/firepower.c	2002/05/15 21:22:14
@@ -243,6 +243,7 @@
 	pba.pba_dmat = &cp->c_dmat_pci;
 	pba.pba_pc = &cp->c_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	(void) config_found(self, &pba, firepower_print);
Index: arch/prep/prep/mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/prep/prep/mainbus.c,v
retrieving revision 1.10
diff -u -r1.10 mainbus.c
--- arch/prep/prep/mainbus.c	2002/05/02 15:18:00	1.10
+++ arch/prep/prep/mainbus.c	2002/05/15 21:22:17
@@ -146,6 +146,7 @@
 	mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
 	mba.mba_pba.pba_pc = &pc;
 	mba.mba_pba.pba_bus = 0;
+	mba.mba_pba.pba_bridgetag = NULL;
 	mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 	config_found(self, &mba.mba_pba, mainbus_print);
 #endif
Index: arch/sandpoint/sandpoint/mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sandpoint/sandpoint/mainbus.c,v
retrieving revision 1.7
diff -u -r1.7 mainbus.c
--- arch/sandpoint/sandpoint/mainbus.c	2001/11/28 23:48:36	1.7
+++ arch/sandpoint/sandpoint/mainbus.c	2002/05/15 21:22:18
@@ -122,6 +122,7 @@
 	mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
 	mba.mba_pba.pba_bus = 0;
 	mba.mba_pba.pba_pc = 0;
+	mba.mba_pba.pba_bridgetag = NULL;
 	mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 
 	config_found(self, &mba.mba_pba, mainbus_print);
Index: arch/sgimips/pci/macepci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sgimips/pci/macepci.c,v
retrieving revision 1.4
diff -u -r1.4 macepci.c
--- arch/sgimips/pci/macepci.c	2002/03/13 13:12:28	1.4
+++ arch/sgimips/pci/macepci.c	2002/05/15 21:22:18
@@ -139,6 +139,7 @@
 /*XXX*/	pba.pba_memt = 2;
 	pba.pba_dmat = &pci_bus_dma_tag;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	pba.pba_pc = pc;
Index: arch/sparc/sparc/msiiep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/msiiep.c,v
retrieving revision 1.8
diff -u -r1.8 msiiep.c
--- arch/sparc/sparc/msiiep.c	2002/05/08 16:51:39	1.8
+++ arch/sparc/sparc/msiiep.c	2002/05/15 21:22:21
@@ -376,6 +376,7 @@
 	 */
 	pba.pba_busname = "pci";
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_iot = sc->sc_iot;
 	pba.pba_memt = sc->sc_memt;
 	pba.pba_dmat = sc->sc_dmat;
Index: arch/sparc64/conf/GENERIC32
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/conf/GENERIC32,v
retrieving revision 1.38
diff -u -r1.38 GENERIC32
--- arch/sparc64/conf/GENERIC32	2002/05/13 22:38:01	1.38
+++ arch/sparc64/conf/GENERIC32	2002/05/15 21:22:22
@@ -200,12 +200,12 @@
 sbus0	at mainbus0				# Ultra 1
 #upa0	at mainbus0				# Ultra 1E, Ultra 2, Ex0000
 psycho*	at mainbus0				# Darwin, Ultra5
-ofpci*	at psycho?
-ofpci*	at ofppb?
-ofppb*	at ofpci?				# `APB' support.
-ebus*	at ofpci?					# ebus devices
+pci*	at psycho?
+pci*	at ppb?
+ppb*	at pci?					# `APB' support.
+ebus*	at pci?					# ebus devices
 # XXX 'puc's aren't really bridges, but there's no better place for them here
-puc*	at ofpci? dev ? function ?		# PCI "universal" comm. cards
+puc*	at pci? dev ? function ?		# PCI "universal" comm. cards
 
 #### Standard system devices -- all required for a given architecture
 
@@ -253,8 +253,8 @@
 
 # PCI serial interfaces
 com*	at puc? port ?			# 16x50s on "universal" comm boards
-cy*	at ofpci? dev ? function ?	# Cyclades Cyclom-Y serial boards
-cz*	at ofpci? dev ? function ?	# Cyclades-Z multi-port serial boards
+cy*	at pci? dev ? function ?	# Cyclades Cyclom-Y serial boards
+cz*	at pci? dev ? function ?	# Cyclades-Z multi-port serial boards
 
 #### Disk controllers and disks
 
@@ -275,23 +275,23 @@
 
 ## Qlogic ISP SBus or PCI SCSI Card
 isp*	at sbus? slot ? offset ?
-isp*	at ofpci?
+isp*	at pci?
 scsibus* at isp?
 
 ## GLM support
-siop*	at ofpci?					# 53C875 "glm" compatible
+siop*	at pci?					# 53C875 "glm" compatible
 scsibus* at siop?
 
 # PCI SCSI controllers
 # 	UT marks untested.
-adv*	at ofpci? dev ? function ?	# AdvanSys 1200[A,B], 9xx[U,UA] SCSI UT
-adw*	at ofpci? dev ? function ?	# AdvanSys 9x0UW[D], 3940U[2,3]W SCSI UT
-ahc*	at ofpci? dev ? function ?	# Adaptec [23]94x, aic78x0 SCSI UT
-bha*	at ofpci? dev ? function ?	# BusLogic 9xx SCSI UT
-dpt*	at ofpci? dev ? function ?	# DPT SmartCache/SmartRAID UT
-iha*	at ofpci? dev ? function ?	# Initio INIC-940/950 SCSI
-pcscp*	at ofpci? dev ? function ?	# AMD 53c974 PCscsi-PCI SCSI UT
-trm*	at ofpci? dev ? function ?	# Tekram DC-395U/UW/F, DC-315/U SCSI
+adv*	at pci? dev ? function ?	# AdvanSys 1200[A,B], 9xx[U,UA] SCSI UT
+adw*	at pci? dev ? function ?	# AdvanSys 9x0UW[D], 3940U[2,3]W SCSI UT
+ahc*	at pci? dev ? function ?	# Adaptec [23]94x, aic78x0 SCSI UT
+bha*	at pci? dev ? function ?	# BusLogic 9xx SCSI UT
+dpt*	at pci? dev ? function ?	# DPT SmartCache/SmartRAID UT
+iha*	at pci? dev ? function ?	# Initio INIC-940/950 SCSI
+pcscp*	at pci? dev ? function ?	# AMD 53c974 PCscsi-PCI SCSI UT
+trm*	at pci? dev ? function ?	# Tekram DC-395U/UW/F, DC-315/U SCSI
 
 scsibus* at scsi?
 
@@ -306,7 +306,7 @@
 uk*	at scsibus? target ? lun ?		# unknown SCSI
 
 # PCI IDE.
-pciide* at ofpci ? dev ? function ? flags 0x0000
+pciide* at pci ? dev ? function ? flags 0x0000
 atapibus* at pciide? channel ?
 
 ## Disable UDMA 4 which causes data corruption on the Acer Labs
@@ -319,9 +319,9 @@
 uk*	at atapibus? drive ? flags 0x0000	# ATAPI unknown
 
 # RAID controllers and devices (untested)
-cac*	at ofpci? dev ? function ?	# Compaq PCI array controllers
-mlx*	at ofpci? dev ? function ?	# Mylex DAC960 & DEC SWXCR family
-twe*	at ofpci? dev ? function ?	# 3ware Escalade RAID controllers
+cac*	at pci? dev ? function ?	# Compaq PCI array controllers
+mlx*	at pci? dev ? function ?	# Mylex DAC960 & DEC SWXCR family
+twe*	at pci? dev ? function ?	# 3ware Escalade RAID controllers
 
 ld*	at cac? unit ?			# logical disk devices
 ld*	at twe? unit ?
@@ -385,7 +385,7 @@
 
 ## Happy Meal Ethernet
 hme*		at sbus? slot ? offset ?
-hme*		at ofpci?	dev ? function ?	# network "hme" compatible
+hme*		at pci?	dev ? function ?	# network "hme" compatible
 
 ## qec/be, qec/hme
 qec*		at sbus? slot ? offset ?
@@ -394,27 +394,27 @@
 
 # PCI network interfaces
 # 	UT marks untested.
-an*	at ofpci? dev ? function ?	# Aironet PC4500/PC4800 (802.11) UT
-en*	at ofpci? dev ? function ?	# ENI/Adaptec ATM UT
+an*	at pci? dev ? function ?	# Aironet PC4500/PC4800 (802.11) UT
+en*	at pci? dev ? function ?	# ENI/Adaptec ATM UT
 # XXX causes ICE
-#ep*	at ofpci? dev ? function ?	# 3Com 3c59x
-ex*	at ofpci? dev ? function ?	# 3Com 90x[B] UT
-epic*	at ofpci? dev ? function ?	# SMC EPIC/100 Ethernet UT
-esh*	at ofpci? dev ? function ?	# Essential HIPPI card UT
-fpa*	at ofpci? dev ? function ?	# DEC DEFPA FDDI UT
-fxp*	at ofpci? dev ? function ?	# Intel EtherExpress PRO 10+/100B UT
-gem*	at ofpci? dev ? function ?	# Apple GMAC and Sun ERI gigabit enet
-le*	at ofpci? dev ? function ?	# PCnet-PCI Ethernet UT
+#ep*	at pci? dev ? function ?	# 3Com 3c59x
+ex*	at pci? dev ? function ?	# 3Com 90x[B] UT
+epic*	at pci? dev ? function ?	# SMC EPIC/100 Ethernet UT
+esh*	at pci? dev ? function ?	# Essential HIPPI card UT
+fpa*	at pci? dev ? function ?	# DEC DEFPA FDDI UT
+fxp*	at pci? dev ? function ?	# Intel EtherExpress PRO 10+/100B UT
+gem*	at pci? dev ? function ?	# Apple GMAC and Sun ERI gigabit enet
+le*	at pci? dev ? function ?	# PCnet-PCI Ethernet UT
 # XXX uses vtophys()
-#lmc*	at ofpci? dev ? function ?	# Lan Media Corp SSI/HSSI/DS3
-ne*	at ofpci? dev ? function ?	# NE2000-compatible Ethernet UT
-ntwoc*	at ofpci? dev ? function ?	# Riscom/N2 PCI Sync Serial UT
-rtk*	at ofpci? dev ? function ?	# Realtek 8129/8139 UT
-sip*	at ofpci? dev ? function ?	# SiS 900 Ethernet UT
-ti*	at ofpci? dev ? function ?	# Alteon ACEnic gigabit Ethernet UT
-tl*	at ofpci? dev ? function ?	# ThunderLAN-based Ethernet
-tlp*	at ofpci? dev ? function ?	# DECchip 21x4x and clones
-vr*	at ofpci? dev ? function ?	# VIA Rhine Fast Ethernet
+#lmc*	at pci? dev ? function ?	# Lan Media Corp SSI/HSSI/DS3
+ne*	at pci? dev ? function ?	# NE2000-compatible Ethernet UT
+ntwoc*	at pci? dev ? function ?	# Riscom/N2 PCI Sync Serial UT
+rtk*	at pci? dev ? function ?	# Realtek 8129/8139 UT
+sip*	at pci? dev ? function ?	# SiS 900 Ethernet UT
+ti*	at pci? dev ? function ?	# Alteon ACEnic gigabit Ethernet UT
+tl*	at pci? dev ? function ?	# ThunderLAN-based Ethernet
+tlp*	at pci? dev ? function ?	# DECchip 21x4x and clones
+vr*	at pci? dev ? function ?	# VIA Rhine Fast Ethernet
 
 # MII/PHY support
 # XXX: only nsphy "tested"
@@ -433,7 +433,7 @@
 ukphy*	at mii? phy ?			# generic unknown PHYs
 
 # PCI USB controllers
-ohci*	at ofpci? dev ? function ?			# Open Host Controller
+ohci*	at pci? dev ? function ?			# Open Host Controller
 
 usb*	at ohci?					# USB bus support
 uhub*	at usb?						# USB Hubs
@@ -463,8 +463,8 @@
 ugen*	at uhub? port ? configuration ? interface ?	# USB Generic driver
 
 # PCI IEEE1394 controllers
-fwohci*	at ofpci? dev ? function ?	# IEEE1394 Open Host Controller
-#fwlynx* at ofpci? dev ? function ?	# IEEE1394 TI Lynx Controller
+fwohci*	at pci? dev ? function ?	# IEEE1394 Open Host Controller
+#fwlynx* at pci? dev ? function ?	# IEEE1394 TI Lynx Controller
 fw*	at fwbus?			# IP over 1394
 
 # IEEE1394 nodes
@@ -515,7 +515,7 @@
 ## /dev/audio support (`audiocs' plus `audio')
 ##
 audiocs*	at sbus? slot ? offset ?	# SUNW,CS4231
-autri*		at ofpci? dev ? function ?	# Blade 100 'sound'
+autri*		at pci? dev ? function ?	# Blade 100 'sound'
 
 audio*		at audiocs?
 audio*		at autri?
Index: arch/sparc64/conf/files.sparc64
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/conf/files.sparc64,v
retrieving revision 1.63
diff -u -r1.63 files.sparc64
--- arch/sparc64/conf/files.sparc64	2002/05/06 22:41:10	1.63
+++ arch/sparc64/conf/files.sparc64	2002/05/15 21:22:22
@@ -46,19 +46,6 @@
 file	arch/sparc64/dev/psycho.c		psycho
 file	arch/sparc64/dev/pci_machdep.c		psycho
 
-#
-# OF PCI stuff
-#
-
-device	ofpci: pci
-attach	ofpci at pcibus
-file	arch/sparc64/dev/ofpci.c		ofpci needs-flag
-
-# PCI-PCI bridge chips
-device	ofppb: pcibus
-attach	ofppb at pci
-file	arch/sparc64/dev/ofppb.c		ofppb
-
 # IOMMU is for both
 file	arch/sparc64/dev/iommu.c		sbus | psycho
 
Index: arch/sparc64/conf/kern.ldscript
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/conf/kern.ldscript,v
retrieving revision 1.3
diff -u -r1.3 kern.ldscript
--- arch/sparc64/conf/kern.ldscript	2002/05/06 22:12:43	1.3
+++ arch/sparc64/conf/kern.ldscript	2002/05/15 21:22:22
@@ -72,7 +72,6 @@
     *(.gnu.linkonce.d*)
     CONSTRUCTORS
   }
-  PROVIDE(pci_cd = ofpci_cd);
   .data1   : { *(.data1) }
   .ctors         :
   {
Index: arch/sparc64/conf/kern32.ldscript
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/conf/kern32.ldscript,v
retrieving revision 1.2
diff -u -r1.2 kern32.ldscript
--- arch/sparc64/conf/kern32.ldscript	2002/05/06 22:12:43	1.2
+++ arch/sparc64/conf/kern32.ldscript	2002/05/15 21:22:22
@@ -73,7 +73,6 @@
     *(.gnu.linkonce.d*)
     CONSTRUCTORS
   }
-  PROVIDE(pci_cd = ofpci_cd);
   .data1   : { *(.data1) }
   .ctors         :
   {
Index: arch/sparc64/dev/pci_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/dev/pci_machdep.c,v
retrieving revision 1.29
diff -u -r1.29 pci_machdep.c
--- arch/sparc64/dev/pci_machdep.c	2002/05/15 18:37:55	1.29
+++ arch/sparc64/dev/pci_machdep.c	2002/05/15 21:22:23
@@ -62,8 +62,6 @@
 
 #include <dev/ofw/ofw_pci.h>
 
-#include <sparc64/dev/ofpcivar.h>
-
 #include <sparc64/dev/iommureg.h>
 #include <sparc64/dev/iommuvar.h>
 #include <sparc64/dev/psychoreg.h>
@@ -74,6 +72,20 @@
 	NULL,
 };
 
+static pcitag_t
+ofpci_make_tag(pci_chipset_tag_t pc, int node, int b, int d, int f)
+{
+	pcitag_t tag;
+
+	tag = PCITAG_CREATE(node, b, d, f);
+
+	/* Enable all the different spaces for this device */
+	pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
+		PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_MASTER_ENABLE|
+		PCI_COMMAND_IO_ENABLE);
+	return (tag);
+}
+
 /*
  * functions provided to the MI code.
  */
@@ -84,7 +96,20 @@
 	struct device *self;
 	struct pcibus_attach_args *pba;
 {
-	/* Don't do nothing */
+	struct sparc_pci_chipset *npc;
+	pcitag_t btag;
+
+	/*
+	 * If we're attaching at a bridge, create a new PCI chipset
+	 * tag that points at the bridge's node.
+	 */
+	if (pba->pba_bridgetag != NULL) {
+		btag = *pba->pba_bridgetag;
+		npc = malloc(sizeof(*npc), M_DEVBUF, M_WAITOK);
+		*npc = *pba->pba_pc;
+		npc->curnode = PCITAG_NODE(btag);
+		pba->pba_pc = npc;
+	}
 }
 
 int
@@ -96,61 +121,6 @@
 	return 32;
 }
 
-#ifdef __PCI_BUS_DEVORDER
-int
-pci_bus_devorder(pc, busno, devs)
-	pci_chipset_tag_t pc;
-	int busno;
-	char *devs;
-{
-	struct ofw_pci_register reg;
-	int node, len, device, i = 0;
-	u_int32_t done = 0;
-#ifdef DEBUG
-	char name[80];
-#endif
-
-	node = pc->curnode;
-#ifdef DEBUG
-	if (sparc_pci_debug & SPDB_PROBE) {
-		OF_getprop(node, "name", &name, sizeof(name));
-		printf("pci_bus_devorder: curnode %x %s\n", node, name);
-	}
-#endif
-	/*
-	 * Initially, curnode is the root of the pci tree.  As we
-	 * attach bridges, curnode should be set to that of the bridge.
-	 */
-	for (node = OF_child(node); node; node = OF_peer(node)) {
-		len = OF_getproplen(node, "reg");
-		if (len < sizeof(reg))
-			continue;
-		if (OF_getprop(node, "reg", (void *)&reg, sizeof(reg)) != len)
-			panic("pci_probe_bus: OF_getprop len botch");
-
-		device = OFW_PCI_PHYS_HI_DEVICE(reg.phys_hi);
-
-		if (done & (1 << device))
-			continue;
-
-		devs[i++] = device;
-		done |= 1 << device;
-#ifdef DEBUG
-	if (sparc_pci_debug & SPDB_PROBE) {
-		OF_getprop(node, "name", &name, sizeof(name));
-		printf("pci_bus_devorder: adding %x %s\n", node, name);
-	}
-#endif
-		if (i == 32)
-			break;
-	}
-	if (i < 32)
-		devs[i] = -1;
-
-	return i;
-}
-#endif
-
 pcitag_t
 pci_make_tag(pc, b, d, f)
 	pci_chipset_tag_t pc;
@@ -263,13 +233,6 @@
 		/* Got a match */
 		tag = ofpci_make_tag(pc, node, b, d, f);
 
-		/*
-		 * Record the node.  This has two effects:
-		 *
-		 * 1) We don't have to search as far.
-		 * 2) pci_bus_devorder will scan the right bus.
-		 */
-		pc->curnode = node;
 		return (tag);
 	}
 	/* No device found -- return a dead tag */
@@ -291,31 +254,44 @@
 		*fp = PCITAG_FUN(tag);
 }
 
-pcitag_t
-ofpci_make_tag(pc, node, b, d, f)
-	pci_chipset_tag_t pc;
-	int node;
-	int b;
-	int d;
-	int f;
+int
+pci_enumerate_bus(struct pci_softc *sc,
+    int (*match)(struct pci_attach_args *), struct pci_attach_args *pap)
 {
+	struct ofw_pci_register reg;
+	pci_chipset_tag_t pc = sc->sc_pc;
 	pcitag_t tag;
-
-	tag = PCITAG_CREATE(node, b, d, f);
-
-	/*
-	 * Record the node.  This has two effects:
-	 *
-	 * 1) We don't have to search as far.
-	 * 2) pci_bus_devorder will scan the right bus.
-	 */
-	pc->curnode = node;
+	pcireg_t class;
+	int node, b, d, f, ret;
+	char name[30];
+
+	for (node = OF_child(pc->curnode); node != 0 && node != -1;
+	     node = OF_peer(node)) {
+		name[0] = name[29] = 0;
+		OF_getprop(node, "name", name, sizeof(name));
+
+		if (OF_getprop(node, "class-code", &class, sizeof(class)) != 
+		    sizeof(class))
+			continue;
+		if (OF_getprop(node, "reg", &reg, sizeof(reg)) < sizeof(reg))
+			panic("pci_enumerate_bus: \"%s\" regs too small", name);
+
+		b = OFW_PCI_PHYS_HI_BUS(reg.phys_hi);
+		d = OFW_PCI_PHYS_HI_DEVICE(reg.phys_hi);
+		f = OFW_PCI_PHYS_HI_FUNCTION(reg.phys_hi);
+
+		if (sc->sc_bus != b) {
+			printf("%s: WARNING: incorrect bus # for \"%s\" "
+			"(%d/%d/%d)\n", sc->sc_dev.dv_xname, name, b, d, f);
+			continue;
+		}
 
-	/* Enable all the different spaces for this device */
-	pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
-		PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_MASTER_ENABLE|
-		PCI_COMMAND_IO_ENABLE);
-	return (tag);
+		tag = ofpci_make_tag(pc, node, b, d, f);
+		ret = pci_probe_device(sc, tag, match, pap);
+		if (match != NULL && ret != 0)
+			return (ret);
+	}
+	return (0);
 }
 
 /* assume we are mapped little-endian/side-effect */
Index: arch/sparc64/dev/psycho.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/dev/psycho.c,v
retrieving revision 1.46
diff -u -r1.46 psycho.c
--- arch/sparc64/dev/psycho.c	2002/05/06 22:29:22	1.46
+++ arch/sparc64/dev/psycho.c	2002/05/15 21:22:24
@@ -63,8 +63,6 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 
-#include <sparc64/dev/ofpcivar.h>
-
 #include <sparc64/dev/iommureg.h>
 #include <sparc64/dev/iommuvar.h>
 #include <sparc64/dev/psychoreg.h>
@@ -72,7 +70,6 @@
 #include <sparc64/sparc64/cache.h>
 
 #include "ioconf.h"
-#include "ofpci.h"
 
 static pci_chipset_tag_t psycho_alloc_chipset __P((struct psycho_pbm *, int,
 						   pci_chipset_tag_t));
@@ -228,7 +225,7 @@
 	struct psycho_softc *sc = (struct psycho_softc *)self;
 	struct psycho_softc *osc = NULL;
 	struct psycho_pbm *pp;
-	struct ofpcibus_attach_args pba;
+	struct pcibus_attach_args pba;
 	struct mainbus_attach_args *ma = aux;
 	bus_space_handle_t bh;
 	u_int64_t csr;
@@ -400,7 +397,7 @@
 	/* get the bus-range for the psycho */
 	psycho_get_bus_range(sc->sc_node, psycho_br);
 
-	pba.opba_pba.pba_bus = psycho_br[0];
+	pba.pba_bus = psycho_br[0];
 
 	printf("bus range %u to %u", psycho_br[0], psycho_br[1]);
 	printf("; PCI bus %d", psycho_br[0]);
@@ -418,7 +415,7 @@
 	pp->pp_pc = psycho_alloc_chipset(pp, sc->sc_node, &_sparc_pci_chipset);
 
 	/* setup the rest of the psycho pbm */
-	pba.opba_pba.pba_pc = psycho_alloc_chipset(pp, sc->sc_node, pp->pp_pc);
+	pba.pba_pc = psycho_alloc_chipset(pp, sc->sc_node, pp->pp_pc);
 
 	printf("\n");
 
@@ -533,16 +530,11 @@
 	/*
 	 * attach the pci.. note we pass PCI A tags, etc., for the sabre here.
 	 */
-#if NOFPCI > 0
-	pba.opba_pba.pba_busname = "ofpci";
-#else
-	pba.opba_pba.pba_busname = "pci";
-#endif
-	pba.opba_pba.pba_flags = sc->sc_psycho_this->pp_flags;
-	pba.opba_pba.pba_dmat = sc->sc_psycho_this->pp_dmat;
-	pba.opba_pba.pba_iot = sc->sc_psycho_this->pp_iot;
-	pba.opba_pba.pba_memt = sc->sc_psycho_this->pp_memt;
-	pba.opba_node = sc->sc_node;
+	pba.pba_busname = "pci";
+	pba.pba_flags = sc->sc_psycho_this->pp_flags;
+	pba.pba_dmat = sc->sc_psycho_this->pp_dmat;
+	pba.pba_iot = sc->sc_psycho_this->pp_iot;
+	pba.pba_memt = sc->sc_psycho_this->pp_memt;
 
 	config_found(self, &pba, psycho_print);
 }
Index: arch/sparc64/include/pci_machdep.h
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/include/pci_machdep.h,v
retrieving revision 1.12
diff -u -r1.12 pci_machdep.h
--- arch/sparc64/include/pci_machdep.h	2002/05/15 19:23:56	1.12
+++ arch/sparc64/include/pci_machdep.h	2002/05/15 21:22:24
@@ -32,11 +32,6 @@
 #define _MACHINE_PCI_MACHDEP_H_
 
 /*
- * We want to contro both device & function probe order.
- */
-#define		__PCI_BUS_DEVORDER
-
-/*
  * Forward declarations.
  */
 struct pci_attach_args;
@@ -75,9 +70,6 @@
 
 void		pci_attach_hook(struct device *, struct device *,
 				     struct pcibus_attach_args *);
-#ifdef __PCI_BUS_DEVORDER
-int		pci_bus_devorder(pci_chipset_tag_t, int, char *);
-#endif
 int		pci_bus_maxdevs(pci_chipset_tag_t, int);
 pcitag_t	pci_make_tag(pci_chipset_tag_t, int, int, int);
 void		pci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *,
@@ -92,7 +84,8 @@
 					 int, int (*)(void *), void *);
 void		pci_intr_disestablish(pci_chipset_tag_t, void *);
 
-#define	pci_enumerate_bus(sc, m, p)					\
-	pci_enumerate_bus_generic((sc), (m), (p))
+int		pci_enumerate_bus(struct pci_softc *,
+		    int (*match)(struct pci_attach_args *),
+		    struct pci_attach_args *);
 
 #endif /* _MACHINE_PCI_MACHDEP_H_ */
Index: arch/sparc64/sparc64/autoconf.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/sparc64/autoconf.c,v
retrieving revision 1.56
diff -u -r1.56 autoconf.c
--- arch/sparc64/sparc64/autoconf.c	2002/05/06 22:20:57	1.56
+++ arch/sparc64/sparc64/autoconf.c	2002/05/15 21:22:27
@@ -1016,7 +1016,6 @@
 	{ "pciide",	BUSCLASS_PCI },
 	{ "siop",	BUSCLASS_PCI },
 	{ "pci",	BUSCLASS_PCI },
-	{ "ofpci",	BUSCLASS_PCI },
 	{ "fdc",	BUSCLASS_FDC },
 };
 
Index: arch/walnut/pci/pchb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/walnut/pci/pchb.c,v
retrieving revision 1.2
diff -u -r1.2 pchb.c
--- arch/walnut/pci/pchb.c	2002/03/13 19:28:25	1.2
+++ arch/walnut/pci/pchb.c	2002/05/15 21:22:29
@@ -165,6 +165,7 @@
 	pba.pba_memt = galaxy_make_bus_space_tag(0, 0);
 	pba.pba_dmat = &galaxy_default_bus_dma_tag;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
 	config_found(self, &pba, phcbprint);
 }
Index: arch/x86_64/pci/pchb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/x86_64/pci/pchb.c,v
retrieving revision 1.1
diff -u -r1.1 pchb.c
--- arch/x86_64/pci/pchb.c	2001/06/19 00:20:45	1.1
+++ arch/x86_64/pci/pchb.c	2002/05/15 21:22:30
@@ -246,6 +246,7 @@
 		pba.pba_memt = pa->pa_memt;
 		pba.pba_dmat = pa->pa_dmat;
 		pba.pba_bus = pbnum;
+		pba.pba_bridgetag = NULL;
 		pba.pba_flags = pa->pa_flags;
 		pba.pba_pc = pa->pa_pc;
 		config_found(self, &pba, pchb_print);
Index: arch/x86_64/x86_64/mainbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/x86_64/x86_64/mainbus.c,v
retrieving revision 1.1
diff -u -r1.1 mainbus.c
--- arch/x86_64/x86_64/mainbus.c	2001/06/19 00:21:17	1.1
+++ arch/x86_64/x86_64/mainbus.c	2002/05/15 21:22:31
@@ -116,6 +116,7 @@
 		mba.mba_pba.pba_pc = NULL;
 		mba.mba_pba.pba_flags = pci_bus_flags();
 		mba.mba_pba.pba_bus = 0;
+		mba.mba_pba.pba_bridgetag = NULL;
 		config_found(self, &mba.mba_pba, mainbus_print);
 	}
 #endif

--C7zPtVaVf+AK4Oqc--