diff options
author | marius <marius@FreeBSD.org> | 2008-04-17 12:38:00 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2008-04-17 12:38:00 +0000 |
commit | 3215bc9d5f31c44edeb0a319c1456140986ac1de (patch) | |
tree | 646b5b1dcb4b90320e3790b627d5df68e35cf191 /sys/sparc64/pci/apb.c | |
parent | b11f9dd52aac5645107b2d8cb24361e9495b17d6 (diff) | |
download | FreeBSD-src-3215bc9d5f31c44edeb0a319c1456140986ac1de.zip FreeBSD-src-3215bc9d5f31c44edeb0a319c1456140986ac1de.tar.gz |
On sparc64 machines with multiple host-PCI-bridges these bridges
have separate configuration spaces so by definition they implement
different PCI domains. Thus change psycho(4) to use PCI domains
instead of reenumerating all PCI busses so they have globally unique
bus numbers and drop support for reenumerating busses in the OFW PCI
code.
According to CVS history reenumeration was also required in order to
get some E450 to boot but given that no other open source kernel
changes the PCI bus numbers assigned by the firmware I believe the
real problem was that the old code used the bus number as the device
number for the PCI busses and unlike most of the other machines the
firmwares of the problematic ones don't use disjoint PCI bus numbers
across the host-PCI-bridges.
MFC after: 1 month
Diffstat (limited to 'sys/sparc64/pci/apb.c')
-rw-r--r-- | sys/sparc64/pci/apb.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/sparc64/pci/apb.c b/sys/sparc64/pci/apb.c index 9455882..d908c17 100644 --- a/sys/sparc64/pci/apb.c +++ b/sys/sparc64/pci/apb.c @@ -106,9 +106,6 @@ static device_method_t apb_methods[] = { /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - /* ofw_pci interface */ - DEVMETHOD(ofw_pci_adjust_busrange, ofw_pcib_gen_adjust_busrange), - { 0, 0 } }; @@ -179,6 +176,11 @@ apb_attach(device_t dev) /* * Get current bridge configuration. */ + sc->sc_bsc.ops_pcib_sc.domain = pci_get_domain(dev); + sc->sc_bsc.ops_pcib_sc.secbus = + pci_read_config(dev, PCIR_SECBUS_1, 1); + sc->sc_bsc.ops_pcib_sc.subbus = + pci_read_config(dev, PCIR_SUBBUS_1, 1); sc->sc_iomap = pci_read_config(dev, APBR_IOMAP, 1); sc->sc_memmap = pci_read_config(dev, APBR_MEMMAP, 1); ofw_pcib_gen_setup(dev); @@ -198,7 +200,7 @@ apb_attach(device_t dev) printf("\n"); } - device_add_child(dev, "pci", sc->sc_bsc.ops_pcib_sc.secbus); + device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } @@ -207,7 +209,7 @@ apb_attach(device_t dev) * is set up to, or capable of handling them. */ static struct resource * -apb_alloc_resource(device_t dev, device_t child, int type, int *rid, +apb_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { struct apb_softc *sc; |