public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] pci: tegra: clip RAM size to 32-bits
@ 2015-10-05 23:00 Stephen Warren
  2015-10-05 23:00 ` [U-Boot] [PATCH 2/5] pci: tegra: use #address-/size-cells from DT Stephen Warren
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Stephen Warren @ 2015-10-05 23:00 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

Tegra peripherals can generally access a 32-bit physical address space,
and I believe this applies to PCIe. Clip the PCI region that refers to
DRAM so it fits into 32-bits to avoid issues.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/pci/pci_tegra.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c
index ebb959f1f31f..357e7793b4ff 100644
--- a/drivers/pci/pci_tegra.c
+++ b/drivers/pci/pci_tegra.c
@@ -997,6 +997,14 @@ static const struct tegra_pcie_soc tegra124_pcie_soc = {
 static int process_nodes(const void *fdt, int nodes[], unsigned int count)
 {
 	unsigned int i;
+	uint64_t dram_end;
+	uint32_t pci_dram_size;
+
+	/* Clip PCI-accessible DRAM to 32-bits */
+	dram_end = ((uint64_t)NV_PA_SDRAM_BASE) + gd->ram_size;
+	if (dram_end > 0x100000000)
+		dram_end = 0x100000000;
+	pci_dram_size = dram_end - NV_PA_SDRAM_BASE;
 
 	for (i = 0; i < count; i++) {
 		const struct tegra_pcie_soc *soc;
@@ -1069,7 +1077,7 @@ static int process_nodes(const void *fdt, int nodes[], unsigned int count)
 		pcie->hose.last_busno = 0;
 
 		pci_set_region(&pcie->hose.regions[0], NV_PA_SDRAM_BASE,
-			       NV_PA_SDRAM_BASE, gd->ram_size,
+			       NV_PA_SDRAM_BASE, pci_dram_size,
 			       PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
 
 		pci_set_region(&pcie->hose.regions[1], pcie->io.start,
-- 
1.9.1

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

end of thread, other threads:[~2015-10-21 16:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 23:00 [U-Boot] [PATCH 1/5] pci: tegra: clip RAM size to 32-bits Stephen Warren
2015-10-05 23:00 ` [U-Boot] [PATCH 2/5] pci: tegra: use #address-/size-cells from DT Stephen Warren
2015-10-05 23:00 ` [U-Boot] [PATCH 3/5] pci: tegra: implement PCA enable workaround Stephen Warren
2015-10-05 23:00 ` [U-Boot] [PATCH 4/5] pci: tegra: call tegra_pcie_board_init() earlier Stephen Warren
2015-10-06 15:14   ` Simon Glass
2015-10-17 18:13     ` Simon Glass
2015-10-05 23:00 ` [U-Boot] [PATCH 5/5] pci: tegra: add/enable support for Tegra210 Stephen Warren
2015-10-21 16:41 ` [U-Boot] [PATCH 1/5] pci: tegra: clip RAM size to 32-bits Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox