Skip to content

Commit ba40f9d

Browse files
rmurphy-armjoergroedel
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/a8d7c0b4393b360ce556f5f15e229d1e2fe73c83.1741702556.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 73d2f10 commit ba40f9d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

drivers/iommu/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ config MTK_IOMMU
482482

483483
config MTK_IOMMU_V1
484484
tristate "MediaTek IOMMU Version 1 (M4U gen1) Support"
485-
depends on ARM
486-
depends on ARCH_MEDIATEK || COMPILE_TEST
485+
depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST
487486
select ARM_DMA_USE_IOMMU
488487
select IOMMU_API
489488
select MEMORY

drivers/iommu/mtk_iommu_v1.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,20 @@
2727
#include <linux/spinlock.h>
2828
#include <linux/string_choices.h>
2929
#include <asm/barrier.h>
30-
#include <asm/dma-iommu.h>
3130
#include <dt-bindings/memory/mtk-memory-port.h>
3231
#include <dt-bindings/memory/mt2701-larb-port.h>
3332
#include <soc/mediatek/smi.h>
3433

34+
#if defined(CONFIG_ARM)
35+
#include <asm/dma-iommu.h>
36+
#else
37+
#define arm_iommu_create_mapping(...) NULL
38+
#define arm_iommu_attach_device(...) -ENODEV
39+
struct dma_iommu_mapping {
40+
struct iommu_domain *domain;
41+
};
42+
#endif
43+
3544
#define REG_MMU_PT_BASE_ADDR 0x000
3645

3746
#define F_ALL_INVLD 0x2

0 commit comments

Comments
 (0)