watchdog.h 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2011 Samsung Electronics
  3. * Heungjun Kim <riverful.kim@samsung.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef __ASM_ARM_ARCH_WATCHDOG_H_
  8. #define __ASM_ARM_ARCH_WATCHDOG_H_
  9. #define WTCON_RESET_OFFSET 0
  10. #define WTCON_INTEN_OFFSET 2
  11. #define WTCON_CLKSEL_OFFSET 3
  12. #define WTCON_EN_OFFSET 5
  13. #define WTCON_PRE_OFFSET 8
  14. #define WTCON_CLK_16 0x0
  15. #define WTCON_CLK_32 0x1
  16. #define WTCON_CLK_64 0x2
  17. #define WTCON_CLK_128 0x3
  18. #define WTCON_CLK(x) ((x & 0x3) << WTCON_CLKSEL_OFFSET)
  19. #define WTCON_PRESCALER(x) ((x) << WTCON_PRE_OFFSET)
  20. #define WTCON_EN (0x1 << WTCON_EN_OFFSET)
  21. #define WTCON_RESET (0x1 << WTCON_RESET_OFFSET)
  22. #define WTCON_INT (0x1 << WTCON_INTEN_OFFSET)
  23. #ifndef __ASSEMBLY__
  24. struct s5p_watchdog {
  25. unsigned int wtcon;
  26. unsigned int wtdat;
  27. unsigned int wtcnt;
  28. unsigned int wtclrint;
  29. };
  30. /* functions */
  31. void wdt_stop(void);
  32. void wdt_start(unsigned int timeout);
  33. #endif /* __ASSEMBLY__ */
  34. #endif