[U-Boot] [PATCH 3/9] mpc85xx: watchdog initialisation added

Rainer Boschung rainer.boschung at keymile.com
Tue Jun 3 09:05:14 CEST 2014


Function to inititialize the cpu watchdog added.

Signed-off-by: Rainer Boschung <rainer.boschung at keymile.com>
---
 arch/powerpc/cpu/mpc85xx/cpu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 684d400..6274f92 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -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)
 {
-- 
1.8.0.1



More information about the U-Boot mailing list