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 |
|
|
// Copyright (C) 2002 Gary Thomas
|
15 |
|
|
//
|
16 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
17 |
|
|
// the terms of the GNU General Public License as published by the Free
|
18 |
|
|
// Software Foundation; either version 2 or (at your option) any later version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
21 |
|
|
// 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 along
|
26 |
|
|
// with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use macros
|
30 |
|
|
// or inline functions from this file, or you compile this file and link it
|
31 |
|
|
// with other works to produce a work based on this file, this file does not
|
32 |
|
|
// by itself cause the resulting work to be covered by the GNU General Public
|
33 |
|
|
// License. However the source code for this file must still be made available
|
34 |
|
|
// in accordance with section (3) of the GNU General Public License.
|
35 |
|
|
//
|
36 |
|
|
// This exception does not invalidate any other reasons why a work based on
|
37 |
|
|
// this file might be covered by the GNU General Public License.
|
38 |
|
|
//
|
39 |
|
|
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
40 |
|
|
// at http://sources.redhat.com/ecos/ecos-license/
|
41 |
|
|
// -------------------------------------------
|
42 |
|
|
//####ECOSGPLCOPYRIGHTEND####
|
43 |
|
|
//==========================================================================
|
44 |
|
|
//#####DESCRIPTIONBEGIN####
|
45 |
|
|
//
|
46 |
|
|
// Author(s): msalter
|
47 |
|
|
// Contributors: msalter, gthomas
|
48 |
|
|
// Date: 2001-12-03
|
49 |
|
|
// Purpose: Define Interrupt support
|
50 |
|
|
// Description: The interrupt details for XScale CPUs are defined here.
|
51 |
|
|
// Usage:
|
52 |
|
|
// #include <pkgconf/system.h>
|
53 |
|
|
// #include CYGBLD_HAL_VARIANT_H
|
54 |
|
|
// #include CYGBLD_HAL_VAR_INTS_H
|
55 |
|
|
//
|
56 |
|
|
// ...
|
57 |
|
|
//
|
58 |
|
|
//
|
59 |
|
|
//####DESCRIPTIONEND####
|
60 |
|
|
//
|
61 |
|
|
//==========================================================================
|
62 |
|
|
|
63 |
|
|
#include <cyg/hal/hal_iop310.h> // registers
|
64 |
|
|
#include <cyg/hal/hal_io.h> // IO macros
|
65 |
|
|
#include <cyg/hal/hal_platform_ints.h> // Platform overrides, setups, etc
|
66 |
|
|
|
67 |
|
|
// *** 80200 CPU ***
|
68 |
|
|
#define CYGNUM_HAL_INTERRUPT_reserved0 0
|
69 |
|
|
#define CYGNUM_HAL_INTERRUPT_PMU_PMN0_OVFL 1 // See Ch.12 - Performance Mon.
|
70 |
|
|
#define CYGNUM_HAL_INTERRUPT_PMU_PMN1_OVFL 2 // PMU counter 0/1 overflow
|
71 |
|
|
#define CYGNUM_HAL_INTERRUPT_PMU_CCNT_OVFL 3 // PMU clock overflow
|
72 |
|
|
#define CYGNUM_HAL_INTERRUPT_BCU_INTERRUPT 4 // See Ch.11 - Bus Control Unit
|
73 |
|
|
#define CYGNUM_HAL_INTERRUPT_NIRQ 5 // external IRQ
|
74 |
|
|
#define CYGNUM_HAL_INTERRUPT_NFIQ 6 // external FIQ
|
75 |
|
|
|
76 |
|
|
// *** XINT6 interrupts ***
|
77 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA_0 7
|
78 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA_1 8
|
79 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA_2 9
|
80 |
|
|
#define CYGNUM_HAL_INTERRUPT_GTSC 10 // Global Time Stamp Counter
|
81 |
|
|
#define CYGNUM_HAL_INTERRUPT_PEC 11 // Performance Event Counter
|
82 |
|
|
#define CYGNUM_HAL_INTERRUPT_AAIP 12 // application accelerator unit
|
83 |
|
|
|
84 |
|
|
// *** XINT7 interrupts ***
|
85 |
|
|
// I2C interrupts
|
86 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C_TX_EMPTY 13
|
87 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C_RX_FULL 14
|
88 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C_BUS_ERR 15
|
89 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C_STOP 16
|
90 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C_LOSS 17
|
91 |
|
|
#define CYGNUM_HAL_INTERRUPT_I2C_ADDRESS 18
|
92 |
|
|
// Messaging Unit interrupts
|
93 |
|
|
#define CYGNUM_HAL_INTERRUPT_MESSAGE_0 19
|
94 |
|
|
#define CYGNUM_HAL_INTERRUPT_MESSAGE_1 20
|
95 |
|
|
#define CYGNUM_HAL_INTERRUPT_DOORBELL 21
|
96 |
|
|
#define CYGNUM_HAL_INTERRUPT_NMI_DOORBELL 22 // FIQ
|
97 |
|
|
#define CYGNUM_HAL_INTERRUPT_QUEUE_POST 23
|
98 |
|
|
#define CYGNUM_HAL_INTERRUPT_OUTBOUND_QUEUE_FULL 24 // FIQ
|
99 |
|
|
#define CYGNUM_HAL_INTERRUPT_INDEX_REGISTER 25
|
100 |
|
|
// PCI Address Translation Unit
|
101 |
|
|
#define CYGNUM_HAL_INTERRUPT_BIST 26
|
102 |
|
|
|
103 |
|
|
// *** External board interrupts (XINT3) ***
|
104 |
|
|
#define CYGNUM_HAL_INTERRUPT_XINT3_BIT0 27
|
105 |
|
|
#define CYGNUM_HAL_INTERRUPT_XINT3_BIT1 28
|
106 |
|
|
#define CYGNUM_HAL_INTERRUPT_XINT3_BIT2 29
|
107 |
|
|
#define CYGNUM_HAL_INTERRUPT_XINT3_BIT3 30
|
108 |
|
|
#define CYGNUM_HAL_INTERRUPT_XINT3_BIT4 31
|
109 |
|
|
#define CYGNUM_HAL_INTERRUPT_XINT3_BITS 5 // Number of significant bits
|
110 |
|
|
|
111 |
|
|
// *** NMI Interrupts go to FIQ ***
|
112 |
|
|
#define CYGNUM_HAL_INTERRUPT_MCU_ERR 35
|
113 |
|
|
#define CYGNUM_HAL_INTERRUPT_PATU_ERR 36
|
114 |
|
|
#define CYGNUM_HAL_INTERRUPT_SATU_ERR 37
|
115 |
|
|
#define CYGNUM_HAL_INTERRUPT_PBDG_ERR 38
|
116 |
|
|
#define CYGNUM_HAL_INTERRUPT_SBDG_ERR 39
|
117 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA0_ERR 40
|
118 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA1_ERR 41
|
119 |
|
|
#define CYGNUM_HAL_INTERRUPT_DMA2_ERR 42
|
120 |
|
|
#define CYGNUM_HAL_INTERRUPT_MU_ERR 43
|
121 |
|
|
#define CYGNUM_HAL_INTERRUPT_reserved52 44
|
122 |
|
|
#define CYGNUM_HAL_INTERRUPT_AAU_ERR 45
|
123 |
|
|
#define CYGNUM_HAL_INTERRUPT_BIU_ERR 46
|
124 |
|
|
|
125 |
|
|
// *** ATU FIQ sources ***
|
126 |
|
|
#define CYGNUM_HAL_INTERRUPT_P_SERR 47
|
127 |
|
|
#define CYGNUM_HAL_INTERRUPT_S_SERR 48
|
128 |
|
|
|
129 |
|
|
#define CYGNUM_HAL_ISR_MIN 0
|
130 |
|
|
#define CYGNUM_HAL_ISR_MAX 48
|
131 |
|
|
|
132 |
|
|
#define CYGNUM_HAL_ISR_COUNT (CYGNUM_HAL_ISR_MAX+1)
|
133 |
|
|
|
134 |
|
|
extern void hal_delay_us(cyg_uint32 usecs);
|
135 |
|
|
#define HAL_DELAY_US(n) hal_delay_us(n);
|
136 |
|
|
|
137 |
|
|
//----------------------------------------------------------------------------
|
138 |
|
|
// Reset.
|
139 |
|
|
|
140 |
|
|
// FIXME - Can we reset the board?
|
141 |
|
|
#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT
|
142 |
|
|
|
143 |
|
|
#define HAL_PLATFORM_RESET_ENTRY 0x00000000
|
144 |
|
|
|
145 |
|
|
// ------------------------------------------------------------------------
|
146 |
|
|
// Dynamically set the timer interrupt rate.
|
147 |
|
|
// Not for application use at all.
|
148 |
|
|
|
149 |
|
|
externC void
|
150 |
|
|
hal_clock_reinitialize( int *pfreq, /* inout */
|
151 |
|
|
unsigned int *pperiod, /* inout */
|
152 |
|
|
unsigned int old_hz ); /* in */
|
153 |
|
|
|
154 |
|
|
#define HAL_CLOCK_REINITIALIZE( _freq, _period, _old_hz ) \
|
155 |
|
|
hal_clock_reinitialize( &_freq, &_period, _old_hz )
|
156 |
|
|
|
157 |
|
|
#endif // CYGONCE_HAL_VAR_INTS_H
|
158 |
|
|
// EOF hal_var_ints.h
|