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

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