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 _cl866f_h_ 24 #define _cl866f_h_ 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 #include "nvtypes.h" 31 32 /* class GT21A_CHANNEL_GPFIFO */ 33 #define GT21A_CHANNEL_GPFIFO (0x0000866F) 34 35 /* NvNotification[] elements */ 36 #define NV866F_NOTIFIERS_RC (0) 37 #define NV866F_NOTIFIERS_SW (1) 38 #define NV866F_NOTIFIERS_GR_DEBUG_INTR (2) 39 #define NV866F_NOTIFIERS_MAXCOUNT (3) 40 41 /* NvNotification[] fields and values */ 42 #define NV866f_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT (0x2000) 43 #define NV866f_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT (0x4000) 44 /* pio method data structure */ 45 typedef volatile struct _cl866f_tag0 { 46 NvV32 Reserved00[0x7c0]; 47 } Nv866fTypedef, G84ChannelGPFifo; 48 #define NV866F_TYPEDEF G84ChannelGPFifo 49 /* dma flow control data structure */ 50 typedef volatile struct _cl866f_tag1 { 51 NvU32 Ignored00[0x010]; /* 0000-0043*/ 52 NvU32 Put; /* put offset, read/write 0040-0043*/ 53 NvU32 Get; /* get offset, read only 0044-0047*/ 54 NvU32 Reference; /* reference value, read only 0048-004b*/ 55 NvU32 PutHi; /* high order put offset bits 004c-004f*/ 56 NvU32 SetReference; /* set reference value 0050-0053*/ 57 NvU32 Ignored02[0x001]; /* 0054-0057*/ 58 NvU32 TopLevelGet; /* top level get offset, read only 0058-005b*/ 59 NvU32 TopLevelGetHi; /* high order top level get bits 005c-005f*/ 60 NvU32 GetHi; /* high order get offset bits 0060-0063*/ 61 NvU32 Ignored03[0x007]; /* 0064-007f*/ 62 NvU32 Yield; /* engine yield, write only 0080-0083*/ 63 NvU32 Ignored04[0x001]; /* 0084-0087*/ 64 NvU32 GPGet; /* GP FIFO get offset, read only 0088-008b*/ 65 NvU32 GPPut; /* GP FIFO put offset 008c-008f*/ 66 NvU32 Ignored05[0x3dc]; 67 } Nv866fControl, G84ControlGPFifo; 68 /* fields and values */ 69 #define NV866F_NUMBER_OF_SUBCHANNELS (8) 70 #define NV866F_SET_OBJECT (0x00000000) 71 #define NV866F_SEMAPHOREA (0x00000010) 72 #define NV866F_SEMAPHOREA_OFFSET_UPPER 7:0 73 #define NV866F_SEMAPHOREB (0x00000014) 74 #define NV866F_SEMAPHOREB_OFFSET_LOWER 31:00 75 #define NV866F_SEMAPHOREC (0x00000018) 76 #define NV866F_SEMAPHOREC_PAYLOAD 31:0 77 #define NV866F_SEMAPHORED (0x0000001C) 78 #define NV866F_SEMAPHORED_OPERATION 3:0 79 #define NV866F_SEMAPHORED_OPERATION_ACQUIRE 0x00000001 80 #define NV866F_SEMAPHORED_OPERATION_RELEASE 0x00000002 81 #define NV866F_SEMAPHORED_OPERATION_ACQ_GEQ 0x00000004 82 #define NV866F_NON_STALLED_INTERRUPT (0x00000020) 83 #define NV866F_FB_FLUSH (0x00000024) 84 #define NV866F_MEM_OP_A (0x00000028) 85 #define NV866F_MEM_OP_A_FLUSH_VIRTUAL_BASE_ADDR 31:0 86 #define NV866F_MEM_OP_B (0x0000002C) 87 #define NV866F_MEM_OP_B_OPERATION 31:29 88 #define NV866F_MEM_OP_B_OPERATION_EVICT (0x00000000) 89 #define NV866F_MEM_OP_B_OPERATION_CLEAN (0x00000001) 90 #define NV866F_MEM_OP_B_OPERATION_INVALIDATE (0x00000002) 91 #define NV866F_MEM_OP_B_FLUSH_ALL 28:28 92 #define NV866F_MEM_OP_B_FLUSH_ALL_DISABLED (0x00000000) 93 #define NV866F_MEM_OP_B_FLUSH_ALL_ENABLED (0x00000001) 94 #define NV866F_MEM_OP_B_NUM_LINES 27:0 95 #define NV866F_SYSMEM_FLUSH_CTXDMA (0x00000030) 96 #define NV866F_SYSMEM_FLUSH_CTXDMA_HANDLE 31:0 97 #define NV866F_SET_REFERENCE (0x00000050) 98 #define NV866F_SET_CONTEXT_DMA_SEMAPHORE (0x00000060) 99 #define NV866F_SEMAPHORE_OFFSET (0x00000064) 100 #define NV866F_SEMAPHORE_ACQUIRE (0x00000068) 101 #define NV866F_SEMAPHORE_RELEASE (0x0000006c) 102 #define NV866F_YIELD (0x00000080) 103 #define NV866F_SWITCH_NO_WAIT (0x00000084) 104 105 // 106 // GPFIFO entry format 107 // 108 #define NV866F_GP_ENTRY__SIZE 8 109 #define NV866F_GP_ENTRY0_DISABLE 0:0 110 #define NV866F_GP_ENTRY0_DISABLE_NOT 0x00000000 111 #define NV866F_GP_ENTRY0_DISABLE_SKIP 0x00000001 112 #define NV866F_GP_ENTRY0_NO_CONTEXT_SWITCH 1:1 113 #define NV866F_GP_ENTRY0_NO_CONTEXT_SWITCH_FALSE 0x00000000 114 #define NV866F_GP_ENTRY0_NO_CONTEXT_SWITCH_TRUE 0x00000001 115 #define NV866F_GP_ENTRY0_GET 31:2 116 #define NV866F_GP_ENTRY1_GET_HI 7:0 117 #define NV866F_GP_ENTRY1_PRIV 8:8 118 #define NV866F_GP_ENTRY1_PRIV_USER 0x00000000 119 #define NV866F_GP_ENTRY1_PRIV_KERNEL 0x00000001 120 #define NV866F_GP_ENTRY1_LEVEL 9:9 121 #define NV866F_GP_ENTRY1_LEVEL_MAIN 0x00000000 122 #define NV866F_GP_ENTRY1_LEVEL_SUBROUTINE 0x00000001 123 #define NV866F_GP_ENTRY1_LENGTH 31:10 124 125 /* dma method descriptor formats */ 126 #define NV866F_DMA_PRIMARY_OPCODE 1:0 127 #define NV866F_DMA_PRIMARY_OPCODE_USES_SECONDARY (0x00000000) 128 #define NV866F_DMA_PRIMARY_OPCODE_RESERVED (0x00000003) 129 #define NV866F_DMA_METHOD_ADDRESS 12:2 130 #define NV866F_DMA_METHOD_SUBCHANNEL 15:13 131 #define NV866F_DMA_TERT_OP 17:16 132 #define NV866F_DMA_TERT_OP_GRP0_INC_METHOD (0x00000000) 133 #define NV866F_DMA_TERT_OP_GRP0_SET_SUB_DEV_MASK (0x00000001) 134 #define NV866F_DMA_TERT_OP_GRP0_DOUBLE_HEADER (0x00000003) 135 #define NV866F_DMA_TERT_OP_GRP2_NON_INC_METHOD (0x00000000) 136 #define NV866F_DMA_TERT_OP_GRP2_RESERVED01 (0x00000001) 137 #define NV866F_DMA_TERT_OP_GRP2_RESERVED10 (0x00000002) 138 #define NV866F_DMA_TERT_OP_GRP2_RESERVED11 (0x00000003) 139 #define NV866F_DMA_METHOD_COUNT 28:18 140 #define NV866F_DMA_SEC_OP 31:29 141 #define NV866F_DMA_SEC_OP_GRP0_USE_TERT (0x00000000) 142 #define NV866F_DMA_SEC_OP_GRP2_USE_TERT (0x00000002) 143 #define NV866F_DMA_SEC_OP_GRP3_RESERVED (0x00000003) 144 #define NV866F_DMA_SEC_OP_GRP4_RESERVED (0x00000004) 145 #define NV866F_DMA_SEC_OP_GRP5_RESERVED (0x00000005) 146 #define NV866F_DMA_SEC_OP_GRP6_RESERVED (0x00000006) 147 #define NV866F_DMA_SEC_OP_GRP7_RESERVED (0x00000007) 148 #define NV866F_DMA_LONG_COUNT 31:0 149 /* dma legacy method descriptor format */ 150 #define NV866F_DMA_OPCODE2 1:0 151 #define NV866F_DMA_OPCODE2_NONE (0x00000000) 152 #define NV866F_DMA_OPCODE 31:29 153 #define NV866F_DMA_OPCODE_METHOD (0x00000000) 154 #define NV866F_DMA_OPCODE_NONINC_METHOD (0x00000002) 155 #define NV866F_DMA_OPCODE3_NONE (0x00000000) 156 /* dma data format */ 157 #define NV866F_DMA_DATA 31:0 158 /* dma double header descriptor format */ 159 #define NV866F_DMA_DH_OPCODE2 1:0 160 #define NV866F_DMA_DH_OPCODE2_NONE (0x00000000) 161 #define NV866F_DMA_DH_METHOD_ADDRESS 12:2 162 #define NV866F_DMA_DH_METHOD_SUBCHANNEL 15:13 163 #define NV866F_DMA_DH_OPCODE3 17:16 164 #define NV866F_DMA_DH_OPCODE3_DOUBLE_HEADER (0x00000003) 165 #define NV866F_DMA_DH_OPCODE 31:29 166 #define NV866F_DMA_DH_OPCODE_METHOD (0x00000000) 167 /* dma double header method count format */ 168 #define NV866F_DMA_DH_METHOD_COUNT 23:0 169 /* dma double header data format */ 170 #define NV866F_DMA_DH_DATA 31:0 171 /* dma nop format */ 172 #define NV866F_DMA_NOP (0x00000000) 173 /* dma set subdevice mask format */ 174 #define NV866F_DMA_SET_SUBDEVICE_MASK (0x00010000) 175 #define NV866F_DMA_SET_SUBDEVICE_MASK_VALUE 15:4 176 #define NV866F_DMA_OPCODE3 17:16 177 #define NV866F_DMA_OPCODE3_SET_SUBDEVICE_MASK (0x00000001) 178 179 #ifdef __cplusplus 180 }; /* extern "C" */ 181 #endif 182 183 #endif /* _cl866f_h_ */ 184