Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:57

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0007  *
0008  * @brief Interrupt API.
0009  */
0010 
0011 /*
0012  * Copyright (C) 2010, 2015 embedded brains GmbH & Co. KG
0013  *
0014  * Redistribution and use in source and binary forms, with or without
0015  * modification, are permitted provided that the following conditions
0016  * are met:
0017  * 1. Redistributions of source code must retain the above copyright
0018  *    notice, this list of conditions and the following disclaimer.
0019  * 2. Redistributions in binary form must reproduce the above copyright
0020  *    notice, this list of conditions and the following disclaimer in the
0021  *    documentation and/or other materials provided with the distribution.
0022  *
0023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0026  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0027  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0028  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0029  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0030  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0031  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0033  * POSSIBILITY OF SUCH DAMAGE.
0034  */
0035 
0036 #ifndef LIBBSP_POWERPC_QORIQ_IRQ_H
0037 #define LIBBSP_POWERPC_QORIQ_IRQ_H
0038 
0039 #include <bsp.h>
0040 
0041 #ifdef __cplusplus
0042 extern "C" {
0043 #endif /* __cplusplus */
0044 
0045 #ifdef QORIQ_IS_HYPERVISOR_GUEST
0046 
0047 #define BSP_INTERRUPT_VECTOR_COUNT 1024
0048 
0049 #else /* !QORIQ_IS_HYPERVISOR_GUEST */
0050 
0051 #define QORIQ_IRQ_ERROR 0
0052 
0053 #if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
0054 
0055 #define QORIQ_IRQ_PCI_EXPRESS_1 4
0056 #define QORIQ_IRQ_PCI_EXPRESS_2 5
0057 #define QORIQ_IRQ_PCI_EXPRESS_3 6
0058 #define QORIQ_IRQ_PCI_EXPRESS_4 7
0059 #define QORIQ_IRQ_PAMU 8
0060 #define QORIQ_IRQ_IFC 9
0061 #define QORIQ_IRQ_DMA_CHANNEL_1_1 12
0062 #define QORIQ_IRQ_DMA_CHANNEL_1_2 13
0063 #define QORIQ_IRQ_DMA_CHANNEL_1_3 14
0064 #define QORIQ_IRQ_DMA_CHANNEL_1_4 15
0065 #define QORIQ_IRQ_DMA_CHANNEL_2_1 16
0066 #define QORIQ_IRQ_DMA_CHANNEL_2_2 17
0067 #define QORIQ_IRQ_DMA_CHANNEL_2_3 18
0068 #define QORIQ_IRQ_DMA_CHANNEL_2_4 19
0069 #define QORIQ_IRQ_DUART_1 20
0070 #define QORIQ_IRQ_DUART_2 21
0071 #define QORIQ_IRQ_DUARL_I2C_1 22
0072 #define QORIQ_IRQ_DUARL_I2C_2 23
0073 #define QORIQ_IRQ_PCI_EXPRESS_1_INTA 24
0074 #define QORIQ_IRQ_PCI_EXPRESS_2_INTA 25
0075 #define QORIQ_IRQ_PCI_EXPRESS_3_INTA 26
0076 #define QORIQ_IRQ_PCI_EXPRESS_4_INTA 27
0077 #define QORIQ_IRQ_USB_1 28
0078 #define QORIQ_IRQ_USB_2 29
0079 #define QORIQ_IRQ_ESDHC 32
0080 #define QORIQ_IRQ_PERF_MON 36
0081 #define QORIQ_IRQ_ESPI 37
0082 #define QORIQ_IRQ_GPIO_2 38
0083 #define QORIQ_IRQ_GPIO_1 39
0084 #define QORIQ_IRQ_SATA_1 52
0085 #define QORIQ_IRQ_SATA_2 53
0086 #define QORIQ_IRQ_DMA_CHANNEL_1_5 60
0087 #define QORIQ_IRQ_DMA_CHANNEL_1_6 61
0088 #define QORIQ_IRQ_DMA_CHANNEL_1_7 62
0089 #define QORIQ_IRQ_DMA_CHANNEL_1_8 63
0090 #define QORIQ_IRQ_DMA_CHANNEL_2_5 64
0091 #define QORIQ_IRQ_DMA_CHANNEL_2_6 65
0092 #define QORIQ_IRQ_DMA_CHANNEL_2_7 66
0093 #define QORIQ_IRQ_DMA_CHANNEL_2_8 67
0094 #define QORIQ_IRQ_EVENT_PROC_UNIT_1 68
0095 #define QORIQ_IRQ_EVENT_PROC_UNIT_2 69
0096 #define QORIQ_IRQ_GPIO_3 70
0097 #define QORIQ_IRQ_GPIO_4 71
0098 #define QORIQ_IRQ_SEC_5_2_JOB_QUEUE_1 72
0099 #define QORIQ_IRQ_SEC_5_2_JOB_QUEUE_2 73
0100 #define QORIQ_IRQ_SEC_5_2_JOB_QUEUE_3 74
0101 #define QORIQ_IRQ_SEC_5_2_JOB_QUEUE_4 75
0102 #define QORIQ_IRQ_SEC_5_2_GLOBAL_ERROR 76
0103 #define QORIQ_IRQ_SEC_MON 77
0104 #define QORIQ_IRQ_EVENT_PROC_UNIT_3 78
0105 #define QORIQ_IRQ_EVENT_PROC_UNIT_4 79
0106 #define QORIQ_IRQ_FRAME_MGR 80
0107 #define QORIQ_IRQ_MDIO_1 84
0108 #define QORIQ_IRQ_MDIO_2 85
0109 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_0 88
0110 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_0 89
0111 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_1 90
0112 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_1 91
0113 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_2 92
0114 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_2 93
0115 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_3 94
0116 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_3 95
0117 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_4 96
0118 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_4 97
0119 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_5 98
0120 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_5 99
0121 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_6 100
0122 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_6 101
0123 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_7 102
0124 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_7 103
0125 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_8 104
0126 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_8 105
0127 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_9 106
0128 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_9 107
0129 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_10 109
0130 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_10 109
0131 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_11 110
0132 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_11 111
0133 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_12 112
0134 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_12 113
0135 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_13 114
0136 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_13 115
0137 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_14 116
0138 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_14 117
0139 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_15 118
0140 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_15 119
0141 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_16 120
0142 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_16 121
0143 #define QORIQ_IRQ_QUEUE_MGR_PORTAL_17 122
0144 #define QORIQ_IRQ_BUFFER_MGR_PORTAL_17 123
0145 #define QORIQ_IRQ_DMA_CHANNEL_3_1 240
0146 #define QORIQ_IRQ_DMA_CHANNEL_3_2 241
0147 #define QORIQ_IRQ_DMA_CHANNEL_3_3 242
0148 #define QORIQ_IRQ_DMA_CHANNEL_3_4 243
0149 #define QORIQ_IRQ_DMA_CHANNEL_3_5 244
0150 #define QORIQ_IRQ_DMA_CHANNEL_3_6 245
0151 #define QORIQ_IRQ_DMA_CHANNEL_3_7 246
0152 #define QORIQ_IRQ_DMA_CHANNEL_3_8 247
0153 
0154 #define QORIQ_IRQ_EXT_BASE 256
0155 
0156 #else /* QORIQ_CHIP_VARIANT */
0157 
0158 /**
0159  * @defgroup QoriqInterruptP1020 QorIQ - P1020 Internal Interrupt Sources
0160  *
0161  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0162  *
0163  * @brief P1020 internal interrupt sources.
0164  *
0165  * @{
0166  */
0167 
0168 #define QORIQ_IRQ_ETSEC_TX_1_GROUP_1 1
0169 #define QORIQ_IRQ_ETSEC_RX_1_GROUP_1 2
0170 #define QORIQ_IRQ_ETSEC_ER_1_GROUP_1 8
0171 #define QORIQ_IRQ_ETSEC_TX_3_GROUP_1 9
0172 #define QORIQ_IRQ_ETSEC_RX_3_GROUP_1 10
0173 #define QORIQ_IRQ_ETSEC_ER_3_GROUP_1 11
0174 #define QORIQ_IRQ_ETSEC_TX_2_GROUP_1 35
0175 #define QORIQ_IRQ_ETSEC_RX_2_GROUP_1 36
0176 #define QORIQ_IRQ_TDM 46
0177 #define QORIQ_IRQ_TDM_ERROR 47
0178 #define QORIQ_IRQ_ETSEC_ER_2_GROUP_1 51
0179 
0180 /** @} */
0181 
0182 /**
0183  * @defgroup QoriqInterruptP2020 QorIQ - P2020 Internal Interrupt Sources
0184  *
0185  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0186  *
0187  * @brief P2020 internal interrupt sources.
0188  *
0189  * @{
0190  */
0191 
0192 #define QORIQ_IRQ_L2_CACHE 0
0193 #define QORIQ_IRQ_ECM 1
0194 #define QORIQ_IRQ_DDR_CONTROLLER 2
0195 #define QORIQ_IRQ_PCI_EXPRESS_3 8
0196 #define QORIQ_IRQ_PCI_EXPRESS_2 9
0197 #define QORIQ_IRQ_PCI_EXPRESS_1 10
0198 #define QORIQ_IRQ_SRIO_ERR_WRT_1_2 32
0199 #define QORIQ_IRQ_SRIO_OUT_DOORBELL_1 33
0200 #define QORIQ_IRQ_SRIO_IN_DOORBELL_1 34
0201 #define QORIQ_IRQ_SRIO_OUT_MSG_1 37
0202 #define QORIQ_IRQ_SRIO_IN_MSG_1 38
0203 #define QORIQ_IRQ_SRIO_OUT_MSG_2 39
0204 #define QORIQ_IRQ_SRIO_IN_MSG_2 40
0205 
0206 /** @} */
0207 
0208 /**
0209  * @defgroup QoriqInterruptAll QorIQ - Internal Interrupt Sources
0210  *
0211  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0212  *
0213  * @brief Internal interrupt sources.
0214  *
0215  * @{
0216  */
0217 
0218 #define QORIQ_IRQ_ELBC 3
0219 #define QORIQ_IRQ_DMA_CHANNEL_1_1 4
0220 #define QORIQ_IRQ_DMA_CHANNEL_2_1 5
0221 #define QORIQ_IRQ_DMA_CHANNEL_3_1 6
0222 #define QORIQ_IRQ_DMA_CHANNEL_4_1 7
0223 #define QORIQ_IRQ_USB_1 12
0224 #define QORIQ_IRQ_ETSEC_TX_1 13
0225 #define QORIQ_IRQ_ETSEC_RX_1 14
0226 #define QORIQ_IRQ_ETSEC_TX_3 15
0227 #define QORIQ_IRQ_ETSEC_RX_3 16
0228 #define QORIQ_IRQ_ETSEC_ER_3 17
0229 #define QORIQ_IRQ_ETSEC_ER_1 18
0230 #define QORIQ_IRQ_ETSEC_TX_2 19
0231 #define QORIQ_IRQ_ETSEC_RX_2 20
0232 #define QORIQ_IRQ_ETSEC_ER_2 24
0233 #define QORIQ_IRQ_DUART_1 26
0234 #define QORIQ_IRQ_I2C 27
0235 #define QORIQ_IRQ_PERFORMANCE_MONITOR 28
0236 #define QORIQ_IRQ_SECURITY_1 29
0237 #define QORIQ_IRQ_USB_2 30
0238 #define QORIQ_IRQ_GPIO 31
0239 #define QORIQ_IRQ_SECURITY_2 42
0240 #define QORIQ_IRQ_ESPI 43
0241 #define QORIQ_IRQ_ETSEC_IEEE_1588_1 52
0242 #define QORIQ_IRQ_ETSEC_IEEE_1588_2 53
0243 #define QORIQ_IRQ_ETSEC_IEEE_1588_3 54
0244 #define QORIQ_IRQ_ESDHC 56
0245 #define QORIQ_IRQ_DMA_CHANNEL_1_2 60
0246 #define QORIQ_IRQ_DMA_CHANNEL_2_2 61
0247 #define QORIQ_IRQ_DMA_CHANNEL_3_2 62
0248 #define QORIQ_IRQ_DMA_CHANNEL_4_2 63
0249 
0250 /** @} */
0251 
0252 #define QORIQ_IRQ_EXT_BASE 64
0253 
0254 #endif /* QORIQ_CHIP_VARIANT */
0255 
0256 /**
0257  * @defgroup QoriqInterruptExternal QorIQ - External Interrupt Sources
0258  *
0259  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0260  *
0261  * @brief External interrupt sources.
0262  *
0263  * @{
0264  */
0265 
0266 #define QORIQ_IRQ_EXT_0 (QORIQ_IRQ_EXT_BASE + 0)
0267 #define QORIQ_IRQ_EXT_1 (QORIQ_IRQ_EXT_BASE + 1)
0268 #define QORIQ_IRQ_EXT_2 (QORIQ_IRQ_EXT_BASE + 2)
0269 #define QORIQ_IRQ_EXT_3 (QORIQ_IRQ_EXT_BASE + 3)
0270 #define QORIQ_IRQ_EXT_4 (QORIQ_IRQ_EXT_BASE + 4)
0271 #define QORIQ_IRQ_EXT_5 (QORIQ_IRQ_EXT_BASE + 5)
0272 #define QORIQ_IRQ_EXT_6 (QORIQ_IRQ_EXT_BASE + 6)
0273 #define QORIQ_IRQ_EXT_7 (QORIQ_IRQ_EXT_BASE + 7)
0274 #define QORIQ_IRQ_EXT_8 (QORIQ_IRQ_EXT_BASE + 8)
0275 #define QORIQ_IRQ_EXT_9 (QORIQ_IRQ_EXT_BASE + 9)
0276 #define QORIQ_IRQ_EXT_10 (QORIQ_IRQ_EXT_BASE + 10)
0277 #define QORIQ_IRQ_EXT_11 (QORIQ_IRQ_EXT_BASE + 11)
0278 
0279 #define QORIQ_IRQ_IS_EXT(vector) \
0280   ((vector) >= QORIQ_IRQ_EXT_0 && (vector) <= QORIQ_IRQ_EXT_11)
0281 /** @} */
0282 
0283 /**
0284  * @defgroup QoriqInterruptIPI QorIQ - Interprocessor Interrupts
0285  *
0286  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0287  *
0288  * @brief Interprocessor interrupts.
0289  *
0290  * @{
0291  */
0292 
0293 #define QORIQ_IRQ_IPI_BASE (QORIQ_IRQ_EXT_11 + 1)
0294 #define QORIQ_IRQ_IPI_0 (QORIQ_IRQ_IPI_BASE + 0)
0295 #define QORIQ_IRQ_IPI_1 (QORIQ_IRQ_IPI_BASE + 1)
0296 #define QORIQ_IRQ_IPI_2 (QORIQ_IRQ_IPI_BASE + 2)
0297 #define QORIQ_IRQ_IPI_3 (QORIQ_IRQ_IPI_BASE + 3)
0298 
0299 /** @} */
0300 
0301 /**
0302  * @defgroup QoriqInterruptIPI QorIQ - Message Interrupts
0303  *
0304  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0305  *
0306  * @brief Message interrupts.
0307  *
0308  * @{
0309  */
0310 
0311 #define QORIQ_IRQ_MI_BASE (QORIQ_IRQ_IPI_3 + 1)
0312 #define QORIQ_IRQ_MI_0 (QORIQ_IRQ_MI_BASE + 0)
0313 #define QORIQ_IRQ_MI_1 (QORIQ_IRQ_MI_BASE + 1)
0314 #define QORIQ_IRQ_MI_2 (QORIQ_IRQ_MI_BASE + 2)
0315 #define QORIQ_IRQ_MI_3 (QORIQ_IRQ_MI_BASE + 3)
0316 #define QORIQ_IRQ_MI_4 (QORIQ_IRQ_MI_BASE + 4)
0317 #define QORIQ_IRQ_MI_5 (QORIQ_IRQ_MI_BASE + 5)
0318 #define QORIQ_IRQ_MI_6 (QORIQ_IRQ_MI_BASE + 6)
0319 #define QORIQ_IRQ_MI_7 (QORIQ_IRQ_MI_BASE + 7)
0320 
0321 /** @} */
0322 
0323 /**
0324  * @defgroup QoriqInterruptIPI QorIQ - Shared Message Signaled Interrupts
0325  *
0326  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0327  *
0328  * @brief Shared message signaled interrupts.
0329  *
0330  * @{
0331  */
0332 
0333 #define QORIQ_IRQ_MSI_BASE (QORIQ_IRQ_MI_7 + 1)
0334 #define QORIQ_IRQ_MSI_0 (QORIQ_IRQ_MSI_BASE + 0)
0335 #define QORIQ_IRQ_MSI_1 (QORIQ_IRQ_MSI_BASE + 1)
0336 #define QORIQ_IRQ_MSI_2 (QORIQ_IRQ_MSI_BASE + 2)
0337 #define QORIQ_IRQ_MSI_3 (QORIQ_IRQ_MSI_BASE + 3)
0338 #define QORIQ_IRQ_MSI_4 (QORIQ_IRQ_MSI_BASE + 4)
0339 #define QORIQ_IRQ_MSI_5 (QORIQ_IRQ_MSI_BASE + 5)
0340 #define QORIQ_IRQ_MSI_6 (QORIQ_IRQ_MSI_BASE + 6)
0341 #define QORIQ_IRQ_MSI_7 (QORIQ_IRQ_MSI_BASE + 7)
0342 
0343 /** @} */
0344 
0345 /**
0346  * @defgroup QoriqInterruptIPI QorIQ - Global Timer Interrupts
0347  *
0348  * @ingroup RTEMSBSPsPowerPCQorIQInterrupt
0349  *
0350  * @brief Global Timer interrupts.
0351  *
0352  * @{
0353  */
0354 
0355 #define QORIQ_IRQ_GT_BASE (QORIQ_IRQ_MSI_7 + 1)
0356 #define QORIQ_IRQ_GT_A_0 (QORIQ_IRQ_GT_BASE + 0)
0357 #define QORIQ_IRQ_GT_A_1 (QORIQ_IRQ_GT_BASE + 1)
0358 #define QORIQ_IRQ_GT_A_2 (QORIQ_IRQ_GT_BASE + 2)
0359 #define QORIQ_IRQ_GT_A_3 (QORIQ_IRQ_GT_BASE + 3)
0360 #define QORIQ_IRQ_GT_B_0 (QORIQ_IRQ_GT_BASE + 4)
0361 #define QORIQ_IRQ_GT_B_1 (QORIQ_IRQ_GT_BASE + 5)
0362 #define QORIQ_IRQ_GT_B_2 (QORIQ_IRQ_GT_BASE + 6)
0363 #define QORIQ_IRQ_GT_B_3 (QORIQ_IRQ_GT_BASE + 7)
0364 
0365 #define QORIQ_INTERRUPT_SOURCE_COUNT (QORIQ_IRQ_GT_B_3 + 1)
0366 
0367 #define QORIQ_IS_INTERRUPT_SOURCE(vector) \
0368   (((rtems_vector_number) (vector)) < QORIQ_INTERRUPT_SOURCE_COUNT)
0369 
0370 #define QORIQ_IRQ_MSI_MULTIPLEX_BASE QORIQ_INTERRUPT_SOURCE_COUNT
0371 
0372 #define QORIQ_IRQ_MSI_COUNT 256
0373 
0374 #define QORIQ_IRQ_MSI_INDEX(vector) ((vector) - QORIQ_IRQ_MSI_MULTIPLEX_BASE)
0375 
0376 #define QORIQ_IRQ_MSI_VECTOR(index) (QORIQ_IRQ_MSI_MULTIPLEX_BASE + (index))
0377 
0378 #define QORIQ_IRQ_IS_MSI(vector) \
0379   (QORIQ_IRQ_MSI_INDEX(vector) < QORIQ_IRQ_MSI_COUNT)
0380 
0381 #define BSP_INTERRUPT_VECTOR_COUNT QORIQ_IRQ_MSI_VECTOR(QORIQ_IRQ_MSI_COUNT)
0382 
0383 /** @} */
0384 
0385 #endif /* QORIQ_IS_HYPERVISOR_GUEST */
0386 
0387 /**
0388  * @defgroup RTEMSBSPsPowerPCQorIQInterrupt QorIQ - Interrupt Support
0389  *
0390  * @ingroup RTEMSBSPsPowerPCQorIQ
0391  *
0392  * @brief Interrupt support.
0393  *
0394  * @{
0395  */
0396 
0397 /*
0398  * These are RTEMS API priority values, not PIC priority values.  We have:
0399  *   15 - API-priority == PIC-priority
0400  *
0401  * The API-priority value 15 (which is PIC-priority 0) effectively disables the
0402  * interrupt.
0403  */
0404 #define QORIQ_PIC_PRIORITY_LOWEST 14
0405 #define QORIQ_PIC_PRIORITY_HIGHEST 0
0406 #define QORIQ_PIC_PRIORITY_DISABLED 15
0407 #define QORIQ_PIC_PRIORITY_INVALID 16
0408 #define QORIQ_PIC_PRIORITY_DEFAULT 13
0409 #define QORIQ_PIC_PRIORITY_IS_VALID(p) \
0410   (((uint32_t) (p)) <= QORIQ_PIC_PRIORITY_DISABLED)
0411 
0412 rtems_status_code qoriq_pic_msi_allocate(rtems_vector_number *vector);
0413 
0414 rtems_status_code qoriq_pic_msi_free(rtems_vector_number vector);
0415 
0416 rtems_status_code qoriq_pic_msi_map(
0417   rtems_vector_number vector,
0418   uint64_t *addr,
0419   uint32_t *data
0420 );
0421 
0422 typedef enum {
0423   QORIQ_EIRQ_TRIGGER_EDGE_FALLING,
0424   QORIQ_EIRQ_TRIGGER_EDGE_RISING,
0425   QORIQ_EIRQ_TRIGGER_LEVEL_LOW,
0426   QORIQ_EIRQ_TRIGGER_LEVEL_HIGH,
0427 } qoriq_eirq_sense_and_polarity;
0428 
0429 /**
0430  * @brief Change polarity and sense settings of external interrupts.
0431  *
0432  * NOTE: There are only very rare edge cases where you need this function.
0433  *
0434  * @a vector must be the vector number of an external interrupt.
0435  *
0436  * Use @a new_sense_and_polarity to select the new setting. If @a
0437  * old_sense_and_polarity is not NULL, the old value is returned.
0438  *
0439  * @returns RTEMS_SUCCSSSFUL on sucess or other values for invalid settings.
0440  */
0441 rtems_status_code qoriq_pic_set_sense_and_polarity(
0442   rtems_vector_number vector,
0443   qoriq_eirq_sense_and_polarity new_sense_and_polarity,
0444   qoriq_eirq_sense_and_polarity *old_sense_and_polarity
0445 );
0446 
0447 /** @} */
0448 
0449 #ifdef __cplusplus
0450 }
0451 #endif /* __cplusplus */
0452 
0453 #endif /* LIBBSP_POWERPC_QORIQ_IRQ_H */