diff options
author | Christophe Leroy | 2018-03-16 17:21:01 +0100 |
---|---|---|
committer | Tom Rini | 2018-04-06 16:31:11 -0400 |
commit | c0bc2a7e06742d32b14b7d71e617dc5428bf8ef2 (patch) | |
tree | cf19f3056f0c14b830fa009a717ec8e816c8d83d /drivers/watchdog | |
parent | 5c5da4318b18b7144975c9d93cbde1b981ed4e56 (diff) |
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')
-rw-r--r-- | drivers/watchdog/Makefile | 1 | ||||
-rw-r--r-- | drivers/watchdog/mpc8xx_wdt.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 4b97df3ab67..4fee6dbd1f4 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -23,3 +23,4 @@ obj-$(CONFIG_WDT_BCM6345) += bcm6345_wdt.o obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o obj-$(CONFIG_WDT_ORION) += orion_wdt.o obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o +obj-$(CONFIG_MPC8xx_WATCHDOG) += mpc8xx_wdt.o diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c new file mode 100644 index 00000000000..ded80c4d6a9 --- /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 */ +} + |