@@ -678,6 +678,9 @@ static int mtk_iommu_probe(struct platform_device *pdev)
}
data->larb_imu[id].dev = &plarbdev->dev;
+ if (data->plat_data->m4u1_mask == (1 << id))
+ data->m4u_id = 1;
+
component_match_add_release(dev, &match, release_of,
compare_of, larbnode);
}
@@ -42,6 +42,7 @@ struct mtk_iommu_plat_data {
bool has_bclk;
bool has_vld_pa_rng;
bool reset_axi;
+ u32 m4u1_mask;
unsigned char larbid_remap[MTK_LARB_NR_MAX];
};
@@ -59,6 +60,7 @@ struct mtk_iommu_data {
bool enable_4GB;
spinlock_t tlb_lock; /* lock for tlb range flush */
+ u32 m4u_id;
struct iommu_device iommu;
const struct mtk_iommu_plat_data *plat_data;
For some platforms(ex: later mt6779), it maybe have two IOMMUs, so we can add m4u_mask variable to distinguish it by different smi_larb id Signed-off-by: Chao Hao <chao.hao@mediatek.com> --- drivers/iommu/mtk_iommu.c | 3 +++ drivers/iommu/mtk_iommu.h | 2 ++ 2 files changed, 5 insertions(+) -- 2.18.0