UPSTREAM: iommu/rockchip: Use DMA API to manage coherency
authorJeffy Chen <jeffy.chen@rock-chips.com>
Mon, 28 Nov 2016 12:43:09 +0000 (20:43 +0800)
committerJeffy Chen <jeffy.chen@rock-chips.com>
Mon, 28 Nov 2016 12:45:31 +0000 (20:45 +0800)
commit5faeb3ebb42c1b7264ad3de6505f8bed31e8b1ed
tree3d848bac82573730e4c32aeede1ea4ea19e276d7
parent4ba9328836ff43c11aa89d5308f24607a7a191c9
UPSTREAM: iommu/rockchip: Use DMA API to manage coherency

Use DMA API instead of architecture internal functions like
__cpuc_flush_dcache_area() etc.

The biggest difficulty here is that dma_map and _sync calls require some
struct device, while there is no real 1:1 relation between an IOMMU
domain and some device. To overcome this, a simple platform device is
registered for each allocated IOMMU domain.

With this patch, this driver can be used on both ARM and ARM64
platforms, such as RK3288 and RK3399 respectively.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit 4f0aba676735c653b4e739b760c1e66cd520d3e3)

Conflicts:
drivers/iommu/rockchip-iommu.c

Change-Id: I0424318ed0cea947e7c8f8d3b52f716f6cc98ce0
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
drivers/iommu/rockchip-iommu.c