diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-03-19 02:43:39 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-03-19 02:43:39 +0000 |
commit | 2de1e0f40803f7f0de26e365f0c02a0b4cc4d330 (patch) | |
tree | e187e02df86e3a0e9b6c58f465d0407f474a2150 /sys/arch/sparc64/include | |
parent | 4cc27836a57fbda13281aa7986a92b1f641e3181 (diff) |
rev 1.86
make the "generic" PCI bus enumeration code the standard case which
gets used if nothing else is defined in MD headers,
introduce a "PCI_MACHDEP_ENUMERATE_BUS" CPP definition which can
be used by MD headers (just 1 port atm) to plug in special code
rev 1.62
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
rev 1.59
Split the code that enumerates the PCI bus and that actually probes
for a device into two functions:
* pci_probe_device() actually probes/attaches the device specified
by the provide pcitag_t.
* pci_enumerate_bus() enumerates the bus, and calls pci_probe_device()
for each device on the bus. A pci_enumerate_bus_generic() is provided
which implements the old method of doing this: If something found at
dev0/func0, determine number of functions and probe each one.
From NetBSD
ok kettenis@
Tested on a good number of amd64/i386/macppc/sparc64 systems
Diffstat (limited to 'sys/arch/sparc64/include')
-rw-r--r-- | sys/arch/sparc64/include/pci_machdep.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/arch/sparc64/include/pci_machdep.h b/sys/arch/sparc64/include/pci_machdep.h index e9148812ebf..ddbc74de461 100644 --- a/sys/arch/sparc64/include/pci_machdep.h +++ b/sys/arch/sparc64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.14 2005/09/04 20:40:53 brad Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.15 2006/03/19 02:43:38 brad Exp $ */ /* $NetBSD: pci_machdep.h,v 1.7 2001/07/20 00:07:14 eeh Exp $ */ /* @@ -33,12 +33,6 @@ #define _MACHINE_PCI_MACHDEP_H_ /* - * We want to control both device & function probe order. - */ -#define __PCI_BUS_DEVORDER -#define __PCI_DEV_FUNCORDER - -/* * Forward declarations. */ struct pci_attach_args; @@ -73,18 +67,11 @@ struct sparc_pci_chipset { bus_space_tag_t bustag; bus_space_handle_t bushandle; int rootnode; /* PCI controller */ - int curnode; /* Current OFW node */ int (*intr_map)(struct pci_attach_args *, pci_intr_handle_t *); }; 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 -#ifdef __PCI_DEV_FUNCORDER -int pci_dev_funcorder(pci_chipset_tag_t, int, 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 *, @@ -98,6 +85,12 @@ void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int, int (*)(void *), void *, char *); void pci_intr_disestablish(pci_chipset_tag_t, void *); +int sparc64_pci_enumerate_bus(struct pci_softc *, + int (*match)(struct pci_attach_args *), + struct pci_attach_args *); + +#define PCI_MACHDEP_ENUMERATE_BUS sparc64_pci_enumerate_bus + #define pciide_machdep_compat_intr_establish(a, b, c, d, e) (NULL) #define pciide_machdep_compat_intr_disestablish(a, b) do { } while (0) |