[U-Boot-Users] Watchdog timer reset

Daniel Ann
2005-05-12T12:05:32Z

On 5/12/05, Wolfgang Denk <wd@denx.de> wrote:
> > Just wondering, does u-boot support periodical reset of watchdog timer
>
> Yes, of course it does.

I'd really appreciate it if you could point me to a file or a function
to take a look.

> If your watchdog i worth it's money it comes up enabled after reset,
> and you can just disable it once and forever. A watchdog that can be
> switched of is not worth to be called by that name.

Actually this is really software driven timer we developed on an 8bit
micom. So, disable/enable isnt much of bother, but like you said about
watchdog, I'm trying to avoid disabling watchdog altogether.

> > How does people normally do this ?
>
> Have a look at the code.

:P sorry for trying an easy way out, but if you happen to know good
place to start, dont hesitate (please) :)

> No, we cannot. U-boot is strictly single-tasking and has no notion of
> signals and the like. Also, your code makes no sense to me.

Okay, its basically using alarm() to produce SIGALRM every 10 seconds.
(assuming alarm() takes second as an argument) And using signal() we
are calling runme() function everytime it is woken up by SIGALRM.
Natually, runme() will do whatever it needs to do, and sets another
alarm before it ends. Not shown in the code, is probably a block read
so it keeps the program running.
Hopefully this makes more sense than a code :P

--
Daniel