1 |
786 |
skrzyp |
#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 Free Software Foundation, 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
|
18 |
|
|
// version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
21 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License
|
26 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use
|
30 |
|
|
// macros or inline functions from this file, or you compile this file
|
31 |
|
|
// and link it with other works to produce a work based on this file,
|
32 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
33 |
|
|
// the GNU General Public License. However the source code for this file
|
34 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
35 |
|
|
// General Public License v2.
|
36 |
|
|
//
|
37 |
|
|
// This exception does not invalidate any other reasons why a work based
|
38 |
|
|
// on this file might be covered by the GNU General Public License.
|
39 |
|
|
// -------------------------------------------
|
40 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
//==========================================================================
|
42 |
|
|
//#####DESCRIPTIONBEGIN####
|
43 |
|
|
//
|
44 |
|
|
// Author(s): <knud.woehler@microplex.de>
|
45 |
|
|
// Date: 2002-09-02
|
46 |
|
|
//
|
47 |
|
|
//####DESCRIPTIONEND####
|
48 |
|
|
//
|
49 |
|
|
//==========================================================================
|
50 |
|
|
|
51 |
|
|
#include <cyg/hal/hal_pxa2x0.h>
|
52 |
|
|
|
53 |
|
|
// 1st level
|
54 |
|
|
#define CYGNUM_HAL_INTERRUPT_SSP3 0
|
55 |
|
|
#define CYGNUM_HAL_INTERRUPT_MSL 1
|
56 |
|
|
#define CYGNUM_HAL_INTERRUPT_USBH2 2
|
57 |
|
|
#define CYGNUM_HAL_INTERRUPT_USBH1 3
|
58 |
|
|
#define CYGNUM_HAL_INTERRUPT_KEYPAD 4
|
59 |
|
|
#define CYGNUM_HAL_INTERRUPT_MEMSTK 5
|
60 |
|
|
#define CYGNUM_HAL_INTERRUPT_PWRI2C 6
|
61 |
|
|
#define CYGNUM_HAL_INTERRUPT_OST_4_11 7
|
62 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO0 8
|
63 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO1 9
|
64 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIOX 10
|
65 |
|
|
#define CYGNUM_HAL_INTERRUPT_USB 11
|
66 |
|
|
#define CYGNUM_HAL_INTERRUPT_PMU 12
|
67 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2S 13
|
68 |
|
|
#define CYGNUM_HAL_INTERRUPT_AC97 14
|
69 |
|
|
#define CYGNUM_HAL_INTERRUPT_ASSP 15 /* PXA25x */
|
70 |
|
|
#define CYGNUM_HAL_INTERRUPT_USIM 15 /* PXA27x */
|
71 |
|
|
#define CYGNUM_HAL_INTERRUT_NSSP 16
|
72 |
|
|
#define CYGNUM_HAL_INTERRUPT_LCD 17
|
73 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C 18
|
74 |
|
|
#define CYGNUM_HAL_INTERRUPT_ICP 19
|
75 |
|
|
#define CYGNUM_HAL_INTERRUPT_STUART 20
|
76 |
|
|
#define CYGNUM_HAL_INTERRUPT_BTUART 21
|
77 |
|
|
#define CYGNUM_HAL_INTERRUPT_FFUART 22
|
78 |
|
|
#define CYGNUM_HAL_INTERRUPT_MMC 23
|
79 |
|
|
#define CYGNUM_HAL_INTERRUPT_SSP 24
|
80 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA 25
|
81 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER0 26
|
82 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER1 27
|
83 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER2 28
|
84 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER3 29
|
85 |
|
|
#define CYGNUM_HAL_INTERRUPT_HZ 30
|
86 |
|
|
#define CYGNUM_HAL_INTERRUPT_ALARM 31
|
87 |
|
|
|
88 |
|
|
#if defined (CYGOPT_HAL_ARM_XSCALE_PXA2X0_VARIANT_PXA27X)
|
89 |
|
|
|
90 |
|
|
#define CYGNUM_HAL_INTERRUPT_TPM 32
|
91 |
|
|
#define CYGNUM_HAL_INTERRUPT_CAMERA 33
|
92 |
|
|
|
93 |
|
|
#define CYGNUM_HAL_INTERNAL_IRQS 34
|
94 |
|
|
|
95 |
|
|
#elif defined(CYGOPT_HAL_ARM_XSCALE_PXA2X0_VARIANT_PXA25X)
|
96 |
|
|
|
97 |
|
|
#define CYGNUM_HAL_INTERNAL_IRQS 32
|
98 |
|
|
|
99 |
|
|
// 2nd level
|
100 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO2 (32+2)
|
101 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO3 (32+3)
|
102 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO4 (32+4)
|
103 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO5 (32+5)
|
104 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO6 (32+6)
|
105 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO7 (32+7)
|
106 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO8 (32+8)
|
107 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO9 (32+9)
|
108 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO10 (32+10)
|
109 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO11 (32+11)
|
110 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO12 (32+12)
|
111 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO13 (32+13)
|
112 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO14 (32+14)
|
113 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO15 (32+15)
|
114 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO16 (32+16)
|
115 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO17 (32+17)
|
116 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO18 (32+18)
|
117 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO19 (32+19)
|
118 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO20 (32+20)
|
119 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO21 (32+21)
|
120 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO22 (32+22)
|
121 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO23 (32+23)
|
122 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO24 (32+24)
|
123 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO25 (32+25)
|
124 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO26 (32+26)
|
125 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO27 (32+27)
|
126 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO28 (32+28)
|
127 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO29 (32+29)
|
128 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO30 (32+30)
|
129 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO31 (32+31)
|
130 |
|
|
|
131 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO32 (64+0)
|
132 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO33 (64+1)
|
133 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO34 (64+2)
|
134 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO35 (64+3)
|
135 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO36 (64+4)
|
136 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO37 (64+5)
|
137 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO38 (64+6)
|
138 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO39 (64+7)
|
139 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO40 (64+8)
|
140 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO41 (64+9)
|
141 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO42 (64+10)
|
142 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO43 (64+11)
|
143 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO44 (64+12)
|
144 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO45 (64+13)
|
145 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO46 (64+14)
|
146 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO47 (64+15)
|
147 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO48 (64+16)
|
148 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO49 (64+17)
|
149 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO50 (64+18)
|
150 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO51 (64+19)
|
151 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO52 (64+20)
|
152 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO53 (64+21)
|
153 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO54 (64+22)
|
154 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO55 (64+23)
|
155 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO56 (64+24)
|
156 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO57 (64+25)
|
157 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO58 (64+26)
|
158 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO59 (64+27)
|
159 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO60 (64+28)
|
160 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO61 (64+29)
|
161 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO62 (64+30)
|
162 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO63 (64+31)
|
163 |
|
|
|
164 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO64 (96+0)
|
165 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO65 (96+1)
|
166 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO66 (96+2)
|
167 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO67 (96+3)
|
168 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO68 (96+4)
|
169 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO69 (96+5)
|
170 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO70 (96+6)
|
171 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO71 (96+7)
|
172 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO72 (96+8)
|
173 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO73 (96+9)
|
174 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO74 (96+10)
|
175 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO75 (96+11)
|
176 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO76 (96+12)
|
177 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO77 (96+13)
|
178 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO78 (96+14)
|
179 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO79 (96+15)
|
180 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO80 (96+16)
|
181 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO81 (96+17)
|
182 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO82 (96+18)
|
183 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO83 (96+19)
|
184 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO84 (96+20)
|
185 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO85 (96+21)
|
186 |
|
|
|
187 |
|
|
#endif
|
188 |
|
|
|
189 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO(i) \
|
190 |
|
|
(((i) < 2) ? (CYGNUM_HAL_INTERRUPT_GPIO0 + (i)) : (CYGNUM_HAL_INTERNAL_IRQS + (i)))
|
191 |
|
|
|
192 |
|
|
#define CYGNUM_HAL_INTERRUPT_NONE -1
|
193 |
|
|
|
194 |
|
|
#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_TIMER0
|
195 |
|
|
|
196 |
|
|
#define CYGNUM_HAL_ISR_MIN 0
|
197 |
|
|
#if defined CYGOPT_HAL_ARM_XSCALE_PXA2X0_VARIANT_PXA25X
|
198 |
|
|
# define CYGNUM_HAL_ISR_MAX (96+21)
|
199 |
|
|
#elif defined CYGOPT_HAL_ARM_XSCALE_PXA2X0_VARIANT_PXA27X
|
200 |
|
|
# define CYGNUM_HAL_ISR_MAX (CYGNUM_HAL_INTERNAL_IRQS + 121)
|
201 |
|
|
#endif
|
202 |
|
|
#define CYGNUM_HAL_ISR_COUNT (CYGNUM_HAL_ISR_MAX-CYGNUM_HAL_ISR_MIN+1)
|
203 |
|
|
|
204 |
|
|
#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY
|
205 |
|
|
externC void hal_clock_latency(cyg_uint32 *);
|
206 |
|
|
# define HAL_CLOCK_LATENCY( _pvalue_ ) hal_clock_latency( (cyg_uint32 *)(_pvalue_) )
|
207 |
|
|
#endif
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
// Reset
|
211 |
|
|
#define HAL_PLATFORM_RESET() \
|
212 |
|
|
CYG_MACRO_START \
|
213 |
|
|
cyg_uint32 ctrl; \
|
214 |
|
|
HAL_DISABLE_INTERRUPTS(ctrl); \
|
215 |
|
|
*PXA2X0_OWER = PXA2X0_OWER_WME; \
|
216 |
|
|
*PXA2X0_OSMR3 = *PXA2X0_OSCR + 1000; \
|
217 |
|
|
for(;;); \
|
218 |
|
|
CYG_MACRO_END
|
219 |
|
|
|
220 |
|
|
#define HAL_PLATFORM_RESET_ENTRY 0x00000000
|
221 |
|
|
|
222 |
|
|
#endif // CYGONCE_HAL_VAR_INTS_H
|
223 |
|
|
|