summaryrefslogtreecommitdiff
path: root/include/iommu.h
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@openbsd.org>2021-10-23 17:58:01 +0300
committerTom Rini <trini@konsulko.com>2021-10-31 15:46:44 +0300
commit40dbf03d7d2dd2b5516f797069e3ea830db6fecc (patch)
tree130f479f79def7c72f81cf6ffd834a0c9c2bf82e /include/iommu.h
parentd73db3042734f8077a5866d9d60d2eeda685b2ec (diff)
downloadu-boot-40dbf03d7d2dd2b5516f797069e3ea830db6fecc.tar.xz
iommu: Add IOMMU uclass
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU. This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/iommu.h')
-rw-r--r--include/iommu.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/iommu.h b/include/iommu.h
new file mode 100644
index 0000000000..6c46adf449
--- /dev/null
+++ b/include/iommu.h
@@ -0,0 +1,16 @@
+#ifndef _IOMMU_H
+#define _IOMMU_H
+
+struct udevice;
+
+#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
+ CONFIG_IS_ENABLED(IOMMU)
+int dev_iommu_enable(struct udevice *dev);
+#else
+static inline int dev_iommu_enable(struct udevice *dev)
+{
+ return 0;
+}
+#endif
+
+#endif