Skip to content

Commit f4b97d3

Browse files
zhengnan-chenjoergroedel
authored andcommitted
iommu/mediatek: mt8189: Add INFRA IOMMUs support
Add support for mt8189 INFRA IOMMUs. Signed-off-by: Zhengnan Chen <zhengnan.chen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Yong Wu <yong.wu@mediatek.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent 7e87226 commit f4b97d3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data, unsigned int ban
339339
#define MTK_IOMMU_4GB_MODE_REMAP_BASE 0x140000000UL
340340

341341
static LIST_HEAD(apulist); /* List the apu iommu HWs */
342+
static LIST_HEAD(infralist); /* List the iommu_infra HW */
342343
static LIST_HEAD(m4ulist); /* List all the M4U HWs */
343344

344345
#define for_each_m4u(data, head) list_for_each_entry(data, head, list)
@@ -1758,6 +1759,18 @@ static const struct mtk_iommu_plat_data mt8189_data_apu = {
17581759
.iova_region_larb_msk = mt8189_apu_region_msk,
17591760
};
17601761

1762+
static const struct mtk_iommu_plat_data mt8189_data_infra = {
1763+
.m4u_plat = M4U_MT8189,
1764+
.flags = WR_THROT_EN | DCM_DISABLE | MTK_IOMMU_TYPE_INFRA |
1765+
CFG_IFA_MASTER_IN_ATF | SHARE_PGTABLE | PGTABLE_PA_35_EN,
1766+
.hw_list = &infralist,
1767+
.banks_num = 1,
1768+
.banks_enable = {true},
1769+
.inv_sel_reg = REG_MMU_INV_SEL_GEN2,
1770+
.iova_region = single_domain,
1771+
.iova_region_nr = ARRAY_SIZE(single_domain),
1772+
};
1773+
17611774
static const struct mtk_iommu_plat_data mt8192_data = {
17621775
.m4u_plat = M4U_MT8192,
17631776
.flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN |
@@ -1860,6 +1873,7 @@ static const struct of_device_id mtk_iommu_of_ids[] = {
18601873
{ .compatible = "mediatek,mt8188-iommu-vdo", .data = &mt8188_data_vdo},
18611874
{ .compatible = "mediatek,mt8188-iommu-vpp", .data = &mt8188_data_vpp},
18621875
{ .compatible = "mediatek,mt8189-iommu-apu", .data = &mt8189_data_apu},
1876+
{ .compatible = "mediatek,mt8189-iommu-infra", .data = &mt8189_data_infra},
18631877
{ .compatible = "mediatek,mt8192-m4u", .data = &mt8192_data},
18641878
{ .compatible = "mediatek,mt8195-iommu-infra", .data = &mt8195_data_infra},
18651879
{ .compatible = "mediatek,mt8195-iommu-vdo", .data = &mt8195_data_vdo},

0 commit comments

Comments
 (0)