1 /*
2  * Copyright (c) 1993-2023, 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 NVERROR_H
24 #define NVERROR_H
25 /******************************************************************************
26 *
27 *   File:  nverror.h
28 *
29 *   Description:
30 *       This file contains the error codes set when the error notifier
31 *   is signaled.
32 *
33 ******************************************************************************/
34 
35 #include "nvcfg_sdk.h"
36 
37 #define ROBUST_CHANNEL_GR_EXCEPTION                     (13)
38 #define ROBUST_CHANNEL_GR_ERROR_SW_NOTIFY               (13)
39 #define ROBUST_CHANNEL_FAKE_ERROR                       (14)
40 #define ROBUST_CHANNEL_VBLANK_CALLBACK_TIMEOUT          (16)
41 #define ROBUST_CHANNEL_DISP_MISSED_NOTIFIER             (19)
42 #define ROBUST_CHANNEL_MPEG_ERROR_SW_METHOD             (20)
43 #define ROBUST_CHANNEL_ME_ERROR_SW_METHOD               (21)
44 #define ROBUST_CHANNEL_VP_ERROR_SW_METHOD               (22)
45 #define ROBUST_CHANNEL_RC_LOGGING_ENABLED               (23)
46 #define ROBUST_CHANNEL_VP_ERROR                         (27)
47 #define ROBUST_CHANNEL_VP2_ERROR                        (28)
48 #define ROBUST_CHANNEL_BSP_ERROR                        (29)
49 #define ROBUST_CHANNEL_BAD_ADDR_ACCESS                  (30)
50 #define ROBUST_CHANNEL_FIFO_ERROR_MMU_ERR_FLT           (31)
51 #define ROBUST_CHANNEL_PBDMA_ERROR                      (32)
52 #define ROBUST_CHANNEL_SEC_ERROR                        (33)
53 #define ROBUST_CHANNEL_MSVLD_ERROR                      (34)
54 #define ROBUST_CHANNEL_MSPDEC_ERROR                     (35)
55 #define ROBUST_CHANNEL_MSPPP_ERROR                      (36)
56 #define ROBUST_CHANNEL_CE0_ERROR                        (39)
57 #define ROBUST_CHANNEL_CE1_ERROR                        (40)
58 #define ROBUST_CHANNEL_CE2_ERROR                        (41)
59 #define ROBUST_CHANNEL_VIC_ERROR                        (42)
60 #define ROBUST_CHANNEL_RESETCHANNEL_VERIF_ERROR         (43)
61 #define ROBUST_CHANNEL_GR_FAULT_DURING_CTXSW            (44)
62 #define ROBUST_CHANNEL_PREEMPTIVE_REMOVAL               (45)
63 #define ROBUST_CHANNEL_NVENC0_ERROR                     (47)
64 #define ROBUST_CHANNEL_GPU_ECC_DBE                      (48)
65 #define PMU_ERROR                                       (59)
66 #define ROBUST_CHANNEL_SEC2_ERROR                       (60)
67 #define PMU_BREAKPOINT                                  (61)
68 #define PMU_HALT_ERROR                                  (62)
69 #define INFOROM_PAGE_RETIREMENT_EVENT                   (63)
70 #define INFOROM_PAGE_RETIREMENT_FAILURE                 (64)
71 #define INFOROM_DRAM_RETIREMENT_EVENT                   (63)
72 #define INFOROM_DRAM_RETIREMENT_FAILURE                 (64)
73 #define ROBUST_CHANNEL_NVENC1_ERROR                     (65)
74 #define ROBUST_CHANNEL_NVDEC0_ERROR                     (68)
75 #define ROBUST_CHANNEL_GR_CLASS_ERROR                   (69)
76 #define ROBUST_CHANNEL_CE3_ERROR                        (70)
77 #define ROBUST_CHANNEL_CE4_ERROR                        (71)
78 #define ROBUST_CHANNEL_CE5_ERROR                        (72)
79 #define ROBUST_CHANNEL_NVENC2_ERROR                     (73)
80 #define NVLINK_ERROR                                    (74)
81 #define ROBUST_CHANNEL_CE6_ERROR                        (75)
82 #define ROBUST_CHANNEL_CE7_ERROR                        (76)
83 #define ROBUST_CHANNEL_CE8_ERROR                        (77)
84 #define VGPU_START_ERROR                                (78)
85 #define ROBUST_CHANNEL_GPU_HAS_FALLEN_OFF_THE_BUS       (79)
86 #define PBDMA_PUSHBUFFER_CRC_MISMATCH                   (80)
87 #define ROBUST_CHANNEL_VGA_SUBSYSTEM_ERROR              (81)
88 #define ROBUST_CHANNEL_NVJPG0_ERROR                     (82)
89 #define ROBUST_CHANNEL_NVDEC1_ERROR                     (83)
90 #define ROBUST_CHANNEL_NVDEC2_ERROR                     (84)
91 #define ROBUST_CHANNEL_CE9_ERROR                        (85)
92 #define ROBUST_CHANNEL_OFA0_ERROR                       (86)
93 #define NVTELEMETRY_DRIVER_REPORT                       (87)
94 #define ROBUST_CHANNEL_NVDEC3_ERROR                     (88)
95 #define ROBUST_CHANNEL_NVDEC4_ERROR                     (89)
96 #define LTC_ERROR                                       (90)
97 #define RESERVED_XID                                    (91)
98 #define EXCESSIVE_SBE_INTERRUPTS                        (92)
99 #define INFOROM_ERASE_LIMIT_EXCEEDED                    (93)
100 #define ROBUST_CHANNEL_CONTAINED_ERROR                  (94)
101 #define ROBUST_CHANNEL_UNCONTAINED_ERROR                (95)
102 #define ROBUST_CHANNEL_NVDEC5_ERROR                     (96)
103 #define ROBUST_CHANNEL_NVDEC6_ERROR                     (97)
104 #define ROBUST_CHANNEL_NVDEC7_ERROR                     (98)
105 #define ROBUST_CHANNEL_NVJPG1_ERROR                     (99)
106 #define ROBUST_CHANNEL_NVJPG2_ERROR                     (100)
107 #define ROBUST_CHANNEL_NVJPG3_ERROR                     (101)
108 #define ROBUST_CHANNEL_NVJPG4_ERROR                     (102)
109 #define ROBUST_CHANNEL_NVJPG5_ERROR                     (103)
110 #define ROBUST_CHANNEL_NVJPG6_ERROR                     (104)
111 #define ROBUST_CHANNEL_NVJPG7_ERROR                     (105)
112 #define SEC_FAULT_ERROR                                 (110)
113 #define GSP_RPC_TIMEOUT                                 (119)
114 #define GSP_ERROR                                       (120)
115 #define C2C_ERROR                                       (121)
116 #define SPI_PMU_RPC_READ_FAIL                           (122)
117 #define SPI_PMU_RPC_WRITE_FAIL                          (123)
118 #define SPI_PMU_RPC_ERASE_FAIL                          (124)
119 #define INFOROM_FS_ERROR                                (125)
120 #define ALI_TRAINING_FAIL                               (136)
121 #define NVLINK_FLA_PRIV_ERR                             (137)
122 #define ROBUST_CHANNEL_DLA_ERROR                        (138)
123 #define ROBUST_CHANNEL_LAST_ERROR                       (ROBUST_CHANNEL_DLA_ERROR)
124 
125 
126 // Indexed CE reference
127 #define ROBUST_CHANNEL_CE_ERROR(x)                                        \
128     ((x < 3) ?                                                            \
129         (ROBUST_CHANNEL_CE0_ERROR + (x)) :                                \
130      ((x < 6) ?                                                           \
131         (ROBUST_CHANNEL_CE3_ERROR + (x - 3)) :                            \
132      ((x < 9) ?                                                           \
133         (ROBUST_CHANNEL_CE6_ERROR + (x - 6)) :                            \
134         (ROBUST_CHANNEL_CE9_ERROR))))
135 
136 #define ROBUST_CHANNEL_IS_CE_ERROR(x)                                        \
137     ((x == ROBUST_CHANNEL_CE0_ERROR) || (x == ROBUST_CHANNEL_CE1_ERROR) ||   \
138      (x == ROBUST_CHANNEL_CE2_ERROR) || (x == ROBUST_CHANNEL_CE3_ERROR) ||   \
139      (x == ROBUST_CHANNEL_CE4_ERROR) || (x == ROBUST_CHANNEL_CE5_ERROR) ||   \
140      (x == ROBUST_CHANNEL_CE6_ERROR) || (x == ROBUST_CHANNEL_CE7_ERROR) ||   \
141      (x == ROBUST_CHANNEL_CE8_ERROR) || (x == ROBUST_CHANNEL_CE9_ERROR))
142 
143 #define ROBUST_CHANNEL_CE_ERROR_IDX(x)                                       \
144     (((x >= ROBUST_CHANNEL_CE0_ERROR) && (x <= ROBUST_CHANNEL_CE2_ERROR)) ?  \
145          (x - ROBUST_CHANNEL_CE0_ERROR) :                                    \
146      (((x >= ROBUST_CHANNEL_CE3_ERROR) && (x <= ROBUST_CHANNEL_CE5_ERROR)) ? \
147          (x - ROBUST_CHANNEL_CE3_ERROR + 3) :                                \
148      (((x >= ROBUST_CHANNEL_CE6_ERROR) && (x <= ROBUST_CHANNEL_CE8_ERROR)) ? \
149          (x - ROBUST_CHANNEL_CE6_ERROR + 6) :                                \
150          (x - ROBUST_CHANNEL_CE9_ERROR + 9))))
151 
152 // Indexed NVDEC reference
153 #define ROBUST_CHANNEL_NVDEC_ERROR(x)                   \
154     ((x < 1) ?                                          \
155         (ROBUST_CHANNEL_NVDEC0_ERROR) :                 \
156       ((x < 3) ?                                        \
157         (ROBUST_CHANNEL_NVDEC1_ERROR + (x - 1)) :       \
158       ((x < 5) ?                                        \
159         (ROBUST_CHANNEL_NVDEC3_ERROR + (x - 3)):        \
160         (ROBUST_CHANNEL_NVDEC5_ERROR + (x - 5)))))
161 
162 #define ROBUST_CHANNEL_IS_NVDEC_ERROR(x)   \
163     ((x == ROBUST_CHANNEL_NVDEC0_ERROR) || \
164      (x == ROBUST_CHANNEL_NVDEC1_ERROR) || \
165      (x == ROBUST_CHANNEL_NVDEC2_ERROR) || \
166      (x == ROBUST_CHANNEL_NVDEC3_ERROR) || \
167      (x == ROBUST_CHANNEL_NVDEC4_ERROR) || \
168      (x == ROBUST_CHANNEL_NVDEC5_ERROR) || \
169      (x == ROBUST_CHANNEL_NVDEC6_ERROR) || \
170      (x == ROBUST_CHANNEL_NVDEC7_ERROR))
171 
172 #define ROBUST_CHANNEL_NVDEC_ERROR_IDX(x)                                           \
173     ((x == ROBUST_CHANNEL_NVDEC0_ERROR) ?                                           \
174          (x - ROBUST_CHANNEL_NVDEC0_ERROR) :                                        \
175      (((x >= ROBUST_CHANNEL_NVDEC1_ERROR) && (x <= ROBUST_CHANNEL_NVDEC2_ERROR)) ?  \
176          (x - ROBUST_CHANNEL_NVDEC1_ERROR + 1) :                                    \
177      (((x >= ROBUST_CHANNEL_NVDEC3_ERROR) && (x <= ROBUST_CHANNEL_NVDEC4_ERROR)) ?  \
178          (x - ROBUST_CHANNEL_NVDEC3_ERROR + 3) :                                    \
179          (x - ROBUST_CHANNEL_NVDEC5_ERROR + 5))))
180 
181 // Indexed NVENC reference
182 #define ROBUST_CHANNEL_NVENC_ERROR(x)                       \
183     ((x == 0) ? (ROBUST_CHANNEL_NVENC0_ERROR) :             \
184                 ((x == 1) ? (ROBUST_CHANNEL_NVENC1_ERROR) : \
185                             (ROBUST_CHANNEL_NVENC2_ERROR)))
186 
187 #define ROBUST_CHANNEL_IS_NVENC_ERROR(x)   \
188     ((x == ROBUST_CHANNEL_NVENC0_ERROR) || \
189      (x == ROBUST_CHANNEL_NVENC1_ERROR) || \
190      (x == ROBUST_CHANNEL_NVENC2_ERROR))
191 
192 #define ROBUST_CHANNEL_NVENC_ERROR_IDX(x)             \
193     (((x == ROBUST_CHANNEL_NVENC0_ERROR)) ?           \
194          (x - ROBUST_CHANNEL_NVENC0_ERROR) :          \
195          (((x == ROBUST_CHANNEL_NVENC1_ERROR)) ?      \
196               (x - ROBUST_CHANNEL_NVENC1_ERROR + 1) : \
197               (x - ROBUST_CHANNEL_NVENC2_ERROR + 2)))
198 
199 // Indexed NVJPG reference
200 #define ROBUST_CHANNEL_NVJPG_ERROR(x)                   \
201     ((x < 1) ?                                          \
202         (ROBUST_CHANNEL_NVJPG0_ERROR) :                 \
203         (ROBUST_CHANNEL_NVJPG1_ERROR + (x - 1)))
204 
205 #define ROBUST_CHANNEL_IS_NVJPG_ERROR(x)                \
206     ((x == ROBUST_CHANNEL_NVJPG0_ERROR) ||              \
207      (x == ROBUST_CHANNEL_NVJPG1_ERROR) ||              \
208      (x == ROBUST_CHANNEL_NVJPG2_ERROR) ||              \
209      (x == ROBUST_CHANNEL_NVJPG3_ERROR) ||              \
210      (x == ROBUST_CHANNEL_NVJPG4_ERROR) ||              \
211      (x == ROBUST_CHANNEL_NVJPG5_ERROR) ||              \
212      (x == ROBUST_CHANNEL_NVJPG6_ERROR) ||              \
213      (x == ROBUST_CHANNEL_NVJPG7_ERROR))
214 
215 #define ROBUST_CHANNEL_NVJPG_ERROR_IDX(x)               \
216     ((x == ROBUST_CHANNEL_NVJPG0_ERROR) ?               \
217          (x - ROBUST_CHANNEL_NVJPG0_ERROR) :            \
218          (x - ROBUST_CHANNEL_NVJPG1_ERROR + 1))
219 
220 // Error Levels
221 #define ROBUST_CHANNEL_ERROR_RECOVERY_LEVEL_INFO      (0)
222 #define ROBUST_CHANNEL_ERROR_RECOVERY_LEVEL_NON_FATAL (1)
223 #define ROBUST_CHANNEL_ERROR_RECOVERY_LEVEL_FATAL     (2)
224 
225 #endif  // NVERROR_H
226