[PATCH] Add support for CONFIG_ARM64_DMA_USE_IOMMU.

Arnd Bergmann arnd at arndb.de
Sat Mar 21 18:31:40 PDT 2015


On Wednesday 18 March 2015, Suman Tripathi wrote:
> I guess there is an overlap with this thread:
> 
> http://thread.gmane.org/gmane.linux.kernel.iommu/8213
> 
> I would rather go for a more generic solution that Robin (cc'ed) is
> trying to implement.
> 
> I followed the above thread but our requirement deviates from normal
> IOMMU conventions.
> For our case we need a 1:1 mapping of PA to IOVA. Actually our's is
> not a real IOMMU (ie not having a cap of page table walk). It's a
> simple 32-bit from (device side ) ot 64-bit (cpu side) address
> translation with the help of a set of window registers. So we want to
> bypass the entire iova .
> 
> Any suggestions on this ?

My first suggestion would be to separate this from IOMMU support completely
as you don't really have an IOMMU. The easiest way to deal with hardware
like this is to use swiotlb with a fixed mapping. This is also the only
way to deal with any devices that may have multiple outstanding DMAs
(PCI, SATA, USB, ...). 

If you have any high-speed devices that only do a single request at a
time connected to this remapper, I would suggest you implement your own
set of dma_map_ops and come back with performance data showing whether it's
worth merging this compared to the trivial iommu support.

	Arnd



More information about the linux-arm-kernel mailing list