xref: /aosp_15_r20/external/mesa3d/src/nouveau/headers/nvidia/classes/cl366e.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
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 _cl366e_h_
24 #define _cl366e_h_
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include "nvtypes.h"
31 
32 /* class NV36_CHANNEL_DMA */
33 #define  NV36_CHANNEL_DMA                                          (0x0000366E)
34 /* NvNotification[] fields and values */
35 #define NV366E_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT              (0x2000)
36 #define NV366E_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT          (0x4000)
37 /* pio method data structure */
38 typedef volatile struct _cl366e_tag0 {
39  NvV32 Reserved00[0x7c0];
40 } Nv366eTypedef, Nv36ChannelDma;
41 #define NV366E_TYPEDEF                                           Nv36ChannelDma
42 /* pio flow control data structure */
43 typedef volatile struct _cl366e_tag1 {
44  NvV32 Ignored00[0x010];
45  NvU32 Put;                     /* put offset, write only           0040-0043*/
46  NvU32 Get;                     /* get offset, read only            0044-0047*/
47  NvU32 Reference;               /* reference value, read only       0048-004b*/
48  NvU32 Ignored01[0x1];
49  NvU32 SetReference;            /* set reference value              0050-0053*/
50  NvU32 Ignored02[0x3];
51  NvU32 SetContextDmaSemaphore;  /* set sema ctxdma, write only      0060-0063*/
52  NvU32 SetSemaphoreOffset;      /* set sema offset, write only      0064-0067*/
53  NvU32 SetSemaphoreAcquire;     /* set sema acquire, write only     0068-006b*/
54  NvU32 SetSemaphoreRelease;     /* set sema release, write only     006c-006f*/
55  NvV32 Ignored03[0x3e4];
56 } Nv366eControl, Nv36ControlDma;
57 /* fields and values */
58 #define NV366E_NUMBER_OF_SUBCHANNELS                               (8)
59 #define NV366E_SET_OBJECT                                          (0x00000000)
60 #define NV366E_SET_REFERENCE                                       (0x00000050)
61 #define NV366E_SET_CONTEXT_DMA_SEMAPHORE                           (0x00000060)
62 #define NV366E_SEMAPHORE_OFFSET                                    (0x00000064)
63 #define NV366E_SEMAPHORE_ACQUIRE                                   (0x00000068)
64 #define NV366E_SEMAPHORE_RELEASE                                   (0x0000006c)
65 
66 /* dma method descriptor format */
67 #define NV366E_DMA_METHOD_ADDRESS                                  12:2
68 #define NV366E_DMA_METHOD_SUBCHANNEL                               15:13
69 #define NV366E_DMA_METHOD_COUNT                                    28:18
70 
71 /* dma opcode format */
72 #define NV366E_DMA_OPCODE                                          31:29
73 #define NV366E_DMA_OPCODE_METHOD                                   (0x00000000)
74 #define NV366E_DMA_OPCODE_NONINC_METHOD                            (0x00000002)
75 /* dma jump format */
76 #define NV366E_DMA_OPCODE_JUMP                                     (0x00000001)
77 #define NV366E_DMA_JUMP_OFFSET                                     28:2
78 
79 /* dma opcode2 format */
80 #define NV366E_DMA_OPCODE2                                         1:0
81 #define NV366E_DMA_OPCODE2_NONE                                    (0x00000000)
82 /* dma jump_long format */
83 #define NV366E_DMA_OPCODE2_JUMP_LONG                               (0x00000001)
84 #define NV366E_DMA_JUMP_LONG_OFFSET                                31:2
85 /* dma call format */
86 #define NV366E_DMA_OPCODE2_CALL                                    (0x00000002)
87 #define NV366E_DMA_CALL_OFFSET                                     31:2
88 
89 /* dma opcode3 format */
90 #define NV366E_DMA_OPCODE3                                         17:16
91 #define NV366E_DMA_OPCODE3_NONE                                    (0x00000000)
92 /* dma return format */
93 #define NV366E_DMA_RETURN                                          (0x00020000)
94 #define NV366E_DMA_OPCODE3_RETURN                                  (0x00000002)
95 
96 /* dma data format */
97 #define NV366E_DMA_DATA                                            31:0
98 
99 /* dma nop format */
100 #define NV366E_DMA_NOP                                             (0x00000000)
101 
102 /* dma set subdevice mask format */
103 #define NV366E_DMA_SET_SUBDEVICE_MASK                              (0x00010000)
104 #define NV366E_DMA_SET_SUBDEVICE_MASK_VALUE                        15:4
105 #define NV366E_DMA_OPCODE3_SET_SUBDEVICE_MASK                      (0x00000001)
106 
107 #ifdef __cplusplus
108 };     /* extern "C" */
109 #endif
110 
111 #endif /* _cl366e_h_ */
112