@@ -197,6 +197,15 @@ static void __iomem *xilinx_pcie_map_bus(struct pci_bus *bus,
return port->reg_base + relbus + where;
}
+/*
+ * This PCIe bridge only has a 32 bit bus master interface, thus truncating
+ * the DMA capability of all PCIe devices attached beneath it.
+ */
+static void xilinx_pcie_add_dev(struct pci_dev *pdev)
+{
+ pdev->dev.bus_dma_mask = DMA_BIT_MASK(32);
+}
+
/* PCIe operations */
static struct pci_ops xilinx_pcie_ops = {
.map_bus = xilinx_pcie_map_bus,
@@ -665,6 +674,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
bridge->ops = &xilinx_pcie_ops;
bridge->map_irq = of_irq_parse_and_map_pci;
bridge->swizzle_irq = pci_common_swizzle;
+ bridge->add_dev = xilinx_pcie_add_dev;
#ifdef CONFIG_PCI_MSI
xilinx_pcie_msi_chip.dev = dev;
This PCIe bridge only has a 32 bit bus master interface, thus truncating the DMA capability of all PCIe devices attached beneath it. This caps the child device capability so that these devices work on systems with physical memory beyond the 4GiB threshold. Based on an earlier patch from Wesley W. Terpstra <wesley@sifive.com>. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/pci/controller/pcie-xilinx.c | 10 ++++++++++ 1 file changed, 10 insertions(+)