| 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 _cl506f_h_ |
| 24 |
#define _cl506f_h_ |
| 25 |
|
| 26 |
#ifdef __cplusplus |
| 27 |
extern "C" { |
| 28 |
#endif |
| 29 |
|
| 30 |
#include "nvtypes.h" |
| 31 |
|
| 32 |
/* class NV50_CHANNEL_GPFIFO */ |
| 33 |
#define NV50_CHANNEL_GPFIFO (0x0000506F) |
| 34 |
|
| 35 |
/* NvNotification[] elements */ |
| 36 |
#define NV506F_NOTIFIERS_RC (0) |
| 37 |
#define NV506F_NOTIFIERS_SW (1) |
| 38 |
#define NV506F_NOTIFIERS_GR_DEBUG_INTR (2) |
| 39 |
#define NV506F_NOTIFIERS_MAXCOUNT (3) |
| 40 |
|
| 41 |
/* NvNotification[] fields and values */ |
| 42 |
#define NV506f_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT (0x2000) |
| 43 |
#define NV506f_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT (0x4000) |
| 44 |
/* pio method data structure */ |
| 45 |
typedef volatile struct _cl506f_tag0 { |
| 46 |
NvV32 Reserved00[0x7c0]; |
| 47 |
} Nv506fTypedef, Nv50ChannelGPFifo; |
| 48 |
#define NV506F_TYPEDEF Nv50ChannelGPFifo |
| 49 |
/* pio flow control data structure */ |
| 50 |
typedef volatile struct _cl506f_tag1 { |
| 51 |
NvU32 Ignored00[0x010]; /* 0000-0039*/ |
| 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 |
} Nv506fControl, Nv50ControlGPFifo; |
| 68 |
/* fields and values */ |
| 69 |
#define NV506F_NUMBER_OF_SUBCHANNELS (8) |
| 70 |
#define NV506F_SET_OBJECT (0x00000000) |
| 71 |
#define NV506F_SET_REFERENCE (0x00000050) |
| 72 |
#define NV506F_SET_CONTEXT_DMA_SEMAPHORE (0x00000060) |
| 73 |
#define NV506F_SEMAPHORE_OFFSET (0x00000064) |
| 74 |
#define NV506F_SEMAPHORE_ACQUIRE (0x00000068) |
| 75 |
#define NV506F_SEMAPHORE_RELEASE (0x0000006c) |
| 76 |
#define NV506F_YIELD (0x00000080) |
| 77 |
|
| 78 |
// |
| 79 |
// GPFIFO entry format |
| 80 |
// |
| 81 |
#define NV506F_GP_ENTRY__SIZE 8 |
| 82 |
#define NV506F_GP_ENTRY0_DISABLE 0:0 |
| 83 |
#define NV506F_GP_ENTRY0_DISABLE_NOT 0x00000000 |
| 84 |
#define NV506F_GP_ENTRY0_DISABLE_SKIP 0x00000001 |
| 85 |
#define NV506F_GP_ENTRY0_NO_CONTEXT_SWITCH 1:1 |
| 86 |
#define NV506F_GP_ENTRY0_NO_CONTEXT_SWITCH_FALSE 0x00000000 |
| 87 |
#define NV506F_GP_ENTRY0_NO_CONTEXT_SWITCH_TRUE 0x00000001 |
| 88 |
#define NV506F_GP_ENTRY0_GET 31:2 |
| 89 |
#define NV506F_GP_ENTRY1_GET_HI 7:0 |
| 90 |
#define NV506F_GP_ENTRY1_PRIV 8:8 |
| 91 |
#define NV506F_GP_ENTRY1_PRIV_USER 0x00000000 |
| 92 |
#define NV506F_GP_ENTRY1_PRIV_KERNEL 0x00000001 |
| 93 |
#define NV506F_GP_ENTRY1_LEVEL 9:9 |
| 94 |
#define NV506F_GP_ENTRY1_LEVEL_MAIN 0x00000000 |
| 95 |
#define NV506F_GP_ENTRY1_LEVEL_SUBROUTINE 0x00000001 |
| 96 |
#define NV506F_GP_ENTRY1_LENGTH 31:10 |
| 97 |
|
| 98 |
/* dma method descriptor formats */ |
| 99 |
#define NV506F_DMA_PRIMARY_OPCODE 1:0 |
| 100 |
#define NV506F_DMA_PRIMARY_OPCODE_USES_SECONDARY (0x00000000) |
| 101 |
#define NV506F_DMA_PRIMARY_OPCODE_RESERVED (0x00000003) |
| 102 |
#define NV506F_DMA_METHOD_ADDRESS 12:2 |
| 103 |
#define NV506F_DMA_METHOD_SUBCHANNEL 15:13 |
| 104 |
#define NV506F_DMA_TERT_OP 17:16 |
| 105 |
#define NV506F_DMA_TERT_OP_GRP0_INC_METHOD (0x00000000) |
| 106 |
#define NV506F_DMA_TERT_OP_GRP0_SET_SUB_DEV_MASK (0x00000001) |
| 107 |
#define NV506F_DMA_TERT_OP_GRP0_DOUBLE_HEADER (0x00000003) |
| 108 |
#define NV506F_DMA_TERT_OP_GRP2_NON_INC_METHOD (0x00000000) |
| 109 |
#define NV506F_DMA_TERT_OP_GRP2_RESERVED01 (0x00000001) |
| 110 |
#define NV506F_DMA_TERT_OP_GRP2_RESERVED10 (0x00000002) |
| 111 |
#define NV506F_DMA_TERT_OP_GRP2_RESERVED11 (0x00000003) |
| 112 |
#define NV506F_DMA_METHOD_COUNT 28:18 |
| 113 |
#define NV506F_DMA_SEC_OP 31:29 |
| 114 |
#define NV506F_DMA_SEC_OP_GRP0_USE_TERT (0x00000000) |
| 115 |
#define NV506F_DMA_SEC_OP_GRP2_USE_TERT (0x00000002) |
| 116 |
#define NV506F_DMA_SEC_OP_GRP3_RESERVED (0x00000003) |
| 117 |
#define NV506F_DMA_SEC_OP_GRP4_RESERVED (0x00000004) |
| 118 |
#define NV506F_DMA_SEC_OP_GRP5_RESERVED (0x00000005) |
| 119 |
#define NV506F_DMA_SEC_OP_GRP6_RESERVED (0x00000006) |
| 120 |
#define NV506F_DMA_SEC_OP_GRP7_RESERVED (0x00000007) |
| 121 |
#define NV506F_DMA_LONG_COUNT 31:0 |
| 122 |
/* dma legacy method descriptor format */ |
| 123 |
#define NV506F_DMA_OPCODE2 1:0 |
| 124 |
#define NV506F_DMA_OPCODE2_NONE (0x00000000) |
| 125 |
#define NV506F_DMA_OPCODE 31:29 |
| 126 |
#define NV506F_DMA_OPCODE_METHOD (0x00000000) |
| 127 |
#define NV506F_DMA_OPCODE_NONINC_METHOD (0x00000002) |
| 128 |
#define NV506F_DMA_OPCODE3_NONE (0x00000000) |
| 129 |
/* dma data format */ |
| 130 |
#define NV506F_DMA_DATA 31:0 |
| 131 |
/* dma double header descriptor format */ |
| 132 |
#define NV506F_DMA_DH_OPCODE2 1:0 |
| 133 |
#define NV506F_DMA_DH_OPCODE2_NONE (0x00000000) |
| 134 |
#define NV506F_DMA_DH_METHOD_ADDRESS 12:2 |
| 135 |
#define NV506F_DMA_DH_METHOD_SUBCHANNEL 15:13 |
| 136 |
#define NV506F_DMA_DH_OPCODE3 17:16 |
| 137 |
#define NV506F_DMA_DH_OPCODE3_DOUBLE_HEADER (0x00000003) |
| 138 |
#define NV506F_DMA_DH_OPCODE 31:29 |
| 139 |
#define NV506F_DMA_DH_OPCODE_METHOD (0x00000000) |
| 140 |
/* dma double header method count format */ |
| 141 |
#define NV506F_DMA_DH_METHOD_COUNT 23:0 |
| 142 |
/* dma double header data format */ |
| 143 |
#define NV506F_DMA_DH_DATA 31:0 |
| 144 |
/* dma nop format */ |
| 145 |
#define NV506F_DMA_NOP (0x00000000) |
| 146 |
/* dma set subdevice mask format */ |
| 147 |
#define NV506F_DMA_SET_SUBDEVICE_MASK (0x00010000) |
| 148 |
#define NV506F_DMA_SET_SUBDEVICE_MASK_VALUE 15:4 |
| 149 |
#define NV506F_DMA_OPCODE3 17:16 |
| 150 |
#define NV506F_DMA_OPCODE3_SET_SUBDEVICE_MASK (0x00000001) |
| 151 |
|
| 152 |
#ifdef __cplusplus |
| 153 |
}; /* extern "C" */ |
| 154 |
#endif |
| 155 |
|
| 156 |
#endif /* _cl506f_h_ */ |