[U-Boot] Relocating to my code.

prathika prathika at deeopl.com
Thu Jun 25 05:27:45 CEST 2009




Detlev Zundel wrote:
> 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.
>
>   
--Thanks for your reply Detley. I think I was just trying to complicate 
things.I have got a better picture now.
Before calling relcoate_code() in board.c, ifI using the command

"cp.b fc2e0000 40000 10000;go 40004"  should be fine.....

Thanks & Regards,
Prathika R




More information about the U-Boot mailing list