[U-Boot-Users] Uboot drivers querry

Hi,
I have a very very elementary question regarding the drivers as implemented in uboot. This is regarding the uboot port that I am doing on my arm proprietary board. I take "at91rm9200" as my reference. I see that for serial drivers certain functions are exposed for eg. "serial_puts" or may be for timers "interrupt_init" or "reset_timer" etc. I see that all these functions are global.
i) How does the bootloader core logic call these functions, are they registered somewhere? Which is that middle layer, that calls these functions?
ii) Now I have to implement these functions for my board, so what do these functions expect? Are these expectations listed anywhere or reading codes of similar boards is the only alternative? I have gone through the whole Readme but could not find it.
iii) How do I know which all functions to implement?
Thanks a lot, Ajay

In message b92b327b0608110622j6d100ae1h6381e86dd150a812@mail.gmail.com you wrote:
i) How does the bootloader core logic call these functions, are they registered somewhere? Which is that middle layer, that calls these functions?
There is no such things as "core logic" or "middle layer". There is only ony big binary which gets linked together from several objet files / libraries. We use standard C or assembler function calls to call any function we need.
ii) Now I have to implement these functions for my board, so what do these functions expect? Are these expectations listed anywhere or reading codes of similar boards is the only alternative? I have gone through the whole Readme but could not find it.
You have to read (and understand!) the existing source code. However, the function name and prototype is usually quite telling.
iii) How do I know which all functions to implement?
The linker will tell you any missing ones as unresolved external references.
Best regards,
Wolfgang Denk

i) How does the bootloader core logic call these functions, are they registered somewhere? Which is that middle layer, that calls these functions?
There is no such things as "core logic" or "middle layer". There is only ony big binary which gets linked together from several objet files / libraries. We use standard C or assembler function calls to call any function we need.
I guess I could not make my point clear. i) From what I understand is that functions like "reset timer", "serial_puts" etc are called anywhere from the code logic as they are global. Is that correct? Their implementation is local to the board architecture. ii) Where does interrupt_init get called from? This is supposed to be a one time call. This is what I was refering to the "core logic".
Thanks & Regards, Ajay

In message b92b327b0608110702v671c7fe3hee41ed43f9ff17a2@mail.gmail.com you wrote:
I guess I could not make my point clear.
Indeed.
i) From what I understand is that functions like "reset timer", "serial_puts" etc are called anywhere from the code logic as they are global. Is that correct? Their implementation is local to the board architecture.
No, these functions are not called "everywhere". Normally you will use puts() instead. serial_puts() may (or may not) be called implicetely then, depending on your stdout settings.
ii) Where does interrupt_init get called from? This is supposed to be
How about using grep to search the source code?
a one time call. This is what I was refering to the "core logic".
I still fail to understand what you mean by "core logic". The fact that we call a function just once does not make it "core logic".
U-Boot's init sequence is described in the README. See there.
Best regards,
Wolfgang Denk
participants (2)
-
Ajay Jain
-
Wolfgang Denk