diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-06-22 02:23:18 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-06-22 02:23:18 +0000 |
commit | 287623370e2ed80006fb7eba25f6eff7a36ac84f (patch) | |
tree | 34cec410153f61923b77e38cef93773e6eec721b | |
parent | d62d61ee14efeb016aa2729993e5366dc0a08582 (diff) | |
download | FreeBSD-src-287623370e2ed80006fb7eba25f6eff7a36ac84f.zip FreeBSD-src-287623370e2ed80006fb7eba25f6eff7a36ac84f.tar.gz |
This is more complicated than I expected. Storage devices need the IOMMU
set up, but must not use it.
-rw-r--r-- | sys/powerpc/ps3/ps3bus.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c index a4f4a39..88b4be2 100644 --- a/sys/powerpc/ps3/ps3bus.c +++ b/sys/powerpc/ps3/ps3bus.c @@ -631,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_t child) struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && + dinfo->bustype != PS3_BUSTYPE_STORAGE) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); @@ -671,7 +672,15 @@ ps3bus_get_dma_tag(device_t dev, device_t child) NULL, NULL, BUS_SPACE_MAXSIZE, 0, BUS_SPACE_MAXSIZE, 0, NULL, NULL, &dinfo->dma_tag); - bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo); + /* + * Note: storage devices have IOMMU mappings set up by the hypervisor, + * but use physical, non-translated addresses. The above IOMMU + * initialization is necessary for the hypervisor to be able to set up + * the mappings, but actual DMA mappings should not use the IOMMU + * routines. + */ + if (dinfo->bustype != PS3_BUSTYPE_STORAGE) + bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo); fail: mtx_unlock(&dinfo->iommu_mtx); |