All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: tegra: Use different MSI target address for Tegra20
@ 2017-09-23  6:17 ` Thierry Reding
  0 siblings, 0 replies; 20+ messages in thread
From: Thierry Reding @ 2017-09-23  6:17 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Thierry Reding, Jonathan Hunter,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

The Tegra20 PCIe controller has a different address range for MSI, so
select a different target address.

Fixes: d7bd554f27c9 ("PCI: tegra: Do not allocate MSI target memory")
Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/pci/host/pci-tegra.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index e8e1ddbaabc9..5b02ea59524b 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1563,8 +1563,18 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
 	 * none of the Tegra SoCs that contain this PCI host bridge can
 	 * address more than 16 GiB of system memory, the last 4 KiB of
 	 * these 1012 GiB is a good candidate.
+	 *
+	 * Unfortunately, Tegra20 is slightly different in that the physical
+	 * address for this MSI region is limited to the lower 32 bits of the
+	 * address map, so the address that we pick is going to have to be
+	 * located somewhere within the region addressable by the CPU and
+	 * on-SoC controllers. To be on the safe side, we select an address
+	 * from a region that is marked unused (0xf0010000 - 0xfffeffff).
 	 */
-	msi->phys = 0xfcfffff000;
+	if (soc->msi_base_shift > 0)
+		msi->phys = 0xfcfffff000;
+	else
+		msi->phys = 0x00f0010000;
 
 	afi_writel(pcie, msi->phys >> soc->msi_base_shift, AFI_MSI_FPCI_BAR_ST);
 	afi_writel(pcie, msi->phys, AFI_MSI_AXI_BAR_ST);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-10-11  0:09 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-23  6:17 [PATCH] PCI: tegra: Use different MSI target address for Tegra20 Thierry Reding
2017-09-23  6:17 ` Thierry Reding
     [not found] ` <20170923061740.6012-1-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-09-25  5:14   ` vidya sagar
2017-09-25  5:14     ` vidya sagar
     [not found]     ` <CAN7O0+JyG3XT5SsWGsiZs0vrk0ha1vQ5N7rjYxs3tM_NvdONdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-25  8:51       ` Thierry Reding
2017-09-25  8:51         ` Thierry Reding
2017-09-28 14:19       ` Thierry Reding
2017-09-28 14:19         ` Thierry Reding
2017-09-29  2:57         ` Bjorn Helgaas
2017-09-29  2:57           ` Bjorn Helgaas
     [not found]           ` <20170929025719.GZ15970-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-09-29  7:22             ` Thierry Reding
2017-09-29  7:22               ` Thierry Reding
2017-10-02 20:19               ` Bjorn Helgaas
2017-10-02 20:19                 ` Bjorn Helgaas
     [not found]                 ` <20171002201924.GC5407-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-10-09 10:29                   ` [PATCH] Revert "PCI: tegra: Do not allocate MSI target memory" Thierry Reding
2017-10-09 10:29                     ` Thierry Reding
     [not found]                     ` <20171009102935.14515-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-11  0:09                       ` Bjorn Helgaas
2017-10-11  0:09                         ` Bjorn Helgaas
2017-10-09 17:43                   ` [PATCH] PCI: tegra: Use different MSI target address for Tegra20 vidya sagar
2017-10-09 17:43                     ` vidya sagar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.