* [PATCH] MIPS: OCTEON: use bootloader provided value for max memory
@ 2016-05-23 15:11 Aaro Koskinen
2016-05-23 17:15 ` David Daney
0 siblings, 1 reply; 2+ messages in thread
From: Aaro Koskinen @ 2016-05-23 15:11 UTC (permalink / raw)
To: David Daney, Ralf Baechle, linux-mips
Cc: Sivasubramanian Palanisamy, Aaro Koskinen
From: Sivasubramanian Palanisamy <sivasubramanian.palanisamy@nokia.com>
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@nokia.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
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;
arg = strstr(arcs_cmdline, "mem=");
if (arg) {
--
2.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: OCTEON: use bootloader provided value for max memory
2016-05-23 15:11 [PATCH] MIPS: OCTEON: use bootloader provided value for max memory Aaro Koskinen
@ 2016-05-23 17:15 ` David Daney
0 siblings, 0 replies; 2+ messages in thread
From: David Daney @ 2016-05-23 17:15 UTC (permalink / raw)
To: Aaro Koskinen; +Cc: Ralf Baechle, linux-mips, Sivasubramanian Palanisamy
On 05/23/2016 08:11 AM, Aaro Koskinen wrote:
> From: Sivasubramanian Palanisamy <sivasubramanian.palanisamy@nokia.com>
>
> 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@nokia.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-23 17:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 15:11 [PATCH] MIPS: OCTEON: use bootloader provided value for max memory Aaro Koskinen
2016-05-23 17:15 ` David Daney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox