diff options
Diffstat (limited to 'drivers/watchdog')
| -rw-r--r-- | drivers/watchdog/Makefile | 3 | ||||
| -rw-r--r-- | drivers/watchdog/bfin_wdt.c | 26 | 
2 files changed, 28 insertions, 1 deletions
| diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 13e7c3768..b9bbbc633 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -27,12 +27,13 @@ LIB	:= $(obj)libwatchdog.o  COBJS-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o  COBJS-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o -ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6)) +ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 vf610))  COBJS-y += imx_watchdog.o  endif  COBJS-$(CONFIG_TNETV107X_WATCHDOG) += tnetv107x_wdt.o  COBJS-$(CONFIG_S5P)               += s5p_wdt.o  COBJS-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o +COBJS-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o  COBJS	:= $(COBJS-y)  SRCS	:= $(COBJS:.o=.c) diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c new file mode 100644 index 000000000..7a6756b2e --- /dev/null +++ b/drivers/watchdog/bfin_wdt.c @@ -0,0 +1,26 @@ +/* + * watchdog.c - driver for Blackfin on-chip watchdog + * + * Copyright (c) 2007-2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include <common.h> +#include <watchdog.h> +#include <asm/blackfin.h> +#include <asm/mach-common/bits/watchdog.h> + +void hw_watchdog_reset(void) +{ +	bfin_write_WDOG_STAT(0); +} + +void hw_watchdog_init(void) +{ +	bfin_write_WDOG_CTL(WDDIS); +	SSYNC(); +	bfin_write_WDOG_CNT(CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000 * get_sclk()); +	hw_watchdog_reset(); +	bfin_write_WDOG_CTL(WDEN); +} |