All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Linz <linz@mazet.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Nios: WATCHDOG preparation
Date: Mon, 16 Feb 2004 10:09:09 +0100	[thread overview]
Message-ID: <0402161009090A.00467@pcj86> (raw)

Hi all,

attached patch includes the WATCHDOG_RESET() macro at some more points in 
U-Boot so I can use it in my upcoming new Nios board support. Please, merge 
it with current CVS tree -- thanks.


--
Best regards,
Stephan Linz
-------------- next part --------------
diff -purN -x CVS u-boot-20040210cvs-prepare_post/cpu/nios/serial.c u-boot-20040210cvs-prepare_watchdog/cpu/nios/serial.c
--- u-boot-20040210cvs-prepare_post/cpu/nios/serial.c	2003-10-08 23:26:14.000000000 +0000
+++ u-boot-20040210cvs-prepare_watchdog/cpu/nios/serial.c	2004-02-15 02:57:28.000000000 +0000
@@ -24,6 +24,8 @@
 
 #include <common.h>
 #include <nios-io.h>
+#include <watchdog.h>
+#include <common.h>
 
 
 static nios_uart_t *uart = (nios_uart_t *)CFG_NIOS_CONSOLE;
@@ -62,7 +64,7 @@ void serial_putc( char c )
 	if (c == '\n')
 		serial_putc('\r');
 	while( (uart->status & NIOS_UART_TRDY) == 0 )
-		;
+		WATCHDOG_RESET ();
 	uart->txdata = (unsigned char)c;
 }
 
@@ -81,6 +83,6 @@ int serial_tstc( void )
 int serial_getc( void )
 {
 	while( serial_tstc() == 0 )
-		;
+		WATCHDOG_RESET ();
 	return( uart->rxdata & 0x00ff );
 }
diff -purN -x CVS u-boot-20040210cvs-prepare_post/drivers/smc91111.c u-boot-20040210cvs-prepare_watchdog/drivers/smc91111.c
--- u-boot-20040210cvs-prepare_post/drivers/smc91111.c	2003-12-06 23:20:42.000000000 +0000
+++ u-boot-20040210cvs-prepare_watchdog/drivers/smc91111.c	2004-02-15 02:57:28.000000000 +0000
@@ -61,6 +61,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <watchdog.h>
 #include "smc91111.h"
 #include <net.h>
 
@@ -1174,7 +1175,11 @@ static void smc_write_phy_register (byte
 #ifndef CONFIG_SMC91111_EXT_PHY
 static void smc_wait_ms(unsigned int ms)
 {
+	/* B E   W A R N E D :
+	 * DON'T EXCEED YOUR WATCHDOG TIMOUT WITH ARGUMENT 'ms' */
+	WATCHDOG_RESET ();
 	udelay(ms*1000);
+	WATCHDOG_RESET ();
 }
 #endif /* !CONFIG_SMC91111_EXT_PHY */
 
diff -purN -x CVS u-boot-20040210cvs-prepare_post/lib_nios/board.c u-boot-20040210cvs-prepare_watchdog/lib_nios/board.c
--- u-boot-20040210cvs-prepare_post/lib_nios/board.c	2004-02-09 23:12:26.000000000 +0000
+++ u-boot-20040210cvs-prepare_watchdog/lib_nios/board.c	2004-02-15 02:57:28.000000000 +0000
@@ -139,13 +139,16 @@ void board_init (void)
 	bd->bi_baudrate	= CONFIG_BAUDRATE;
 
 	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
+		WATCHDOG_RESET ();
 		if ((*init_fnc_ptr) () != 0) {
 			hang ();
 		}
 	}
 
+	WATCHDOG_RESET ();
 	bd->bi_flashsize = flash_init();
 
+	WATCHDOG_RESET ();
 	mem_malloc_init();
 	malloc_bin_reloc();
 	env_relocate();
@@ -157,12 +160,14 @@ void board_init (void)
 		if (s) s = (*e) ? e + 1 : e;
 	}
 
+	WATCHDOG_RESET ();
 	devices_init();
 	jumptable_init();
 	console_init_r();
 	/*
 	 */
 
+	WATCHDOG_RESET ();
 	interrupt_init ();
 
 #ifdef CONFIG_STATUS_LED
-------------- next part --------------
* Patch by Stephan Linz, 15 Feb 2004
  - prepare WATCHDOG framework support for NIOS targets;
    (add WATCHDOG_RESET() macros)

             reply	other threads:[~2004-02-16  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-16  9:09 Stephan Linz [this message]
2004-02-16  9:30 ` [U-Boot-Users] Re: [PATCH] Nios: WATCHDOG preparation Wolfgang Denk
2004-02-16 10:07   ` Stephan Linz
2004-02-17 17:34     ` [U-Boot-Users] " Stephan Linz
2004-02-23 23:19       ` [U-Boot-Users] " Wolfgang Denk

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=0402161009090A.00467@pcj86 \
    --to=linz@mazet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.