[U-Boot-Users] Watchdog timer reset

Hey folks,
Just wondering, does u-boot support periodical reset of watchdog timer ? If not, I suppose I have to disable the watchdog when I enter uboot in interactive mode, and probably enable it when I exit u-boot.
How does people normally do this ?
Just out of curiosity, (assuming u-boot does not do something like above), can we do something similar to below code?
-=-=-=-=-=-=-=-=-=-=-=-=-=-= signal(SIGALRM, runme);
function runme(void) { printf("hi\n"); alarm(10); } -=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cheers,

In message 9b7ca657050509040572e02726@mail.gmail.com you wrote:
Just wondering, does u-boot support periodical reset of watchdog timer
Yes, of course it does.
? If not, I suppose I have to disable the watchdog when I enter uboot in interactive mode, and probably enable it when I exit u-boot.
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.
How does people normally do this ?
Have a look at the code.
Just out of curiosity, (assuming u-boot does not do something like above), can we do something similar to below code?
-=-=-=-=-=-=-=-=-=-=-=-=-=-= signal(SIGALRM, runme);
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.
Best regards,
Wolfgang Denk

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

In message 9b7ca657050512050554c9e1dd@mail.gmail.com you wrote:
I'd really appreciate it if you could point me to a file or a function to take a look.
watchdog_reset() for example?
Try running something like
$ cd u-boot $ find * -type f | xargs egrep watchdog or $ find * -type f | xargs egrep watchdog_reset
:P sorry for trying an easy way out, but if you happen to know good place to start, dont hesitate (please) :)
See above - this is obviosly hardware dependent, but looking for watchdog_reset() in cpu/*/cpu.c might be helpful...
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
No, it does not. As mentioned before, there are no signals or tasks or similar in U-Boot. Everything is strictly single-tasking. I'm not sure waht you want, but you can problaby do something like
for (;;) { /* do something */ usleep (10 * CFG_HZ); }
in C, but I don't understand what that would give you.
Best regards,
Wolfgang Denk

On 5/12/05, Wolfgang Denk wd@denx.de wrote:
watchdog_reset() for example?
Thanks. I can see what's going on now. I wasnt really interested about how to reset watchdog itself, but rather continuously calling particular function in set interval. Having looked at how WATCHDOG_RESET() is called, I sort of see it now.
No, it does not. As mentioned before, there are no signals or tasks or similar in U-Boot. Everything is strictly single-tasking. I'm not sure waht you want, but you can problaby do something like
for (;;) { /* do something */ usleep (10 * CFG_HZ); }
in C, but I don't understand what that would give you.
Okay, I got you on U-Boot being single tasking process. And like you said, I wouldnt want to do something like above also :P
Thanks again for putting me on the right track. Cheers,
participants (2)
-
Daniel Ann
-
Wolfgang Denk