This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: "Harmless" bugs in AT91 PIT code
- From: Jim Seymour <ecosjim at cipher dot com>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: ecos-patches at ecos dot sourceware dot org
- Date: Thu, 25 Jan 2007 14:59:06 -0800
- Subject: Re: "Harmless" bugs in AT91 PIT code
- References: <45B804AA.6050902@cipher.com> <20070125083947.GH4953@lunn.ch>
Andrew Lunn wrote:
On Wed, Jan 24, 2007 at 05:15:22PM -0800, Jim Seymour wrote:
New mailing list subscriber here, so please forgive me if I've muddled
up the patch submission procedure...
The AT91 Periodic Interval Timer module has two "mostly harmless" bugs
that the attached patch corrects. This patch is for:
.../packages/hal/arm/at91/var/current/src/timer_pit.c
First, in hal_clock_initialize(), "period" is stored directly in the
PIT_MR register. It should be "(period - 1)". This error is corrected
by the first call to hal_clock_reset(), but it still should be set up
correctly the first time.
Second, there are four places where the PIV field in PIT_MR is masked
with 0xffffff (24 bits), instead of 0xfffff (20 bits). This has no ill
effect that I can see - except that the assert in hal_clock_reset() will
not get triggered for certain illegal values.
Hi Jim
Please could you test this patch. I decided to add a mask #define to
var_io.h to replace the hard coded numbers. So it should now be right
(or wrong) everywhere.
Thanks
Andrew
No problem. We're a few days away from having a working system, but
once we do, we'll give it a whirl.
I'll report back here once I'm confident of the results...
--
Jim Seymour, Cipher Systems, Inc., 503-617-7447, http://www.cipher.com