This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: MPC860, hal_delay_us fails
- From: Eric Doenges <Eric dot Doenges at DynaPel dot com>
- To: nprasad3 at gmu dot edu
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 27 Nov 2003 08:36:03 +0100
- Subject: Re: [ECOS] MPC860, hal_delay_us fails
- References: <a9312a87d8.a87d8a9312@gmu.edu>
nprasad3@gmu.edu wrote:
Hi,
I am trying to get eCos running on a custom board that has an MPC860 processor. Can someone please provide more insight into this routine and why it fails.
1. hal_delay_us - processor stays put in the following loop (*forever*).
do {
asm volatile("mfdec %0;" : "=r"(new_dec) : );
} while (old_dec == new_dec);
The register values for old_dec and new_dec do not change at all and hence
> cpu is spinning in it forever. I replaced the routine with a simple
for loop
> to simulate delay ofcourse not at all accurately and redboot comes up
fine.
> This routine is called in the early phases of redboot (before even
> redboot writes information so it was giving the false impression that
there
> was something seriously wrong with the config).
The way I read PPC documentation, the decrementor should always be
decrementing from the same clock source as the time base counter. Does
your time base counter increment on the 860 ? If it does, the other
possibility is that the compiler wrongly assumes that new_dec doesn't
change in the do ... while loop and falsely optimizes it into an endless
loop - however this seem rather unlikely as other people would have
encountered this problem as well. I think you should check how the time
base clock source is generated on the PPC 860 in general and your board
in particular.
--
--------------------------------------------------------------------
| Eric Doenges | DynaPel Laboratories GmbH |
| Tel: +49 89 962428 23 | Fraunhoferstrasse 9/2 |
| Fax: +49 89 962428 90 | D - 85737 Ismaning, Germany |
--------------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss