Patchwork [U-Boot] README: Clarify difference of CONFIG_WATCHDOG and CONFIG_HW_WATCHDOG

login
register
mail settings
Submitter Detlev Zundel
Date April 27, 2011, 3:25 p.m.
Message ID <1303917959-32324-1-git-send-email-dzu@denx.de>
Download mbox | patch
Permalink /patch/93072/
State Accepted
Commit 6abe6fb68b6ba17a9b6b538924bea94c249dcb9b
Headers show

Comments

Detlev Zundel - April 27, 2011, 3:25 p.m.
Now that we have the documentation, the code should be changed to reflect
it ;)

Asd far as I can see, these are the places where HW_WATCHDOG is used
instead of WATCHDOG:

arch/blackfin/cpu/blackfin/watchdog.c
arch/m68k/cpu/mcf547x_8x/cpu.c

The relevant maintainers are on CC.

Signed-off-by: Detlev Zundel <dzu@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: TsiChungLiew <Tsi-Chung.Liew@freescale.com>
---
 README |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
Mike Frysinger - April 27, 2011, 4:27 p.m.
On Wed, Apr 27, 2011 at 11:25, Detlev Zundel wrote:
> Now that we have the documentation, the code should be changed to reflect
> it ;)
>
> Asd far as I can see, these are the places where HW_WATCHDOG is used
> instead of WATCHDOG:

the trouble is that watchdog.h doesnt seem to match, nor does the
name.  "hardware" means to me "hardware" as in "the cpu hardware".

#ifdef CONFIG_HW_WATCHDOG
...
#else
    /*
     * Maybe a software watchdog?
     */
...
#endif

i dont see how a watchdog in the SoC could be a "software" watchdog or
a "non-hardware" watchdog.

the watchdog system is a legacy mess, so probably be easier to just
gut the whole thing.
-mike
Detlev Zundel - April 29, 2011, 11:06 a.m.
Hi Mike,

> On Wed, Apr 27, 2011 at 11:25, Detlev Zundel wrote:
>> Now that we have the documentation, the code should be changed to reflect
>> it ;)
>>
>> Asd far as I can see, these are the places where HW_WATCHDOG is used
>> instead of WATCHDOG:
>
> the trouble is that watchdog.h doesnt seem to match, nor does the
> name.  "hardware" means to me "hardware" as in "the cpu hardware".

Yes, I understand that the situation is not 100% ideal, but I do not
share your pessimism.  Currently we should straighten out the
inconsistencies present in the code and then subsequently we can think
about aligning it with what we agree on to be a good name for.

>
> #ifdef CONFIG_HW_WATCHDOG
> ...
> #else
>     /*
>      * Maybe a software watchdog?
>      */
> ...
> #endif
>
> i dont see how a watchdog in the SoC could be a "software" watchdog or
> a "non-hardware" watchdog.

True, we should align the comments in here also - I'll se if I can come
up with something sensible.

> the watchdog system is a legacy mess, so probably be easier to just
> gut the whole thing.

A agree that the naming is not ideal, but this isn't a good enough
argument for removing it.  Apart from that, this feature is used in many
commercial systems...

Cheers
  Detlev
Mike Frysinger - April 30, 2011, 12:17 a.m.
On Friday, April 29, 2011 07:06:56 Detlev Zundel wrote:
> > On Wed, Apr 27, 2011 at 11:25, Detlev Zundel wrote:
> >> Now that we have the documentation, the code should be changed to
> >> reflect it ;)
> >> 
> >> Asd far as I can see, these are the places where HW_WATCHDOG is used
> > 
> >> instead of WATCHDOG:
> > the trouble is that watchdog.h doesnt seem to match, nor does the
> > name.  "hardware" means to me "hardware" as in "the cpu hardware".
> 
> Yes, I understand that the situation is not 100% ideal, but I do not
> share your pessimism.

it isnt pessimism ... it's a fact that the documentation does not match the 
source, nor is the source clear.

> > > the watchdog system is a legacy mess, so probably be easier to just
> > gut the whole thing.
> 
> A agree that the naming is not ideal, but this isn't a good enough
> argument for removing it.  Apart from that, this feature is used in many
> commercial systems...

i didnt mean remove it and not provide equivalent functionality.  there should 
be a single CONFIG_WATCHDOG and every different watchdog driver should have 
its own CONFIG_WATCHDOG_FOO define.
-mike
Wolfgang Denk - May 12, 2011, 9:26 p.m.
Dear Detlev Zundel,

In message <1303917959-32324-1-git-send-email-dzu@denx.de> you wrote:
> Now that we have the documentation, the code should be changed to reflect
> it ;)
> 
> Asd far as I can see, these are the places where HW_WATCHDOG is used
> instead of WATCHDOG:
> 
> arch/blackfin/cpu/blackfin/watchdog.c
> arch/m68k/cpu/mcf547x_8x/cpu.c
> 
> The relevant maintainers are on CC.
> 
> Signed-off-by: Detlev Zundel <dzu@denx.de>
> Cc: Mike Frysinger <vapier@gentoo.org>
> Cc: TsiChungLiew <Tsi-Chung.Liew@freescale.com>
> ---
>  README |   17 ++++++++++++-----
>  1 files changed, 12 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/README b/README
index cdbb9de..63f5647 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@ 
 #
-# (C) Copyright 2000 - 2009
+# (C) Copyright 2000 - 2011
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -719,10 +719,17 @@  The following options need to be configured:
 - Watchdog:
 		CONFIG_WATCHDOG
 		If this variable is defined, it enables watchdog
-		support. There must be support in the platform specific
-		code for a watchdog. For the 8xx and 8260 CPUs, the
-		SIU Watchdog feature is enabled in the SYPCR
-		register.
+		support for the SoC. There must be support in the SoC
+		specific code for a watchdog. For the 8xx and 8260
+		CPUs, the SIU Watchdog feature is enabled in the SYPCR
+		register.  When supported for a specific SoC is
+		available, then no further board specific code should
+		be needed to use it.
+
+		CONFIG_HW_WATCHDOG
+		When using a watchdog circuitry external to the used
+		SoC, then define this variable and provide board
+		specific code for the "hw_watchdog_reset" function.
 
 - U-Boot Version:
 		CONFIG_VERSION_VARIABLE