diff options
author | John Baldwin <jhb@FreeBSD.org> | 2012-03-02 20:38:04 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2012-03-02 20:38:04 +0000 |
commit | 1b1596a3b34a5a8a84fc24d1ef7b1c2d071afaf2 (patch) | |
tree | b50d96653ef1fad93fd23cd1c81a0d5719b09573 /sys/sparc64/pci | |
parent | 3b7eabb569785a121452505fedeecbe4d6a9fad3 (diff) | |
download | src-1b1596a3b34a5a8a84fc24d1ef7b1c2d071afaf2.tar.gz src-1b1596a3b34a5a8a84fc24d1ef7b1c2d071afaf2.zip |
- 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
Notes
Notes:
svn path=/head/; revision=232403
Diffstat (limited to 'sys/sparc64/pci')
-rw-r--r-- | sys/sparc64/pci/ofw_pcibus.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/sparc64/pci/ofw_pcibus.c b/sys/sparc64/pci/ofw_pcibus.c index d753b086c35a..9dd0e275aaf7 100644 --- a/sys/sparc64/pci/ofw_pcibus.c +++ b/sys/sparc64/pci/ofw_pcibus.c @@ -100,8 +100,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); EARLY_DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_pcibus, 1); @@ -230,13 +230,14 @@ ofw_pcibus_attach(device_t dev) phandle_t node, child; uint32_t clock; u_int busno, domain, func, slot; + int error; + error = pci_attach_common(dev); + if (error) + return (error); pcib = device_get_parent(dev); domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); - if (bootverbose) - device_printf(dev, "domain=%d, physical bus=%d\n", - domain, busno); node = ofw_bus_get_node(dev); /* |