@@ -92,6 +92,7 @@ int pci_host_common_probe(struct platform_device *pdev,
return ret;
}
+ of_pci_host_check_ats(bridge);
platform_set_drvdata(pdev, bridge->bus);
return 0;
}
@@ -576,6 +576,15 @@ int pci_parse_request_of_pci_ranges(struct device *dev,
}
EXPORT_SYMBOL_GPL(pci_parse_request_of_pci_ranges);
+void of_pci_host_check_ats(struct pci_host_bridge *bridge)
+{
+ struct device_node *np = bridge->bus->dev.of_node;
+
+ if (!np)
+ return;
+
+ bridge->ats_supported = of_property_read_bool(np, "ats-supported");
+}
#endif /* CONFIG_PCI */
/**
@@ -7,12 +7,14 @@
struct pci_dev;
struct device_node;
+struct pci_host_bridge;
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI)
struct device_node *of_pci_find_child_device(struct device_node *parent,
unsigned int devfn);
int of_pci_get_devfn(struct device_node *np);
void of_pci_check_probe_only(void);
+void of_pci_host_check_ats(struct pci_host_bridge *bridge);
#else
static inline struct device_node *of_pci_find_child_device(struct device_node *parent,
unsigned int devfn)
@@ -26,6 +28,7 @@ static inline int of_pci_get_devfn(struct device_node *np)
}
static inline void of_pci_check_probe_only(void) { }
+static inline void of_pci_host_check_ats(struct pci_host_bridge *bridge) { }
#endif
#if IS_ENABLED(CONFIG_OF_IRQ)
Copy the ats-supported flag into the pci_host_bridge structure. Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> --- drivers/pci/controller/pci-host-common.c | 1 + drivers/pci/of.c | 9 +++++++++ include/linux/of_pci.h | 3 +++ 3 files changed, 13 insertions(+)