summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@openbsd.org>2021-10-23 17:58:02 +0300
committerTom Rini <trini@konsulko.com>2021-10-31 15:46:44 +0300
commitfb5746243707d6b84dea02490a86868c3d7f534d (patch)
tree42152600fb6ba702c4211d7065c4d5801087eb9d /drivers
parent40dbf03d7d2dd2b5516f797069e3ea830db6fecc (diff)
downloadu-boot-fb5746243707d6b84dea02490a86868c3d7f534d.tar.xz
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 f1ceb10150..af1c6bbb7a 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 0000000000..c8161a40ae
--- /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,
+};