omap_wdt.h 1.7 KB

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