aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/host/pci-aardvark.c2
-rw-r--r--drivers/pci/host/pci-tegra.c22
2 files changed, 8 insertions, 16 deletions
diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c
index 89f4e3d072d7..26ed0c08f209 100644
--- a/drivers/pci/host/pci-aardvark.c
+++ b/drivers/pci/host/pci-aardvark.c
@@ -935,6 +935,8 @@ static int advk_pcie_probe(struct platform_device *pdev)
935 bridge->sysdata = pcie; 935 bridge->sysdata = pcie;
936 bridge->busnr = 0; 936 bridge->busnr = 0;
937 bridge->ops = &advk_pcie_ops; 937 bridge->ops = &advk_pcie_ops;
938 bridge->map_irq = of_irq_parse_and_map_pci;
939 bridge->swizzle_irq = pci_common_swizzle;
938 940
939 ret = pci_scan_root_bus_bridge(bridge); 941 ret = pci_scan_root_bus_bridge(bridge);
940 if (ret < 0) { 942 if (ret < 0) {
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 9c40da54f88a..1987fec1f126 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -233,6 +233,7 @@ struct tegra_msi {
233 struct msi_controller chip; 233 struct msi_controller chip;
234 DECLARE_BITMAP(used, INT_PCI_MSI_NR); 234 DECLARE_BITMAP(used, INT_PCI_MSI_NR);
235 struct irq_domain *domain; 235 struct irq_domain *domain;
236 unsigned long pages;
236 struct mutex lock; 237 struct mutex lock;
237 u64 phys; 238 u64 phys;
238 int irq; 239 int irq;
@@ -1529,22 +1530,9 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
1529 goto err; 1530 goto err;
1530 } 1531 }
1531 1532
1532 /* 1533 /* setup AFI/FPCI range */
1533 * The PCI host bridge on Tegra contains some logic that intercepts 1534 msi->pages = __get_free_pages(GFP_KERNEL, 0);
1534 * MSI writes, which means that the MSI target address doesn't have 1535 msi->phys = virt_to_phys((void *)msi->pages);
1535 * to point to actual physical memory. Rather than allocating one 4
1536 * KiB page of system memory that's never used, we can simply pick
1537 * an arbitrary address within an area reserved for system memory
1538 * in the FPCI address map.
1539 *
1540 * However, in order to avoid confusion, we pick an address that
1541 * doesn't map to physical memory. The FPCI address map reserves a
1542 * 1012 GiB region for system memory and memory-mapped I/O. Since
1543 * none of the Tegra SoCs that contain this PCI host bridge can
1544 * address more than 16 GiB of system memory, the last 4 KiB of
1545 * these 1012 GiB is a good candidate.
1546 */
1547 msi->phys = 0xfcfffff000;
1548 1536
1549 afi_writel(pcie, msi->phys >> soc->msi_base_shift, AFI_MSI_FPCI_BAR_ST); 1537 afi_writel(pcie, msi->phys >> soc->msi_base_shift, AFI_MSI_FPCI_BAR_ST);
1550 afi_writel(pcie, msi->phys, AFI_MSI_AXI_BAR_ST); 1538 afi_writel(pcie, msi->phys, AFI_MSI_AXI_BAR_ST);
@@ -1596,6 +1584,8 @@ static int tegra_pcie_disable_msi(struct tegra_pcie *pcie)
1596 afi_writel(pcie, 0, AFI_MSI_EN_VEC6); 1584 afi_writel(pcie, 0, AFI_MSI_EN_VEC6);
1597 afi_writel(pcie, 0, AFI_MSI_EN_VEC7); 1585 afi_writel(pcie, 0, AFI_MSI_EN_VEC7);
1598 1586
1587 free_pages(msi->pages, 0);
1588
1599 if (msi->irq > 0) 1589 if (msi->irq > 0)
1600 free_irq(msi->irq, pcie); 1590 free_irq(msi->irq, pcie);
1601 1591