From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd: booti: fix the image runtime location
Date: Mon, 12 Sep 2016 08:04:01 -0400 [thread overview]
Message-ID: <20160912120401.GA13192@bill-the-cat> (raw)
In-Reply-To: <20160912091850.GA23934@linux-7smt.suse>
On Mon, Sep 12, 2016 at 05:18:53PM +0800, Peng Fan wrote:
> On Mon, Sep 12, 2016 at 05:07:58PM +0800, Peng Fan wrote:
> >We should not use "bi_dram[0].start + text_offset" as the image dst.
> >The text_offset maybe 0 for some images, such as XEN. Then the dst
> >is actually bi_dram[0].start, which maybe the location of spin table.
> >
> >Let's use "images->ep & ~(ih->text_offset)" as the dst address.
>
> This patch maybe not that correct according to the doc from Linux kernel.
> "
> The Image must be placed text_offset bytes from a 2MB aligned base
> address anywhere in usable system RAM and called there. The region
> between the 2 MB aligned base address and the start of the image has no
> special significance to the kernel, and may be used for other purposes.
> "
>
> Now I do not have a good idea that we may have a spin table in the start
> of DRAM or even a small firmware.
>
> Is it better to change gd->bd->bi_dram[0].start?
> For example physical dram starts from 0x80000000, but 4K is reserved at the beginning.
> So is it ok to change gd->bd->bi_dram[0].start to 0x80001000?
So, to be more precise, with v4.5 the memory location restrictions were
relaxed. So we first need to update cmd/booti.c to know that res1 is
now 'flags' and that we must check bit3 to determine where / how to
align the image. In the case of bit3 == 0 we must continue to do what
we do today. In the case of bit3 == 1, we have to decide what exactly
to do. My first thought is to see if images->ep is 2MB aligned and if
so move to images->ep + ih->text_offset. If not 2MB aligned, align that
and then add ih->text_offset.
Then any areas that need to be reserved in memory, wherever they are,
can still be marked off as reserved in the DT.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160912/1a5ff6e4/attachment.sig>
next prev parent reply other threads:[~2016-09-12 12:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 9:07 [U-Boot] [PATCH] cmd: booti: fix the image runtime location Peng Fan
2016-09-12 9:18 ` Peng Fan
2016-09-12 12:04 ` Tom Rini [this message]
2016-09-13 6:02 ` Peng Fan
2016-09-13 11:19 ` Tom Rini
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=20160912120401.GA13192@bill-the-cat \
--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