diff options
author | jhb <jhb@FreeBSD.org> | 2012-03-02 20:38:04 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-03-02 20:38:04 +0000 |
commit | d6e546f14a581a2fb495e470ff7bf73ec4282395 (patch) | |
tree | b50d96653ef1fad93fd23cd1c81a0d5719b09573 /sys/powerpc | |
parent | 6d9202e45726f379f997128f531e4d8945656c74 (diff) | |
download | FreeBSD-src-d6e546f14a581a2fb495e470ff7bf73ec4282395.zip FreeBSD-src-d6e546f14a581a2fb495e470ff7bf73ec4282395.tar.gz |
- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
The tag enforces a single restriction that all DMA transactions must not
cross a 4GB boundary. Note that while this restriction technically only
applies to PCI-express, this change applies it to all PCI devices as it
is simpler to implement that way and errs on the side of caution.
- Add a softc structure for PCI bus devices to hold the bus_dma tag and
a new pci_attach_common() routine that performs actions common to the
attach phase of all PCI bus drivers. Right now this only consists of
a bootverbose printf and the allocate of a bus_dma tag if necessary.
- Adjust all PCI bus drivers to allocate a PCI bus softc and to call
pci_attach_common() from their attach routines.
MFC after: 2 weeks
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/ofw/ofw_pcibus.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c index 9618e4c..c611bb5 100644 --- a/sys/powerpc/ofw/ofw_pcibus.c +++ b/sys/powerpc/ofw/ofw_pcibus.c @@ -95,8 +95,8 @@ struct ofw_pcibus_devinfo { static devclass_t pci_devclass; -DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, 1 /* no softc */, - pci_driver); +DEFINE_CLASS_1(pci, ofw_pcibus_driver, ofw_pcibus_methods, + sizeof(struct pci_softc), pci_driver); DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0); MODULE_VERSION(ofw_pcibus, 1); MODULE_DEPEND(ofw_pcibus, pci, 1, 1, 1); @@ -116,12 +116,13 @@ static int ofw_pcibus_attach(device_t dev) { u_int busno, domain; + int error; + error = pci_attach_common(dev); + if (error) + return (error); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); /* * Attach those children represented in the device tree. |