From mboxrd@z Thu Jan 1 00:00:00 1970 From: prathika Date: Thu, 25 Jun 2009 08:57:45 +0530 Subject: [U-Boot] Relocating to my code. In-Reply-To: References: <4A3F43F0.4050603@deeopl.com> <4A41EA8A.8080802@deeopl.com> Message-ID: <4A42EEB1.109@deeopl.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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