Skip to content

Commit b17336c

Browse files
Honghui Zhangjoergroedel
authored andcommitted
iommu/mediatek: add support for mtk iommu generation one HW
Mediatek SoC's M4U has two generations of HW architcture. Generation one uses flat, one layer pagetable, and was shipped with ARM architecture, it only supports 4K size page mapping. MT2701 SoC uses this generation one m4u HW. Generation two uses the ARM short-descriptor translation table format for address translation, and was shipped with ARM64 architecture, MT8173 uses this generation two m4u HW. All the two generation iommu HW only have one iommu domain, and all its iommu clients share the same iova address. These two generation m4u HW have slit different register groups and register offset, but most register names are the same. This patch add iommu support for mediatek SoC mt2701. Signed-off-by: Honghui Zhang <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 3c8f4ad commit b17336c

File tree

3 files changed

+746
-0
lines changed

3 files changed

+746
-0
lines changed

drivers/iommu/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,22 @@ config MTK_IOMMU
343343

344344
If unsure, say N here.
345345

346+
config MTK_IOMMU_V1
347+
bool "MTK IOMMU Version 1 (M4U gen1) Support"
348+
depends on ARM
349+
depends on ARCH_MEDIATEK || COMPILE_TEST
350+
select ARM_DMA_USE_IOMMU
351+
select IOMMU_API
352+
select MEMORY
353+
select MTK_SMI
354+
select COMMON_CLK_MT2701_MMSYS
355+
select COMMON_CLK_MT2701_IMGSYS
356+
select COMMON_CLK_MT2701_VDECSYS
357+
help
358+
Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
359+
Multimedia Memory Managememt Unit. This option enables remapping of
360+
DMA memory accesses for the multimedia subsystem.
361+
362+
if unsure, say N here.
363+
346364
endif # IOMMU_SUPPORT

drivers/iommu/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-$(CONFIG_INTEL_IOMMU_SVM) += intel-svm.o
1818
obj-$(CONFIG_IPMMU_VMSA) += ipmmu-vmsa.o
1919
obj-$(CONFIG_IRQ_REMAP) += intel_irq_remapping.o irq_remapping.o
2020
obj-$(CONFIG_MTK_IOMMU) += mtk_iommu.o
21+
obj-$(CONFIG_MTK_IOMMU_V1) += mtk_iommu_v1.o
2122
obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o
2223
obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o
2324
obj-$(CONFIG_ROCKCHIP_IOMMU) += rockchip-iommu.o

0 commit comments

Comments
 (0)