]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/mediatek: Add get_domain_id from dev->dma_range_map
authorYong Wu <yong.wu@mediatek.com>
Mon, 11 Jan 2021 11:19:08 +0000 (19:19 +0800)
committerWill Deacon <will@kernel.org>
Mon, 1 Feb 2021 11:31:19 +0000 (11:31 +0000)
commitb3fdf68e87cf7852d29170ee437798d0ce7a7d6d
tree3738e53cb6a4f21eaae4d4c5b793c9f20e07eff3
parentca2452ec46f9c81c5cb628bc4bc40effabc730bb
iommu/mediatek: Add get_domain_id from dev->dma_range_map

Add a new interface _get_domain_id from dev->dma_range_map,
The iommu consumer device will use dma-ranges in dtsi node to indicate
its dma address region requirement. In this iommu driver, we will get
the requirement and decide which iova domain it should locate.

In the lastest SoC, there will be several iova-regions(domains), we will
compare and calculate which domain is right. If the start/end of device
requirement equal some region. it is best fit of course. If it is inside
some region, it is also ok. the iova requirement of a device should not
be inside two or more regions.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Link: https://lore.kernel.org/r/20210111111914.22211-28-yong.wu@mediatek.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/mtk_iommu.c