omap_wdt.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef __ASSEMBLY__
  12. #include <linux/bitops.h>
  13. #endif
  14. /*
  15. * Watchdog:
  16. * Using the prescaler, the OMAP watchdog could go for many
  17. * months before firing. These limits work without scaling,
  18. * with the 60 second default assumed by most tools and docs.
  19. */
  20. #define TIMER_MARGIN_MAX (24 * 60 * 60) /* 1 day */
  21. #define TIMER_MARGIN_DEFAULT 60 /* 60 secs */
  22. #define TIMER_MARGIN_MIN 1
  23. #define PTV 0 /* prescale */
  24. #define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
  25. #define WDT_WWPS_PEND_WCLR BIT(0)
  26. #define WDT_WWPS_PEND_WLDR BIT(2)
  27. #define WDT_WWPS_PEND_WTGR BIT(3)
  28. #define WDT_WWPS_PEND_WSPR BIT(4)
  29. #define WDT_WCLR_PRE BIT(5)
  30. #define WDT_WCLR_PTV_OFF 2
  31. /* Watchdog timer registers */
  32. struct wd_timer {
  33. unsigned int resv1[4];
  34. unsigned int wdtwdsc; /* offset 0x010 */
  35. unsigned int wdtwdst; /* offset 0x014 */
  36. unsigned int wdtwisr; /* offset 0x018 */
  37. unsigned int wdtwier; /* offset 0x01C */
  38. unsigned int wdtwwer; /* offset 0x020 */
  39. unsigned int wdtwclr; /* offset 0x024 */
  40. unsigned int wdtwcrr; /* offset 0x028 */
  41. unsigned int wdtwldr; /* offset 0x02C */
  42. unsigned int wdtwtgr; /* offset 0x030 */
  43. unsigned int wdtwwps; /* offset 0x034 */
  44. unsigned int resv2[3];
  45. unsigned int wdtwdly; /* offset 0x044 */
  46. unsigned int wdtwspr; /* offset 0x048 */
  47. unsigned int resv3[1];
  48. unsigned int wdtwqeoi; /* offset 0x050 */
  49. unsigned int wdtwqstar; /* offset 0x054 */
  50. unsigned int wdtwqsta; /* offset 0x058 */
  51. unsigned int wdtwqens; /* offset 0x05C */
  52. unsigned int wdtwqenc; /* offset 0x060 */
  53. unsigned int resv4[39];
  54. unsigned int wdt_unfr; /* offset 0x100 */
  55. };
  56. struct omap3_wdt_priv {
  57. struct wd_timer *regs;
  58. unsigned int wdt_trgr_pattern;
  59. };
  60. #endif /* __OMAP_WDT_H__ */