blob: dc26e6ad06de0177c950a2603c32b57bb270f0fb [file] [log] [blame]
wdenk012771d2002-03-08 21:31:05 +00001/*
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/*
25 * Watchdog functions and macros.
26 */
27#ifndef _WATCHDOG_H_
28#define _WATCHDOG_H_
29
30#if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG)
31# error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together."
32#endif
33
34/*
35 * Hardware watchdog
36 */
37#ifdef CONFIG_HW_WATCHDOG
38 #if defined(__ASSEMBLY__)
39 #define WATCHDOG_RESET bl hw_watchdog_reset
40 #else
41 extern void hw_watchdog_reset(void);
42
43 #define WATCHDOG_RESET hw_watchdog_reset
44 #endif /* __ASSEMBLY__ */
45#else
46 /*
47 * Maybe a software watchdog?
48 */
49 #if defined(CONFIG_WATCHDOG)
50 #if defined(__ASSEMBLY__)
51 #define WATCHDOG_RESET bl watchdog_reset
52 #else
53 extern void watchdog_reset(void);
54
55 #define WATCHDOG_RESET watchdog_reset
56 #endif
57 #else
58 /*
59 * No hardware or software watchdog.
60 */
61 #if defined(__ASSEMBLY__)
62 #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
63 #else
64 #define WATCHDOG_RESET() {}
65 #endif /* __ASSEMBLY__ */
66 #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */
67#endif /* CONFIG_HW_WATCHDOG */
68
69/*
70 * Prototypes from $(CPU)/cpu.c.
71 */
72
73/* MPC 8xx */
74#if (defined(CONFIG_8xx) || defined(CONFIG_MPC860)) && !defined(__ASSEMBLY__)
75 void reset_8xx_watchdog(volatile immap_t *immr);
76#endif
77
wdenk0db5bca2003-03-31 17:27:09 +000078/* MPC 5xx */
79#if defined(CONFIG_5xx) && !defined(__ASSEMBLY__)
80 void reset_5xx_watchdog(volatile immap_t *immr);
81#endif
82
wdenk012771d2002-03-08 21:31:05 +000083/* IBM 4xx */
84#if defined(CONFIG_4xx) && !defined(__ASSEMBLY__)
85 void reset_4xx_watchdog(void);
86#endif
87
88/* MPC 8260 */
89#if defined(CONFIG_MPC8260) && !defined(__ASSEMBLY__)
90#if defined(CONFIG_WATCHDOG)
91extern __inline__ void
92reset_8260_watchdog(volatile immap_t *immr)
93{
94 immr->im_siu_conf.sc_swsr = 0x556c;
95 immr->im_siu_conf.sc_swsr = 0xaa39;
96}
97#endif /* !__ASSEMBLY__ && CONFIG_WATCHDOG */
98#endif /* CONFIG_MPC8260 && !__ASSEMBLY__ */
99
100#endif /* _WATCHDOG_H_ */
101