public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Linux kernel hangs on "while (bdp->cbd_sc & BD_SC_READY);" when booting the kernel with PPCBoot
       [not found] ` <3E7870A8.70507@eunet.yu>
@ 2003-03-21 22:29   ` Petter Larsen
  2003-03-26  2:10     ` Petter Larsen
  0 siblings, 1 reply; 2+ messages in thread
From: Petter Larsen @ 2003-03-21 22:29 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] Linux kernel hangs on "while (bdp->cbd_sc & BD_SC_READY);" when booting the kernel with PPCBoot
  2003-03-21 22:29   ` [U-Boot-Users] Linux kernel hangs on "while (bdp->cbd_sc & BD_SC_READY);" when booting the kernel with PPCBoot Petter Larsen
@ 2003-03-26  2:10     ` Petter Larsen
  0 siblings, 0 replies; 2+ messages in thread
From: Petter Larsen @ 2003-03-26  2:10 UTC (permalink / raw)
  To: u-boot

Hello

I solved this. I just removed the define statement, 
"#define CONFIG_CLOCKS_IN_MHZ 1" and I also removed the environment
variable.

The CPU and BUS frequencies are now sent in Hz to the kernel instead of
MHz. Know the kernel boots without help from the simple bootloader, and
I can also now send bootargs and so into the kernel...

Thanks for all help.

Best regards
Petter Larsen
  
On Fri, 2003-03-21 at 23:29, Petter Larsen wrote:
> 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
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by:Crypto Challenge is now open! 
> Get cracking and register here for some mind boggling fun and 
> the chance of winning an Apple iPod:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-26  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E18vNM3-0004nu-00@sc8-sf-list2.sourceforge.net>
     [not found] ` <3E7870A8.70507@eunet.yu>
2003-03-21 22:29   ` [U-Boot-Users] Linux kernel hangs on "while (bdp->cbd_sc & BD_SC_READY);" when booting the kernel with PPCBoot Petter Larsen
2003-03-26  2:10     ` Petter Larsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox