1 |
27 |
unneback |
#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 |
|
|
//#####DESCRIPTIONBEGIN####
|
44 |
|
|
//
|
45 |
|
|
// Author(s): gthomas
|
46 |
|
|
// Contributors: gthomas
|
47 |
|
|
// Date: 2000-05-08
|
48 |
|
|
// Purpose: Define Interrupt support
|
49 |
|
|
// Description: The interrupt details for the SA1110/Assabet are defined here.
|
50 |
|
|
// Usage:
|
51 |
|
|
// #include <pkgconf/system.h>
|
52 |
|
|
// #include CYGBLD_HAL_VARIANT_H
|
53 |
|
|
// #include CYGBLD_HAL_VAR_INTS_H
|
54 |
|
|
//
|
55 |
|
|
// ...
|
56 |
|
|
//
|
57 |
|
|
//
|
58 |
|
|
//####DESCRIPTIONEND####
|
59 |
|
|
//
|
60 |
|
|
//==========================================================================
|
61 |
|
|
|
62 |
|
|
#include <cyg/hal/hal_sa11x0.h> // registers
|
63 |
|
|
|
64 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO0 0
|
65 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO1 1
|
66 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO2 2
|
67 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO3 3
|
68 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO4 4
|
69 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO5 5
|
70 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO6 6
|
71 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO7 7
|
72 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO8 8
|
73 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO9 9
|
74 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO10 10
|
75 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO 11 // Don't use directly!
|
76 |
|
|
#define CYGNUM_HAL_INTERRUPT_LCD 12
|
77 |
|
|
#define CYGNUM_HAL_INTERRUPT_UDC 13
|
78 |
|
|
#define CYGNUM_HAL_INTERRUPT_UART1 15
|
79 |
|
|
#define CYGNUM_HAL_INTERRUPT_UART2 16
|
80 |
|
|
#define CYGNUM_HAL_INTERRUPT_UART3 17
|
81 |
|
|
#define CYGNUM_HAL_INTERRUPT_MCP 18
|
82 |
|
|
#define CYGNUM_HAL_INTERRUPT_SSP 19
|
83 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER0 26
|
84 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER1 27
|
85 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER2 28
|
86 |
|
|
#define CYGNUM_HAL_INTERRUPT_TIMER3 29
|
87 |
|
|
#define CYGNUM_HAL_INTERRUPT_HZ 30
|
88 |
|
|
#define CYGNUM_HAL_INTERRUPT_ALARM 31
|
89 |
|
|
|
90 |
|
|
// GPIO bits 31..11 can generate interrupts as well, but they all
|
91 |
|
|
// end up clumped into interrupt signal #11. Using the symbols
|
92 |
|
|
// below allow for detection of these separately.
|
93 |
|
|
|
94 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO11 (32+11)
|
95 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO12 (32+12)
|
96 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO13 (32+13)
|
97 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO14 (32+14)
|
98 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO15 (32+15)
|
99 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO16 (32+16)
|
100 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO17 (32+17)
|
101 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO18 (32+18)
|
102 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO19 (32+19)
|
103 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO20 (32+20)
|
104 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO21 (32+21)
|
105 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO22 (32+22)
|
106 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO23 (32+23)
|
107 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO24 (32+24)
|
108 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO25 (32+25)
|
109 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO26 (32+26)
|
110 |
|
|
#define CYGNUM_HAL_INTERRUPT_GPIO27 (32+27)
|
111 |
|
|
|
112 |
|
|
#define CYGNUM_HAL_INTERRUPT_NONE -1
|
113 |
|
|
|
114 |
|
|
#define CYGNUM_HAL_ISR_MIN 0
|
115 |
|
|
#define CYGNUM_HAL_ISR_MAX (27+32)
|
116 |
|
|
|
117 |
|
|
#define CYGNUM_HAL_ISR_COUNT (CYGNUM_HAL_ISR_MAX+1)
|
118 |
|
|
|
119 |
|
|
// The vector used by the Real time clock
|
120 |
|
|
#define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_TIMER0
|
121 |
|
|
|
122 |
|
|
// SA11x0 method for reading clock interrupt latency
|
123 |
|
|
#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY
|
124 |
|
|
externC void hal_clock_latency(cyg_uint32 *);
|
125 |
|
|
# define HAL_CLOCK_LATENCY( _pvalue_ ) \
|
126 |
|
|
hal_clock_latency( (cyg_uint32 *)(_pvalue_) )
|
127 |
|
|
#endif
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
//----------------------------------------------------------------------------
|
131 |
|
|
// Reset.
|
132 |
|
|
#define HAL_PLATFORM_RESET() \
|
133 |
|
|
CYG_MACRO_START \
|
134 |
|
|
cyg_uint32 ctrl; \
|
135 |
|
|
\
|
136 |
|
|
/* By disabling interupts we will just hang in the loop below */ \
|
137 |
|
|
/* if for some reason the software reset fails. */ \
|
138 |
|
|
HAL_DISABLE_INTERRUPTS(ctrl); \
|
139 |
|
|
\
|
140 |
|
|
/* Software reset. */ \
|
141 |
|
|
*SA11X0_RESET_SOFTWARE_RESET = SA11X0_INVOKE_SOFTWARE_RESET; \
|
142 |
|
|
\
|
143 |
|
|
for(;;); /* hang here forever if reset fails */ \
|
144 |
|
|
CYG_MACRO_END
|
145 |
|
|
|
146 |
|
|
// Fallback (never really used)
|
147 |
|
|
#define HAL_PLATFORM_RESET_ENTRY 0x00000000
|
148 |
|
|
|
149 |
|
|
#endif // CYGONCE_HAL_VAR_INTS_H
|