Skip to contentSkip to conversation

bugfix: the watchdog post for lwmon5

PATCH New Sascha Laue 3 participants 6 messages Apr 1, 2008 – Apr 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bugfix: the watchdog post for lwmon5

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.

---
 post/board/lwmon5/watchdog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
post/board/lwmon5/watchdog.c +4 -1
index 48ff687..014aae4 100644
@@ -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);
Signature · 1 line
1.5.2.4
#1 lore raw

PATCH 1/1 bugfix: the watchdog post for lwmon5

Quoted 3 lines · In message <[email protected]> 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

Quoted 1 line

...

post/board/lwmon5/watchdog.c static void watchdog_magic_write(uint value) · line 58

Quoted 2 lines
post/board/lwmon5/watchdog.c +1 -1
-	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)) {

post/board/lwmon5/watchdog.c int lwmon5_watchdog_post_test(int flags) · line 104

Quoted 9 lines
post/board/lwmon5/watchdog.c +3 -0
 		 * 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

Signature · 6 lines
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
#2 lore raw

PATCH 1/1 bugfix: the watchdog post for lwmon5

Quoted 8 lines · In message <[email protected]> I wrote:

post/board/lwmon5/watchdog.c int lwmon5_watchdog_post_test(int flags) · line 104

Quoted 6 lines
post/board/lwmon5/watchdog.c +3 -0
 		/* 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

Signature · 5 lines
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: [email protected]
Witch!  Witch!  They'll burn ya!
	-- Hag, "Tomorrow is Yesterday", stardate unknown
#3 lore raw

PATCH 1/1 bugfix: the watchdog post for lwmon5

In reply to Wolfgang Denk

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.

---
 post/board/lwmon5/watchdog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
post/board/lwmon5/watchdog.c +1 -1
index 48ff687..899fbfb 100644
@@ -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.
Signature · 3 lines
1.5.2.4

-------- Original-Nachricht --------
Quoted 50 lines

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

Quoted 2 lines · In message <[email protected]> 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.

Quoted 1 line

Lowpegel on GPIO62 point to a voltagefailure.

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

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

Quoted 1 line

...

Review

Quoted 2 lines
(quoted diff) +1 -1
-	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)) {

Review int lwmon5_watchdog_post_test(int flags) · line 104

Quoted 9 lines
(quoted diff) +3 -0
 		 * 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

Signature · 6 lines
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
#4 lore raw

PATCH 1/1 bugfix: the watchdog post for lwmon5

Quoted 7 lines · In message <[email protected]> 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.

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
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
#5 lore raw

PATCH 1/1 bugfix: the watchdog post for lwmon5

Hi,

Quoted 8 lines
Quoted 7 lines · In message <[email protected]> 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.

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

Signature · 6 lines
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