source: rtems/c/src/lib/libbsp/powerpc/mbx8xx/irq/irq.h @ bc98089

4.104.11
Last change on this file since bc98089 was e872f07, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 4, 2007 at 9:03:34 PM

2007-12-04 Joel Sherrill <joel.sherrill@…>

  • Makefile.am: Add bsppredriverhook.c.
  • irq/irq.h: Attempt to correct definition of BSP_CPM_IRQ_LOWEST_OFFSET.
  • Property mode set to 100644
File size: 6.2 KB
Line 
1/* irq.h
2 *
3 *  This include file describe the data structure and the functions implemented
4 *  by rtems to write interrupt handlers.
5 *
6 *  CopyRight (C) 1999 valette@crf.canon.fr
7 *
8 *  This code is heavilly inspired by the public specification of STREAM V2
9 *  that can be found at :
10 *
11 *      <http://www.chorus.com/Documentation/index.html> by following
12 *  the STREAM API Specification Document link.
13 *
14 *  The license and distribution terms for this file may be
15 *  found in found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#ifndef LIBBSP_POWERPC_MBX8XX_IRQ_IRQ_H
22#define LIBBSP_POWERPC_MBX8XX_IRQ_IRQ_H
23
24#include <rtems/irq.h>
25
26#ifndef ASM
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32extern volatile unsigned int ppc_cached_irq_mask;
33
34/*
35 * Symblolic IRQ names and related definitions.
36 */
37
38  /*
39   * SIU IRQ handler related definitions
40   */
41#define BSP_SIU_IRQ_NUMBER              16 /* 16 reserved but in the future... */
42#define BSP_SIU_IRQ_LOWEST_OFFSET       0
43#define  BSP_SIU_IRQ_MAX_OFFSET         (BSP_SIU_IRQ_LOWEST_OFFSET + BSP_SIU_IRQ_NUMBER - 1)
44  /*
45   * CPM IRQ handlers related definitions
46   * CAUTION : BSP_CPM_IRQ_LOWEST_OFFSET should be equal to OPENPIC_VEC_SOURCE
47   */
48#define BSP_CPM_IRQ_NUMBER              32
49#define BSP_CPM_IRQ_LOWEST_OFFSET       (BSP_SIU_IRQ_NUMBER + BSP_SIU_IRQ_LOWEST_OFFSET)
50#define BSP_CPM_IRQ_MAX_OFFSET          (BSP_CPM_IRQ_LOWEST_OFFSET + BSP_CPM_IRQ_NUMBER - 1)
51  /*
52   * PowerPc exceptions handled as interrupt where a rtems managed interrupt
53   * handler might be connected
54   */
55#define BSP_PROCESSOR_IRQ_NUMBER        1
56#define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_CPM_IRQ_MAX_OFFSET + 1)
57#define BSP_PROCESSOR_IRQ_MAX_OFFSET    (BSP_PROCESSOR_IRQ_LOWEST_OFFSET + BSP_PROCESSOR_IRQ_NUMBER - 1)
58  /*
59   * Summary
60   */
61#define BSP_IRQ_NUMBER          (BSP_PROCESSOR_IRQ_MAX_OFFSET + 1)
62#define BSP_LOWEST_OFFSET       (BSP_SIU_IRQ_LOWEST_OFFSET)
63#define BSP_MAX_OFFSET          (BSP_PROCESSOR_IRQ_MAX_OFFSET)
64    /*
65     * Some SIU IRQ symbolic name definition. Please note that
66     * INT IRQ are defined but a single one will be used to
67     * redirect all CPM interrupt.
68     */
69#define BSP_SIU_EXT_IRQ_0       0
70#define BSP_SIU_INT_IRQ_0       1
71
72#define BSP_SIU_EXT_IRQ_1       2
73#define BSP_SIU_INT_IRQ_1       3
74
75#define BSP_SIU_EXT_IRQ_2       4
76#define BSP_SIU_INT_IRQ_2       5
77
78#define BSP_SIU_EXT_IRQ_3       6
79#define BSP_SIU_INT_IRQ_3       7
80
81#define BSP_SIU_EXT_IRQ_4       8
82#define BSP_SIU_INT_IRQ_4       9
83
84#define BSP_SIU_EXT_IRQ_5       10
85#define BSP_SIU_INT_IRQ_5       11
86
87#define BSP_SIU_EXT_IRQ_6       12
88#define BSP_SIU_INT_IRQ_6       13
89
90#define BSP_SIU_EXT_IRQ_7       14
91#define BSP_SIU_INT_IRQ_7       15
92  /*
93   * Symbolic name for CPM interrupt on SIU Internal level 2
94   */
95#define BSP_CPM_INTERRUPT       BSP_SIU_INT_IRQ_2
96#define BSP_PERIODIC_TIMER      BSP_SIU_INT_IRQ_6
97#define BSP_FAST_ETHERNET_CTRL  BSP_SIU_INT_IRQ_3
98  /*
99     * Some CPM IRQ symbolic name definition
100     */
101#define BSP_CPM_IRQ_ERROR               BSP_CPM_IRQ_LOWEST_OFFSET
102#define BSP_CPM_IRQ_PARALLEL_IO_PC4     (BSP_CPM_IRQ_LOWEST_OFFSET + 1)
103#define BSP_CPM_IRQ_PARALLEL_IO_PC5     (BSP_CPM_IRQ_LOWEST_OFFSET + 2)
104#define BSP_CPM_IRQ_SMC2_OR_PIP         (BSP_CPM_IRQ_LOWEST_OFFSET + 3)
105#define BSP_CPM_IRQ_SMC1                (BSP_CPM_IRQ_LOWEST_OFFSET + 4)
106#define BSP_CPM_IRQ_SPI                 (BSP_CPM_IRQ_LOWEST_OFFSET + 5)
107#define BSP_CPM_IRQ_PARALLEL_IO_PC6     (BSP_CPM_IRQ_LOWEST_OFFSET + 6)
108#define BSP_CPM_IRQ_TIMER_4             (BSP_CPM_IRQ_LOWEST_OFFSET + 7)
109
110#define BSP_CPM_IRQ_PARALLEL_IO_PC7     (BSP_CPM_IRQ_LOWEST_OFFSET + 9)
111#define BSP_CPM_IRQ_PARALLEL_IO_PC8     (BSP_CPM_IRQ_LOWEST_OFFSET + 10)
112#define BSP_CPM_IRQ_PARALLEL_IO_PC9     (BSP_CPM_IRQ_LOWEST_OFFSET + 11)
113#define BSP_CPM_IRQ_TIMER_3             (BSP_CPM_IRQ_LOWEST_OFFSET + 12)
114
115#define BSP_CPM_IRQ_PARALLEL_IO_PC10    (BSP_CPM_IRQ_LOWEST_OFFSET + 14)
116#define BSP_CPM_IRQ_PARALLEL_IO_PC11    (BSP_CPM_IRQ_LOWEST_OFFSET + 15)
117#define BSP_CPM_I2C                     (BSP_CPM_IRQ_LOWEST_OFFSET + 16)
118#define BSP_CPM_RISC_TIMER_TABLE        (BSP_CPM_IRQ_LOWEST_OFFSET + 17)
119#define BSP_CPM_IRQ_TIMER_2             (BSP_CPM_IRQ_LOWEST_OFFSET + 18)
120
121#define BSP_CPM_IDMA2                   (BSP_CPM_IRQ_LOWEST_OFFSET + 20)
122#define BSP_CPM_IDMA1                   (BSP_CPM_IRQ_LOWEST_OFFSET + 21)
123#define BSP_CPM_SDMA_CHANNEL_BUS_ERR    (BSP_CPM_IRQ_LOWEST_OFFSET + 22)
124#define BSP_CPM_IRQ_PARALLEL_IO_PC12    (BSP_CPM_IRQ_LOWEST_OFFSET + 23)
125#define BSP_CPM_IRQ_PARALLEL_IO_PC13    (BSP_CPM_IRQ_LOWEST_OFFSET + 24)
126#define BSP_CPM_IRQ_TIMER_1             (BSP_CPM_IRQ_LOWEST_OFFSET + 25)
127#define BSP_CPM_IRQ_PARALLEL_IO_PC14    (BSP_CPM_IRQ_LOWEST_OFFSET + 26)
128#define BSP_CPM_IRQ_SCC4                (BSP_CPM_IRQ_LOWEST_OFFSET + 27)
129#define BSP_CPM_IRQ_SCC3                (BSP_CPM_IRQ_LOWEST_OFFSET + 28)
130#define BSP_CPM_IRQ_SCC2                (BSP_CPM_IRQ_LOWEST_OFFSET + 29)
131#define BSP_CPM_IRQ_SCC1                (BSP_CPM_IRQ_LOWEST_OFFSET + 30)
132#define BSP_CPM_IRQ_PARALLEL_IO_PC15    (BSP_CPM_IRQ_LOWEST_OFFSET + 31)
133    /*
134     * Some Processor exception handled as rtems IRQ symbolic name definition
135     */
136#define BSP_DECREMENTER                 BSP_PROCESSOR_IRQ_LOWEST_OFFSET
137
138
139#define CPM_INTERRUPT
140
141/*-------------------------------------------------------------------------+
142| Function Prototypes.
143+--------------------------------------------------------------------------*/
144/*
145 * ------------------------ PPC SIU Mngt Routines -------
146 */
147
148/*
149 * function to disable a particular irq at 8259 level. After calling
150 * this function, even if the device asserts the interrupt line it will
151 * not be propagated further to the processor
152 */
153int BSP_irq_disable_at_siu        (const rtems_irq_number irqLine);
154/*
155 * function to enable a particular irq at 8259 level. After calling
156 * this function, if the device asserts the interrupt line it will
157 * be propagated further to the processor
158 */
159int BSP_irq_enable_at_siu               (const rtems_irq_number irqLine);
160/*
161 * function to acknoledge a particular irq at 8259 level. After calling
162 * this function, if a device asserts an enabled interrupt line it will
163 * be propagated further to the processor. Mainly usefull for people
164 * writting raw handlers as this is automagically done for rtems managed
165 * handlers.
166 */
167int BSP_irq_ack_at_siu                  (const rtems_irq_number irqLine);
168/*
169 * function to check if a particular irq is enabled at 8259 level. After calling
170 */
171int BSP_irq_enabled_at_siu      (const rtems_irq_number irqLine);
172
173extern void BSP_rtems_irq_mng_init(unsigned cpuId);
174
175#ifdef __cplusplus
176}
177#endif
178
179#endif
180
181#endif
Note: See TracBrowser for help on using the repository browser.