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 | |
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')
-rw-r--r-- | sys/sparc64/pci/apb.c | 1 | ||||
-rw-r--r-- | sys/sparc64/pci/ofw_pci.h | 2 | ||||
-rw-r--r-- | sys/sparc64/pci/ofw_pcib.c | 1 | ||||
-rw-r--r-- | sys/sparc64/pci/ofw_pcib_subr.c | 1 | ||||
-rw-r--r-- | sys/sparc64/pci/ofw_pcibus.c | 19 | ||||
-rw-r--r-- | sys/sparc64/pci/psycho.c | 1 | ||||
-rw-r--r-- | sys/sparc64/pci/schizo.c | 1 |
7 files changed, 19 insertions, 7 deletions
diff --git a/sys/sparc64/pci/apb.c b/sys/sparc64/pci/apb.c index d908c17..ba0698c 100644 --- a/sys/sparc64/pci/apb.c +++ b/sys/sparc64/pci/apb.c @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/openfirm.h> #include <machine/bus.h> -#include <machine/ofw_bus.h> #include <machine/resource.h> #include <dev/pci/pcireg.h> diff --git a/sys/sparc64/pci/ofw_pci.h b/sys/sparc64/pci/ofw_pci.h index 252f474..19c2fbe 100644 --- a/sys/sparc64/pci/ofw_pci.h +++ b/sys/sparc64/pci/ofw_pci.h @@ -34,7 +34,7 @@ #ifndef _SPARC64_PCI_OFW_PCI_H_ #define _SPARC64_PCI_OFW_PCI_H_ -#include <machine/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> typedef uint32_t ofw_pci_intr_t; diff --git a/sys/sparc64/pci/ofw_pcib.c b/sys/sparc64/pci/ofw_pcib.c index 966d77f..8a5b991 100644 --- a/sys/sparc64/pci/ofw_pcib.c +++ b/sys/sparc64/pci/ofw_pcib.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/openfirm.h> #include <machine/bus.h> -#include <machine/ofw_bus.h> #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> diff --git a/sys/sparc64/pci/ofw_pcib_subr.c b/sys/sparc64/pci/ofw_pcib_subr.c index 9996b7e..6dd0990 100644 --- a/sys/sparc64/pci/ofw_pcib_subr.c +++ b/sys/sparc64/pci/ofw_pcib_subr.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ofw/openfirm.h> #include <machine/bus.h> -#include <machine/ofw_bus.h> #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> 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); +} + diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c index d961191..505eec4 100644 --- a/sys/sparc64/pci/psycho.c +++ b/sys/sparc64/pci/psycho.c @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include <machine/bus_private.h> #include <machine/iommureg.h> #include <machine/iommuvar.h> -#include <machine/ofw_bus.h> #include <machine/resource.h> #include <machine/ver.h> diff --git a/sys/sparc64/pci/schizo.c b/sys/sparc64/pci/schizo.c index 8f01f9c..45bee8d 100644 --- a/sys/sparc64/pci/schizo.c +++ b/sys/sparc64/pci/schizo.c @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include <machine/fsr.h> #include <machine/iommureg.h> #include <machine/iommuvar.h> -#include <machine/ofw_bus.h> #include <machine/resource.h> #include <dev/pci/pcireg.h> |