Commit 9cb30a71 authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Bjorn Helgaas
Browse files

PCI: OF: Support "external-facing" property



Set the "untrusted" attribute to any PCIe port that has an
"external-facing" device tree property.  Any device downstream of this port
will inherit the attribute and have only the strictest IOMMU protection.

Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent badd9f19
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -31,10 +31,16 @@ void pci_release_of_node(struct pci_dev *dev)

void pci_set_bus_of_node(struct pci_bus *bus)
{
	if (bus->self == NULL)
		bus->dev.of_node = pcibios_get_phb_of_node(bus);
	else
		bus->dev.of_node = of_node_get(bus->self->dev.of_node);
	struct device_node *node;

	if (bus->self == NULL) {
		node = pcibios_get_phb_of_node(bus);
	} else {
		node = of_node_get(bus->self->dev.of_node);
		if (node && of_property_read_bool(node, "external-facing"))
			bus->self->untrusted = true;
	}
	bus->dev.of_node = node;
}

void pci_release_bus_of_node(struct pci_bus *bus)