Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2f40ccd authored by Kumar Gala's avatar Kumar Gala Committed by Linus Torvalds
Browse files

[PATCH] ppc32: Added support for the Book-E style Watchdog Timer



PowerPC 40x and Book-E processors support a watchdog timer at the processor
core level.  The timer has implementation dependent timeout frequencies
that can be configured by software.

One the first Watchdog timeout we get a critical exception.  It is left to
board specific code to determine what should happen at this point.  If
nothing is done and another timeout period expires the processor may
attempt to reset the machine.

Command line parameters:
  wdt=0 : disable watchdog (default)
  wdt=1 : enable watchdog

  wdt_period=N : N sets the value of the Watchdog Timer Period.

  The Watchdog Timer Period meaning is implementation specific. Check
  User Manual for the processor for more details.

This patch is based off of work done by Takeharu Kato.

Signed-off-by: default avatarMatt McClintock <msm@freescale.com>
Signed-off-by: default avatarKumar Gala <kumar.gala@freescale.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 886b9fa4
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -228,6 +228,26 @@ advantechwdt.c -- Advantech Single Board Computer
	The GETSTATUS call returns if the device is open or not.
	[FIXME -- silliness again?]
	
booke_wdt.c -- PowerPC BookE Watchdog Timer

	Timeout default varies according to frequency, supports
	SETTIMEOUT

	Watchdog can not be turned off, CONFIG_WATCHDOG_NOWAYOUT
	does not make sense

	GETSUPPORT returns the watchdog_info struct, and
	GETSTATUS returns the supported options. GETBOOTSTATUS
	returns a 1 if the last reset was caused by the
	watchdog and a 0 otherwise. This watchdog can not be
	disabled once it has been started. The wdt_period kernel
	parameter selects which bit of the time base changing
	from 0->1 will trigger the watchdog exception. Changing
	the timeout from the ioctl calls will change the
	wdt_period as defined above. Finally if you would like to
	replace the default Watchdog Handler you can implement the
	WatchdogHandler() function in your own code.

eurotechwdt.c -- Eurotech CPU-1220/1410

	The timeout can be set using the SETTIMEOUT ioctl and defaults
+4 −0
Original line number Diff line number Diff line
@@ -462,7 +462,11 @@ interrupt_base:

	/* Watchdog Timer Interrupt */
	/* TODO: Add watchdog support */
#ifdef CONFIG_BOOKE_WDT
	CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
#else
	CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException)
#endif

	/* Data TLB Error Interrupt */
	START_EXCEPTION(DataTLBError)
+3 −1
Original line number Diff line number Diff line
@@ -448,7 +448,9 @@ label:

/* 0x1020 - Watchdog Timer (WDT) Exception
*/

#ifdef CONFIG_BOOKE_WDT
	CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
#else
	CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException)
#endif

+4 −1
Original line number Diff line number Diff line
@@ -564,8 +564,11 @@ interrupt_base:
	EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE)

	/* Watchdog Timer Interrupt */
	/* TODO: Add watchdog support */
#ifdef CONFIG_BOOKE_WDT
	CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
#else
	CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException)
#endif

	/* Data TLB Error Interrupt */
	START_EXCEPTION(DataTLBError)
+24 −0
Original line number Diff line number Diff line
@@ -615,6 +615,30 @@ machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
	if (ppc_md.progress)
		ppc_md.progress("id mach(): done", 0x200);
}
#ifdef CONFIG_BOOKE_WDT
/* Checks wdt=x and wdt_period=xx command-line option */
int __init early_parse_wdt(char *p)
{
	extern u32 wdt_enable;

	if (p && strncmp(p, "0", 1) != 0)
	       wdt_enable = 1;

	return 0;
}
early_param("wdt", early_parse_wdt);

int __init early_parse_wdt_period (char *p)
{
	extern u32 wdt_period;

	if (p)
		wdt_period = simple_strtoul(p, NULL, 0);

	return 0;
}
early_param("wdt_period", early_parse_wdt_period);
#endif	/* CONFIG_BOOKE_WDT */

/* Checks "l2cr=xxxx" command-line option */
int __init ppc_setup_l2cr(char *str)
Loading