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 
20 #ifndef _LPC32XX_WDT_H
21 #define _LPC32XX_WDT_H
22 
23 #include <asm/types.h>
24 
25 /* Watchdog Timer Registers */
26 struct wdt_regs {
27 	u32 isr;		/* Interrupt Status Register		*/
28 	u32 ctrl;		/* Control Register			*/
29 	u32 counter;		/* Counter Value Register		*/
30 	u32 mctrl;		/* Match Control Register		*/
31 	u32 match0;		/* Match 0 Register			*/
32 	u32 emr;		/* External Match Control Register	*/
33 	u32 pulse;		/* Reset Pulse Length Register		*/
34 	u32 res;		/* Reset Source Register		*/
35 };
36 
37 /* Watchdog Timer Control Register bits */
38 #define WDTIM_CTRL_PAUSE_EN		(1 << 2)
39 #define WDTIM_CTRL_RESET_COUNT		(1 << 1)
40 #define WDTIM_CTRL_COUNT_ENAB		(1 << 0)
41 
42 /* Watchdog Timer Match Control Register bits */
43 #define WDTIM_MCTRL_RESFRC2		(1 << 6)
44 #define WDTIM_MCTRL_RESFRC1		(1 << 5)
45 #define WDTIM_MCTRL_M_RES2		(1 << 4)
46 #define WDTIM_MCTRL_M_RES1		(1 << 3)
47 #define WDTIM_MCTRL_STOP_COUNT0		(1 << 2)
48 #define WDTIM_MCTRL_RESET_COUNT0	(1 << 1)
49 #define WDTIM_MCTRL_MR0_INT		(1 << 0)
50 
51 #endif /* _LPC32XX_WDT_H */
52