]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/mach-tegra/board2.c
ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs
[karo-tx-uboot.git] / arch / arm / mach-tegra / board2.c
index ce9b6959efb13a31be8c757f6f3b4bee5c83fcf3..e0d8687cbcface59f107f1d1a11157824ba6e34f 100644 (file)
@@ -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