On 05/23/2016 08:11 AM, Aaro Koskinen wrote:
From: Sivasubramanian Palanisamy <sivasubramanian.palanisamy@xxxxxxxxx>
Currently the maximum memory on OCTEON boards is limited to 512 MB unless
user passes the mem= parameter. Use bootloader provided value for max
memory instead of the hardcoded default limit.
Signed-off-by: Sivasubramanian Palanisamy <sivasubramanian.palanisamy@xxxxxxxxx>
Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxxxxx>
---
arch/mips/cavium-octeon/setup.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index cd7101f..ef9705d 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -800,6 +800,8 @@ void __init prom_init(void)
/* Default to 64MB in the simulator to speed things up */
if (octeon_is_simulation())
MAX_MEMORY = 64ull << 20;
+ else if (octeon_bootinfo->dram_size)
+ MAX_MEMORY = octeon_bootinfo->dram_size * 1024ull * 1024ull;
We can make this whole thing more sane by:
1) Rename MAX_MEMORY to max_memory, as it is not a macro.
2) Statically assign the default value at the variable definition site
at the top of the file to something like ULLONG_MAX.
3) Don't add these two lines as they would now be redundant.
David Daney