omap_wdt.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * omap_wdt.h
  3. *
  4. * OMAP Watchdog header file
  5. *
  6. * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef __OMAP_WDT_H__
  11. #define __OMAP_WDT_H__
  12. /*
  13. * Watchdog:
  14. * Using the prescaler, the OMAP watchdog could go for many
  15. * months before firing. These limits work without scaling,
  16. * with the 60 second default assumed by most tools and docs.
  17. */
  18. #define TIMER_MARGIN_MAX (24 * 60 * 60) /* 1 day */
  19. #define TIMER_MARGIN_DEFAULT 60 /* 60 secs */
  20. #define TIMER_MARGIN_MIN 1
  21. #define PTV 0 /* prescale */
  22. #define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
  23. #define WDT_WWPS_PEND_WCLR BIT(0)
  24. #define WDT_WWPS_PEND_WLDR BIT(2)
  25. #define WDT_WWPS_PEND_WTGR BIT(3)
  26. #define WDT_WWPS_PEND_WSPR BIT(4)
  27. #define WDT_WCLR_PRE BIT(5)
  28. #define WDT_WCLR_PTV_OFF 2
  29. /* Watchdog timer registers */
  30. struct wd_timer {
  31. unsigned int resv1[4];
  32. unsigned int wdtwdsc; /* offset 0x010 */
  33. unsigned int wdtwdst; /* offset 0x014 */
  34. unsigned int wdtwisr; /* offset 0x018 */
  35. unsigned int wdtwier; /* offset 0x01C */
  36. unsigned int wdtwwer; /* offset 0x020 */
  37. unsigned int wdtwclr; /* offset 0x024 */
  38. unsigned int wdtwcrr; /* offset 0x028 */
  39. unsigned int wdtwldr; /* offset 0x02C */
  40. unsigned int wdtwtgr; /* offset 0x030 */
  41. unsigned int wdtwwps; /* offset 0x034 */
  42. unsigned int resv2[3];
  43. unsigned int wdtwdly; /* offset 0x044 */
  44. unsigned int wdtwspr; /* offset 0x048 */
  45. unsigned int resv3[1];
  46. unsigned int wdtwqeoi; /* offset 0x050 */
  47. unsigned int wdtwqstar; /* offset 0x054 */
  48. unsigned int wdtwqsta; /* offset 0x058 */
  49. unsigned int wdtwqens; /* offset 0x05C */
  50. unsigned int wdtwqenc; /* offset 0x060 */
  51. unsigned int resv4[39];
  52. unsigned int wdt_unfr; /* offset 0x100 */
  53. };
  54. #endif /* __OMAP_WDT_H__ */