C function call in Linux kernel
Quoted 10 lines
Quoted 1 line · In message <[email protected]> you wrote:
I check the structure before I posted this question. I also tried to
include
Quoted 2 lines
u-boot.h. But still no luck. The kernel is always stuck at the first C function call.Let's go back a few steps.
How do you know that? And what exactly means "stuck" in this context?
I put the following piece of code in head_4xx.S:
lis r17, UART1_BASE at h
addi r17, r17, UART1_BASE at l
li r18, '1'
stb r18, 0(r17)
sync
bl early_init /* We have to do this with MMU on */
lis r17, UART1_BASE at h
addi r17, r17, UART1_BASE at l
li r18, '2'
stb r18, 0(r17)
syncearly_init is the c functional. From the console I can see '1' but no '2', which is expected after early_init is done.
I also put the UART code to the setup.c/early_init() right after it is called. No output either. So I guess the C function call got some problem.
I remember I had somewhat similiar when I touched u-boot at the very beginning. At that time I put u-boot code in flash starting from FF800000 but forgot to change the TEXT_BASE in board/walnut405/config.mk. The u-boot did run at that time but I couldn't call C function. Fortunately I found this mistake right away. But this time it doesn't seem like the same solution. The kernel was relocated by the u-boot to 0x0 and the TLB did set map 0xC0000000 to 0x0. This makes me doubt the setting of sdram is not correct.
BTW, could anybody tell me how to calcuate the value of SDRAM0_RTR? For example, I have a SDRAM with 100MHz and I want to get 15.2us interval, thus the value should be 15.2us / 10ns = 1520 = 0x5F0, the register value should be 0x2F800000. But on my hardware spec the value is 0x0FD00000, which doesn't look correct to me. If I use 100MHz and want to get 7.6us interval, the value should be 0x2F8, then the register value should be 0x17C00000, is it right?
Frank
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar ? get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
How do you know that? And what exactly means "stuck" in this context?
I put the following piece of code in
head_4xx.S:
...
Quoted 2 lines
early_initis the c functional. From the console I can see '1' but no '2', which is expected afterearly_initis done.
What you write is true, although you didn't mean it:
It is indeed expected that you don't see '2', because your code just crashes the system.
Quoted 2 lines
I also put the UART code to the setup.c/early_init() right after it is called. No output either. So I guess the C function call got some problem.
No. The only problem is that your code will crash the system when the MMU is on.
Get yourself a BDI2000.
Best regards,
Wolfgang Denk
Signature · 5 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de "It was the Law of the Sea, they said. Civilization ends at the wa- terline. Beyond that, we all enter the food chain, and not always right at the top." - Hunter S. Thompson