[U-Boot] [PATCH] arm:kirkwood: Add hardware watchdog support for Marvell Kirkwood boards

Tom Tom.Rix at windriver.com
Mon Sep 28 16:28:40 CEST 2009


Simon Kagstrom wrote:
> On Mon, 28 Sep 2009 07:36:32 -0500
> Tom <Tom.Rix at windriver.com> wrote:
> 
>>> +void hw_watchdog_reset(void)
>>> +{
>>> +	unsigned long time = CONFIG_SYS_TCLK * watchdog_timeout;
>>> diff --git a/include/asm-arm/arch-kirkwood/cpu.h b/include/asm-arm/arch-kirkwood/cpu.h
>>> index b3022a3..df49c3f 100644
>>> --- a/include/asm-arm/arch-kirkwood/cpu.h
>>> +++ b/include/asm-arm/arch-kirkwood/cpu.h
>>> @@ -165,5 +165,7 @@ int kw_config_mpp(unsigned int mpp0_7, unsigned int mpp8_15,
>>>  		unsigned int mpp32_39, unsigned int mpp40_47,
>>>  		unsigned int mpp48_55);
>>>  unsigned int kw_winctrl_calcsize(unsigned int sizeval);
>>> +void kw_watchdog_init(unsigned long timeout_secs);
>> You should add hw_watchdog_reset to H the file or declare it static.
> 
> It's a public interface and defined in  include/watchdog.h (this is
> what's being called by WATCHDOG_RESET), but I'll submit a new patch
> which includes this.

Yes thanks.  My mistake.
A new patch is not needed.

> 
>> You may want to add #define stubs to handle the ifndef CONFIG_HW_WATCHDOG.
> 
> I'm afraid I don't understand this comment though, what is the
> suggestion here?
> 
> // Simon

Something like this is already being done in watchdog.h
So it it not needed.

#ifdef CONFIG_HW_WATCHDOG
	#if defined(__ASSEMBLY__)
		#define WATCHDOG_RESET bl hw_watchdog_reset
	#else
		extern void hw_watchdog_reset(void);

		#define WATCHDOG_RESET hw_watchdog_reset
	#endif /* __ASSEMBLY__ */
#else

<snip>
		/*
		 * No hardware or software watchdog.
		 */
		#if defined(__ASSEMBLY__)
			#define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
		#else
----> stub 		#define WATCHDOG_RESET() {}
		#endif /* __ASSEMBLY__ */
	#endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
#endif /* CONFIG_HW_WATCHDOG */

Thanks for making your changes clear to me.
Ack-ed

Tom



More information about the U-Boot mailing list