public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Relocating to my code.
Date: Wed, 24 Jun 2009 15:39:08 +0200	[thread overview]
Message-ID: <m2prcthhtv.fsf@ohwell.denx.de> (raw)
In-Reply-To: <4A41EA8A.8080802@deeopl.com> (prathika@deeopl.com's message of "Wed, 24 Jun 2009 14:27:46 +0530")

Hi Prathika,

> I did not mean it should run from flash itself..My application will
> just reside in flash, I will read back from flash to a RAM location.

To be honest, I have trouble understanding this.

> As I understand, in board_init_f(), after calling the init_sequence,
> relocate_code() is called and it is a must to call relocate_code(),
> from where it branches to main_loop().  My aim is to branch to my
> application code before calling relocate_code().My application code's
> executable address is 0x40004.

Well, if you are working on a PowerPC platform, then 0x40004 is
certainly a RAM address.

> Is it that i can just give jump to 0x40004 before calling
> relocate_code() and it works?

I still don't get why you want to change *anything* inside U-Boot.  Why
not just use the commands that are available in the command line
interpreter?  Say you have your application stored at fc2e0000
(arbitrary address) and it is 64k in size.  Then why not just do:

cp.b fc2e0000 40000 10000;go 40004

Setting bootenv to these commands will start your application on U-Boot
timeout.  Sticking them into preboot even runs them before the command
line is started at all.

Cheers
  Detlev

-- 
 Those who do not understand Unix are condemned to reinvent it,
 poorly.
 - Henry Spencer, University of Toronto Unix hack
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

  parent reply	other threads:[~2009-06-24 13:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22  8:42 [U-Boot] Relocating to my code prathika
2009-06-24  8:34 ` Detlev Zundel
     [not found]   ` <4A41EA8A.8080802@deeopl.com>
2009-06-24 13:39     ` Detlev Zundel [this message]
2009-06-25  3:27       ` prathika
2009-06-25 12:58         ` Detlev Zundel

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=m2prcthhtv.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --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