diff options
author | Robin Murphy <robin.murphy@arm.com> | 2025-03-11 14:15:56 +0000 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2025-03-13 12:17:30 +0100 |
commit | ba40f9dc95b27df499ee683d94baa82bfe73b69e (patch) | |
tree | 85d5b954452294439e0a5903d493f65b75894eac | |
parent | 73d2f10957f517e5918c81b7e859e214ba71c044 (diff) |
iommu/mediatek-v1: Support COMPILE_TEST
Add COMPILE_TEST support to Mediatek v1 so I have less chance of
breaking it again in future. This just needs the ARM dma-iommu API
stubbing out for now.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/a8d7c0b4393b360ce556f5f15e229d1e2fe73c83.1741702556.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | drivers/iommu/Kconfig | 3 | ||||
-rw-r--r-- | drivers/iommu/mtk_iommu_v1.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 5124e7431fe3..cd750f512dee 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -482,8 +482,7 @@ config MTK_IOMMU config MTK_IOMMU_V1 tristate "MediaTek IOMMU Version 1 (M4U gen1) Support" - depends on ARM - depends on ARCH_MEDIATEK || COMPILE_TEST + depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST select ARM_DMA_USE_IOMMU select IOMMU_API select MEMORY diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 3e724e7f10f0..66824982e05f 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -27,11 +27,20 @@ #include <linux/spinlock.h> #include <linux/string_choices.h> #include <asm/barrier.h> -#include <asm/dma-iommu.h> #include <dt-bindings/memory/mtk-memory-port.h> #include <dt-bindings/memory/mt2701-larb-port.h> #include <soc/mediatek/smi.h> +#if defined(CONFIG_ARM) +#include <asm/dma-iommu.h> +#else +#define arm_iommu_create_mapping(...) NULL +#define arm_iommu_attach_device(...) -ENODEV +struct dma_iommu_mapping { + struct iommu_domain *domain; +}; +#endif + #define REG_MMU_PT_BASE_ADDR 0x000 #define F_ALL_INVLD 0x2 |