Skip to content

Commit 8644441

Browse files
Chao Haojoergroedel
authored andcommitted
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 <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 829316b commit 8644441

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,13 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)
555555
return ret;
556556
}
557557

558-
if (data->plat_data->m4u_plat == M4U_MT8173)
558+
if (data->plat_data->m4u_plat == M4U_MT8173) {
559559
regval = F_MMU_PREFETCH_RT_REPLACE_MOD |
560560
F_MMU_TF_PROT_TO_PROGRAM_ADDR_MT8173;
561-
else
562-
regval = F_MMU_TF_PROT_TO_PROGRAM_ADDR;
561+
} else {
562+
regval = readl_relaxed(data->base + REG_MMU_CTRL_REG);
563+
regval |= F_MMU_TF_PROT_TO_PROGRAM_ADDR;
564+
}
563565
writel_relaxed(regval, data->base + REG_MMU_CTRL_REG);
564566

565567
regval = F_L2_MULIT_HIT_EN |

0 commit comments

Comments
 (0)