public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] common: bootm: reserve memory bank
Date: Mon, 18 Jun 2018 15:02:24 -0400	[thread overview]
Message-ID: <20180618190224.GL4609@bill-the-cat.ec.rr.com> (raw)
In-Reply-To: <1528960045-6651-1-git-send-email-jason.zhu@rock-chips.com>

On Thu, Jun 14, 2018 at 03:07:25PM +0800, Jason Zhu wrote:

> Actually the DRAM is not only seperated in one
> bank. The DRAM bank information is stored in
> gd->bd->bi_dram, so reserve lmb according to
> gd->bd->bi_dram.
> 
> Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
> ---
>  common/bootm.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/common/bootm.c b/common/bootm.c
> index e789f68..46689fa 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -53,16 +53,23 @@ __weak void board_quiesce_devices(void)
>  #ifdef CONFIG_LMB
>  static void boot_start_lmb(bootm_headers_t *images)
>  {
> +	lmb_init(&images->lmb);
> +#ifdef CONFIG_NR_DRAM_BANKS
> +	int i;
> +
> +	for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
> +		lmb_add(&images->lmb, gd->bd->bi_dram[i].start,
> +			gd->bd->bi_dram[i].size);
> +	}
> +#else
>  	ulong		mem_start;
>  	phys_size_t	mem_size;
>  
> -	lmb_init(&images->lmb);
> -
>  	mem_start = env_get_bootm_low();
>  	mem_size = env_get_bootm_size();
>  
>  	lmb_add(&images->lmb, (phys_addr_t)mem_start, mem_size);
> -
> +#endif
>  	arch_lmb_reserve(&images->lmb);
>  	board_lmb_reserve(&images->lmb);
>  }

Can you describe a bit how you ran into this problem?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180618/ae0c2d01/attachment.sig>

  reply	other threads:[~2018-06-18 19:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14  7:07 [U-Boot] [PATCH] common: bootm: reserve memory bank Jason Zhu
2018-06-18 19:02 ` Tom Rini [this message]
2018-06-19  1:20   ` jason.zhu at rock-chips.com
2018-06-25  2:31 ` Kever Yang
  -- strict thread matches above, loose matches on Subject: below --
2018-06-14  8:06 Jason Zhu

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=20180618190224.GL4609@bill-the-cat.ec.rr.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox