public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] How does u-boot know where to put its start code?
Date: Fri, 22 Apr 2011 15:56:07 +0200	[thread overview]
Message-ID: <4DB188F7.2010709@aribaud.net> (raw)
In-Reply-To: <4DB1785C.4070509@dawes.za.net>

Le 22/04/2011 14:45, Rogan Dawes a ?crit :
> On 2011/04/20 12:17 PM, Rogan Dawes wrote:
>> Now if I can just figure out how to write to my flash using OpenOCD, I
>> can hopefully recover.
>>
>> Regards,
>>
>> Rogan
>
> Phew! Thanks to Albert's sloflash utility, I was finally able to get
> something back into my flash, and get the board booting again. What a
> relief! :-D
>
> Now I need to solve the problem of placing the _start code at the
> address of the reset vector, since I have 3 64kB sectors to play with,
> but one of them is 99% empty, other than the reset vector code which
> just jumps to _start.
>
> And of course, a mainline u-boot will not fit into just 128kB.
>
> Any thoughts on how to link u-boot to place _start or any other routine
> that can jump to _start at 0xffff0000?
>
> I had this suggestion on IRC:
>
>              . = .;
>              __u_boot_cmd_start = .;
>              .u_boot_cmd : { *(.u_boot_cmd) }
>              __u_boot_cmd_end = .;
>
>              . = _start + 0x70000;
>              .reset_vector_sect :
>              {
>                      arch/arm/cpu/arm926ejs/start.o (.reset_vector_sect)
>                      *(.reset_vector_sect)
>              }
>
>
>
>      #include<asm-offsets.h>
>      #include<config.h>
>      #include<common.h>
>      #include<version.h>
>
>      .section    ".reset_vector_sect",#alloc, #execinstr
>      _reset_vector:
>          b   _start
>
>
> Although I'm not sure how to interpret it :-)

Basically (the excepts are only a sketch of what is really needed) it 
amounts to manually mapping code sections, some at FFF80000 and some 
(the reset vectors first) at FFFF0000. It does not fill up the last 
sector at FFFF0000, not in this form at least, because the last sector 
would only contain the reset sector sections; you'd have to select other 
input sections to complement the reset vector ones. Plus, the generated 
binary would actually span the whole flash, from FFF80000 to FFFFxxxx, 
which is *huge*.

> Regards,
>
> Rogan


Amicalement,
-- 
Albert.

      reply	other threads:[~2011-04-22 13:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 21:13 [U-Boot] How does u-boot know where to put its start code? Rogan Dawes
2011-04-20  2:23 ` Hebbar, Gururaja
2011-04-20  5:42   ` Albert ARIBAUD
2011-04-20  7:46     ` Rogan Dawes
2011-04-20  8:29       ` Albert ARIBAUD
2011-04-20 10:17         ` Rogan Dawes
2011-04-22 12:45           ` Rogan Dawes
2011-04-22 13:56             ` Albert ARIBAUD [this message]

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=4DB188F7.2010709@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --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