From: David Daney <ddaney.cavm@gmail.com>
To: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org,
Sivasubramanian Palanisamy <sivasubramanian.palanisamy@nokia.com>
Subject: Re: [PATCH] MIPS: OCTEON: use bootloader provided value for max memory
Date: Mon, 23 May 2016 10:15:19 -0700 [thread overview]
Message-ID: <57433AA7.2070005@gmail.com> (raw)
In-Reply-To: <1464016319-5266-1-git-send-email-aaro.koskinen@nokia.com>
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
prev parent reply other threads:[~2016-05-23 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57433AA7.2070005@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=aaro.koskinen@nokia.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=sivasubramanian.palanisamy@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.