[U-Boot-Users] clarifications u-boot for arm

Hi, I am using a omap5912osk board which uses arm926-ejs CPU.
I am trying to understand the flow of u-boot - what really happens when the board is powered on till i get the u-boot prompt which accepts commands from the user.
I started with the file u-boot-1.1.4/cpu/arm926ejs/start.S
Is this the place where u-boot actually starts?.
It tries switch the cpu mode to SVC32 mode and relocates u-boot to RAM, disables MMU and does so many things which i dont really understand.
Could anyone explain it to me what really is happening out there and why?.
Then i figured out that a function start_armboot() is called. This function is present in lib_arm/board.c is this function called by start.S?
Where exactly it is called from?.
There is a reference to start_armboot in start.S not sure if it is the one?.
ldr pc, _start_armboot
_start_armboot: .word start_armboot
Does this actually invoke start_armboot?.
I have got so far. could you please tell me am i right in my understarting?.
I understand that start_armboot initialises the the cpu, board, dram....
Once this is done - we can say that the board has been initialised.
Now start_armboot provides a prompt to accept and download the kernel.
Am i right in assuming this?.
Any other information and pointers u provide will be helpful
I am trying to understand u-boot sources and any help will be highly appreciated.
I just wanted to clarify my understanding.
Thanks and Regards, sriram

In message 8bf247760607140029l62f6c124idee300237361518f@mail.gmail.com you wrote:
I am trying to understand the flow of u-boot - what really happens
when the board is powered on till i get the u-boot prompt which accepts commands from the user.
You've posted the same question before.
I started with the file u-boot-1.1.4/cpu/arm926ejs/start.S Is this the place where u-boot actually starts?.
Yes.
It tries switch the cpu mode to SVC32 mode and relocates u-boot to RAM, disables MMU and does so many things which i dont really understand.
I recommend toi follow the flow step by step. Most functions have pretty descriptive names.
Could anyone explain it to me what really is happening out there and why?.
We initialize the system step by step as needed to get a running system capable of booting Linux.
Then i figured out that a function start_armboot() is called. This function is present in lib_arm/board.c is this function called by start.S?
Where exactly it is called from?.
Use grep to find the call.
There is a reference to start_armboot in start.S not sure if it is the one?.
Why not?
ldr pc, _start_armboot
_start_armboot: .word start_armboot
Does this actually invoke start_armboot?.
Guess what happens when you load a new address into the rpgram counter?
I have got so far. could you please tell me am i right in my understarting?.
Yes.
I understand that start_armboot initialises the the cpu, board, dram.... Once this is done - we can say that the board has been initialised.
More or less.
Any other information and pointers u provide will be helpful
Read the README, the manual, and the sources.
Best regards,
Wolfgang Denk

Hi, Thanks for your response. I have gone much further and would like to know If
ldr pc, _start_armboot _start_armboot: .word start_armboot
Does this really invoke start_armboot?. This is because _start_armboot is what is stored in pc and not start_armboot and there is also a branch point _start_armboot (underscore start_armboot) Please see above.
Actually the above declares a variable start_armboot and does not invoke the function start_armboot. If this is true, then who calls start_armboot?
According to me start_armboot ( ) which is present in lib_arm/board.c never returns until u reset the board and probably should be one of the last functions that needs to be called.
Correct?.
Rest agreed, What i have understood is First, reset is called which set the cpu to SVC32 mode and calls cpu_init_crit which inturn calls lowlevel_init to setup memory and board specific register values.
Then stack is setup and start_amboot is called.
start_armboot is the point of entry where code is C. ie (Assembly to C) begins from start_armboot.
am i Correct?.
This is the function which does some remaining initialisation and then starts initialising the for pheripherals.
am i Correct?
I didnt understand the things relating interrupt and thier processing though.
Thanks and Regards, sriram

Hello,
The answer to your question "who calls start_armboot?" is answered by you ASM code below. Hint... take a close look at the regsiter you are loading.
:-)
Regards,
Russell
On 7/14/06, Ram vshrirama@gmail.com wrote:
Hi, Thanks for your response. I have gone much further and would like to know If
ldr pc, _start_armboot _start_armboot: .word start_armboot
Does this really invoke start_armboot?. This is because _start_armboot is what is stored in pc and not start_armboot and there is also a branch point _start_armboot (underscore start_armboot) Please see above.
Actually the above declares a variable start_armboot and does not invoke the function start_armboot. If this is true, then who calls start_armboot?
According to me start_armboot ( ) which is present in lib_arm/board.c never returns until u reset the board and probably should be one of the last functions that needs to be called.
Correct?.
Rest agreed, What i have understood is First, reset is called which set the cpu to SVC32 mode and calls cpu_init_crit which inturn calls lowlevel_init to setup memory and board specific register values.
Then stack is setup and start_amboot is called. start_armboot is the point of entry where code is C. ie
(Assembly to C) begins from start_armboot.
am i Correct?. This is the function which does some remaining initialisation
and then starts initialising the for pheripherals.
am i Correct?
I didnt understand the things relating interrupt and thier processing though.
Thanks and Regards, sriram
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&da... _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

See bottom posted reply.
Russell Peterson wrote:
Hello,
The answer to your question "who calls start_armboot?" is answered by you ASM code below. Hint... take a close look at the regsiter you are loading.
:-)
Regards,
Russell
On 7/14/06, *Ram* <vshrirama@gmail.com mailto:vshrirama@gmail.com> wrote:
Hi, Thanks for your response. I have gone much further and would like to know If ldr pc, _start_armboot _start_armboot: .word start_armboot Does this really invoke start_armboot?. This is because _start_armboot is what is stored in pc and not start_armboot and there is also a branch point _start_armboot (underscore start_armboot) Please see above. Actually the above declares a variable start_armboot and does not invoke the function start_armboot. If this is true, then who calls start_armboot?
[snip - I believe your observations are correct, but am not an expert]
Thanks and Regards, sriram
Sriram:
C compiler naming convention prepends an underscore to the C function name so the C function start_armboot() can be referenced from assembly as a branch (call) to the label _start_armboot.
gvb

Dear Ram!
Ram schrieb:
Does this really invoke start_armboot?. This is because
_start_armboot is what is stored in pc and not start_armboot and there is also a branch point _start_armboot (underscore start_armboot) Please see above.
And why don't you learn the syntax and semantics of ARM assembler before you send messages to this list?
I didnt understand the things relating interrupt and thier processing though.
In order to understand the interrupt related things I recommend reading some documents about ARM architecture, your processor datasheet(s) AND U-BOOT DOCUMENTATION. Then you will find out by yourself why it is so difficult to understand interrupt handling on most platforms... :-) And why don't you just hook your JTAG debugger on the interrupt entry point and try to follow the execution flow? Then you will also notice something very important in U-Boot...
Andreas Schweigstill
participants (5)
-
Andreas Schweigstill
-
Jerry Van Baren
-
Ram
-
Russell Peterson
-
Wolfgang Denk