watchdog.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * (C) Copyright 2001
  3. * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * Watchdog functions and macros.
  25. */
  26. #ifndef _WATCHDOG_H_
  27. #define _WATCHDOG_H_
  28. #if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG)
  29. # error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together."
  30. #endif
  31. /*
  32. * Hardware watchdog
  33. */
  34. #ifdef CONFIG_HW_WATCHDOG
  35. void hw_watchdog_init(void);
  36. #if defined(__ASSEMBLY__)
  37. #define WATCHDOG_RESET bl hw_watchdog_reset
  38. #else
  39. extern void hw_watchdog_reset(void);
  40. #define WATCHDOG_RESET hw_watchdog_reset
  41. #endif /* __ASSEMBLY__ */
  42. #else
  43. /*
  44. * Maybe a software watchdog?
  45. */
  46. #if defined(CONFIG_WATCHDOG)
  47. #if defined(__ASSEMBLY__)
  48. #define WATCHDOG_RESET bl watchdog_reset
  49. #else
  50. extern void watchdog_reset(void);
  51. #define WATCHDOG_RESET watchdog_reset
  52. #endif
  53. #else
  54. /*
  55. * No hardware or software watchdog.
  56. */
  57. #if defined(__ASSEMBLY__)
  58. #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
  59. #else
  60. #define WATCHDOG_RESET() {}
  61. #endif /* __ASSEMBLY__ */
  62. #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
  63. #endif /* CONFIG_HW_WATCHDOG */
  64. /*
  65. * Prototypes from $(CPU)/cpu.c.
  66. */
  67. /* MPC 8xx */
  68. #if (defined(CONFIG_8xx) || defined(CONFIG_MPC860)) && !defined(__ASSEMBLY__)
  69. void reset_8xx_watchdog(volatile immap_t *immr);
  70. #endif
  71. /* MPC 5xx */
  72. #if defined(CONFIG_5xx) && !defined(__ASSEMBLY__)
  73. void reset_5xx_watchdog(volatile immap_t *immr);
  74. #endif
  75. /* MPC 5xxx */
  76. #if defined(CONFIG_MPC5xxx) && !defined(__ASSEMBLY__)
  77. void reset_5xxx_watchdog(void);
  78. #endif
  79. /* AMCC 4xx */
  80. #if defined(CONFIG_4xx) && !defined(__ASSEMBLY__)
  81. void reset_4xx_watchdog(void);
  82. #endif
  83. #endif /* _WATCHDOG_H_ */