All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs
@ 2015-07-27 17:45 Stephen Warren
  2015-07-27 17:45 ` [U-Boot] [PATCH 2/3] ARM: tegra: Use standard cache enable for 64-bit Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stephen Warren @ 2015-07-27 17:45 UTC (permalink / raw)
  To: u-boot

From: Thierry Reding <treding@nvidia.com>

Most peripherals on Tegra can do DMA only to the lower 32-bit
address space, even on 64-bit SoCs. This limitation is
typically overcome by the use of an IOMMU. Since the IOMMU is
not entirely trivial to set up and serves no other purpose
(I/O protection, ...) in U-Boot, restrict 64-bit Tegra SoCs to
the lower 32-bit address space for RAM. This ensures that the
physical addresses of buffers that are programmed into the
various DMA engines are valid and don't alias to lower addresses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
These 3 patches are pre-requisites for T210 support (either compile-time
or run-time) but don't seem to have been sent to the mailing lists
recently.

 arch/arm/mach-tegra/board2.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index ce9b6959efb1..e0d8687cbcfa 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -274,3 +274,19 @@ void pad_init_mmc(struct mmc_host *host)
 #endif	/* T30 */
 }
 #endif	/* MMC */
+
+#ifdef CONFIG_ARM64
+/*
+ * Most hardware on 64-bit Tegra is still restricted to DMA to the lower
+ * 32-bits of the physical address space. Cap the maximum usable RAM area
+ * at 4 GiB to avoid DMA buffers from being allocated beyond the 32-bit
+ * boundary that most devices can address.
+ */
+ulong board_get_usable_ram_top(ulong total_size)
+{
+	if (gd->ram_top > 0x100000000)
+		return 0x100000000;
+
+	return gd->ram_top;
+}
+#endif
-- 
1.9.1

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

end of thread, other threads:[~2015-07-28 16:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 17:45 [U-Boot] [PATCH 1/3] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs Stephen Warren
2015-07-27 17:45 ` [U-Boot] [PATCH 2/3] ARM: tegra: Use standard cache enable for 64-bit Stephen Warren
2015-07-28 15:33   ` Simon Glass
2015-07-28 15:42     ` Stephen Warren
2015-07-27 17:45 ` [U-Boot] [PATCH 3/3] ARM: tegra: Disable SPL and non-cached memory on 64-bit Stephen Warren
2015-07-28 15:33   ` Simon Glass
2015-07-28 15:44     ` Stephen Warren
2015-07-28 15:50       ` Simon Glass
2015-07-28 16:05         ` Stephen Warren
2015-07-28 16:12           ` Simon Glass
2015-07-28 15:33 ` [U-Boot] [PATCH 1/3] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs Simon Glass

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.