source: rtems/c/src/lib/libcpu/powerpc/mpc55xx/include/irq.h @ d374492

4.104.11
Last change on this file since d374492 was d374492, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Jul 21, 2009 at 8:38:04 AM

Update for MPC55XX changes

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup mpc55xx
5 *
6 * @brief IRQ
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21#ifndef LIBBSP_POWERPC_IRQ_H
22#define LIBBSP_POWERPC_IRQ_H
23
24#include <rtems/irq-extension.h>
25#include <rtems/irq.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif /* __cplusplus */
30
31/*
32 * Interrupt numbers
33 */
34
35/* Basics */
36#define MPC55XX_IRQ_MIN 0U
37#define MPC55XX_IRQ_MAX 328U
38#define MPC55XX_IRQ_BASE MPC55XX_IRQ_MIN
39#define MPC55XX_IRQ_NUMBER (MPC55XX_IRQ_MAX + 1U)
40
41/* Software interrupts */
42#define MPC55XX_IRQ_SOFTWARE_MIN 0U
43#define MPC55XX_IRQ_SOFTWARE_MAX 7U
44#define MPC55XX_IRQ_SOFTWARE_GET_INDEX( v) (v)
45#define MPC55XX_IRQ_SOFTWARE_GET_REQUEST( i) (i)
46#define MPC55XX_IRQ_SOFTWARE_NUMBER (MPC55XX_IRQ_SOFTWARE_MAX + 1U)
47
48/* eDMA interrupts */
49#define MPC55XX_IRQ_EDMA_ERROR_LOW 10U
50#define MPC55XX_IRQ_EDMA_ERROR_HIGH 210U
51#define MPC55XX_IRQ_EDMA_REQUEST_LOW_MIN 11U
52#define MPC55XX_IRQ_EDMA_REQUEST_LOW_MAX 42U
53#define MPC55XX_IRQ_EDMA_REQUEST_HIGH_MIN 211U
54#define MPC55XX_IRQ_EDMA_REQUEST_HIGH_MAX 242U
55#define MPC55XX_IRQ_EDMA_GET_CHANNEL( v) (((v) > MPC55XX_IRQ_EDMA_REQUEST_LOW_MAX) ? ((v) + 32U - MPC55XX_IRQ_EDMA_REQUEST_HIGH_MIN) : ((v) - MPC55XX_IRQ_EDMA_REQUEST_LOW_MIN))
56#define MPC55XX_IRQ_EDMA_GET_REQUEST( c) (((c) >= 32U) ? ((c) - 32U + MPC55XX_IRQ_EDMA_REQUEST_HIGH_MIN) : ((c) + MPC55XX_IRQ_EDMA_REQUEST_LOW_MIN))
57
58/* SIU external interrupts */
59#define MPC55XX_IRQ_SIU_EXTERNAL_0 46U
60#define MPC55XX_IRQ_SIU_EXTERNAL_1 47U
61#define MPC55XX_IRQ_SIU_EXTERNAL_2 48U
62#define MPC55XX_IRQ_SIU_EXTERNAL_3 49U
63#define MPC55XX_IRQ_SIU_EXTERNAL_4_15 50U
64
65/* eMIOS interrupts */
66#define MPC55XX_IRQ_EMIOS_REQUEST_LOW_MIN 51U
67#define MPC55XX_IRQ_EMIOS_REQUEST_LOW_MAX 66U
68#define MPC55XX_IRQ_EMIOS_REQUEST_HIGH_MIN 202U
69#define MPC55XX_IRQ_EMIOS_REQUEST_HIGH_MAX 209U
70#define MPC55XX_IRQ_EMIOS_GET_CHANNEL( v) (((v) > MPC55XX_IRQ_EMIOS_REQUEST_LOW_MAX) ? ((v) + 16U - MPC55XX_IRQ_EMIOS_REQUEST_HIGH_MIN) : ((v) - MPC55XX_IRQ_EMIOS_REQUEST_LOW_MIN))
71#define MPC55XX_IRQ_EMIOS_GET_REQUEST( c) (((c) >= 16U) ? ((c) - 16U + MPC55XX_IRQ_EMIOS_REQUEST_HIGH_MIN) : ((c) + MPC55XX_IRQ_EMIOS_REQUEST_LOW_MIN))
72
73/* Checks */
74#define MPC55XX_IRQ_IS_VALID(v) ((v) >= MPC55XX_IRQ_MIN && (v) <= MPC55XX_IRQ_MAX)
75#define MPC55XX_IRQ_IS_SOFTWARE(v) ((v) >= MPC55XX_IRQ_SOFTWARE_MIN && (v) <= MPC55XX_IRQ_SOFTWARE_MAX)
76
77/*
78 * Interrupt controller
79 */
80
81#define MPC55XX_INTC_MIN_PRIORITY 1U
82#define MPC55XX_INTC_MAX_PRIORITY 15U
83#define MPC55XX_INTC_DISABLED_PRIORITY 0U
84#define MPC55XX_INTC_INVALID_PRIORITY (MPC55XX_INTC_MAX_PRIORITY + 1)
85#define MPC55XX_INTC_DEFAULT_PRIORITY (MPC55XX_INTC_MIN_PRIORITY + 1)
86#define MPC55XX_INTC_IS_VALID_PRIORITY(p) ((p) >= MPC55XX_INTC_DISABLED_PRIORITY && (p) <= MPC55XX_INTC_MAX_PRIORITY)
87
88rtems_status_code mpc55xx_interrupt_handler_install(
89        rtems_vector_number vector,
90        const char *info,
91        rtems_option options,
92        unsigned priority,
93        rtems_interrupt_handler handler,
94        void *arg
95);
96
97rtems_status_code mpc55xx_intc_get_priority( rtems_vector_number vector, unsigned *priority);
98
99rtems_status_code mpc55xx_intc_set_priority( rtems_vector_number vector, unsigned priority);
100
101rtems_status_code mpc55xx_intc_raise_software_irq( rtems_vector_number vector);
102
103rtems_status_code mpc55xx_intc_clear_software_irq( rtems_vector_number vector);
104
105#ifdef __cplusplus
106};
107#endif /* __cplusplus */
108
109#endif /* LIBBSP_POWERPC_IRQ_H */
Note: See TracBrowser for help on using the repository browser.