
On Sun, Oct 4, 2009 at 10:15 PM, Ingo van Lil inguin@gmx.de wrote:
On 10/04/2009 01:29 AM, Wolfgang Denk wrote:
No, not an exception, but the reference implementation. I cannot help it that most other architectures / SoCs don;t care much.
Well, if such an uncommon side-effect is expected of a function with a well-known name it should at least be prominently documented. I like Mike's suggestion to have a central udelay() implementation for that; I'm gonna try to whip up a patch tomorrow.
I'm using an Atmel AT91-based custom board, and the udelay() function can be found in cpu/arm926ejs/at91/timer.c. Unfortunately there's no central udelay() implementation in lib_arm.
Guess nobody attempted to use a WD on such a system before.
You hardly have a choice: After reset the AT91's watchdog timer runs at maximum period (15 seconds), and the control register is one-time writable. If you disable the watchdog in u-boot there's no way to re-enable it later in the OS.
Regards, Ingo
Naive question of the day - Is there any reason for the complexity of the watchdog implementation with all the #defines to sort out software and hardware resets?
Wouldn't it be easier to replace it with a weak function with an empty default implementation over-ridden at the board/arch/cpu level as needed?
We can then call the watchdog reset in udelay() - will be a problem if the watchdog needs udelay (for a timed reset pulse for example)
Just a thought
Regards,
Graeme