public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5
@ 2008-04-01  7:59 Sascha Laue
  2008-04-01  8:33 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Sascha Laue @ 2008-04-01  7:59 UTC (permalink / raw)
  To: u-boot

bugfix: the watchdog post for lwmon5 doesn't work. This Patch fix it.
To trigger and activate the watchdog correct it is necessary to create 2 pulses.
Lowpegel on GPIO62 point to a voltagefailure.

Signed-off-by: Sascha Laue <sascha.laue@liebherr.com>
---
 post/board/lwmon5/watchdog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/post/board/lwmon5/watchdog.c b/post/board/lwmon5/watchdog.c
index 48ff687..014aae4 100644
--- a/post/board/lwmon5/watchdog.c
+++ b/post/board/lwmon5/watchdog.c
@@ -55,7 +55,7 @@ static void watchdog_magic_write(uint value)
 
 int sysmon1_post_test(int flags)
 {
-	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
+	if (0 == gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
 		/*
 		 * 3.1. GPIO62 is low
 		 * Assuming system voltage failure.
@@ -99,6 +99,9 @@ int lwmon5_watchdog_post_test(int flags)
 		ints = disable_interrupts ();
 		/* 3.2.2. strobe watchdog once */
 		WATCHDOG_RESET();
+		base = post_time_ms (0);
+		while (post_time_ms (base) < 2)
+		WATCHDOG_RESET();
 		out_be32((void *)CFG_WATCHDOG_TIME_ADDR, 0);
 		/* 3.2.3. save time of strobe in scratch register 2 */
 		base = post_time_ms (0);
-- 
1.5.2.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5
  2008-04-01  7:59 [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5 Sascha Laue
@ 2008-04-01  8:33 ` Wolfgang Denk
  2008-04-01 11:32   ` Wolfgang Denk
  2008-04-01 13:13   ` Sascha Laue
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Denk @ 2008-04-01  8:33 UTC (permalink / raw)
  To: u-boot

In message <20080401075941.145820@gmx.net> you wrote:
> bugfix: the watchdog post for lwmon5 doesn't work. This Patch fix it.
> To trigger and activate the watchdog correct it is necessary to create 2 pulses.
> Lowpegel on GPIO62 point to a voltagefailure.

Please fix English ("correct", "Lowpegel", "voltagefailure").

Is it really 2 pulses - or just one, consisting of 

> Signed-off-by: Sascha Laue <sascha.laue@liebherr.com>
...
> -	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
> +	if (0 == gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {

Please write that as:

	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS) == 0) {
or
	if (!gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {

>  		 * 3.1. GPIO62 is low
>  		 * Assuming system voltage failure.
> @@ -99,6 +99,9 @@ int lwmon5_watchdog_post_test(int flags)
>  		ints = disable_interrupts ();
>  		/* 3.2.2. strobe watchdog once */
>  		WATCHDOG_RESET();
> +		base = post_time_ms (0);
> +		while (post_time_ms (base) < 2)
> +		WATCHDOG_RESET();

Are you absolutely sure that is needed?

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
Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to  megatons
several  minutes  ago.  We don't need no stinkin' tactical nukes. (By
the way, do you have change for 10 million people?)           - lwall

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5
  2008-04-01  8:33 ` Wolfgang Denk
@ 2008-04-01 11:32   ` Wolfgang Denk
  2008-04-01 13:13   ` Sascha Laue
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2008-04-01 11:32 UTC (permalink / raw)
  To: u-boot

In message <20080401083320.B918D24544@gemini.denx.de> I wrote:
>
> >  		/* 3.2.2. strobe watchdog once */
> >  		WATCHDOG_RESET();
> > +		base = post_time_ms (0);
> > +		while (post_time_ms (base) < 2)
> > +		WATCHDOG_RESET();
> 
> Are you absolutely sure that is needed?

Maybe I should have been more explicit - note that above code with
correct indentation looks like this:

  		/* 3.2.2. strobe watchdog once */
  		WATCHDOG_RESET();
		base = post_time_ms (0);
		while (post_time_ms (base) < 2)
			WATCHDOG_RESET();

I. e. the comment "once" is wrong - you trigger the watchdog many more
times that you probably think.

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@denx.de
Witch!  Witch!  They'll burn ya!
	-- Hag, "Tomorrow is Yesterday", stardate unknown

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5
  2008-04-01  8:33 ` Wolfgang Denk
  2008-04-01 11:32   ` Wolfgang Denk
@ 2008-04-01 13:13   ` Sascha Laue
  2008-04-14  6:33     ` Wolfgang Denk
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Laue @ 2008-04-01 13:13 UTC (permalink / raw)
  To: u-boot

You are right! I've checked it again and find the mistake by myself. 

Subject: [PATCH] bugfix: lwmon5 watchdog post
If the hardware watchdog detects a voltage error, the watchdog set GPIO62 to low.
The watchdog POST have to detect this lowpegel.

Signed-off-by: Sascha Laue <leglas0@legpc180.leg.liebherr.i>
---
 post/board/lwmon5/watchdog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/post/board/lwmon5/watchdog.c b/post/board/lwmon5/watchdog.c
index 48ff687..899fbfb 100644
--- a/post/board/lwmon5/watchdog.c
+++ b/post/board/lwmon5/watchdog.c
@@ -55,7 +55,7 @@ static void watchdog_magic_write(uint value)
 
 int sysmon1_post_test(int flags)
 {
-	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
+	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS) == 0) {
 		/*
 		 * 3.1. GPIO62 is low
 		 * Assuming system voltage failure.
-- 
1.5.2.4

-------- Original-Nachricht --------
> Datum: Tue, 01 Apr 2008 10:33:20 +0200
> Von: Wolfgang Denk <wd@denx.de>
> An: "Sascha Laue" <Sascha.Laue@gmx.biz>
> CC: u-boot-users at lists.sourceforge.net
> Betreff: Re: [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5

> In message <20080401075941.145820@gmx.net> you wrote:
> > bugfix: the watchdog post for lwmon5 doesn't work. This Patch fix it.
> > To trigger and activate the watchdog correct it is necessary to create 2
> pulses.
> > Lowpegel on GPIO62 point to a voltagefailure.
> 
> Please fix English ("correct", "Lowpegel", "voltagefailure").
> 
> Is it really 2 pulses - or just one, consisting of 
> 
> > Signed-off-by: Sascha Laue <sascha.laue@liebherr.com>
> ...
> > -	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
> > +	if (0 == gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
> 
> Please write that as:
> 
> 	if (gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS) == 0) {
> or
> 	if (!gpio_read_in_bit(CFG_GPIO_SYSMON_STATUS)) {
> 
> >  		 * 3.1. GPIO62 is low
> >  		 * Assuming system voltage failure.
> > @@ -99,6 +99,9 @@ int lwmon5_watchdog_post_test(int flags)
> >  		ints = disable_interrupts ();
> >  		/* 3.2.2. strobe watchdog once */
> >  		WATCHDOG_RESET();
> > +		base = post_time_ms (0);
> > +		while (post_time_ms (base) < 2)
> > +		WATCHDOG_RESET();
> 
> Are you absolutely sure that is needed?
> 
> 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
> Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to  megatons
> several  minutes  ago.  We don't need no stinkin' tactical nukes. (By
> the way, do you have change for 10 million people?)           - lwall

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5
  2008-04-01 13:13   ` Sascha Laue
@ 2008-04-14  6:33     ` Wolfgang Denk
  2008-04-14 17:44       ` Detlev Zundel
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-04-14  6:33 UTC (permalink / raw)
  To: u-boot

In message <20080401131303.17520@gmx.net> you wrote:
> You are right! I've checked it again and find the mistake by myself. 
> 
> Subject: [PATCH] bugfix: lwmon5 watchdog post
> If the hardware watchdog detects a voltage error, the watchdog set GPIO62 to low.
> The watchdog POST have to detect this lowpegel.
> 
> Signed-off-by: Sascha Laue <leglas0@legpc180.leg.liebherr.i>

Applied, thanks.

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
News is what a chap who doesn't care much  about  anything  wants  to
read. And it's only news until he's read it. After that it's dead.
                           - Evelyn Waugh _Scoop_ (1938) bk. 1, ch. 5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5
  2008-04-14  6:33     ` Wolfgang Denk
@ 2008-04-14 17:44       ` Detlev Zundel
  0 siblings, 0 replies; 6+ messages in thread
From: Detlev Zundel @ 2008-04-14 17:44 UTC (permalink / raw)
  To: u-boot

Hi,

> In message <20080401131303.17520@gmx.net> you wrote:
>> You are right! I've checked it again and find the mistake by myself. 
>> 
>> Subject: [PATCH] bugfix: lwmon5 watchdog post
>> If the hardware watchdog detects a voltage error, the watchdog set GPIO62 to low.
>> The watchdog POST have to detect this lowpegel.
>> 
>> Signed-off-by: Sascha Laue <leglas0@legpc180.leg.liebherr.i>

It just occured to me, Sascha you should check your git-setup.

Very likely a "git-config --global user.email <real e-mail>" helps you
out here.

Cheers
  Detlev

-- 
Die eine Haelfte der Welt lacht ueber die andere, und Narren sind alle.
                                    --- Baltasar Gracian
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-14 17:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-01  7:59 [U-Boot-Users] [PATCH] bugfix: the watchdog post for lwmon5 Sascha Laue
2008-04-01  8:33 ` Wolfgang Denk
2008-04-01 11:32   ` Wolfgang Denk
2008-04-01 13:13   ` Sascha Laue
2008-04-14  6:33     ` Wolfgang Denk
2008-04-14 17:44       ` Detlev Zundel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox