wdt.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2011 by Vladimir Zapolskiy <vz@mleia.com>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. * MA 02110-1301, USA.
  18. */
  19. #ifndef _LPC32XX_WDT_H
  20. #define _LPC32XX_WDT_H
  21. #include <asm/types.h>
  22. /* Watchdog Timer Registers */
  23. struct wdt_regs {
  24. u32 isr; /* Interrupt Status Register */
  25. u32 ctrl; /* Control Register */
  26. u32 counter; /* Counter Value Register */
  27. u32 mctrl; /* Match Control Register */
  28. u32 match0; /* Match 0 Register */
  29. u32 emr; /* External Match Control Register */
  30. u32 pulse; /* Reset Pulse Length Register */
  31. u32 res; /* Reset Source Register */
  32. };
  33. /* Watchdog Timer Control Register bits */
  34. #define WDTIM_CTRL_PAUSE_EN (1 << 2)
  35. #define WDTIM_CTRL_RESET_COUNT (1 << 1)
  36. #define WDTIM_CTRL_COUNT_ENAB (1 << 0)
  37. /* Watchdog Timer Match Control Register bits */
  38. #define WDTIM_MCTRL_RESFRC2 (1 << 6)
  39. #define WDTIM_MCTRL_RESFRC1 (1 << 5)
  40. #define WDTIM_MCTRL_M_RES2 (1 << 4)
  41. #define WDTIM_MCTRL_M_RES1 (1 << 3)
  42. #define WDTIM_MCTRL_STOP_COUNT0 (1 << 2)
  43. #define WDTIM_MCTRL_RESET_COUNT0 (1 << 1)
  44. #define WDTIM_MCTRL_MR0_INT (1 << 0)
  45. #endif /* _LPC32XX_WDT_H */