iommu/mediatek: Modify MMU_CTRL register setting
authorChao Hao <chao.hao@mediatek.com>
Fri, 3 Jul 2020 04:41:26 +0000 (12:41 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 10 Jul 2020 14:13:11 +0000 (16:13 +0200)
commit864444130eed304835b09c86a5bf2ff05bc2f4a2
tree7e77da511f06b82979e428ef541e907e63274c05
parent829316b3bc897a3275a0354505fde3ccd0053936
iommu/mediatek: Modify MMU_CTRL register setting

The MMU_CTRL register of MT8173 is different from other SoCs.
The in_order_wr_en is bit[9] which is zero by default.
Other SoCs have the vitcim_tlb_en feature mapped to bit[12].
This bit is set to one by default. We need to preserve the bit
when setting F_MMU_TF_PROT_TO_PROGRAM_ADDR as otherwise the
bit will be cleared and IOMMU performance will drop.

Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Yong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20200703044127.27438-10-chao.hao@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c