watchdog.c 456 B

12345678910111213141516171819202122232425
  1. /*
  2. * watchdog.c - driver for Blackfin on-chip watchdog
  3. *
  4. * Copyright (c) 2007-2008 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #include <common.h>
  9. #include <watchdog.h>
  10. #include <asm/blackfin.h>
  11. #ifdef CONFIG_HW_WATCHDOG
  12. void hw_watchdog_reset(void)
  13. {
  14. bfin_write_WDOG_STAT(0);
  15. }
  16. void hw_watchdog_init(void)
  17. {
  18. bfin_write_WDOG_CNT(5 * get_sclk()); /* 5 second timeout */
  19. hw_watchdog_reset();
  20. bfin_write_WDOG_CTL(0x0);
  21. }
  22. #endif