watchdog.h 984 B

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