* [U-Boot] Relocating to my code. @ 2009-06-22 8:42 prathika 2009-06-24 8:34 ` Detlev Zundel 0 siblings, 1 reply; 5+ messages in thread From: prathika @ 2009-06-22 8:42 UTC (permalink / raw) To: u-boot hi everyone, I am working on a card based on PPC440EP, I am porting u-boot on this card. As I understand, the PPC initially boots from the flash and then relocates itself to RAM address where there is board_init_r() and main_loop() is called. I have an application code that simply does a loop back on UART channel2. After all the initialization, I want to knock off the relocation code, board_init_r() and main_loop() execution in u-boot and relocate it to my application The application code will residing in flash. How can I do this.... anyone kindly help me in this regard........... Regards, Prathika R ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Relocating to my code. 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> 0 siblings, 1 reply; 5+ messages in thread From: Detlev Zundel @ 2009-06-24 8:34 UTC (permalink / raw) To: u-boot Hi Prathika, > hi everyone, > I am working on a card based on PPC440EP, I am porting u-boot on this card. > As I understand, the PPC initially boots from the flash and then > relocates itself to RAM address where there is board_init_r() and > main_loop() is called. Correct. Running from flash makes writing to flash (i.e. updating images there) somewhat complicated. > I have an application code that simply does a loop back on UART > channel2. After all the initialization, > I want to knock off the relocation code, board_init_r() and main_loop() > execution in u-boot and relocate it to my application > The application code will residing in flash. How can I do this.... > anyone kindly help me in this regard........... Why do you want to run from flash - what exactly are you trying to do? Did you think about the consequences, i.e. where will your code store local variables, etc.? Why do you want to use U-Boot in the first place if you do not want to use its main functionality? Cheers Detlev -- The mathematician's patterns, like the painter's or the poet's, must be beautiful; the ideas, like the colours or the words, must fit together in a harmonious way. Beauty is the first test: there is no permanent place in the world for ugly mathematics. -- G. H. Hardy -- 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <4A41EA8A.8080802@deeopl.com>]
* [U-Boot] Relocating to my code. [not found] ` <4A41EA8A.8080802@deeopl.com> @ 2009-06-24 13:39 ` Detlev Zundel 2009-06-25 3:27 ` prathika 0 siblings, 1 reply; 5+ messages in thread From: Detlev Zundel @ 2009-06-24 13:39 UTC (permalink / raw) To: u-boot 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Relocating to my code. 2009-06-24 13:39 ` Detlev Zundel @ 2009-06-25 3:27 ` prathika 2009-06-25 12:58 ` Detlev Zundel 0 siblings, 1 reply; 5+ messages in thread From: prathika @ 2009-06-25 3:27 UTC (permalink / raw) To: u-boot 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Relocating to my code. 2009-06-25 3:27 ` prathika @ 2009-06-25 12:58 ` Detlev Zundel 0 siblings, 0 replies; 5+ messages in thread From: Detlev Zundel @ 2009-06-25 12:58 UTC (permalink / raw) To: u-boot Hi Prathika, > --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 Uhm, well, actually you should not touch U-Boot code at all. It should simply work. > "cp.b fc2e0000 40000 10000;go 40004" should be fine..... Don't forget to substitute fc2e0000 with the address for your setup ;) Cheers Detlev -- Irrationality is the square root of all evil. -- Douglas Hofstadter -- 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-25 12:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-06-25 3:27 ` prathika
2009-06-25 12:58 ` Detlev Zundel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox