Skip to content

Commit e149573

Browse files
willdeacongregkh
authored andcommitted
of: property: Add device link support for "iommu-map"
Commit 8e12257 ("of: property: Add device link support for iommus, mboxes and io-channels") added device link support for IOMMU linkages described using the "iommus" property. For PCI devices, this property is not present and instead the "iommu-map" property is used on the host bridge node to map the endpoint RequesterIDs to their corresponding IOMMU instance. Add support for "iommu-map" to the device link supplier bindings so that probing of PCI devices can be deferred until after the IOMMU is available. Cc: Rob Herring <[email protected]> Cc: Robin Murphy <[email protected]> Signed-off-by: Will Deacon <[email protected]> Acked-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3883539 commit e149573

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/of/property.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,10 +1190,20 @@ DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
11901190
DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells")
11911191
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
11921192

1193+
static struct device_node *parse_iommu_maps(struct device_node *np,
1194+
const char *prop_name, int index)
1195+
{
1196+
if (strcmp(prop_name, "iommu-map"))
1197+
return NULL;
1198+
1199+
return of_parse_phandle(np, prop_name, (index * 4) + 1);
1200+
}
1201+
11931202
static const struct supplier_bindings of_supplier_bindings[] = {
11941203
{ .parse_prop = parse_clocks, },
11951204
{ .parse_prop = parse_interconnects, },
11961205
{ .parse_prop = parse_iommus, },
1206+
{ .parse_prop = parse_iommu_maps, },
11971207
{ .parse_prop = parse_mboxes, },
11981208
{ .parse_prop = parse_io_channels, },
11991209
{ .parse_prop = parse_regulators, },

0 commit comments

Comments
 (0)