summaryrefslogtreecommitdiff
path: root/manuals/volta/gv100/dev_usermode.ref.txt
blob: b0a00c97e4ba54b0a377008679d248222424f7a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------

CONTENTS

    Introduction

    Identification and Capabilities Registers

    PTIMER Current Time Registers

    Channel Work Submission Registers

    Key

INTRODUCTION
===============================================================================



     This manual describes the USERMODE device.  USERMODE is a mappable range of
registers for use by usermode drivers.  The range is 64KB aligned and 64KB in
size to match the maximum page size of systems supported by NVIDIA hardware.

     Note that accesses to undefined registers in this device range do not cause
PRI_TIMEOUT interrupts to be raised.  This is different from other PRI devices.
Writes to undefined registers are silently thrown away.  Reads from undefined
registers return 0.

Mnemonic Description            Size    Interface
-------  -----------            ----    ---------
USERMODE Usermode region         64K    HOST

#define NV_USERMODE                           0x0081FFFF:0x00810000 /* RW--D */




IDENTIFICATION AND CAPABILITIES REGISTERS
===============================================================================

     The first 128 bytes of the NV_USERMODE device are reserved for up to 32
configuration and capabilities registers.


CFG0 - Config register 0: Class ID for the NV_USERMODE class

     The USERMODE_CLASS_ID field of the CFG0 register contains the class ID for
the class corresponding to the NV_USERMODE device.  In gv100, this is the class
volta_usermode_a.


#define  NV_USERMODE_CFG0                                 0x00810000 /* R--4R */
#define  NV_USERMODE_CFG0_USERMODE_CLASS_ID                     15:0 /* R-IUF */
#define  NV_USERMODE_CFG0_USERMODE_CLASS_ID_VALUE             50017 /* R-I-V */

// Note: addresses up to 0x810080 are reserved for CGF and capabilities registers


PTIMER CURRENT TIME REGISTERS
===============================================================================

     The TIME registers contain the current time as kept by the PTIMER; see
dev_timer.ref.  The current time is expressed in elapsed nanoseconds since the
UNIX epoch, 00:00 GMT, January 1, 1970 (zero hour).  It generally has a
resolution of 32 nanoseconds.

     Note: To query the current time, read TIME_1, then TIME_0, and then TIME_1
again.  If the two readings of TIME_1 do not match, repeat the procedure.  This
avoids incorrectly retrieving an incorrect time referring to a point up to 4
seconds in the future: if one were to simply read TIME_0 and then TIME_1, TIME_0
may overflow between the two reads.

     TIME_0 contains the low 32 bits of the timer. The least significant 5 bits
are always zero.  The NSEC field contains the low order bits in 32ns
granularity.

     TIME_1 contains the high order bits.  The NSEC field contains the upper 29
bits of the timer.


TIME_0 Register - Timer Low Bits


#define NV_USERMODE_TIME_0                                0x00810080 /* R--4R */
#define NV_USERMODE_TIME_0_NSEC                                 31:5 /* R-XUF */


TIME_1 Register - Timer High Bits


#define NV_USERMODE_TIME_1                                0x00810084 /* R--4R */
#define NV_USERMODE_TIME_1_NSEC                                 28:0 /* R-XUF */

// Note: addresses 0x810088 and 0x81008c are reserved for future TIME registers



CHANNEL WORK SUBMISSION REGISTERS
===============================================================================

NOTIFY_CHANNEL_PENDING - Notify Host that a channel has new work available

     Writing a channel ID to the ID field of NOTIFY_CHANNEL_PENDING tells Host
that new work is available to run on that channel.  This causes the PENDING
status to be set in the NV_PCCSR_CHANNEL_STATUS field for that channel and
behaves identically to writing NV_PCCSR_CHANNEL_FORCE_PENDING, but is accessible
to usermode drivers.  Setting pending will cause Host to schedule the channel
the next time it comes up in the runlist.  Once the channel is scheduled, the
PBDMA will read GP_PUT from USERD to determine whether work is actually
available for the channel.

     Submitting new work to a channel involves these steps:

     1. Write methods to the pushbuffer space
     2. Construct a new gp_fifo entry pointing to that pushbuffer space
     3. Update GP_PUT in USERD to indicate the new gp_fifo entry is ready
     4. Write the channel's handle to NV_USERMODE_NOTIFY_CHANNEL_PENDING_ID

     Note that if the ID refers to a non-existent channel, the write will be
ignored.  Moreover, a write to an ID that exceeds the maximum supported channel
ID will have no effect (it will not overflow, causing some other channel to go
pending).

     Note that if the ID refers to a channel for which GP_PUT == GP_GET, Host will
still schedule the channel in order to determine the current status of its
GP_PUT, at which point it will discover there is no new work and move on to the
next channel.


#define  NV_USERMODE_NOTIFY_CHANNEL_PENDING               0x00810090 /* -W-4R */
#define  NV_USERMODE_NOTIFY_CHANNEL_PENDING_ID                  31:0 /* -W-UF */



KEY
===============================================================================

--------------------------------------------------------------------------------
                         KEY LEGEND
--------------------------------------------------------------------------------

Each define in the .ref file has a 5 field code to say what kind of define it is: i.e. /* RW--R */
The following legend shows accepted values for each of the 5 fields:
  Read, Write, Internal State, Declaration/Size, and Define Indicator.

  Read
    ' ' = Other Information
    '-' = Field is part of a write-only register
    'C' = Value read is always the same, constant value line follows (C)
    'R' = Value is read


  Write
    ' ' = Other Information
    '-' = Must not be written (D), value ignored when written (R,A,F)
    'W' = Can be written


  Internal State
    ' ' = Other Information
    '-' = No internal state
    'X' = Internal state, initial value is unknown
    'I' = Internal state, initial value is known and follows (I), see "Reset Signal" section for signal.
    'E' = Internal state, initial value is known and follows (E), see "Reset Signal" section for signal.
    'B' = Internal state, initial value is known and follows (B), see "Reset Signal" section for signal.
    'C' = Internal state, initial value is known and follows (C), see "Reset Signal" section for signal.

    'V' = (legacy) Internal state, initialize at volatile reset
    'D' = (legacy) Internal state, default initial value at object creation (legacy: Only used in dev_ram.ref)
    'C' = (legacy) Internal state, initial value at object creation
    'C' = (legacy) Internal state, class-based initial value at object creation (legacy: Only used in dev_ram.ref)


  Declaration/Size
    ' ' = Other Information
    '-' = Does Not Apply
    'V' = Type is void
    'U' = Type is unsigned integer
    'S' = Type is signed integer
    'F' = Type is IEEE floating point
    '1' = Byte size (008)
    '2' = Short size (016)
    '3' = Three byte size (024)
    '4' = Word size (032)
    '8' = Double size (064)


  Define Indicator
    ' ' = Other Information
    'C' = Clear value
    'D' = Device
    'L' = Logical device.
    'M' = Memory
    'R' = Register
    'A' = Array of Registers
    'F' = Field
    'V' = Value
    'T' = Task
    'P' = Phantom Register

    'B' = (legacy) Bundle address
    'G' = (legacy) General purpose configuration register
    'C' = (legacy) Class

  Reset signal defaults for graphics engine registers.
    All graphics engine registers use the following defaults for reset signals:
     'E' = initialized with engine_reset_
     'I' = initialized with context_reset_
     'B' = initialized with reset_IB_dly_

  Reset signal
    For units that differ from the graphics engine defaults, the reset signals should be defined here: