From: Simon Kagstrom Date: Tue, 29 Sep 2009 10:28:46 +0200 Subject: [U-Boot] [PATCH] arm:kirkwood: Add hardware watchdog support for Marvell Kirkwood boards In-Reply-To: <73173D32E9439E4ABB5151606C3E19E202EF7E9507@SC-VEXCH1.marvell.com> References: <1254121586-26903-1-git-send-email-simon.kagstrom@netinsight.net> <73173D32E9439E4ABB5151606C3E19E202EF7E9507@SC-VEXCH1.marvell.com> Message-ID: <20090929102846.2040875e@marrow.netinsight.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 28 Sep 2009 19:16:16 -0700 Prafulla Wadaskar wrote: > But do you really need Watchdog support for u-boot? Paranoia really has no limits :-). The main objective for me personally is to have the watchdog on when Linux starts, but if there is a risk (for whatever reason) that U-boot hangs, it would also help there. > Because if you want to use the watchdog, you will need to keep it running in > Entire code. That's fine, the code is already sprinkled with WATCHDOG_RESET() in many places (which calls hw_watchdog_reset()). Also note that this patch doesn't actually turn it on, you'll have to call kw_watchdog_init() first to do that. > Secondly Pls have a look at drivers/watchdog/at91sam9_wdt.c and its implementation, > This will be a good way of implementation. Well, I did look at that, and I believe the implementation is fairly similar. What I wonder about in that context is the use of hw_watchdog_init(). I first thought this was generic, but it's not exported via watchdog.h (like hw_watchdog_reset()). I think it would be nice to have a generic interface which exports void hw_watchdog_init(unsigned long timeout_ms); to initialize the watchdog and timeout. The timeout would be a bit crude since hardware have limits to how long the timeouts would be, but anyway. Another good feature would be a command-line interface to turn it on and configure it, i.e., something like watchdog on 5000 # Set timeout to 5000 ms watchdog off # Turn off (if possible) // Simon