[PATCH] m8xx_wdt: software watchdog reset/interrupt select

Marcelo Tosatti marcelo.tosatti at cyclades.com
Tue Nov 15 16:42:16 EST 2005


Hi Florian!

On Tue, Nov 15, 2005 at 07:41:43AM +0100, Florian Schirmer wrote:
> Hi,
> 
> >Note: From my reading of the documentation, even if the SWRI bit is
> >unset (interrupt select mode), an NMI at IRQ0 should cause the system to
> >jump to exception vector 0x100, resetting the system.
> >
> >So I'm wondering if the interrupt mode ever worked?
> 
> Never tried the interrupt mode. IMHO doesn't make much sense for a 
> watchdog. Why don't you simply set SWRI?

The SYPCR register can be set only _once_ at machine startup and the
bootloader in question does not have an option to change the mode. Many
bootloaders probably dont.

> >+static void m8xx_wdt_timer_func(unsigned long data)
> >+{
> >+	m8xx_wdt_reset();
> >+	m8xx_wdt_timer.expires = jiffies + 25;
> >+	add_timer(&m8xx_wdt_timer);
> >+}
> >+
> >+void m8xx_wdt_install_timer(volatile immap_t *imap)
> >+{
> >+	m8xx_wdt_timer.expires = jiffies + 25;
> >+	add_timer(&m8xx_wdt_timer);
> >+}
> 
> m8xx_wdt_install_timer doesn't need imap and you could call it from 
> m8xx_wdt_timer_func to re-engange the timer resulting in less duplicated 
> code. Just a cosmetic thing though.

Indeed. Will update the patch and resend you for review.

Thanks



More information about the Linuxppc-embedded mailing list