mpc85xx: watchdog initialisation added
authorBoschung, Rainer <Rainer.Boschung@keymile.com>
Tue, 3 Jun 2014 07:05:14 +0000 (09:05 +0200)
committerYork Sun <yorksun@freescale.com>
Fri, 1 Aug 2014 21:18:17 +0000 (14:18 -0700)
Function to inititialize the cpu watchdog added.

Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com>
[York Sun: Add prototype in watchdog.h]
Reviewed-by: York Sun <yorksun@freescale.com>
arch/powerpc/cpu/mpc85xx/cpu.c
include/watchdog.h

index 684d4007e48a9f9be845c12f533fc9a0d0b873ef..6274f929dd0fa3d035052187f4f7e9a9f889f78a 100644 (file)
@@ -310,6 +310,14 @@ __weak unsigned long get_tbclk (void)
 
 
 #if defined(CONFIG_WATCHDOG)
+#define WATCHDOG_MASK (TCR_WP(63) | TCR_WRC(3) | TCR_WIE)
+void
+init_85xx_watchdog(void)
+{
+       mtspr(SPRN_TCR, (mfspr(SPRN_TCR) & ~WATCHDOG_MASK) |
+             TCR_WP(CONFIG_WATCHDOG_PRESC) | TCR_WRC(CONFIG_WATCHDOG_RC));
+}
+
 void
 reset_85xx_watchdog(void)
 {
index aacacb970a1bab2f03f5b6731811bf0379a9fa42..bd0a8d6b19fdef0a9d9467f1a25747ca02976cc1 100644 (file)
@@ -95,4 +95,8 @@ int init_func_watchdog_reset(void);
 #if defined(CONFIG_HW_WATCHDOG) && !defined(__ASSEMBLY__)
        void hw_watchdog_init(void);
 #endif
+
+#if defined(CONFIG_MPC85xx) && !defined(__ASSEMBLY__)
+       void init_85xx_watchdog(void);
+#endif
 #endif /* _WATCHDOG_H_ */