aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Kettenis2021-10-23 16:58:02 +0200
committerTom Rini2021-10-31 08:46:44 -0400
commitfb5746243707d6b84dea02490a86868c3d7f534d (patch)
tree42152600fb6ba702c4211d7065c4d5801087eb9d /drivers
parent40dbf03d7d2dd2b5516f797069e3ea830db6fecc (diff)
test: Add tests for IOMMU uclass
Add a set of tests for the IOMMU uclass. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/Makefile2
-rw-r--r--drivers/iommu/sandbox_iommu.c18
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
index f1ceb101507..af1c6bbb7ac 100644
--- a/drivers/iommu/Makefile
+++ b/drivers/iommu/Makefile
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0+
obj-$(CONFIG_IOMMU) += iommu-uclass.o
+
+obj-$(CONFIG_SANDBOX) += sandbox_iommu.o
diff --git a/drivers/iommu/sandbox_iommu.c b/drivers/iommu/sandbox_iommu.c
new file mode 100644
index 00000000000..c8161a40aef
--- /dev/null
+++ b/drivers/iommu/sandbox_iommu.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2021 Mark Kettenis <kettenis@openbsd.org>
+ */
+
+#include <common.h>
+#include <dm.h>
+
+static const struct udevice_id sandbox_iommu_ids[] = {
+ { .compatible = "sandbox,iommu" },
+ { /* sentinel */ }
+};
+
+U_BOOT_DRIVER(sandbox_iommu) = {
+ .name = "sandbox_iommu",
+ .id = UCLASS_IOMMU,
+ .of_match = sandbox_iommu_ids,
+};