[U-Boot-Users] watchdog usage in U-Boot

Hi,
maybe this is again a stupid question, but I did not yet figure out about it myself, so maybe somebody could give me some pointers and/or correct my assumptions.
I want to use the watchdog in my MCF5373L board (which is supported by U-Boot using the MCF532x code). I find watchdog_init and so on but I did not see any of these being called anywhere from within U-Boot. However, when enabling the watchdog with CONFIG_WATCHDOG, the timer already starts and will expire if any U-Boot internal task takes too long.
From other posts I found some things that I would like to state
as assumptions, please correct me if any of these is wrong
- watchdog is not initialized by default, has to be done by board-specific code - watchdog servicing (reset the counter) is also not done by default - has to be done by board-specific code - I saw a patch by Wolfgang that splits udelay, but did not see how the watchdog_reset is handled by this? Where is this done?
My problem with this is: - enabling watchdog with CONFIG_WATCHDOG will not disable the (normally enabled) watchdog during startup and thus it will time out with time-consuming tasks (like bootdelay or loading a large FPGA) - I have no defined "watchdog service" before control is handed over to the linux kernel, so even when the linux kernel would have support for the correct watchdog (which I still have to implement), the timeout is never well defined at this point.
I can implement watchdog_init() in my board-specific startup code and call watchdog_reset from time to time during my board-specific FPGA loader, but first this seems not to be a very elegant way and second this does not solve the problem of bootdelay and handing over control to the linux kernel.
I would be happy if anybody could give some hints despite this long text...
Regards, Wolfgang

In message 47BD8EC3.14413.6591E84@w.wegner.astro-kom.de you wrote:
I want to use the watchdog in my MCF5373L board (which is supported by U-Boot using the MCF532x code). I find watchdog_init and so on but I did not see any of these being called anywhere from within U-Boot. However, when enabling
How did you search? You might want to do a case-insensitive search for watchdog_init and watchdog_reset. There is some CPP trickery involved.
From other posts I found some things that I would like to state
as assumptions, please correct me if any of these is wrong
- watchdog is not initialized by default, has to be done by board-specific code
Wrong, INIT_FUNC_WATCHDOG_INIT get's called by global init code - at least on the architectures where watchdog support has been implemented. For reference, please see the PPC code.
- watchdog servicing (reset the counter) is also not done by default - has to be done by board-specific code
Wrong, this is being done globally.
- I saw a patch by Wolfgang that splits udelay, but did not see how the watchdog_reset is handled by this? Where is this done?
Search watchdog_reset ignoring case so you will find for example INIT_FUNC_WATCHDOG_RESET as well...
Best regards,
Wolfgang Denk

Hi Wolfgang,
On 21 Feb 2008 at 17:51, Wolfgang Denk wrote:
In message 47BD8EC3.14413.6591E84@w.wegner.astro-kom.de you wrote:
I want to use the watchdog in my MCF5373L board (which is supported by U-Boot using the MCF532x code). I find watchdog_init and so on but I did not see any of these being called anywhere from within U-Boot. However, when enabling
How did you search? You might want to do a case-insensitive search for watchdog_init and watchdog_reset. There is some CPP trickery involved.
find . -iname "*.c" -exec grep -H watchdog_reset {} ; in the u-boot directory, to be exact. ;-) moving the "i" to the correct place reveals everything - I do not know why I overlooked this.
Thank you very much for pointing me to this - I think now everything is clear.
Best regards, Wolfgang
participants (2)
-
w.wegner@astro-kom.de
-
Wolfgang Denk