omap_wdt.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * linux/drivers/char/watchdog/omap_wdt.h
  4. *
  5. * BRIEF MODULE DESCRIPTION
  6. * OMAP Watchdog timer register definitions
  7. *
  8. * Copyright (C) 2004 Texas Instruments.
  9. */
  10. #ifndef _OMAP_WATCHDOG_H
  11. #define _OMAP_WATCHDOG_H
  12. #define OMAP_WATCHDOG_REV (0x00)
  13. #define OMAP_WATCHDOG_SYS_CONFIG (0x10)
  14. #define OMAP_WATCHDOG_STATUS (0x14)
  15. #define OMAP_WATCHDOG_CNTRL (0x24)
  16. #define OMAP_WATCHDOG_CRR (0x28)
  17. #define OMAP_WATCHDOG_LDR (0x2c)
  18. #define OMAP_WATCHDOG_TGR (0x30)
  19. #define OMAP_WATCHDOG_WPS (0x34)
  20. #define OMAP_WATCHDOG_SPR (0x48)
  21. /* Using the prescaler, the OMAP watchdog could go for many
  22. * months before firing. These limits work without scaling,
  23. * with the 60 second default assumed by most tools and docs.
  24. */
  25. #define TIMER_MARGIN_MAX (24 * 60 * 60) /* 1 day */
  26. #define TIMER_MARGIN_DEFAULT 60 /* 60 secs */
  27. #define TIMER_MARGIN_MIN 1
  28. #define PTV 0 /* prescale */
  29. #define GET_WLDR_VAL(secs) (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
  30. #define GET_WCCR_SECS(val) ((0xffffffff - (val) + 1) / (32768/(1<<PTV)))
  31. #endif /* _OMAP_WATCHDOG_H */