aboutsummaryrefslogtreecommitdiff
path: root/drivers/watchdog/mpc8xx_wdt.c
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2018-03-16 17:21:01 +0100
committerTom Rini <trini@konsulko.com>2018-04-06 16:31:11 -0400
commitc0bc2a7e06742d32b14b7d71e617dc5428bf8ef2 (patch)
treecf19f3056f0c14b830fa009a717ec8e816c8d83d /drivers/watchdog/mpc8xx_wdt.c
parent5c5da4318b18b7144975c9d93cbde1b981ed4e56 (diff)
downloadu-boot-c0bc2a7e06742d32b14b7d71e617dc5428bf8ef2.zip
u-boot-c0bc2a7e06742d32b14b7d71e617dc5428bf8ef2.tar.gz
u-boot-c0bc2a7e06742d32b14b7d71e617dc5428bf8ef2.tar.bz2
powerpc: mpc8xx: move watchdog into drivers/watchdog
In preparation of DM watchdog, move basic actions into drivers/watchdog Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Diffstat (limited to 'drivers/watchdog/mpc8xx_wdt.c')
-rw-r--r--drivers/watchdog/mpc8xx_wdt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c
new file mode 100644
index 0000000..ded80c4
--- /dev/null
+++ b/drivers/watchdog/mpc8xx_wdt.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 CS Systemes d'Information
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <mpc8xx.h>
+#include <asm/cpm_8xx.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void hw_watchdog_reset(void)
+{
+ immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
+
+ out_be16(&immap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
+ out_be16(&immap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
+}
+