Lines Matching +full:iommu +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0-only
3 * OF helpers for IOMMU
9 #include <linux/iommu.h>
26 struct fwnode_handle *fwnode = &iommu_spec->np->fwnode; in of_iommu_xlate()
30 if ((ops && !ops->of_xlate) || in of_iommu_xlate()
31 !of_device_is_available(iommu_spec->np)) in of_iommu_xlate()
34 ret = iommu_fwspec_init(dev, &iommu_spec->np->fwnode, ops); in of_iommu_xlate()
38 * The otherwise-empty fwspec handily serves to indicate the specific in of_iommu_xlate()
39 * IOMMU device we're waiting for, which will be useful if we ever get in of_iommu_xlate()
40 * a proper probe-ordering dependency mechanism in future. in of_iommu_xlate()
45 if (!try_module_get(ops->owner)) in of_iommu_xlate()
46 return -ENODEV; in of_iommu_xlate()
48 ret = ops->of_xlate(dev, iommu_spec); in of_iommu_xlate()
49 module_put(ops->owner); in of_iommu_xlate()
60 err = of_map_id(master_np, *id, "iommu-map", in of_iommu_configure_dev_id()
61 "iommu-map-mask", &iommu_spec.np, in of_iommu_configure_dev_id()
64 return err == -ENODEV ? NO_IOMMU : err; in of_iommu_configure_dev_id()
78 "#iommu-cells", in of_iommu_configure_dev()
100 return of_iommu_configure_dev_id(info->np, info->dev, &input_id); in of_pci_iommu_init()
122 if (fwspec->ops) in of_iommu_configure()
123 return fwspec->ops; in of_iommu_configure()
130 * We don't currently walk up the tree looking for a parent IOMMU. in of_iommu_configure()
132 * Documentation/devicetree/bindings/iommu/iommu.txt in of_iommu_configure()
148 * Two success conditions can be represented by non-negative err here: in of_iommu_configure()
149 * >0 : there is no IOMMU, or one was unavailable for non-fatal reasons in of_iommu_configure()
150 * 0 : we found an IOMMU, and dev->fwspec is initialised appropriately in of_iommu_configure()
156 ops = fwspec->ops; in of_iommu_configure()
159 * If we have reason to believe the IOMMU driver missed the initial in of_iommu_configure()
162 if (!err && dev->bus && !device_iommu_mapped(dev)) in of_iommu_configure()
166 if (err == -EPROBE_DEFER) { in of_iommu_configure()
169 dev_dbg(dev, "Adding to IOMMU failed: %d\n", err); in of_iommu_configure()