All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH][RFC] image: fdt: Fix DT relocation handling with multiple DRAM banks with gap
Date: Sat, 12 Mar 2022 03:41:25 +0100	[thread overview]
Message-ID: <9832fafc-bb88-9c6a-1a72-4b21f7a03877@denx.de> (raw)
In-Reply-To: <CAPnjgZ04U19z0KFKjSRC7RvzjPv_tRd-fv=J=SqSGLmm=AH2BQ@mail.gmail.com>

On 3/12/22 03:24, Simon Glass wrote:
> Hi Marek,
> 
> On Wed, 21 Jul 2021 at 18:05, Marek Vasut <marex@denx.de> wrote:
>>
>> The current implementation of boot_relocate_fdt() places DT at the
>> highest usable DRAM address, which is calculated as:
>>    env_get_bootm_low() + env_get_bootm_mapsize()
>> which by default becomes gd->ram_base + gd->ram_size.
>>
>> Systems like i.MX53 can have multiple DRAM banks with gap between them,
>> e.g. have DRAM at 0x70000000-0x8fffffff and 0xb0000000-0xcfffffff , so
>> for them the calculated highest DRAM address is 0xafffffff, which is
>> exactly in the gap and thus not usable.
>>
>> Fix this by iterating over all DRAM banks and tracking the remaining
>> amount of the total mapping size obtained from env_get_bootm_mapsize().
>> Limit the maximum LMB area size to each bank, to avoid using nonexistent
>> DRAM.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Tom Rini <trini@konsulko.com>
>> ---
>>   common/image-fdt.c | 40 ++++++++++++++++++++++++++++++++++++----
>>   1 file changed, 36 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Should we put this behind a Kconfig option to reduce code size?

Since this depends on DT content, we cannot predict what kind of DT will 
be passed to U-Boot, so no, we cannot put this behind a Kconfig option.

  reply	other threads:[~2022-03-12  2:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  0:05 [PATCH][RFC] image: fdt: Fix DT relocation handling with multiple DRAM banks with gap Marek Vasut
2022-03-12  2:24 ` Simon Glass
2022-03-12  2:41   ` Marek Vasut [this message]
2022-03-12  5:02     ` Simon Glass
2022-03-12 10:40       ` Marek Vasut

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=9832fafc-bb88-9c6a-1a72-4b21f7a03877@denx.de \
    --to=marex@denx.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 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.