]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mxc91231/var/v2_0/include/hal_var_ints.h
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / mxc91231 / var / v2_0 / include / hal_var_ints.h
1 #ifndef CYGONCE_HAL_VAR_INTS_H
2 #define CYGONCE_HAL_VAR_INTS_H
3 //==========================================================================
4 //
5 //      hal_var_ints.h
6 //
7 //      HAL Interrupt and clock support
8 //
9 //==========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 //
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
18 //
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22 // for more details.
23 //
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 //
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
34 //
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
37 //
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //==========================================================================
43
44 #include <cyg/hal/hal_soc.h>         // registers
45
46 // NOTE:  These interrupt definitions are not used by redboot.  The
47 //        defines are provided to fulfill build requirements.
48 #define CYGNUM_HAL_INTERRUPT_GPIO0   0
49 #define CYGNUM_HAL_INTERRUPT_GPIO1   1
50 #define CYGNUM_HAL_INTERRUPT_GPIO2   2
51 #define CYGNUM_HAL_INTERRUPT_GPIO3   3
52 #define CYGNUM_HAL_INTERRUPT_GPIO4   4
53 #define CYGNUM_HAL_INTERRUPT_GPIO5   5
54 #define CYGNUM_HAL_INTERRUPT_GPIO6   6
55 #define CYGNUM_HAL_INTERRUPT_GPIO7   7
56 #define CYGNUM_HAL_INTERRUPT_GPIO8   8
57 #define CYGNUM_HAL_INTERRUPT_GPIO9   9
58 #define CYGNUM_HAL_INTERRUPT_GPIO10  10
59 #define CYGNUM_HAL_INTERRUPT_GPIO    11  // Don't use directly!
60 #define CYGNUM_HAL_INTERRUPT_LCD     12
61 #define CYGNUM_HAL_INTERRUPT_UDC     13
62 #define CYGNUM_HAL_INTERRUPT_UART1   15
63 #define CYGNUM_HAL_INTERRUPT_UART2   16
64 #define CYGNUM_HAL_INTERRUPT_UART3   17
65 #define CYGNUM_HAL_INTERRUPT_UART4   17
66 #define CYGNUM_HAL_INTERRUPT_MCP     18
67 #define CYGNUM_HAL_INTERRUPT_SSP     19
68 #define CYGNUM_HAL_INTERRUPT_TIMER0  26
69 #define CYGNUM_HAL_INTERRUPT_TIMER1  27
70 #define CYGNUM_HAL_INTERRUPT_TIMER2  28
71 #define CYGNUM_HAL_INTERRUPT_TIMER3  29
72 #define CYGNUM_HAL_INTERRUPT_HZ      30
73 #define CYGNUM_HAL_INTERRUPT_ALARM   31
74
75 // GPIO bits 31..11 can generate interrupts as well, but they all
76 // end up clumped into interrupt signal #11.  Using the symbols
77 // below allow for detection of these separately.
78
79 #define CYGNUM_HAL_INTERRUPT_GPIO11  (32+11)
80 #define CYGNUM_HAL_INTERRUPT_GPIO12  (32+12)
81 #define CYGNUM_HAL_INTERRUPT_GPIO13  (32+13)
82 #define CYGNUM_HAL_INTERRUPT_GPIO14  (32+14)
83 #define CYGNUM_HAL_INTERRUPT_GPIO15  (32+15)
84 #define CYGNUM_HAL_INTERRUPT_GPIO16  (32+16)
85 #define CYGNUM_HAL_INTERRUPT_GPIO17  (32+17)
86 #define CYGNUM_HAL_INTERRUPT_GPIO18  (32+18)
87 #define CYGNUM_HAL_INTERRUPT_GPIO19  (32+19)
88 #define CYGNUM_HAL_INTERRUPT_GPIO20  (32+20)
89 #define CYGNUM_HAL_INTERRUPT_GPIO21  (32+21)
90 #define CYGNUM_HAL_INTERRUPT_GPIO22  (32+22)
91 #define CYGNUM_HAL_INTERRUPT_GPIO23  (32+23)
92 #define CYGNUM_HAL_INTERRUPT_GPIO24  (32+24)
93 #define CYGNUM_HAL_INTERRUPT_GPIO25  (32+25)
94 #define CYGNUM_HAL_INTERRUPT_GPIO26  (32+26)
95 #define CYGNUM_HAL_INTERRUPT_GPIO27  (32+27)
96
97 #define CYGNUM_HAL_INTERRUPT_NONE    -1
98
99 #define CYGNUM_HAL_ISR_MIN            0
100 #define CYGNUM_HAL_ISR_MAX           (27+32)
101
102 #define CYGNUM_HAL_ISR_COUNT         (CYGNUM_HAL_ISR_MAX+1)
103
104 // The vector used by the Real time clock
105 #define CYGNUM_HAL_INTERRUPT_RTC     CYGNUM_HAL_INTERRUPT_TIMER0
106
107 // The vector used by the Ethernet
108 #define CYGNUM_HAL_INTERRUPT_ETH     CYGNUM_HAL_INTERRUPT_GPIO0
109
110 // method for reading clock interrupt latency
111 #ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY
112 externC void hal_clock_latency(cyg_uint32 *);
113 # define HAL_CLOCK_LATENCY( _pvalue_ ) \
114          hal_clock_latency( (cyg_uint32 *)(_pvalue_) )
115 #endif
116
117 //----------------------------------------------------------------------------
118 // Reset.
119 #define HAL_PLATFORM_RESET()                                                  \
120     CYG_MACRO_START                                                           \
121         *(volatile unsigned int *)(WEIM_CTRL_CS0 + CSCRU) = 0x00001E00;       \
122         *(volatile unsigned int *)(WEIM_CTRL_CS0 + CSCRL) = 0x20000D01;       \
123         *(volatile unsigned int *)(WEIM_CTRL_CS0 + CSCRA) = 0x0;              \
124         *(volatile unsigned short *)WDOG_BASE_ADDR = 0x7;                 \
125         /* hang here forever if reset fails */                                \
126         while (1){}                                                           \
127     CYG_MACRO_END
128
129 // Fallback (never really used)
130 #define HAL_PLATFORM_RESET_ENTRY 0x00000000
131
132 #endif // CYGONCE_HAL_VAR_INTS_H