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)
This commit is contained in:
Kip Macy 2006-10-12 04:44:01 +00:00
parent 600c53adf9
commit c94d217091
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163260
2 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@
__FBSDID("$FreeBSD$");
#include "opt_ofw_pci.h"
#include "opt_global.h"
#include <sys/param.h>
#include <sys/kernel.h>
@ -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));
}

View File

@ -27,6 +27,7 @@
__FBSDID("$FreeBSD$");
#include "opt_ofw_pci.h"
#include "opt_global.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -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));
}