summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Roese <[email protected]>2016-11-11 08:18:44 +0100
committerStefan Roese <[email protected]>2016-12-05 13:34:33 +0100
commit059f75d501c8a92c6e25b6996e28a81ee6cb0418 (patch)
treefda39ab59abe1eaa5f6eede066192662ae696129
parent1ec5aa630a02174734725ce49bd5351ad5037c2e (diff)
arm64: mvebu: Restrict memory size to a usable maximum
Not all memory is mapped in the MMU. So we need to restrict the memory size so that U-Boot does not try to access it. Also, the internal registers are located at 0xf000.0000 - 0xffff.ffff. Currently only 2GiB are mapped for system memory. This is what we pass to the U-Boot subsystem here. Signed-off-by: Stefan Roese <[email protected]> Cc: Nadav Haklai <[email protected]> Cc: Neta Zur Hershkovits <[email protected]> Cc: Kostya Porotchkin <[email protected]> Cc: Omri Itach <[email protected]> Cc: Igal Liberman <[email protected]> Cc: Haim Boot <[email protected]> Cc: Hanna Hawa <[email protected]>
-rw-r--r--arch/arm/mach-mvebu/arm64-common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c
index 1fc2ff2f7cf..8f026559c2f 100644
--- a/arch/arm/mach-mvebu/arm64-common.c
+++ b/arch/arm/mach-mvebu/arm64-common.c
@@ -17,6 +17,23 @@
DECLARE_GLOBAL_DATA_PTR;
/*
+ * Not all memory is mapped in the MMU. So we need to restrict the
+ * memory size so that U-Boot does not try to access it. Also, the
+ * internal registers are located at 0xf000.0000 - 0xffff.ffff.
+ * Currently only 2GiB are mapped for system memory. This is what
+ * we pass to the U-Boot subsystem here.
+ */
+#define USABLE_RAM_SIZE 0x80000000
+
+ulong board_get_usable_ram_top(ulong total_size)
+{
+ if (gd->ram_size > USABLE_RAM_SIZE)
+ return USABLE_RAM_SIZE;
+
+ return gd->ram_size;
+}
+
+/*
* On ARMv8, MBus is not configured in U-Boot. To enable compilation
* of the already implemented drivers, lets add a dummy version of
* this function so that linking does not fail.