[574fb67] | 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 |
---|
| 28 | extern "C" { |
---|
| 29 | #endif /* __cplusplus */ |
---|
| 30 | |
---|
| 31 | /* |
---|
| 32 | * Interrupt numbers |
---|
| 33 | */ |
---|
| 34 | |
---|
| 35 | /* Basics */ |
---|
| 36 | #define MPC55XX_IRQ_MIN 0 |
---|
| 37 | #define MPC55XX_IRQ_MAX 328 |
---|
| 38 | #define MPC55XX_IRQ_BASE MPC55XX_IRQ_MIN |
---|
| 39 | #define MPC55XX_IRQ_NUMBER (MPC55XX_IRQ_MAX + 1) |
---|
| 40 | |
---|
| 41 | /* Software interrupts */ |
---|
| 42 | #define MPC55XX_IRQ_SOFTWARE_MIN 0 |
---|
| 43 | #define MPC55XX_IRQ_SOFTWARE_MAX 7 |
---|
| 44 | #define MPC55XX_IRQ_SOFTWARE_NUMBER (MPC55XX_IRQ_SOFTWARE_MAX + 1) |
---|
| 45 | |
---|
| 46 | /* eDMA interrupts */ |
---|
| 47 | #define MPC55XX_IRQ_EDMA_ERROR_LOW 10 |
---|
| 48 | #define MPC55XX_IRQ_EDMA_ERROR_HIGH 210 |
---|
| 49 | #define MPC55XX_IRQ_EDMA_REQUEST_LOW_MIN 11 |
---|
| 50 | #define MPC55XX_IRQ_EDMA_REQUEST_LOW_MAX 42 |
---|
| 51 | #define MPC55XX_IRQ_EDMA_REQUEST_HIGH_MIN 211 |
---|
| 52 | #define MPC55XX_IRQ_EDMA_REQUEST_HIGH_MAX 242 |
---|
| 53 | #define MPC55XX_IRQ_EDMA_GET_CHANNEL( i) (((i) > MPC55XX_IRQ_EDMA_REQUEST_LOW_MAX) ? ((i) - MPC55XX_IRQ_EDMA_REQUEST_HIGH_MIN + 32) : ((i) - MPC55XX_IRQ_EDMA_REQUEST_LOW_MIN)) |
---|
| 54 | #define MPC55XX_IRQ_EDMA_GET_REQUEST( c) (((c) > 31) ? ((c) + MPC55XX_IRQ_EDMA_REQUEST_HIGH_MIN - 32) : ((c) + MPC55XX_IRQ_EDMA_REQUEST_LOW_MIN)) |
---|
| 55 | |
---|
| 56 | /* Checks */ |
---|
| 57 | #define MPC55XX_IRQ_IS_VALID(i) ((i) >= MPC55XX_IRQ_MIN && (i) <= MPC55XX_IRQ_MAX) |
---|
| 58 | #define MPC55XX_IRQ_IS_SOFTWARE(i) ((i) >= MPC55XX_IRQ_SOFTWARE_MIN && (i) <= MPC55XX_IRQ_SOFTWARE_MAX) |
---|
| 59 | |
---|
| 60 | /* |
---|
| 61 | * Interrupt controller |
---|
| 62 | */ |
---|
| 63 | |
---|
| 64 | #define MPC55XX_INTC_INVALID_PRIORITY -1 |
---|
| 65 | #define MPC55XX_INTC_DISABLED_PRIORITY 0 |
---|
| 66 | #define MPC55XX_INTC_MIN_PRIORITY 1 |
---|
| 67 | #define MPC55XX_INTC_MAX_PRIORITY 15 |
---|
| 68 | #define MPC55XX_INTC_DEFAULT_PRIORITY MPC55XX_INTC_MIN_PRIORITY |
---|
| 69 | #define MPC55XX_INTC_IS_VALID_PRIORITY(p) ((p) >= MPC55XX_INTC_DISABLED_PRIORITY && (p) <= MPC55XX_INTC_MAX_PRIORITY) |
---|
| 70 | |
---|
| 71 | rtems_status_code mpc55xx_interrupt_handler_install( |
---|
| 72 | rtems_vector_number vector, |
---|
| 73 | int priority, |
---|
| 74 | const char *info, |
---|
| 75 | rtems_option options, |
---|
| 76 | rtems_interrupt_handler handler, |
---|
| 77 | void *arg |
---|
| 78 | ); |
---|
| 79 | |
---|
| 80 | rtems_status_code mpc55xx_intc_get_priority( int i, int *p); |
---|
| 81 | |
---|
| 82 | rtems_status_code mpc55xx_intc_set_priority( int i, int p); |
---|
| 83 | |
---|
| 84 | rtems_status_code mpc55xx_intc_raise_software_irq( int i); |
---|
| 85 | |
---|
| 86 | rtems_status_code mpc55xx_intc_clear_software_irq( int i); |
---|
| 87 | |
---|
| 88 | #ifdef __cplusplus |
---|
| 89 | }; |
---|
| 90 | #endif /* __cplusplus */ |
---|
| 91 | |
---|
| 92 | #endif /* LIBBSP_POWERPC_IRQ_H */ |
---|