From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] powerpc SPL framework: Avoiding relocate_code
Date: Thu, 12 Sep 2013 12:58:57 -0500 [thread overview]
Message-ID: <1379008737.2536.15.camel@snotra.buserror.net> (raw)
In-Reply-To: <522DAD4A.3010504@freescale.com>
On Mon, 2013-09-09 at 16:43 +0530, Prabhakar Kushwaha wrote:
> Hi,
>
> SPL framework is used to support multi-stage booting. Where first
> level boot loader is created via SPL having relocate_code() function.
> I am working on a Freescale's SoC which has less internal SRAM.
> I don't want to use relocate_code() as to support this function, I need
> to reduce SPL bin to SRAM/2 size.
>
> is there way to avoid relocate_code function ?
>
> I tried with below sequence, but it is not working for me :(
>
> .globl relocate_code
> relocate_code:
> mr r1,r3 /* Set new stack pointer */
> mr r9,r4 /* Save copy of Init Data pointer */
> mr r10,r5 /* Save copy of Destination Address */
>
> GET_GOT
> #ifndef CONFIG_SPL_BUILD
>
> --
> --
> #endif
> .globl in_ram
> in_ram:
Well, you certainly don't want to disable it for all SPLs...
> The reason is bss "variables" which are mapped to 0x0000_0000 onwards
> because "bss"section are mapped after 0xfffffffc in lds. They are not
> available during SPL execution. is there way to relocate bss section in
> the execution range of SPL?
Are you talking about a scenario in which the SPL is loaded into SRAM
rather than (e.g.) the NAND buffer? In that case, why is U-Boot not
linked at the actual SRAM address? No copy should be needed in that
case, and the BSS will not be at zero.
If you are talking about a NAND buffer style boot (i.e. not a PBL-using
chip), then you must relocate, so the NAND buffer can be reused for I/O
(and in any case the SRAM is much larger than the NAND buffer on
Freescale PPC chips that I'm familiar with).
-Scott
next prev parent reply other threads:[~2013-09-12 17:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 11:13 [U-Boot] powerpc SPL framework: Avoiding relocate_code Prabhakar Kushwaha
2013-09-12 17:58 ` Scott Wood [this message]
2013-09-13 9:53 ` Prabhakar Kushwaha
2013-09-16 20:46 ` Scott Wood
-- strict thread matches above, loose matches on Subject: below --
2013-09-09 11:10 Prabhakar Kushwaha
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=1379008737.2536.15.camel@snotra.buserror.net \
--to=scottwood@freescale.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