[U-Boot-Users] Linux kernel hangs on "while (bdp->cbd_sc & BD_SC_READY);" when booting the kernel with PPCBoot

Petter Larsen pla at morecom.no
Fri Mar 21 23:29:07 CET 2003


Hello

I have a strange error. Se my debug procedure.

I connect to the target with a BDM4DBG debugger and run only the init
section.

I then load the symbols for the kernel and sets a breakpoint at the
function, 
static void my_console_write(int idx, const char *s,
				unsigned count)
in the file arch/ppc/8xx_io/uart.c.

I use a 2.4.20 kernel, patched with preemptive and low latency patch.

I then do a "c" in the debugger for starting up PPCBoot.

I then load the kernel over tftp in PPCBoot and start it with "bootm
400000"

The kernel starts, and stops at my breakpoint.

When I step through the code it comes to a for loop where it shall print
one character at time.

When a step through the line that says "bdp->cbd_sc |= BD_SC_READY;" I
should see the character that lies in the *cp pointer printed out on the
console. 
This does not happen when I boot the kernel with PPCBoot, but it happens
if I include the simple bootloader in the kernel.

E.g. the kernel will print the character on the console if I include the
simple bootloader in the kernel, the code that is under
arc/ppc/boot/simple..., and boot that kernel  with PPCBoot. This is a
bootloader so what I essentially do here is that PPCBoot just starts
another bootloader, which should not be necessary which also Wolfgang
Denx told me some day.

Another thing I also found out is that if I use the kernel that comes
with the eldk2.0.2 distributions from Denx, kernel 2.4.4, it works
without this simple bootloader in the kernel... Strange.

Is it something wrong with the interrupt which should empty the transmit
buffer or something? I am not so good to find out of these things.

I also saw another thing, when I booted the kernel with the simple
bootloader in the kernel, the line in the function my_console_write(..)
that looks like this "bdp->cbd_sc |= BD_SC_READY;" has a value in
"cbd_sc = 8192" before and after the line is executed. This does not
happen when I boot the kernel without the simple bootloader. When I boot
the kernel without the simple bootloader the value turns in to what I
thought it should do, A000. BD_SC_READY is defined to be 0x8000.

8192 =  0x2000 
0x2000 | 0x8000 = 0xA000

Becuase bdb->cbd_sc = 40960 (0xA000) the loop, "while (bdp->cbd_sc &
BD_SC_READY);" just hangs.


Can anybody help me here?
What is really happening when the code "bdp->cbd_sc |= BD_SC_READY;"
execute? 


Best regards
Petter Larsen
Consultant
moreCom as






More information about the U-Boot mailing list