1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2015-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #pragma once
25 
26 #include <nvtypes.h>
27 
28 //
29 // This file was generated with FINN, an NVIDIA coding tool.
30 // Source file:      ctrl/ctrlc36f.finn
31 //
32 
33 
34 
35 
36 /* VOLTA_CHANNEL_GPFIFO_A control commands and parameters */
37 
38 #include "ctrl/ctrlxxxx.h"
39 #include "ctrl/ctrl906f.h"          /* C36F is partially derived from 906F */
40 #include "ctrl/ctrla06f.h"          /* C36F is partially derived from a06F */
41 #define NVC36F_CTRL_CMD(cat,idx)  \
42     NVXXXX_CTRL_CMD(0xC36F, NVC36F_CTRL_##cat, idx)
43 
44 /* VOLTA_CHANNEL_GPFIFO_A command categories (6bits) */
45 #define NVC36F_CTRL_RESERVED (0x00)
46 #define NVC36F_CTRL_GPFIFO   (0x01)
47 #define NVC36F_CTRL_EVENT    (0x02)
48 
49 /*
50  * NVC36F_CTRL_CMD_NULL
51  *
52  * This command does nothing.
53  * This command does not take any parameters.
54  *
55  * Possible status values returned is: NV_OK
56 */
57 #define NVC36F_CTRL_CMD_NULL (0xc36f0000) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_RESERVED_INTERFACE_ID << 8) | 0x0" */
58 
59 
60 
61 
62 
63 
64 /*
65  * NVC36F_CTRL_GET_CLASS_ENGINEID
66  *
67  * Please see description of NV906F_CTRL_GET_CLASS_ENGINEID for more information.
68  *
69  */
70 #define NVC36F_CTRL_GET_CLASS_ENGINEID (0xc36f0101) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_GET_CLASS_ENGINEID_PARAMS_MESSAGE_ID" */
71 
72 #define NVC36F_CTRL_GET_CLASS_ENGINEID_PARAMS_MESSAGE_ID (0x1U)
73 
74 typedef NV906F_CTRL_GET_CLASS_ENGINEID_PARAMS NVC36F_CTRL_GET_CLASS_ENGINEID_PARAMS;
75 
76 /*
77  * NVC36F_CTRL_RESET_CHANNEL
78  *
79  * Please see description of NV906F_CTRL_CMD_RESET_CHANNEL for more information.
80  *
81  */
82 #define NVC36F_CTRL_CMD_RESET_CHANNEL (0xc36f0102) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_CMD_RESET_CHANNEL_PARAMS_MESSAGE_ID" */
83 
84 #define NVC36F_CTRL_CMD_RESET_CHANNEL_PARAMS_MESSAGE_ID (0x2U)
85 
86 typedef NV906F_CTRL_CMD_RESET_CHANNEL_PARAMS NVC36F_CTRL_CMD_RESET_CHANNEL_PARAMS;
87 
88 /*
89  * NVC36F_CTRL_CMD_GPFIFO_SCHEDULE
90  *
91  * Please see description of NVA06F_CTRL_CMD_GPFIFO_SCHEDULE for more information.
92  *
93  */
94 #define NVC36F_CTRL_CMD_GPFIFO_SCHEDULE (0xc36f0103) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_GPFIFO_SCHEDULE_PARAMS_MESSAGE_ID" */
95 
96 #define NVC36F_CTRL_GPFIFO_SCHEDULE_PARAMS_MESSAGE_ID (0x3U)
97 
98 typedef NVA06F_CTRL_GPFIFO_SCHEDULE_PARAMS NVC36F_CTRL_GPFIFO_SCHEDULE_PARAMS;
99 
100 /*
101  * NVC36F_CTRL_CMD_BIND
102  *
103  * Please see description of NVA06F_CTRL_CMD_BIND for more information.
104  */
105 #define NVC36F_CTRL_CMD_BIND (0xc36f0104) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_BIND_PARAMS_MESSAGE_ID" */
106 
107 #define NVC36F_CTRL_BIND_PARAMS_MESSAGE_ID (0x4U)
108 
109 typedef NVA06F_CTRL_BIND_PARAMS NVC36F_CTRL_BIND_PARAMS;
110 
111 /*
112  * NVC36F_CTRL_CMD_EVENT_SET_NOTIFICATION
113  *
114  * Please see description of NVA06F_CTRL_CMD_EVENT_SET_NOTIFICATION for more information.
115 */
116 #define NVC36F_CTRL_CMD_EVENT_SET_NOTIFICATION (0xc36f0205) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_EVENT_INTERFACE_ID << 8) | 0x5" */
117 
118 typedef NVA06F_CTRL_EVENT_SET_NOTIFICATION_PARAMS NVC36F_CTRL_EVENT_SET_NOTIFICATION_PARAMS;
119 
120 /* valid action values */
121 #define NVC36F_CTRL_EVENT_SET_NOTIFICATION_ACTION_DISABLE NVA06F_CTRL_EVENT_SET_NOTIFICATION_ACTION_DISABLE
122 #define NVC36F_CTRL_EVENT_SET_NOTIFICATION_ACTION_SINGLE  NVA06F_CTRL_EVENT_SET_NOTIFICATION_ACTION_SINGLE
123 #define NVC36F_CTRL_EVENT_SET_NOTIFICATION_ACTION_REPEAT  NVA06F_CTRL_EVENT_SET_NOTIFICATION_ACTION_REPEAT
124 
125 /*
126  * NVC36F_CTRL_CMD_EVENT_SET_TRIGGER
127  *
128  * Please see description of NVA06F_CTRL_CMD_EVENT_SET_TRIGGER for more information.
129  */
130 #define NVC36F_CTRL_CMD_EVENT_SET_TRIGGER                 (0xc36f0206) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_EVENT_INTERFACE_ID << 8) | 0x6" */
131 
132 
133 
134 
135 
136 /*
137  * NVC36F_CTRL_CMD_GET_MMU_FAULT_INFO
138  *
139  * Please see description of NV906F_CTRL_CMD_GET_MMU_FAULT_INFO for more information.
140  *
141  */
142 #define NVC36F_CTRL_CMD_GET_MMU_FAULT_INFO (0xc36f0107) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_GET_MMU_FAULT_INFO_PARAMS_MESSAGE_ID" */
143 
144 #define NVC36F_CTRL_GET_MMU_FAULT_INFO_PARAMS_MESSAGE_ID (0x7U)
145 
146 typedef NV906F_CTRL_GET_MMU_FAULT_INFO_PARAMS NVC36F_CTRL_GET_MMU_FAULT_INFO_PARAMS;
147 
148 /*
149  * NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN
150  *
151  *    This command returns an opaque work submit token to the caller which
152  *    can be used to write to doorbell register to finish submitting work. If
153  *    the client has provided an error context handle during channel allocation,
154  *    and the error context is large enough to write the doorbell token, a
155  *    notification at index NV_CHANNELGPFIFO_NOTIFICATION_TYPE_WORK_SUBMIT_TOKEN
156  *    will be sent with the work submit token value. This index may be modified
157  *    by NVC36F_CTRL_CMD_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX.
158  *
159  *    workSubmitToken       The 32-bit work submit token
160  *
161  *    Possible status values returned are:
162  *     NV_OK
163  *     NV_ERR_INVALID_OBJECT_HANDLE
164  *     NV_ERR_INVALID_ARGUMENT
165  *
166  */
167 
168 #define NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN (0xc36f0108) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN_PARAMS_MESSAGE_ID" */
169 
170 #define NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN_PARAMS_MESSAGE_ID (0x8U)
171 
172 typedef struct NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN_PARAMS {
173     NvU32 workSubmitToken;
174 } NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN_PARAMS;
175 
176 /**
177  * NVC36F_CTRL_CMD_GPFIFO_UPDATE_FAULT_METHOD_BUFFER
178  *
179  *    This command updates the HOST CE Fault method buffer
180  *    data structure of Virtual channel created for SR-IOV guest. It will also
181  *    update the fault method buffer address in the instance block of the channel
182  *
183  *    bar2Addr[]
184  *           Array contains the Virtual BAR2 address mapped by the Guest during channel
185  *           creation.
186  *    Possible status values returned are:
187  *     NV_OK
188  *     NV_ERR_INVALID_INSUFFICIENT_RESOURCES
189  *
190  */
191 #define NVC36F_CTRL_CMD_GPFIFO_FAULT_METHOD_BUFFER_MAX_RUNQUEUES 0x2
192 #define NVC36F_CTRL_CMD_GPFIFO_UPDATE_FAULT_METHOD_BUFFER        (0xc36f0109) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_GPFIFO_UPDATE_FAULT_METHOD_BUFFER_PARAMS_MESSAGE_ID" */
193 
194 #define NVC36F_CTRL_GPFIFO_UPDATE_FAULT_METHOD_BUFFER_PARAMS_MESSAGE_ID (0x9U)
195 
196 typedef struct NVC36F_CTRL_GPFIFO_UPDATE_FAULT_METHOD_BUFFER_PARAMS {
197     NV_DECLARE_ALIGNED(NvU64 bar2Addr[NVC36F_CTRL_CMD_GPFIFO_FAULT_METHOD_BUFFER_MAX_RUNQUEUES], 8);
198 } NVC36F_CTRL_GPFIFO_UPDATE_FAULT_METHOD_BUFFER_PARAMS;
199 
200 /*
201  * NVC36F_CTRL_CMD_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX
202  *
203  *    This command updates the notifier index within the error context notifier
204  *    to write the doorbell token to. This interface cannot be used to cause the
205  *    token to overwrite the RC notification slot. The notification slot
206  *    referred to by the passed index must be within the bounds of the error
207  *    context notifier object. In the case that multiple channels share the same
208  *    error context, it is not illegal for the client to set the same index for
209  *    multiple channels (however it is not recommended).
210  *
211  *    [IN] index
212  *      Notification slot to write the doorbell token. The initial value of this
213  *      index is NV_CHANNELGPFIFO_NOTIFICATION_TYPE_WORK_SUBMIT_TOKEN.
214  *
215  *    Possible status values returned are:
216  *     NV_OK
217  *     NV_ERR_INVALID_OBJECT_HANDLE
218  *     NV_ERR_INVALID_ARGUMENT
219  */
220 
221 #define NVC36F_CTRL_CMD_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX (0xc36f010a) /* finn: Evaluated from "(FINN_VOLTA_CHANNEL_GPFIFO_A_GPFIFO_INTERFACE_ID << 8) | NVC36F_CTRL_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX_PARAMS_MESSAGE_ID" */
222 
223 #define NVC36F_CTRL_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX_PARAMS_MESSAGE_ID (0xAU)
224 
225 typedef struct NVC36F_CTRL_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX_PARAMS {
226     NvU32 index;
227 } NVC36F_CTRL_GPFIFO_SET_WORK_SUBMIT_TOKEN_NOTIF_INDEX_PARAMS;
228 
229 /* _ctrlc36f.h_ */
230 
231