]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
commit803cf9e5a6aa64e94f9c554190bc0031929f6857
tree3738e53cb6a4f21eaae4d4c5b793c9f20e07eff3
parent585e58f498a2855dc7a8d351df34dd645447f337
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