diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2008-12-15 15:31:10 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2008-12-15 15:31:10 +0000 |
commit | f0e837432d62958c713c7e6ebbb2adc52c8fd696 (patch) | |
tree | ca68e24ea5167314369eefd8755cc6038f9ec07e /sys/sparc64/pci/ofw_pcibus.c | |
parent | 907438a3fe46be01afa5020f515481b240da1a08 (diff) | |
download | FreeBSD-src-f0e837432d62958c713c7e6ebbb2adc52c8fd696.zip FreeBSD-src-f0e837432d62958c713c7e6ebbb2adc52c8fd696.tar.gz |
Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular,
the code for parsing interrupt maps) to PowerPC and reflect their new MI
status by moving them to the shared dev/ofw directory.
This commit also modifies the OFW PCI enumeration procedure on PowerPC to
allow the bus to find non-firmware-enumerated devices that Apple likes to add,
and adds some useful Open Firmware properties (compat and name) to the pnpinfo
string of children on OFW SBus, EBus, PCI, and MacIO links. Because of the
change to PCI enumeration on PowerPC, X has started working again on PPC
machines with Grackle hostbridges.
Reviewed by: marius
Obtained from: sparc64
Diffstat (limited to 'sys/sparc64/pci/ofw_pcibus.c')
-rw-r--r-- | sys/sparc64/pci/ofw_pcibus.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/sparc64/pci/ofw_pcibus.c b/sys/sparc64/pci/ofw_pcibus.c index 7918370..65a498a 100644 --- a/sys/sparc64/pci/ofw_pcibus.c +++ b/sys/sparc64/pci/ofw_pcibus.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include <sys/pciio.h> #include <dev/ofw/ofw_bus.h> -#include <dev/ofw/ofw_bus_subr.h> #include <dev/ofw/ofw_pci.h> #include <dev/ofw/openfirm.h> @@ -69,6 +68,8 @@ static device_probe_t ofw_pcibus_probe; static device_attach_t ofw_pcibus_attach; static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo; +static int ofw_pcibus_child_pnpinfo_str_method(device_t cbdev, device_t child, + char *buf, size_t buflen); static device_method_t ofw_pcibus_methods[] = { /* Device interface */ @@ -76,6 +77,7 @@ static device_method_t ofw_pcibus_methods[] = { DEVMETHOD(device_attach, ofw_pcibus_attach), /* Bus interface */ + DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method), /* PCI interface */ DEVMETHOD(pci_assign_interrupt, ofw_pcibus_assign_interrupt), @@ -302,3 +304,18 @@ ofw_pcibus_get_devinfo(device_t bus, device_t dev) dinfo = device_get_ivars(dev); return (&dinfo->opd_obdinfo); } + +static int +ofw_pcibus_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, + size_t buflen) +{ + pci_child_pnpinfo_str_method(cbdev, child, buf, buflen); + + if (ofw_bus_get_node(child) != -1) { + strlcat(buf, " ", buflen); /* Separate info */ + ofw_bus_gen_child_pnpinfo_str(cbdev, child, buf, buflen); + } + + return (0); +} + |