public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Darwin Rambo <drambo@broadcom.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: Allow u-boot to run from offset base address
Date: Thu, 15 May 2014 07:16:27 -0700	[thread overview]
Message-ID: <5374CC3B.7000504@broadcom.com> (raw)
In-Reply-To: <20140515042628.5CEB038047D@gemini.denx.de>


On 14-05-14 09:26 PM, Wolfgang Denk wrote:
> Dear Darwin Rambo,
>
> In message <1400105145-6628-1-git-send-email-drambo@broadcom.com> you wrote:
>> If an earlier loader stage requires an image header and a specific
>> offset, then u-boot's base address (CONFIG_SYS_TEXT_BASE) may be
>> advanced beyond an aligned address. In this case the relocation
> Sorry, I cannot parse that.  CONFIG_SYS_TEXT_BASE is a compile time
> constant, it cannot be "advanced" by a loader.  Do you mean that some
> loader loads U-Boot to an incorrect address?  Well, in this case the
> loader should be fixed, or?

Thank you for your comments.
  
I mean that the loader loads u-boot to it's correct address, which is
offset by a small amount because of a previous header requiring alignment.
Here's an example. u-boot is compiled to run at 0x88000020 because we want
to put a small header in front of the image, which starts at 0x88000000 and
needs to be aligned for its own reasons. Now for arm64, I believe that u-boot
cannot normally be positioned at any alignment less than 0x800 hex. So
u-boot would normally run at addresses like 0x88000000, 0x88000800, 0x88001000, etc.
And in these cases the relocation works fine. But if we want to position u-boot
at a smaller offset than 0x800, the symbol relocation breaks for arm64. It
turns out that there is a trivial fix so that u-boot can run at smaller offset
addresses, which I have provided here, is tested, and solves our problem nicely,
but only for arm64 right now.

>
>> This change is done under CONFIG_ARM64 conditional compilation
>> because it has only been tested there and may not be appropriate
>> for other architectures.
> In any case, any such changes (if there should be agreement that they
> are actually useful) should be done in an architecture-neutral way.
> Implementing it for one specific architecture only is wrong.

Yes, I agree, but I am not sure if this is a arm64-only problem or not.
Armv7 doesn't show this problem, and I can't test other architectures
for their alignment issues. So I thought that I would at least show the
fix for arm64 so we can decide if and how to proceed. Any suggestions you
can provide on how to proceed would be appreciated. And if the fix is
not suitable for upstreaming, then we should know it.

Is there a way to have architecture specific hooks like this called from
the generic common/board_f.c? The fix is also in arch/arm/lib/board.c but it
sounds like that file might be disappearing.

Also there might be a generic fix possible that works for all architectures
(by removing the ifdef CONFIG_ARM64), but I don't have the resources to test
them. Maybe it would be best to decide if we want to support this feature or
not first. Thanks!

Regards,
Darwin

>
> Best regards,
>
> Wolfgang Denk
>

  reply	other threads:[~2014-05-15 14:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 22:05 [U-Boot] [PATCH] arm: Allow u-boot to run from offset base address Darwin Rambo
2014-05-14 22:41 ` Jeroen Hofstee
2014-05-15 14:21   ` Darwin Rambo
2014-05-15 15:21     ` Wolfgang Denk
2014-05-15 16:07       ` Darwin Rambo
2014-05-15 19:19         ` Wolfgang Denk
2014-05-26  9:50           ` Albert ARIBAUD
2014-05-26 16:11             ` Darwin Rambo
2014-06-02  7:26               ` Albert ARIBAUD
2014-06-03  0:37                 ` Darwin Rambo
2014-06-09 10:23                   ` Albert ARIBAUD
2014-06-09 20:45                     ` Steve Rae
2014-06-09 20:56                       ` Jeroen Hofstee
2014-06-10  5:16                       ` Albert ARIBAUD
2014-06-10 17:56                         ` Steve Rae
2014-06-10 18:13                           ` Wolfgang Denk
2014-06-10 19:38                             ` Steve Rae
2014-06-10 20:35                               ` Wolfgang Denk
2014-06-10 23:15                                 ` Steve Rae
2014-06-11  4:49                                   ` Wolfgang Denk
2014-06-11  6:45                                     ` Albert ARIBAUD
2014-06-11 18:56                                       ` Steve Rae
2014-06-11 21:16                                         ` Wolfgang Denk
2014-06-25 12:52                                           ` Albert ARIBAUD
2014-06-10 21:20                               ` Albert ARIBAUD
2014-06-11  0:14                                 ` Steve Rae
2014-06-11  5:02                                   ` Wolfgang Denk
2014-06-11  4:38                                 ` Wolfgang Denk
2014-05-15  4:26 ` Wolfgang Denk
2014-05-15 14:16   ` Darwin Rambo [this message]
2014-05-15 15:16     ` Wolfgang Denk

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=5374CC3B.7000504@broadcom.com \
    --to=drambo@broadcom.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