1 /******************************************************************************* 2 Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. 3 4 Permission is hereby granted, free of charge, to any person obtaining a 5 copy of this software and associated documentation files (the "Software"), 6 to deal in the Software without restriction, including without limitation 7 the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 and/or sell copies of the Software, and to permit persons to whom the 9 Software is furnished to do so, subject to the following conditions: 10 11 The above copyright notice and this permission notice shall be included in 12 all copies or substantial portions of the Software. 13 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 DEALINGS IN THE SOFTWARE. 21 22 *******************************************************************************/ 23 #ifndef _cl826f_h_ 24 #define _cl826f_h_ 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 #include "nvtypes.h" 31 32 /* class G82_CHANNEL_GPFIFO */ 33 #define G82_CHANNEL_GPFIFO (0x0000826F) 34 35 /* NvNotification[] indexes */ 36 /* channel id returned in index 0 at alloc time */ 37 #define NV826F_NOTIFIERS_GET_CHANNEL_ID_INDEX (0) 38 #define NV826F_NOTIFIERS_GET_CHANNEL_ID_INFO32_ID 31:0 39 /* RC error occurring in channel updates index 0 */ 40 #define NV826F_NOTIFIERS_ROBUST_CHANNEL_ERROR_INDEX (0) 41 #define NV826F_NOTIFIERS_ROBUST_CHANNEL_ERROR_INFO32_ERRTYPE 31:0 42 #define NV826F_NOTIFIERS_ROBUST_CHANNEL_ERROR_STATUS 15:0 43 #define NV826F_NOTIFIERS_ROBUST_CHANNEL_ERROR_STATUS_ERROR 0xFFFF 44 #define NV826F_NOTIFIERS_UNUSED (1) 45 #define NV826F_NOTIFIERS_GR_DEBUG_INTR (2) 46 #define NV826F_NOTIFIERS_MAXCOUNT (3) 47 48 /* NvNotification[] fields and values */ 49 #define NV826F_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT (0x2000) 50 #define NV826F_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT (0x4000) 51 /* pio method data structure */ 52 typedef volatile struct _cl826f_tag0 { 53 NvV32 Reserved00[0x7c0]; 54 } Nv826fTypedef, G82ChannelGPFifo; 55 #define NV826F_TYPEDEF G82ChannelGPFifo 56 /* dma flow control data structure */ 57 typedef volatile struct _cl826f_tag1 { 58 NvU32 Ignored00[0x010]; /* 0000-0043*/ 59 NvU32 Put; /* put offset, read/write 0040-0043*/ 60 NvU32 Get; /* get offset, read only 0044-0047*/ 61 NvU32 Reference; /* reference value, read only 0048-004b*/ 62 NvU32 PutHi; /* high order put offset bits 004c-004f*/ 63 NvU32 SetReference; /* set reference value 0050-0053*/ 64 NvU32 Ignored02[0x001]; /* 0054-0057*/ 65 NvU32 TopLevelGet; /* top level get offset, read only 0058-005b*/ 66 NvU32 TopLevelGetHi; /* high order top level get bits 005c-005f*/ 67 NvU32 GetHi; /* high order get offset bits 0060-0063*/ 68 NvU32 Ignored03[0x007]; /* 0064-007f*/ 69 NvU32 Yield; /* engine yield, write only 0080-0083*/ 70 NvU32 Ignored04[0x001]; /* 0084-0087*/ 71 NvU32 GPGet; /* GP FIFO get offset, read only 0088-008b*/ 72 NvU32 GPPut; /* GP FIFO put offset 008c-008f*/ 73 NvU32 Ignored05[0x3dc]; 74 } Nv826fControl, G82ControlGPFifo; 75 /* fields and values */ 76 #define NV826F_NUMBER_OF_SUBCHANNELS (8) 77 #define NV826F_SET_OBJECT (0x00000000) 78 #define NV826F_SEMAPHOREA (0x00000010) 79 #define NV826F_SEMAPHOREA_OFFSET_UPPER 7:0 80 #define NV826F_SEMAPHOREB (0x00000014) 81 #define NV826F_SEMAPHOREB_OFFSET_LOWER 31:00 82 #define NV826F_SEMAPHOREC (0x00000018) 83 #define NV826F_SEMAPHOREC_PAYLOAD 31:0 84 #define NV826F_SEMAPHORED (0x0000001C) 85 #define NV826F_SEMAPHORED_OPERATION 2:0 86 #define NV826F_SEMAPHORED_OPERATION_ACQUIRE 0x00000001 87 #define NV826F_SEMAPHORED_OPERATION_RELEASE 0x00000002 88 #define NV826F_SEMAPHORED_OPERATION_ACQ_GEQ 0x00000004 89 #define NV826F_NON_STALLED_INTERRUPT (0x00000020) 90 #define NV826F_FB_FLUSH (0x00000024) 91 #define NV826F_SET_REFERENCE (0x00000050) 92 #define NV826F_SET_CONTEXT_DMA_SEMAPHORE (0x00000060) 93 #define NV826F_SEMAPHORE_OFFSET (0x00000064) 94 #define NV826F_SEMAPHORE_ACQUIRE (0x00000068) 95 #define NV826F_SEMAPHORE_RELEASE (0x0000006c) 96 #define NV826F_YIELD (0x00000080) 97 #define NV826F_SWITCH_NO_WAIT (0x00000084) 98 99 100 /* GPFIFO entry format */ 101 #define NV826F_GP_ENTRY__SIZE 8 102 #define NV826F_GP_ENTRY0_DISABLE 0:0 103 #define NV826F_GP_ENTRY0_DISABLE_NOT 0x00000000 104 #define NV826F_GP_ENTRY0_DISABLE_SKIP 0x00000001 105 #define NV826F_GP_ENTRY0_NO_CONTEXT_SWITCH 1:1 106 #define NV826F_GP_ENTRY0_NO_CONTEXT_SWITCH_FALSE 0x00000000 107 #define NV826F_GP_ENTRY0_NO_CONTEXT_SWITCH_TRUE 0x00000001 108 #define NV826F_GP_ENTRY0_GET 31:2 109 #define NV826F_GP_ENTRY1_GET_HI 7:0 110 #define NV826F_GP_ENTRY1_PRIV 8:8 111 #define NV826F_GP_ENTRY1_PRIV_USER 0x00000000 112 #define NV826F_GP_ENTRY1_PRIV_KERNEL 0x00000001 113 #define NV826F_GP_ENTRY1_LEVEL 9:9 114 #define NV826F_GP_ENTRY1_LEVEL_MAIN 0x00000000 115 #define NV826F_GP_ENTRY1_LEVEL_SUBROUTINE 0x00000001 116 #define NV826F_GP_ENTRY1_LENGTH 31:10 117 118 /* dma method descriptor formats */ 119 #define NV826F_DMA_PRIMARY_OPCODE 1:0 120 #define NV826F_DMA_PRIMARY_OPCODE_USES_SECONDARY (0x00000000) 121 #define NV826F_DMA_PRIMARY_OPCODE_RESERVED (0x00000003) 122 #define NV826F_DMA_METHOD_ADDRESS 12:2 123 #define NV826F_DMA_METHOD_SUBCHANNEL 15:13 124 #define NV826F_DMA_TERT_OP 17:16 125 #define NV826F_DMA_TERT_OP_GRP0_INC_METHOD (0x00000000) 126 #define NV826F_DMA_TERT_OP_GRP0_SET_SUB_DEV_MASK (0x00000001) 127 #define NV826F_DMA_TERT_OP_GRP0_DOUBLE_HEADER (0x00000003) 128 #define NV826F_DMA_TERT_OP_GRP2_NON_INC_METHOD (0x00000000) 129 #define NV826F_DMA_TERT_OP_GRP2_RESERVED01 (0x00000001) 130 #define NV826F_DMA_TERT_OP_GRP2_RESERVED10 (0x00000002) 131 #define NV826F_DMA_TERT_OP_GRP2_RESERVED11 (0x00000003) 132 #define NV826F_DMA_METHOD_COUNT 28:18 133 #define NV826F_DMA_SEC_OP 31:29 134 #define NV826F_DMA_SEC_OP_GRP0_USE_TERT (0x00000000) 135 #define NV826F_DMA_SEC_OP_GRP2_USE_TERT (0x00000002) 136 #define NV826F_DMA_SEC_OP_GRP3_RESERVED (0x00000003) 137 #define NV826F_DMA_SEC_OP_GRP4_RESERVED (0x00000004) 138 #define NV826F_DMA_SEC_OP_GRP5_RESERVED (0x00000005) 139 #define NV826F_DMA_SEC_OP_GRP6_RESERVED (0x00000006) 140 #define NV826F_DMA_SEC_OP_GRP7_RESERVED (0x00000007) 141 #define NV826F_DMA_LONG_COUNT 31:0 142 /* dma legacy method descriptor format */ 143 #define NV826F_DMA_OPCODE2 1:0 144 #define NV826F_DMA_OPCODE2_NONE (0x00000000) 145 #define NV826F_DMA_OPCODE 31:29 146 #define NV826F_DMA_OPCODE_METHOD (0x00000000) 147 #define NV826F_DMA_OPCODE_NONINC_METHOD (0x00000002) 148 #define NV826F_DMA_OPCODE3_NONE (0x00000000) 149 /* dma data format */ 150 #define NV826F_DMA_DATA 31:0 151 /* dma double header descriptor format */ 152 #define NV826F_DMA_DH_OPCODE2 1:0 153 #define NV826F_DMA_DH_OPCODE2_NONE (0x00000000) 154 #define NV826F_DMA_DH_METHOD_ADDRESS 12:2 155 #define NV826F_DMA_DH_METHOD_SUBCHANNEL 15:13 156 #define NV826F_DMA_DH_OPCODE3 17:16 157 #define NV826F_DMA_DH_OPCODE3_DOUBLE_HEADER (0x00000003) 158 #define NV826F_DMA_DH_OPCODE 31:29 159 #define NV826F_DMA_DH_OPCODE_METHOD (0x00000000) 160 /* dma double header method count format */ 161 #define NV826F_DMA_DH_METHOD_COUNT 23:0 162 /* dma double header data format */ 163 #define NV826F_DMA_DH_DATA 31:0 164 /* dma nop format */ 165 #define NV826F_DMA_NOP (0x00000000) 166 /* dma set subdevice mask format */ 167 #define NV826F_DMA_SET_SUBDEVICE_MASK (0x00010000) 168 #define NV826F_DMA_SET_SUBDEVICE_MASK_VALUE 15:4 169 #define NV826F_DMA_OPCODE3 17:16 170 #define NV826F_DMA_OPCODE3_SET_SUBDEVICE_MASK (0x00000001) 171 172 #ifdef __cplusplus 173 }; /* extern "C" */ 174 #endif 175 176 #endif /* _cl826f_h_ */ 177