From f64ee1a32f0c0053cd991dd2e771a5925a41a3a2 Mon Sep 17 00:00:00 2001 From: kmacy Date: Thu, 12 Oct 2006 04:44:01 +0000 Subject: The T2000 has multiple PCI domains requiring bus allocation to be done differently. This pulls in changes by jmg from perforce and makes them sun4v only for now. Approved by: scottl (acting as backup for mentor rwatson) --- sys/sparc64/pci/ofw_pcib.c | 6 ++++++ sys/sparc64/pci/ofw_pcib_subr.c | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'sys/sparc64/pci') diff --git a/sys/sparc64/pci/ofw_pcib.c b/sys/sparc64/pci/ofw_pcib.c index d4e627d..9d20486 100644 --- a/sys/sparc64/pci/ofw_pcib.c +++ b/sys/sparc64/pci/ofw_pcib.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ofw_pci.h" +#include "opt_global.h" #include #include @@ -119,6 +120,11 @@ ofw_pcib_attach(device_t dev) sc = device_get_softc(dev); ofw_pcib_gen_setup(dev); pcib_attach_common(dev); +#ifdef SUN4V + device_add_child(dev, "pci", -1); +#else device_add_child(dev, "pci", sc->ops_pcib_sc.secbus); +#endif + return (bus_generic_attach(dev)); } diff --git a/sys/sparc64/pci/ofw_pcib_subr.c b/sys/sparc64/pci/ofw_pcib_subr.c index 6e9620e..834ebe3 100644 --- a/sys/sparc64/pci/ofw_pcib_subr.c +++ b/sys/sparc64/pci/ofw_pcib_subr.c @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ofw_pci.h" +#include "opt_global.h" #include #include @@ -52,8 +53,10 @@ void ofw_pcib_gen_setup(device_t bridge) { struct ofw_pcib_gen_softc *sc; +#ifndef SUN4V u_int secbus; +#endif sc = device_get_softc(bridge); sc->ops_pcib_sc.dev = bridge; sc->ops_node = ofw_bus_get_node(bridge); @@ -65,6 +68,7 @@ ofw_pcib_gen_setup(device_t bridge) * bus number for it; the firmware preset does not always seem to be * correct. */ +#ifndef SUN4V secbus = ofw_pci_alloc_busno(sc->ops_node); pci_write_config(bridge, PCIR_PRIBUS_1, pci_get_bus(bridge), 1); pci_write_config(bridge, PCIR_SECBUS_1, secbus, 1); @@ -73,6 +77,7 @@ ofw_pcib_gen_setup(device_t bridge) /* Notify parent bridges. */ OFW_PCI_ADJUST_BUSRANGE(device_get_parent(bridge), secbus); +#endif ofw_bus_setup_iinfo(sc->ops_node, &sc->ops_iinfo, sizeof(ofw_pci_intr_t)); } -- cgit v1.1