Skip to content

Commit 9a87005

Browse files
YongWu-HFjoergroedel
authored andcommitted
iommu/mediatek: Add a flag DCM_DISABLE
In the infra iommu, we should disable DCM. add a new flag for this. Signed-off-by: Yong Wu <yong.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/r/20220503071427.2285-12-yong.wu@mediatek.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 129a3b8 commit 9a87005

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#define F_MMU_STANDARD_AXI_MODE_MASK (BIT(3) | BIT(19))
5252

5353
#define REG_MMU_DCM_DIS 0x050
54+
#define F_MMU_DCM BIT(8)
55+
5456
#define REG_MMU_WR_LEN_CTRL 0x054
5557
#define F_MMU_WR_THROT_DIS_MASK (BIT(5) | BIT(21))
5658

@@ -119,6 +121,7 @@
119121
#define HAS_LEGACY_IVRP_PADDR BIT(7)
120122
#define IOVA_34_EN BIT(8)
121123
#define SHARE_PGTABLE BIT(9) /* 2 HW share pgtable */
124+
#define DCM_DISABLE BIT(10)
122125

123126
#define MTK_IOMMU_HAS_FLAG(pdata, _x) \
124127
((((pdata)->flags) & (_x)) == (_x))
@@ -765,7 +768,11 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)
765768
regval = F_MMU_VLD_PA_RNG(7, 4);
766769
writel_relaxed(regval, data->base + REG_MMU_VLD_PA_RNG);
767770
}
768-
writel_relaxed(0, data->base + REG_MMU_DCM_DIS);
771+
if (MTK_IOMMU_HAS_FLAG(data->plat_data, DCM_DISABLE))
772+
writel_relaxed(F_MMU_DCM, data->base + REG_MMU_DCM_DIS);
773+
else
774+
writel_relaxed(0, data->base + REG_MMU_DCM_DIS);
775+
769776
if (MTK_IOMMU_HAS_FLAG(data->plat_data, WR_THROT_EN)) {
770777
/* write command throttling mode */
771778
regval = readl_relaxed(data->base + REG_MMU_WR_LEN_CTRL);

0 commit comments

Comments
 (0)