From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2]: common: Add a watchdog CLI command
Date: Wed, 28 Oct 2009 16:56:09 +0100 [thread overview]
Message-ID: <20091028155609.A7780E916D6@gemini.denx.de> (raw)
In-Reply-To: <20091028154925.1dd1a8a9@marrow.netinsight.se>
Dear Simon Kagstrom,
In message <20091028154925.1dd1a8a9@marrow.netinsight.se> you wrote:
>
> > Can we check for some error code here from lower layer and dump some error message?
> > For ex. Specified timeout value may be invalid for specific h/w
>
> We could, but I'd like to keep the interface simple. Basically: tell
Well, but error checking and sending respective information to the
user is essential.
> the hardware driver to enable the watchdog "as good as possible", and
> then the hardware will enable a watchdog that will timeout "sometime".
Um... No. This sounds horrible to me.
The driver should do _exactly_ what the user asks for, or raise an
error.
> This is hardly an end-user issue anyway: he/she will test the board
> properly to find a good timeout value anyway, and I believe the
> interface can be kept simple. I just like it since it makes it simple
> to enable the watchdog where you like it in boot scripts etc.
Well, if you have anything on your board which is actually worth the
name watchdog then this whole command will be moot.
A _real_ watchdog is automatically active after reset, and cannot be
disabled by any software.
A somewhat reasonable watchdog can be configured exactly once (for
example, the MPC8xx processors use a write-once register for this
purpose).
A "watchdog" that can be disabled by software is just a toy and
neither worth the money nor the effort ;-)
> > > +#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
> > > +extern void watchdog_enable(unsigned int timeout_secs);
> > > +
> > > +extern void watchdog_disable(void);
> > > +#else
> > > +static inline void watchdog_enable(unsigned int timeout_secs) { }
> > > +static inline void watchdog_disable(void) { }
> > > +#endif
> > > +
> >
> > What does this means?
>
> It was just a way of making the interface calls valid (but empty) if
> the watchdog support isn't there. The idea is to avoid #ifdefs in the
> code (like for WATCHDOG_RESET).
Please use weak functions for this purpose.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone who doesn't believe in miracles is not a realist.
- David Ben Gurion
next prev parent reply other threads:[~2009-10-28 15:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-28 14:11 [U-Boot] [PATCH 0/2]: Watchdog support from the command line Simon Kagstrom
2009-10-28 14:14 ` [U-Boot] [PATCH 1/2]: common: Add a watchdog CLI command Simon Kagstrom
2009-10-28 14:29 ` Prafulla Wadaskar
2009-10-28 14:49 ` Simon Kagstrom
2009-10-28 15:56 ` Wolfgang Denk [this message]
2009-10-28 14:15 ` [U-Boot] [PATCH 2/2]: arm:kirkwood: Add hardware watchdog support for Marvell Kirkwood boards Simon Kagstrom
2009-10-28 15:41 ` Prafulla Wadaskar
2009-10-29 8:07 ` [U-Boot] [PATCH v2 0/2]: Watchdog support from the command line Simon Kagstrom
2009-10-29 8:09 ` [U-Boot] [PATCH v2 1/2]: common: Add a watchdog CLI command Simon Kagstrom
2009-10-29 8:29 ` Prafulla Wadaskar
2009-11-06 9:28 ` Simon Kagstrom
2009-11-06 9:34 ` Prafulla Wadaskar
2009-11-06 11:18 ` Mike Frysinger
2009-10-29 8:11 ` [U-Boot] [PATCH v2 2/2]: arm:kirkwood: Add hardware watchdog support for Marvell Kirkwood boards Simon Kagstrom
2009-10-29 8:32 ` Prafulla Wadaskar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091028155609.A7780E916D6@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox