OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2010 NVIDIA Corporation. |
| 3 * All rights reserved. |
| 4 * |
| 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: |
| 7 * |
| 8 * Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. |
| 10 * |
| 11 * Redistributions in binary form must reproduce the above copyright notice, |
| 12 * this list of conditions and the following disclaimer in the documentation |
| 13 * and/or other materials provided with the distribution. |
| 14 * |
| 15 * Neither the name of the NVIDIA Corporation nor the names of its contributors |
| 16 * may be used to endorse or promote products derived from this software |
| 17 * without specific prior written permission. |
| 18 * |
| 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 * POSSIBILITY OF SUCH DAMAGE. |
| 30 * |
| 31 */ |
| 32 |
| 33 #ifndef INCLUDED_nvrm_avp_shrd_interrupt_H |
| 34 #define INCLUDED_nvrm_avp_shrd_interrupt_H |
| 35 |
| 36 #include "nvos.h" |
| 37 #include "nvrm_init.h" |
| 38 #include "nvrm_module.h" |
| 39 #include "nvrm_interrupt.h" |
| 40 |
| 41 #if defined(__cplusplus) |
| 42 extern "C" |
| 43 { |
| 44 #endif |
| 45 |
| 46 /* Max number of clients with shared interrupt handler */ |
| 47 enum {MAX_SHRDINT_CLIENTS = 32}; |
| 48 |
| 49 /* Now AP15 support only VDE interrupts 6 */ |
| 50 enum {MAX_SHRDINT_INTERRUPTS = 6}; |
| 51 /* VDE Sync Token Interrupt */ |
| 52 enum {AP15_SYNC_TOKEN_INTERRUPT_INDEX = 0}; |
| 53 /* VDE BSE-V Interrupt */ |
| 54 enum {AP15_BSE_V_INTERRUPT_INDEX = 1}; |
| 55 /* VDE BSE-A Interrupt */ |
| 56 enum {AP15_BSE_A_INTERRUPT_INDEX = 2}; |
| 57 /* VDE SXE Interrupt */ |
| 58 enum {AP15_SXE_INTERRUPT_INDEX = 3}; |
| 59 /* VDE UCQ Error Interrupt */ |
| 60 enum {AP15_UCQ_INTERRUPT_INDEX = 4}; |
| 61 /* VDE Interrupt */ |
| 62 enum {AP15_VDE_INTERRUPT_INDEX = 5}; |
| 63 |
| 64 /* Now AP20 support only VDE interrupts 5 */ |
| 65 enum {AP20_MAX_SHRDINT_INTERRUPTS = 5}; |
| 66 /* VDE Sync Token Interrupt */ |
| 67 enum {AP20_SYNC_TOKEN_INTERRUPT_INDEX = 0}; |
| 68 /* VDE BSE-V Interrupt */ |
| 69 enum {AP20_BSE_V_INTERRUPT_INDEX = 1}; |
| 70 /* VDE SXE Interrupt */ |
| 71 enum {AP20_SXE_INTERRUPT_INDEX = 2}; |
| 72 /* VDE UCQ Error Interrupt */ |
| 73 enum {AP20_UCQ_INTERRUPT_INDEX = 3}; |
| 74 /* VDE Interrupt */ |
| 75 enum {AP20_VDE_INTERRUPT_INDEX = 4}; |
| 76 |
| 77 enum |
| 78 { |
| 79 NvRmArbSema_Vde = 0, |
| 80 NvRmArbSema_Bsea, |
| 81 //This should be last |
| 82 NvRmArbSema_Num, |
| 83 }; |
| 84 |
| 85 /* Shared interrupt private init , init done during RM init on AVP */ |
| 86 NvError NvRmAvpShrdInterruptPrvInit(NvRmDeviceHandle hRmDevice); |
| 87 |
| 88 /* Shared interrupt private de-init , de-init done during RM close on AVP */ |
| 89 void NvRmAvpShrdInterruptPrvDeinit(NvRmDeviceHandle hRmDevice); |
| 90 |
| 91 /* Get logical interrupt for a module*/ |
| 92 NvU32 NvRmAvpShrdInterruptGetIrqForLogicalInterrupt(NvRmDeviceHandle hRmDevice, |
| 93 NvRmModuleID ModuleID, |
| 94 NvU32 Index); |
| 95 /* Register for shared interrpt */ |
| 96 NvError NvRmAvpShrdInterruptRegister(NvRmDeviceHandle hRmDevice, |
| 97 NvU32 IrqListSize, |
| 98 const NvU32 *pIrqList, |
| 99 const NvOsInterruptHandler *pIrqHandlerList
, |
| 100 void *pContext, |
| 101 NvOsInterruptHandle *handle, |
| 102 NvU32 *ClientIndex); |
| 103 /* Un-register a shared interrpt */ |
| 104 void NvRmAvpShrdInterruptUnregister(NvRmDeviceHandle hRmDevice, |
| 105 NvOsInterruptHandle handle, |
| 106 NvU32 ClientIndex); |
| 107 /* Get exclisive access to a hardware(VDE) block */ |
| 108 NvError NvRmAvpShrdInterruptAquireHwBlock(NvRmModuleID ModuleID, NvU32 ClientId)
; |
| 109 |
| 110 /* Release exclisive access to a hardware(VDE) block */ |
| 111 NvError NvRmAvpShrdInterruptReleaseHwBlock(NvRmModuleID ModuleID, NvU32 ClientId
); |
| 112 |
| 113 #if defined(__cplusplus) |
| 114 } |
| 115 #endif |
| 116 |
| 117 #endif //INCLUDED_nvrm_avp_shrd_interrupt_H |
OLD | NEW |