linux-stable/include/linux/of_iommu.h
Thierry Reding a5bf3cfce8 iommu: Implement of_iommu_get_resv_regions()
This is an implementation that IOMMU drivers can use to obtain reserved
memory regions from a device tree node. It uses the reserved-memory DT
bindings to find the regions associated with a given device. If these
regions are marked accordingly, identity mappings will be created for
them in the IOMMU domain that the devices will be attached to.

Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230120174251.4004100-4-thierry.reding@gmail.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2023-01-25 11:48:28 +01:00

34 lines
703 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __OF_IOMMU_H
#define __OF_IOMMU_H
struct device;
struct device_node;
struct iommu_ops;
#ifdef CONFIG_OF_IOMMU
extern const struct iommu_ops *of_iommu_configure(struct device *dev,
struct device_node *master_np,
const u32 *id);
extern void of_iommu_get_resv_regions(struct device *dev,
struct list_head *list);
#else
static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
struct device_node *master_np,
const u32 *id)
{
return NULL;
}
static inline void of_iommu_get_resv_regions(struct device *dev,
struct list_head *list)
{
}
#endif /* CONFIG_OF_IOMMU */
#endif /* __OF_IOMMU_H */