Skip to content

Commit 068c86e

Browse files
Chao Haojoergroedel
authored andcommitted
iommu/mediatek: Add mt6779 basic support
1. Start from mt6779, INVLDT_SEL move to offset=0x2c, so we add REG_MMU_INV_SEL_GEN2 definition and mt6779 uses it. 2. Add mt6779_data to support mm_iommu HW init. Signed-off-by: Chao Hao <[email protected]> Reviewed-by: 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 8644441 commit 068c86e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#define REG_MMU_INVLD_START_A 0x024
3838
#define REG_MMU_INVLD_END_A 0x028
3939

40+
#define REG_MMU_INV_SEL_GEN2 0x02c
4041
#define REG_MMU_INV_SEL_GEN1 0x038
4142
#define F_INVLD_EN0 BIT(0)
4243
#define F_INVLD_EN1 BIT(1)
@@ -808,6 +809,13 @@ static const struct mtk_iommu_plat_data mt2712_data = {
808809
.larbid_remap = {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}},
809810
};
810811

812+
static const struct mtk_iommu_plat_data mt6779_data = {
813+
.m4u_plat = M4U_MT6779,
814+
.flags = HAS_SUB_COMM | OUT_ORDER_WR_EN | WR_THROT_EN,
815+
.inv_sel_reg = REG_MMU_INV_SEL_GEN2,
816+
.larbid_remap = {{0}, {1}, {2}, {3}, {5}, {7, 8}, {10}, {9}},
817+
};
818+
811819
static const struct mtk_iommu_plat_data mt8173_data = {
812820
.m4u_plat = M4U_MT8173,
813821
.flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI,
@@ -824,6 +832,7 @@ static const struct mtk_iommu_plat_data mt8183_data = {
824832

825833
static const struct of_device_id mtk_iommu_of_ids[] = {
826834
{ .compatible = "mediatek,mt2712-m4u", .data = &mt2712_data},
835+
{ .compatible = "mediatek,mt6779-m4u", .data = &mt6779_data},
827836
{ .compatible = "mediatek,mt8173-m4u", .data = &mt8173_data},
828837
{ .compatible = "mediatek,mt8183-m4u", .data = &mt8183_data},
829838
{}

drivers/iommu/mtk_iommu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct mtk_iommu_suspend_reg {
3737
enum mtk_iommu_plat {
3838
M4U_MT2701,
3939
M4U_MT2712,
40+
M4U_MT6779,
4041
M4U_MT8173,
4142
M4U_MT8183,
4243
};

0 commit comments

Comments
 (0)