mirror of
https://github.com/torvalds/linux
synced 2024-09-20 02:57:25 +00:00
[POWERPC] ppc: Fix booke watchdog initialization
Fix two problems in the book-e watchdog driver. a) The 4xx default period was defined wrong b) Clear status before enabling the watchdog exception Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
2366fb16ab
commit
f31909c003
|
@ -35,7 +35,7 @@
|
||||||
#ifdef CONFIG_FSL_BOOKE
|
#ifdef CONFIG_FSL_BOOKE
|
||||||
#define WDT_PERIOD_DEFAULT 63 /* Ex. wdt_period=28 bus=333Mhz , reset=~40sec */
|
#define WDT_PERIOD_DEFAULT 63 /* Ex. wdt_period=28 bus=333Mhz , reset=~40sec */
|
||||||
#else
|
#else
|
||||||
#define WDT_PERIOD_DEFAULT 4 /* Refer to the PPC40x and PPC4xx manuals */
|
#define WDT_PERIOD_DEFAULT 3 /* Refer to the PPC40x and PPC4xx manuals */
|
||||||
#endif /* for timing information */
|
#endif /* for timing information */
|
||||||
|
|
||||||
u32 booke_wdt_enabled = 0;
|
u32 booke_wdt_enabled = 0;
|
||||||
|
@ -47,6 +47,14 @@ u32 booke_wdt_period = WDT_PERIOD_DEFAULT;
|
||||||
#define WDTP(x) (TCR_WP(x))
|
#define WDTP(x) (TCR_WP(x))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* booke_wdt_ping:
|
||||||
|
*/
|
||||||
|
static __inline__ void booke_wdt_ping(void)
|
||||||
|
{
|
||||||
|
mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* booke_wdt_enable:
|
* booke_wdt_enable:
|
||||||
*/
|
*/
|
||||||
|
@ -54,20 +62,14 @@ static __inline__ void booke_wdt_enable(void)
|
||||||
{
|
{
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
|
/* clear status before enabling watchdog */
|
||||||
|
booke_wdt_ping();
|
||||||
val = mfspr(SPRN_TCR);
|
val = mfspr(SPRN_TCR);
|
||||||
val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
|
val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
|
||||||
|
|
||||||
mtspr(SPRN_TCR, val);
|
mtspr(SPRN_TCR, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* booke_wdt_ping:
|
|
||||||
*/
|
|
||||||
static __inline__ void booke_wdt_ping(void)
|
|
||||||
{
|
|
||||||
mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* booke_wdt_write:
|
* booke_wdt_write:
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue