@@ -6,6 +6,8 @@
#include <common.h>
#include <fdtdec.h>
+DECLARE_GLOBAL_DATA_PTR;
+
int dram_init(void)
{
return fdtdec_setup_mem_size_base();
@@ -15,3 +17,23 @@ int dram_init_banksize(void)
{
return fdtdec_setup_memory_banksize();
}
+
+ulong board_get_usable_ram_top(ulong total_size)
+{
+#ifdef CONFIG_64BIT
+ /*
+ * Ensure that we run from first 4GB so that all
+ * addresses used by U-Boot are 32bit addresses.
+ *
+ * This in-turn ensures that 32bit DMA capabale
+ * devices work fine because DMA mapping APIs will
+ * provide 32bit DMA addresses only.
+ */
+ if (gd->ram_top > 0x100000000UL)
+ return 0x100000000UL;
+ else
+ return gd->ram_top;
+#else
+ return gd->ram_top;
+#endif
+}