blob: 1886bda0ae633c15c6f8485b174e7e4f32c1495f [file] [log] [blame]
Mike Frysinger9171fc82008-03-30 15:46:13 -04001/*
2 * watchdog.c - driver for Blackfin on-chip watchdog
3 *
Mike Frysinger313e8aa2009-11-12 18:42:07 -05004 * Copyright (c) 2007-2009 Analog Devices Inc.
Mike Frysinger9171fc82008-03-30 15:46:13 -04005 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#include <common.h>
10#include <watchdog.h>
11#include <asm/blackfin.h>
12
Mike Frysinger9171fc82008-03-30 15:46:13 -040013void hw_watchdog_reset(void)
14{
15 bfin_write_WDOG_STAT(0);
16}
17
18void hw_watchdog_init(void)
19{
20 bfin_write_WDOG_CNT(5 * get_sclk()); /* 5 second timeout */
21 hw_watchdog_reset();
22 bfin_write_WDOG_CTL(0x0);
23}