iommu/mediatek: Support up to 34bit iova in tlb flush
authorYong Wu <yong.wu@mediatek.com>
Mon, 11 Jan 2021 11:19:02 +0000 (19:19 +0800)
committerWill Deacon <will@kernel.org>
Mon, 1 Feb 2021 11:31:18 +0000 (11:31 +0000)
commitbfed873114c5fbb8982113abbab17cde7788dcba
tree72522429d270c1f2f7a4395919dc353458a5ba69
parentc0b57581b73be7b43f39e0dff201c93413f6a668
iommu/mediatek: Support up to 34bit iova in tlb flush

If the iova is 34bit, the iova[32][33] is the bit0/1 in the tlb flush
register. Add a new macro for this.

In the macro, since (iova + size - 1) may be end with 0xfff, then the
bit0/1 always is 1, thus add a mask.

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