From 3f2546b2ef55b661fd8dd69682b38992225e86f6 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 29 Apr 2019 01:17:54 +0100 Subject: Initial import of qemu-2.4.1 --- roms/u-boot/drivers/watchdog/bfin_wdt.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 roms/u-boot/drivers/watchdog/bfin_wdt.c (limited to 'roms/u-boot/drivers/watchdog/bfin_wdt.c') diff --git a/roms/u-boot/drivers/watchdog/bfin_wdt.c b/roms/u-boot/drivers/watchdog/bfin_wdt.c new file mode 100644 index 00000000..7a6756b2 --- /dev/null +++ b/roms/u-boot/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 +#include +#include +#include + +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); +} -- cgit v1.2.3