imxwdogreg.h revision 1.1.8.2 1 1.1.8.2 rmind /*-
2 1.1.8.2 rmind * Copyright (c) 2010 Genetec Corporation. All rights reserved.
3 1.1.8.2 rmind * Written by Hiroyuki Bessho for Genetec Corporation.
4 1.1.8.2 rmind *
5 1.1.8.2 rmind * Redistribution and use in source and binary forms, with or without
6 1.1.8.2 rmind * modification, are permitted provided that the following conditions
7 1.1.8.2 rmind * are met:
8 1.1.8.2 rmind * 1. Redistributions of source code must retain the above copyright
9 1.1.8.2 rmind * notice, this list of conditions and the following disclaimer.
10 1.1.8.2 rmind * 2. Redistributions in binary form must reproduce the above
11 1.1.8.2 rmind * copyright notice, this list of conditions and the following
12 1.1.8.2 rmind * disclaimer in the documentation and/or other materials provided
13 1.1.8.2 rmind * with the distribution.
14 1.1.8.2 rmind *
15 1.1.8.2 rmind * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
16 1.1.8.2 rmind * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 1.1.8.2 rmind * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 1.1.8.2 rmind * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS
19 1.1.8.2 rmind * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 1.1.8.2 rmind * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 1.1.8.2 rmind * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 1.1.8.2 rmind * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 1.1.8.2 rmind * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 1.1.8.2 rmind * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 1.1.8.2 rmind * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1.8.2 rmind * SUCH DAMAGE.
27 1.1.8.2 rmind */
28 1.1.8.2 rmind
29 1.1.8.2 rmind /*
30 1.1.8.2 rmind * Watchdog register definitions for Freescale i.MX31 and i.MX51
31 1.1.8.2 rmind *
32 1.1.8.2 rmind * MCIMX31 and MCIMX31L Application Processors
33 1.1.8.2 rmind * Reference Manual
34 1.1.8.2 rmind * MCIMC31RM
35 1.1.8.2 rmind * Rev. 2.3
36 1.1.8.2 rmind * 1/2007
37 1.1.8.2 rmind *
38 1.1.8.2 rmind * MCIMX51 Multimedia Applications Processor
39 1.1.8.2 rmind * Reference Manual
40 1.1.8.2 rmind * MCIMX51RM
41 1.1.8.2 rmind * Rev. 1
42 1.1.8.2 rmind * 2/2010
43 1.1.8.2 rmind */
44 1.1.8.2 rmind
45 1.1.8.2 rmind #ifndef IMXWDOGREG_H
46 1.1.8.2 rmind #define IMXWDOGREG_H
47 1.1.8.2 rmind
48 1.1.8.2 rmind #ifdef _LOCORE
49 1.1.8.2 rmind #ifndef __BIT
50 1.1.8.2 rmind #define __BIT(n) (1<<(n))
51 1.1.8.2 rmind #endif
52 1.1.8.2 rmind #ifndef __BITS
53 1.1.8.2 rmind #define __BITS(hi,lo) (((1<<((hi)+1))-1) & ~((1<<((lo))-1))
54 1.1.8.2 rmind #endif
55 1.1.8.2 rmind #else
56 1.1.8.2 rmind #include <sys/cdefs.h>
57 1.1.8.2 rmind #endif
58 1.1.8.2 rmind
59 1.1.8.2 rmind
60 1.1.8.2 rmind #define IMX_WDOG_WCR 0x0000 /* Watchdog Control Register */
61 1.1.8.2 rmind #define WCR_WDZST __BIT(0) /* watchdog low power */
62 1.1.8.2 rmind #define WCR_WDBG __BIT(1) /* watchdog debug enable */
63 1.1.8.2 rmind #define WCR_WDE __BIT(2) /* watchdog enable */
64 1.1.8.2 rmind #define WCR_WDT __BIT(3) /* timeout assertion */
65 1.1.8.2 rmind #define WCR_SRS __BIT(4) /* software reset signal */
66 1.1.8.2 rmind #define WCR_WDA __BIT(5) /* ipp_wdog* assertion */
67 1.1.8.2 rmind #define WCR_WDW __BIT(7) /* disable for wait */
68 1.1.8.2 rmind #define WCR_WT_SHIFT 8
69 1.1.8.2 rmind #define WCR_WT_LEN 8
70 1.1.8.2 rmind #define WCR_WT_MASK __BIT(WCR_WT_SHIFT+WCR_WT_LEN-1, WCR_WT_SHIFT)
71 1.1.8.2 rmind /* watchdog timeout
72 1.1.8.2 rmind 0=0.5sec 0xff=128sec */
73 1.1.8.2 rmind
74 1.1.8.2 rmind #define IMX_WDOG_WSR 0x0002 /* Watchdog Service Register */
75 1.1.8.2 rmind #define WSR_MAGIC1 0x5555 /* 1st word of service sequence */
76 1.1.8.2 rmind #define WSR_MAGIC2 0xaaaa /* 2nd word of service sequence */
77 1.1.8.2 rmind
78 1.1.8.2 rmind #define IMX_WDOG_WRSR 0x0004 /* Watchdog Reset Status Register */
79 1.1.8.2 rmind #define WRSR_SFTW __BIT(0) /* reset is the result of a
80 1.1.8.2 rmind * software reset */
81 1.1.8.2 rmind #define WRSR_TOUT __BIT(1) /* reset is the result of a
82 1.1.8.2 rmind * WDOG timeout */
83 1.1.8.2 rmind /* only for i.MX31 */
84 1.1.8.2 rmind #define WRSR_CMON __BIT(2)
85 1.1.8.2 rmind #define WRSR_EXT __BIT(3)
86 1.1.8.2 rmind #define WRSR_PWR __BIT(4)
87 1.1.8.2 rmind #define WRSR_JRST __BIT(5)
88 1.1.8.2 rmind
89 1.1.8.2 rmind
90 1.1.8.2 rmind /* only for i.MX51 */
91 1.1.8.2 rmind #define IMX_WDOG_WICR 0x0006 /* Watchdog Interrupt Control Register */
92 1.1.8.2 rmind #define WICR_WICT_LEN 8
93 1.1.8.2 rmind #define WICR_WICT_MASK __BITS(WICT_LEN-1,0) /* interrupt count timeout */
94 1.1.8.2 rmind #define WICR_WTIS __BIT(14) /* interrupt status [w1c] */
95 1.1.8.2 rmind #define WICR_WIE __BIT(15) /* interrupt enable */
96 1.1.8.2 rmind
97 1.1.8.2 rmind
98 1.1.8.2 rmind /* only for i.MX51 */
99 1.1.8.2 rmind #define IMX_WDOG_WMCR 0x0008
100 1.1.8.2 rmind #define WMCR_PDE __BIT(0) /* power down enable */
101 1.1.8.2 rmind
102 1.1.8.2 rmind #endif
103