public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: add initilisation of watchdog in init_sequence
@ 2010-05-26 11:07 Nicolas Ferre
  2010-05-30 11:17 ` Tom Rix
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Ferre @ 2010-05-26 11:07 UTC (permalink / raw)
  To: u-boot

For platforms that implement a hardware watchdog, call its initialization
routine in init_sequence.
This location has been chosen to be the closest to initialization of console as
some watchdog drivers are writing status messages. On the other hand, watchdog
setup should be close to chip startup to be able to begin the triggering
quickly.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/lib/board.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index f5660a9..569009e 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -70,6 +70,10 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
+#ifdef CONFIG_HW_WATCHDOG
+extern void hw_watchdog_init(void);
+#endif
+
 #ifndef CONFIG_IDENT_STRING
 #define CONFIG_IDENT_STRING ""
 #endif
@@ -251,6 +255,9 @@ init_fnc_t *init_sequence[] = {
 	serial_init,		/* serial communications setup */
 	console_init_f,		/* stage 1 init of console */
 	display_banner,		/* say that we are here */
+#if defined(CONFIG_HW_WATCHDOG)
+	hw_watchdog_init,	/* watchdog setup */
+#endif
 #if defined(CONFIG_DISPLAY_CPUINFO)
 	print_cpuinfo,		/* display cpu info (and speed) */
 #endif
-- 
1.5.6.5

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

* [U-Boot] [PATCH] arm: add initilisation of watchdog in init_sequence
  2010-05-26 11:07 [U-Boot] [PATCH] arm: add initilisation of watchdog in init_sequence Nicolas Ferre
@ 2010-05-30 11:17 ` Tom Rix
  2010-06-10 13:47   ` Nicolas Ferre
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rix @ 2010-05-30 11:17 UTC (permalink / raw)
  To: u-boot

Nicolas Ferre wrote:
> For platforms that implement a hardware watchdog, call its initialization
> routine in init_sequence.
> This location has been chosen to be the closest to initialization of console as
> some watchdog drivers are writing status messages. On the other hand, watchdog
> setup should be close to chip startup to be able to begin the triggering
> quickly.
> 
I am not opposed to putting watchdog into the init sequence.

A current ARM way for initializing the watchdog is to do it in
s_init.  Why doesn't this work for you ?

Reviewing other watchdog additions in the init sequences from powerpc,sh,m68k
If an init is to be added, this setup should be cut-n-pasted from one
of these.  There should be follow-on patches to convert the ARM s_init's over to 
using the init sequence.

Tom


> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  arch/arm/lib/board.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index f5660a9..569009e 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -70,6 +70,10 @@ extern int  AT91F_DataflashInit(void);
>  extern void dataflash_print_info(void);
>  #endif
>  
> +#ifdef CONFIG_HW_WATCHDOG
> +extern void hw_watchdog_init(void);
> +#endif
> +
>  #ifndef CONFIG_IDENT_STRING
>  #define CONFIG_IDENT_STRING ""
>  #endif
> @@ -251,6 +255,9 @@ init_fnc_t *init_sequence[] = {
>  	serial_init,		/* serial communications setup */
>  	console_init_f,		/* stage 1 init of console */
>  	display_banner,		/* say that we are here */
> +#if defined(CONFIG_HW_WATCHDOG)
> +	hw_watchdog_init,	/* watchdog setup */
> +#endif
>  #if defined(CONFIG_DISPLAY_CPUINFO)
>  	print_cpuinfo,		/* display cpu info (and speed) */
>  #endif

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

* [U-Boot] [PATCH] arm: add initilisation of watchdog in init_sequence
  2010-05-30 11:17 ` Tom Rix
@ 2010-06-10 13:47   ` Nicolas Ferre
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2010-06-10 13:47 UTC (permalink / raw)
  To: u-boot

Le 30/05/2010 13:17, Tom Rix :
> Nicolas Ferre wrote:
>> For platforms that implement a hardware watchdog, call its initialization
>> routine in init_sequence.
>> This location has been chosen to be the closest to initialization of
>> console as
>> some watchdog drivers are writing status messages. On the other hand,
>> watchdog
>> setup should be close to chip startup to be able to begin the triggering
>> quickly.
>>
> I am not opposed to putting watchdog into the init sequence.
> 
> A current ARM way for initializing the watchdog is to do it in
> s_init.  Why doesn't this work for you ?

Well, I only see it done like this in some omap platforms. It does work
for me because we do not always use the lowlevel_init.S file: sometimes,
the low level initialization is done by a tiny first level bootloader...

> Reviewing other watchdog additions in the init sequences from
> powerpc,sh,m68k
> If an init is to be added, this setup should be cut-n-pasted from one
> of these.  There should be follow-on patches to convert the ARM s_init's
> over to using the init sequence.

I guess that as architecture implementation are different in the way of
initializing watchdog, I may include this in each board file or create a
common initialization for AT91 at board level...

Best regards,
-- 
Nicolas Ferre

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

end of thread, other threads:[~2010-06-10 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 11:07 [U-Boot] [PATCH] arm: add initilisation of watchdog in init_sequence Nicolas Ferre
2010-05-30 11:17 ` Tom Rix
2010-06-10 13:47   ` Nicolas Ferre

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