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>
This commit is contained in:
16
include/iommu.h
Normal file
16
include/iommu.h
Normal file
@@ -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
|
Reference in New Issue
Block a user