| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bint_plat.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/50 $ |
|---|
| 12 | * $brcm_Date: 2/28/12 11:41a $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/basemodules/int/bint_plat.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/50 2/28/12 11:41a mward |
|---|
| 21 | * SW7435-7: add BINT_INTC_SIZE 4 for 7435, 3 for others |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/49 1/4/12 12:04p erickson |
|---|
| 24 | * SW7425-2090: remove need to edit BCHP_CHIP list in bint_plat.h |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/48 12/16/11 7:29p bselva |
|---|
| 27 | * SW7360-6: Added appframework support for 7360 platform |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/47 11/1/11 11:04a mward |
|---|
| 30 | * SW7435-7: Add 7435. |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/46 10/3/11 12:00p katrep |
|---|
| 33 | * SW7429-1:7429 bringup |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/45 3/14/11 1:48p jhaberf |
|---|
| 36 | * SW35330-13: replaced 935330 with 935233 support |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/44 12/6/10 1:44p etrudeau |
|---|
| 39 | * SWBLURAY-23579: add 7640 support |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/44 12/6/10 1:09p etrudeau |
|---|
| 42 | * SWBLURAY-23579: add 7640 support |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/43 11/30/10 6:15p katrep |
|---|
| 45 | * SW7231-4:add support for 7231,7346,7346 |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/42 11/4/10 3:36p jhaberf |
|---|
| 48 | * SW35230-1: Added 35125 DTV chip support |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/41 11/2/10 11:13a xhuang |
|---|
| 51 | * SW7552-4: Add 7552 support |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/40 9/13/10 5:23p hongtaoz |
|---|
| 54 | * SW7425-7: adding 7425 support; |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/39 8/18/10 11:29a nickh |
|---|
| 57 | * SW7422-12: Add 7422 support |
|---|
| 58 | * |
|---|
| 59 | * Hydra_Software_Devel/38 8/4/10 7:14p xhuang |
|---|
| 60 | * SW7358-3: Add support for 7358 |
|---|
| 61 | * |
|---|
| 62 | * Hydra_Software_Devel/38 8/4/10 7:12p xhuang |
|---|
| 63 | * SW7358-3: Add support for 7358 |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/37 11/6/09 11:37a gmohile |
|---|
| 66 | * SW7408-1 : Add 7408 support |
|---|
| 67 | * |
|---|
| 68 | * Hydra_Software_Devel/36 9/29/09 2:22p lwhite |
|---|
| 69 | * SW7468-6: Add 7468 support |
|---|
| 70 | * |
|---|
| 71 | * Hydra_Software_Devel/35 9/16/09 1:16p nitinb |
|---|
| 72 | * SW7550-7: Add support for 7550 |
|---|
| 73 | * |
|---|
| 74 | * Hydra_Software_Devel/34 9/10/09 5:14p jhaberf |
|---|
| 75 | * SW35230-1: Creating 35230 DTV chip build environment |
|---|
| 76 | * |
|---|
| 77 | * Hydra_Software_Devel/33 8/27/09 8:07p mward |
|---|
| 78 | * SW7125-4: 7125 needs BINT_NEW_INT_MODEL |
|---|
| 79 | * |
|---|
| 80 | * Hydra_Software_Devel/32 7/24/09 6:11p pntruong |
|---|
| 81 | * PR55861: Further refactored the new int macro. |
|---|
| 82 | * |
|---|
| 83 | * Hydra_Software_Devel/32 7/24/09 6:10p pntruong |
|---|
| 84 | * PR55861: Further refactored the new int macro. |
|---|
| 85 | * |
|---|
| 86 | * Hydra_Software_Devel/32 7/24/09 6:06p pntruong |
|---|
| 87 | * PR55861: Further refactored the new int macro to ease porting of new |
|---|
| 88 | * chips. |
|---|
| 89 | * |
|---|
| 90 | * Hydra_Software_Devel/31 7/24/09 1:07p mward |
|---|
| 91 | * PR55545: Add 7125 to BINT_NEW_INT_MODEL list. |
|---|
| 92 | * |
|---|
| 93 | * Hydra_Software_Devel/30 4/23/09 11:04a jhaberf |
|---|
| 94 | * PR53796: Adding BCM35130 support. |
|---|
| 95 | * |
|---|
| 96 | * Hydra_Software_Devel/29 1/30/09 3:42p jrubio |
|---|
| 97 | * PR51629: add 7336 support |
|---|
| 98 | * |
|---|
| 99 | * Hydra_Software_Devel/28 12/3/08 10:42p pntruong |
|---|
| 100 | * PR49691: Refactored ifdefs for new interrupt model. |
|---|
| 101 | * |
|---|
| 102 | * Hydra_Software_Devel/27 12/3/08 9:16p nickh |
|---|
| 103 | * PR49691: Enable interrupt support for 7420 for new user mode driver |
|---|
| 104 | * |
|---|
| 105 | * Hydra_Software_Devel/26 9/29/08 5:22p pntruong |
|---|
| 106 | * PR47411: Enable interrupt support for 3548/3556 for new user mode |
|---|
| 107 | * driver. |
|---|
| 108 | * |
|---|
| 109 | * Hydra_Software_Devel/25 11/28/07 11:47a katrep |
|---|
| 110 | * PR37430: fixed compiler error. |
|---|
| 111 | * |
|---|
| 112 | * Hydra_Software_Devel/24 11/28/07 10:58a katrep |
|---|
| 113 | * PR37430: Extended interrupt interface to 128 bits for 7405,7325,7335 |
|---|
| 114 | * |
|---|
| 115 | * Hydra_Software_Devel/23 11/21/07 1:47p ronchan |
|---|
| 116 | * PR 32395: added compile option to select interrupt array size for 7325 |
|---|
| 117 | * |
|---|
| 118 | * Hydra_Software_Devel/22 11/21/07 12:26p ronchan |
|---|
| 119 | * PR 32395: increased L1 interrupt array size from 64 to 70 for 7325 |
|---|
| 120 | * |
|---|
| 121 | * Hydra_Software_Devel/21 2/15/07 12:01p erickson |
|---|
| 122 | * PR26657: optimized BINT_Isr. added BINT_IS_STANDARD to allow standard |
|---|
| 123 | * interrupts to be processed inside bint.c. |
|---|
| 124 | * |
|---|
| 125 | * Hydra_Software_Devel/20 5/26/06 3:12p albertl |
|---|
| 126 | * PR21392: Removed remaining code accessing timers directly. |
|---|
| 127 | * |
|---|
| 128 | * Hydra_Software_Devel/19 5/24/06 6:58p albertl |
|---|
| 129 | * PR21392: Changed BINT stats tracking to use timers from TMR module. |
|---|
| 130 | * Removed code accessing timers directly. |
|---|
| 131 | * |
|---|
| 132 | * Hydra_Software_Devel/18 2/15/06 5:30p vsilyaev |
|---|
| 133 | * PR 19693: Added support for acquiring interrupt rate |
|---|
| 134 | * |
|---|
| 135 | * Hydra_Software_Devel/17 4/5/05 7:13p albertl |
|---|
| 136 | * PR10596: Added new statistics tracking functionality. |
|---|
| 137 | * |
|---|
| 138 | * Hydra_Software_Devel/16 12/14/04 4:32p marcusk |
|---|
| 139 | * PR13361: Added more details to L1Shift and L2RegOffset members. |
|---|
| 140 | * |
|---|
| 141 | * Hydra_Software_Devel/15 1/5/04 4:26p marcusk |
|---|
| 142 | * PR9117: Updated to support PI provided L2 interrupt handler (for |
|---|
| 143 | * transport message and overflow interrupts). Updated documentation. |
|---|
| 144 | * |
|---|
| 145 | * Hydra_Software_Devel/14 12/29/03 3:58p marcusk |
|---|
| 146 | * PR9117: Updated with changes required to support interrupt ids rather |
|---|
| 147 | * than strings. |
|---|
| 148 | * |
|---|
| 149 | * Hydra_Software_Devel/13 12/18/03 2:08p marcusk |
|---|
| 150 | * PR8985: Refactored to use single ISR() routine. Removed reserved names. |
|---|
| 151 | * Placed all platform specific defines in bint_plat.h |
|---|
| 152 | * |
|---|
| 153 | * Hydra_Software_Devel/12 9/16/03 10:30a marcusk |
|---|
| 154 | * Updated to comply with DocJet requirements. Fixes for PR8055. |
|---|
| 155 | * |
|---|
| 156 | * Hydra_Software_Devel/11 8/26/03 10:43a marcusk |
|---|
| 157 | * Removed default settings (they are not valid) |
|---|
| 158 | * |
|---|
| 159 | * Hydra_Software_Devel/10 8/22/03 3:00p erickson |
|---|
| 160 | * added BINT_GetDefaultSettings |
|---|
| 161 | * |
|---|
| 162 | * Hydra_Software_Devel/9 6/18/03 3:26p dlwin |
|---|
| 163 | * Added support to allow for more general implementation of Interrupt |
|---|
| 164 | * manager. |
|---|
| 165 | * |
|---|
| 166 | * Hydra_Software_Devel/8 4/2/03 10:39a marcusk |
|---|
| 167 | * Updated to support flag to specify if the interrupt can be triggered by |
|---|
| 168 | * the CPU. |
|---|
| 169 | * |
|---|
| 170 | * Hydra_Software_Devel/7 3/21/03 6:30p marcusk |
|---|
| 171 | * Minor updates. |
|---|
| 172 | * |
|---|
| 173 | * Hydra_Software_Devel/6 3/21/03 10:23a marcusk |
|---|
| 174 | * Removed array and replaced with pointer. |
|---|
| 175 | * |
|---|
| 176 | * Hydra_Software_Devel/5 3/19/03 11:28a marcusk |
|---|
| 177 | * Added module overview. |
|---|
| 178 | * |
|---|
| 179 | * Hydra_Software_Devel/4 3/17/03 9:06a marcusk |
|---|
| 180 | * Updated with const strings and removed un-needed typedef. |
|---|
| 181 | * |
|---|
| 182 | * Hydra_Software_Devel/3 3/13/03 3:24p marcusk |
|---|
| 183 | * Added include to fix build. |
|---|
| 184 | * |
|---|
| 185 | * Hydra_Software_Devel/2 3/12/03 3:07p marcusk |
|---|
| 186 | * Updated comments. |
|---|
| 187 | * |
|---|
| 188 | * Hydra_Software_Devel/1 3/12/03 2:21p marcusk |
|---|
| 189 | * Initial Version. |
|---|
| 190 | * |
|---|
| 191 | ***************************************************************************/ |
|---|
| 192 | |
|---|
| 193 | /*= Module Overview ********************************************************* |
|---|
| 194 | |
|---|
| 195 | The platform API is used to manage an instance of the interrupt interface. |
|---|
| 196 | This includes opening and closing and instance and the actual function that |
|---|
| 197 | is called when a L1 interrupt is generated. Multiple instances of an |
|---|
| 198 | InterruptInterface can be used for the same chip if and only if they do not |
|---|
| 199 | manage the same L2 interrupt bits. For example, one InterruptInterface |
|---|
| 200 | instance may be used the BSP/kernel code to manage standard peripherals |
|---|
| 201 | (IDE, USB, ENET, etc.), while another exists in a driver to manage interrupts |
|---|
| 202 | specific to that driver. |
|---|
| 203 | |
|---|
| 204 | The InterruptInterface also supports proprietary L2 interrupt handlers |
|---|
| 205 | through the use of the chip specific interrupt definition (see BINT_DONT_PROCESS_L2) |
|---|
| 206 | for chip specific definitions. When using this feature, the InterruptInterface |
|---|
| 207 | acts only as the central interrupt dispatcher used for processing all |
|---|
| 208 | L1 interrupts. This feature is mainly used to simplify the platform specific |
|---|
| 209 | code (so it only has to worry about calling BINT_Isr() for all L1 interrupts. |
|---|
| 210 | |
|---|
| 211 | In addition the InterruptInterface can be used to notify the platform |
|---|
| 212 | specific code regarding the L1 interrupts that are managed by an instance. |
|---|
| 213 | This can be done using the BINT_GetL1BitMask() routine. |
|---|
| 214 | |
|---|
| 215 | ***************************************************************************/ |
|---|
| 216 | |
|---|
| 217 | #ifndef BINT_PLATFORM_H |
|---|
| 218 | #define BINT_PLATFORM_H |
|---|
| 219 | |
|---|
| 220 | #include "breg_mem.h" |
|---|
| 221 | #include "bint.h" |
|---|
| 222 | |
|---|
| 223 | #ifdef __cplusplus |
|---|
| 224 | extern "C" { |
|---|
| 225 | #endif |
|---|
| 226 | |
|---|
| 227 | /* New interrupt model! Avoid doing this in many files that uses |
|---|
| 228 | * new int model. */ |
|---|
| 229 | #if((BCHP_CHIP==7038) || (BCHP_CHIP==7401) || (BCHP_CHIP==7403) || \ |
|---|
| 230 | (BCHP_CHIP==7400) || (BCHP_CHIP==7118) || (BCHP_CHIP==7440) || (BCHP_CHIP==7601) || \ |
|---|
| 231 | (BCHP_CHIP==3560) || (BCHP_CHIP==3563) || (BCHP_CHIP==3573)) |
|---|
| 232 | #define BINT_NEW_INT_MODEL (0) |
|---|
| 233 | #else |
|---|
| 234 | /* the #else should always contain the new architecture. |
|---|
| 235 | also, if the number of L1 registers changes in the future, consider a macro whose value is the # of registers. */ |
|---|
| 236 | #define BINT_NEW_INT_MODEL (1) |
|---|
| 237 | #if (BCHP_CHIP==7435) |
|---|
| 238 | #define BINT_INTC_SIZE 4 |
|---|
| 239 | #else |
|---|
| 240 | #define BINT_INTC_SIZE 3 |
|---|
| 241 | #endif |
|---|
| 242 | #endif |
|---|
| 243 | |
|---|
| 244 | #if (BINT_NEW_INT_MODEL) |
|---|
| 245 | #define BINT_MAX_INTC_SIZE 4 /* interrupt controller size this interface is capable of handling */ |
|---|
| 246 | #define BINT_P_L1_SIZE (32*BINT_INTC_SIZE) /* Size of L1 interrupt register */ |
|---|
| 247 | #else |
|---|
| 248 | #define BINT_P_L1_SIZE 64 /* Size of L1 interrupt register */ |
|---|
| 249 | #endif |
|---|
| 250 | |
|---|
| 251 | #define BINT_DONT_PROCESS_L2 0xFFFFFFFF |
|---|
| 252 | #define BINT_IS_STANDARD 0x40000000 /* See BINT_P_IntMap.L1Shift for usage. */ |
|---|
| 253 | |
|---|
| 254 | /* |
|---|
| 255 | Summary: |
|---|
| 256 | This structure is used to store the interrupt map supported by a specific |
|---|
| 257 | instance of the interrupt interface. |
|---|
| 258 | */ |
|---|
| 259 | typedef struct BINT_P_IntMap |
|---|
| 260 | { |
|---|
| 261 | int L1Shift; /* L1 shift value (-1 signifies the end of list). |
|---|
| 262 | * This value must match the L1Shift value passed |
|---|
| 263 | * into BINT_Isr() when you wish to process interrupts |
|---|
| 264 | * associated with this entry. |
|---|
| 265 | * This value, in combination with the L2RegOffset value, creates |
|---|
| 266 | * a unique L1 shift to L2 register mapping that is used |
|---|
| 267 | * when BINT_Isr() is called. |
|---|
| 268 | * |
|---|
| 269 | * This value can be OR'd with BINT_IS_STANDARD. If this is true, |
|---|
| 270 | * then this is a "standard" interrupt which can be processed in bint.c |
|---|
| 271 | * more efficiently. Overall performance improvement is significant. |
|---|
| 272 | * Each bint_CHIP.c file should set BINT_IS_STANDARD for standard L2's. |
|---|
| 273 | */ |
|---|
| 274 | uint32_t L2RegOffset; /* L2 Register offset used when the specified L1 triggers. |
|---|
| 275 | * This value, in combination with the L1Shift value, creates |
|---|
| 276 | * a unique L1 shift to L2 register mapping that is used |
|---|
| 277 | * when BINT_Isr() is called. This value is passed into |
|---|
| 278 | * BINT_SetIntFunc(), BINT_ClearIntFunc(), BINT_SetMaskFunc(), |
|---|
| 279 | * BINT_ClearMaskFunc(), BINT_ReadMaskFunc(), and BINT_ReadStatusFunc() |
|---|
| 280 | * functions as the baseAddr parameter. |
|---|
| 281 | * All BINT_Id's associated with this L2 register must also |
|---|
| 282 | * be defined using the same L2RegOffset value. |
|---|
| 283 | */ |
|---|
| 284 | uint32_t L2InvalidMask; /* Mask that specifies the invalid bits contained in this L2 register |
|---|
| 285 | * (1 means the interrupt bit is not valid). BINT_DONT_PROCESS_L2 specifies |
|---|
| 286 | * that these L2 interrupts are processed by a proprietary L2 interrupt |
|---|
| 287 | * handling routine (so just call the callback and don't touch any of |
|---|
| 288 | * the interrupt registers). When an L1 interrupt fires that is defined |
|---|
| 289 | * with a BINT_DONT_PROCESS_L2 mask, only the most recently created callback |
|---|
| 290 | * associated with that L1 shift will be called. |
|---|
| 291 | * Any callbacks associated with BINT_DONT_PROCESS_L2 masks will be called |
|---|
| 292 | * when the L1 interrupt triggers regardless of whether they are enabled or |
|---|
| 293 | * disabled. |
|---|
| 294 | */ |
|---|
| 295 | const char *L2Name; /* Name of L2 interrupt */ |
|---|
| 296 | } BINT_P_IntMap; |
|---|
| 297 | |
|---|
| 298 | /* Used to Software Trigger an interrupt, used only if target H/W supports it */ |
|---|
| 299 | typedef void (*BINT_SetIntFunc)( |
|---|
| 300 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 301 | uint32_t baseAddr, /* [in] Base Register Offset, from device base */ |
|---|
| 302 | int shift /* [in] Bit Shift */ |
|---|
| 303 | ); |
|---|
| 304 | |
|---|
| 305 | /* Used to Clear an interrupt */ |
|---|
| 306 | typedef void (*BINT_ClearIntFunc)( |
|---|
| 307 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 308 | uint32_t baseAddr, /* [in] Base Register Offset, from device base */ |
|---|
| 309 | int shift /* [in] Bit Shift */ |
|---|
| 310 | ); |
|---|
| 311 | |
|---|
| 312 | /* Used to Mask an interrupt */ |
|---|
| 313 | typedef void (*BINT_SetMaskFunc)( |
|---|
| 314 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 315 | uint32_t baseAddr, /* [in] Base Register Offset, from device base */ |
|---|
| 316 | int shift /* [in] Bit Shift */ |
|---|
| 317 | ); |
|---|
| 318 | |
|---|
| 319 | /* Used to Clear an interrupt mask */ |
|---|
| 320 | typedef void (*BINT_ClearMaskFunc)( |
|---|
| 321 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 322 | uint32_t baseAddr, /* [in] Base Register Offset, from device base */ |
|---|
| 323 | int shift /* [in] Bit Shift */ |
|---|
| 324 | ); |
|---|
| 325 | |
|---|
| 326 | /* Used to read the L2 interrupt mask */ |
|---|
| 327 | typedef uint32_t (*BINT_ReadMaskFunc)( |
|---|
| 328 | BREG_Handle Handle, /* [in] handle created by BINT_Open */ |
|---|
| 329 | uint32_t baseAddr /* [in] Base Register Offset, from device base */ |
|---|
| 330 | ); |
|---|
| 331 | |
|---|
| 332 | /* Used to read the L2 interrupt status */ |
|---|
| 333 | typedef uint32_t (*BINT_ReadStatusFunc)( |
|---|
| 334 | BREG_Handle Handle, /* [in] handle created by BINT_Open */ |
|---|
| 335 | uint32_t baseAddr /* [in] Base Register Offset, from device base */ |
|---|
| 336 | ); |
|---|
| 337 | |
|---|
| 338 | typedef struct |
|---|
| 339 | { |
|---|
| 340 | BINT_SetIntFunc pSetInt; /* ptr to Set Interrupt, NULL if none */ |
|---|
| 341 | BINT_ClearIntFunc pClearInt; /* ptr to Clear Interrupt, NULL if none */ |
|---|
| 342 | BINT_SetMaskFunc pSetMask; /* ptr to Set Interrupt Mask, REQUIRED */ |
|---|
| 343 | BINT_ClearMaskFunc pClearMask; /* ptr to Clear Interrupt Mask, REQUIRED */ |
|---|
| 344 | BINT_ReadMaskFunc pReadMask; /* ptr to Read Mask, REQUIRED */ |
|---|
| 345 | BINT_ReadStatusFunc pReadStatus; /* ptr to Read Status, REQUIRED */ |
|---|
| 346 | const BINT_P_IntMap *pIntMap; /* ptr to the interrupt map, REQUIRED */ |
|---|
| 347 | const char *name; /* chip name */ |
|---|
| 348 | } BINT_Settings; |
|---|
| 349 | |
|---|
| 350 | /* |
|---|
| 351 | Summary: |
|---|
| 352 | This function creates an instance of a interrupt interface. |
|---|
| 353 | */ |
|---|
| 354 | BERR_Code BINT_Open( |
|---|
| 355 | BINT_Handle *pHandle, /* [out] Returns handle to instance on interrupt interface */ |
|---|
| 356 | BREG_Handle regHandle, /* [in] handle used for reading and writing registers */ |
|---|
| 357 | const BINT_Settings *pDefSettings /* [in] pointer to default settings */ |
|---|
| 358 | ); |
|---|
| 359 | |
|---|
| 360 | /* |
|---|
| 361 | Summary: |
|---|
| 362 | This function destroys an instance of a interrupt interface. |
|---|
| 363 | */ |
|---|
| 364 | BERR_Code BINT_Close( |
|---|
| 365 | BINT_Handle Handle /* [in] handle created by BINT_Open */ |
|---|
| 366 | ); |
|---|
| 367 | |
|---|
| 368 | /* |
|---|
| 369 | Summary: |
|---|
| 370 | This function returns a bit mask that describes which L1 interrupts the specified |
|---|
| 371 | instance of the BINT module is currently handling. |
|---|
| 372 | |
|---|
| 373 | Description: |
|---|
| 374 | If a bit is set that means that this instanace of BINT is handling the L2 register |
|---|
| 375 | associated with that L1 bit. This can be used by the platform initialization routine |
|---|
| 376 | to automatically create mappings between the L1 ISR handler and the BINT module instance. |
|---|
| 377 | |
|---|
| 378 | Sample Code: |
|---|
| 379 | static void BFramework_EnableIsr( BINT_Handle intHandle ) |
|---|
| 380 | { |
|---|
| 381 | unsigned long i; |
|---|
| 382 | bool enableIsr; |
|---|
| 383 | uint32_t l1masklo, l1maskhi; |
|---|
| 384 | |
|---|
| 385 | BINT_GetL1BitMask( intHandle, &l1masklo, &l1maskhi ); |
|---|
| 386 | for( i=0; i<BINT_P_L1_SIZE; i++ ) |
|---|
| 387 | { |
|---|
| 388 | enableIsr = false; |
|---|
| 389 | if( i >=32 ) |
|---|
| 390 | { |
|---|
| 391 | if( l1maskhi & 1ul<<(i-32) ) |
|---|
| 392 | { |
|---|
| 393 | enableIsr = true; |
|---|
| 394 | } |
|---|
| 395 | } |
|---|
| 396 | else |
|---|
| 397 | { |
|---|
| 398 | if( l1masklo & 1ul<<i ) |
|---|
| 399 | { |
|---|
| 400 | enableIsr = true; |
|---|
| 401 | } |
|---|
| 402 | } |
|---|
| 403 | if( enableIsr ) |
|---|
| 404 | { |
|---|
| 405 | BDBG_WRN(("Enabling L1 interrupt %ld", i)); |
|---|
| 406 | CPUINT1_ConnectIsr(i, (FN_L1_ISR)BINT_Isr, intHandle, i ); |
|---|
| 407 | CPUINT1_Enable(i); |
|---|
| 408 | } |
|---|
| 409 | } |
|---|
| 410 | } |
|---|
| 411 | */ |
|---|
| 412 | #if (BINT_NEW_INT_MODEL) |
|---|
| 413 | void BINT_GetL1BitMask( |
|---|
| 414 | BINT_Handle intHandle, /* [in] handle created by BINT_Open */ |
|---|
| 415 | uint32_t BitMask[BINT_MAX_INTC_SIZE] /* [out] Bitmask that specifies which L1 bits are managed by BINT */ |
|---|
| 416 | ); |
|---|
| 417 | #else |
|---|
| 418 | void BINT_GetL1BitMask( |
|---|
| 419 | BINT_Handle intHandle, /* [in] handle created by BINT_Open */ |
|---|
| 420 | uint32_t *pBitMaskLo, /* [out] Bitmask that specifies which L1 bits are managed by BINT */ |
|---|
| 421 | uint32_t *pBitMaskHi /* [out] Bitmask that specifies which L1 bits are managed by BINT */ |
|---|
| 422 | ); |
|---|
| 423 | #endif |
|---|
| 424 | |
|---|
| 425 | /* |
|---|
| 426 | Summary: |
|---|
| 427 | This function should be called any time an interrupt occurs. |
|---|
| 428 | |
|---|
| 429 | Description: |
|---|
| 430 | This function should be called for each L1 interrupt bit that needs |
|---|
| 431 | to be processed by the interrupt interface module. |
|---|
| 432 | |
|---|
| 433 | The interrupt interface does not mask or manage any L1 interrupt registers. |
|---|
| 434 | This is to allow the platform/os specific code to share the L1 registers |
|---|
| 435 | between platform/os specific code and common code which uses the interrupt |
|---|
| 436 | interface. |
|---|
| 437 | */ |
|---|
| 438 | void BINT_Isr( |
|---|
| 439 | BINT_Handle Handle, /* [in] handle created by BINT_Open */ |
|---|
| 440 | int L1Shift /* [in] shift value for L1 interrupt bit to be processed */ |
|---|
| 441 | ); |
|---|
| 442 | |
|---|
| 443 | #ifdef __cplusplus |
|---|
| 444 | } |
|---|
| 445 | #endif |
|---|
| 446 | |
|---|
| 447 | #endif |
|---|
| 448 | /* End of File */ |
|---|