]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/memsize.c
am335x_evm: Remove SPI SPL from NOR support target
[karo-tx-uboot.git] / common / memsize.c
index 73b92c8a00e4f76ebde34a50b5da4847e4599455..589400d3b14d8a8c53e9908ca2aec7cce66f0e11 100644 (file)
@@ -5,7 +5,10 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include <config.h>
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef __PPC__
 /*
  * At least on G2 PowerPC cores, sequential accesses to non-existent
@@ -76,3 +79,14 @@ long get_ram_size(long *base, long maxsize)
 
        return (maxsize);
 }
+
+phys_size_t __weak get_effective_memsize(void)
+{
+#ifndef CONFIG_VERY_BIG_RAM
+       return gd->ram_size;
+#else
+       /* limit stack to what we can reasonable map */
+       return ((gd->ram_size > CONFIG_MAX_MEM_MAPPED) ?
+               CONFIG_MAX_MEM_MAPPED : gd->ram_size);
+#endif
+}