1 /******************************************************************************
2 * Copyright (c) 2002 - 2020 Xilinx, Inc.  All rights reserved.
3 * SPDX-License-Identifier: MIT
4 ******************************************************************************/
5 
6 /*****************************************************************************/
7 /**
8 *
9 * @file xstatus.h
10 *
11 * @addtogroup common_status_codes Xilinx® software status codes
12 *
13 * The xstatus.h file contains the Xilinx® software status codes.These codes are
14 * used throughout the Xilinx device drivers.
15 *
16 * @{
17 ******************************************************************************/
18 
19 #ifndef XSTATUS_H        /* prevent circular inclusions */
20 #define XSTATUS_H        /* by using protection macros */
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /***************************** Include Files *********************************/
27 
28 #include "xil_types.h"
29 #include "xil_assert.h"
30 
31 /************************** Constant Definitions *****************************/
32 
33 /*********************** Common statuses 0 - 500 *****************************/
34 /**
35 @name Common Status Codes for All Device Drivers
36 @{
37 */
38 #define XST_SUCCESS                     0L
39 #define XST_FAILURE                     1L
40 #define XST_DEVICE_NOT_FOUND            2L
41 #define XST_DEVICE_BLOCK_NOT_FOUND      3L
42 #define XST_INVALID_VERSION             4L
43 #define XST_DEVICE_IS_STARTED           5L
44 #define XST_DEVICE_IS_STOPPED           6L
45 #define XST_FIFO_ERROR                  7L    /*!< An error occurred during an
46                            operation with a FIFO such as
47                            an underrun or overrun, this
48                            error requires the device to
49                            be reset */
50 #define XST_RESET_ERROR                 8L    /*!< An error occurred which requires
51                            the device to be reset */
52 #define XST_DMA_ERROR                   9L    /*!< A DMA error occurred, this error
53                            typically requires the device
54                            using the DMA to be reset */
55 #define XST_NOT_POLLED                  10L    /*!< The device is not configured for
56                            polled mode operation */
57 #define XST_FIFO_NO_ROOM                11L    /*!< A FIFO did not have room to put
58                            the specified data into */
59 #define XST_BUFFER_TOO_SMALL            12L    /*!< The buffer is not large enough
60                            to hold the expected data */
61 #define XST_NO_DATA                     13L    /*!< There was no data available */
62 #define XST_REGISTER_ERROR              14L    /*!< A register did not contain the
63                            expected value */
64 #define XST_INVALID_PARAM               15L    /*!< An invalid parameter was passed
65                            into the function */
66 #define XST_NOT_SGDMA                   16L    /*!< The device is not configured for
67                            scatter-gather DMA operation */
68 #define XST_LOOPBACK_ERROR              17L    /*!< A loopback test failed */
69 #define XST_NO_CALLBACK                 18L    /*!< A callback has not yet been
70                            registered */
71 #define XST_NO_FEATURE                  19L    /*!< Device is not configured with
72                            the requested feature */
73 #define XST_NOT_INTERRUPT               20L    /*!< Device is not configured for
74                            interrupt mode operation */
75 #define XST_DEVICE_BUSY                 21L    /*!< Device is busy */
76 #define XST_ERROR_COUNT_MAX             22L    /*!< The error counters of a device
77                            have maxed out */
78 #define XST_IS_STARTED                  23L    /*!< Used when part of device is
79                            already started i.e.
80                            sub channel */
81 #define XST_IS_STOPPED                  24L    /*!< Used when part of device is
82                            already stopped i.e.
83                            sub channel */
84 #define XST_DATA_LOST                   26L    /*!< Driver defined error */
85 #define XST_RECV_ERROR                  27L    /*!< Generic receive error */
86 #define XST_SEND_ERROR                  28L    /*!< Generic transmit error */
87 #define XST_NOT_ENABLED                 29L    /*!< A requested service is not
88                            available because it has not
89                            been enabled */
90 #define XST_NO_ACCESS            30L    /* Generic access error */
91 #define XST_TIMEOUT                     31L    /*!< Event timeout occurred */
92 
93 /** @} */
94 /***************** Utility Component statuses 401 - 500  *********************/
95 /**
96 @name Utility Component Status Codes 401 - 500
97 @{
98 */
99 #define XST_MEMTEST_FAILED              401L    /*!< Memory test failed */
100 
101 /** @} */
102 /***************** Common Components statuses 501 - 1000 *********************/
103 /**
104 @name Packet Fifo Status Codes 501 - 510
105 @{
106 */
107 /********************* Packet Fifo statuses 501 - 510 ************************/
108 
109 #define XST_PFIFO_LACK_OF_DATA          501L    /*!< Not enough data in FIFO   */
110 #define XST_PFIFO_NO_ROOM               502L    /*!< Not enough room in FIFO   */
111 #define XST_PFIFO_BAD_REG_VALUE         503L    /*!< Self test, a register value
112                            was invalid after reset */
113 #define XST_PFIFO_ERROR                 504L    /*!< Generic packet FIFO error */
114 #define XST_PFIFO_DEADLOCK              505L    /*!< Packet FIFO is reporting
115                          * empty and full simultaneously
116                          */
117 /** @} */
118 /**
119 @name DMA Status Codes 511 - 530
120 @{
121 */
122 /************************** DMA statuses 511 - 530 ***************************/
123 
124 #define XST_DMA_TRANSFER_ERROR          511L    /*!< Self test, DMA transfer
125                            failed */
126 #define XST_DMA_RESET_REGISTER_ERROR    512L    /*!< Self test, a register value
127                            was invalid after reset */
128 #define XST_DMA_SG_LIST_EMPTY           513L    /*!< Scatter gather list contains
129                            no buffer descriptors ready
130                            to be processed */
131 #define XST_DMA_SG_IS_STARTED           514L    /*!< Scatter gather not stopped */
132 #define XST_DMA_SG_IS_STOPPED           515L    /*!< Scatter gather not running */
133 #define XST_DMA_SG_LIST_FULL            517L    /*!< All the buffer descriptors of
134                            the scatter gather list are
135                            being used */
136 #define XST_DMA_SG_BD_LOCKED            518L    /*!< The scatter gather buffer
137                            descriptor which is to be
138                            copied over in the scatter
139                            list is locked */
140 #define XST_DMA_SG_NOTHING_TO_COMMIT    519L    /*!< No buffer descriptors have been
141                            put into the scatter gather
142                            list to be committed */
143 #define XST_DMA_SG_COUNT_EXCEEDED       521L    /*!< The packet count threshold
144                            specified was larger than the
145                            total # of buffer descriptors
146                            in the scatter gather list */
147 #define XST_DMA_SG_LIST_EXISTS          522L    /*!< The scatter gather list has
148                            already been created */
149 #define XST_DMA_SG_NO_LIST              523L    /*!< No scatter gather list has
150                            been created */
151 #define XST_DMA_SG_BD_NOT_COMMITTED     524L    /*!< The buffer descriptor which was
152                            being started was not committed
153                            to the list */
154 #define XST_DMA_SG_NO_DATA              525L    /*!< The buffer descriptor to start
155                            has already been used by the
156                            hardware so it can't be reused
157                          */
158 #define XST_DMA_SG_LIST_ERROR           526L    /*!< General purpose list access
159                            error */
160 #define XST_DMA_BD_ERROR                527L    /*!< General buffer descriptor
161                            error */
162 /** @} */
163 /**
164 @name IPIF Status Codes Codes 531 - 550
165 @{
166 */
167 /************************** IPIF statuses 531 - 550 ***************************/
168 
169 #define XST_IPIF_REG_WIDTH_ERROR        531L    /*!< An invalid register width
170                            was passed into the function */
171 #define XST_IPIF_RESET_REGISTER_ERROR   532L    /*!< The value of a register at
172                            reset was not valid */
173 #define XST_IPIF_DEVICE_STATUS_ERROR    533L    /*!< A write to the device interrupt
174                            status register did not read
175                            back correctly */
176 #define XST_IPIF_DEVICE_ACK_ERROR       534L    /*!< The device interrupt status
177                            register did not reset when
178                            acked */
179 #define XST_IPIF_DEVICE_ENABLE_ERROR    535L    /*!< The device interrupt enable
180                            register was not updated when
181                            other registers changed */
182 #define XST_IPIF_IP_STATUS_ERROR        536L    /*!< A write to the IP interrupt
183                            status register did not read
184                            back correctly */
185 #define XST_IPIF_IP_ACK_ERROR           537L    /*!< The IP interrupt status register
186                            did not reset when acked */
187 #define XST_IPIF_IP_ENABLE_ERROR        538L    /*!< IP interrupt enable register was
188                            not updated correctly when other
189                            registers changed */
190 #define XST_IPIF_DEVICE_PENDING_ERROR   539L    /*!< The device interrupt pending
191                            register did not indicate the
192                            expected value */
193 #define XST_IPIF_DEVICE_ID_ERROR        540L    /*!< The device interrupt ID register
194                            did not indicate the expected
195                            value */
196 #define XST_IPIF_ERROR                  541L    /*!< Generic ipif error */
197 /** @} */
198 
199 /****************** Device specific statuses 1001 - 4095 *********************/
200 /**
201 @name Ethernet Status Codes 1001 - 1050
202 @{
203 */
204 /********************* Ethernet statuses 1001 - 1050 *************************/
205 
206 #define XST_EMAC_MEMORY_SIZE_ERROR  1001L    /*!< Memory space is not big enough
207                          * to hold the minimum number of
208                          * buffers or descriptors */
209 #define XST_EMAC_MEMORY_ALLOC_ERROR 1002L    /*!< Memory allocation failed */
210 #define XST_EMAC_MII_READ_ERROR     1003L    /*!< MII read error */
211 #define XST_EMAC_MII_BUSY           1004L    /*!< An MII operation is in progress */
212 #define XST_EMAC_OUT_OF_BUFFERS     1005L    /*!< Driver is out of buffers */
213 #define XST_EMAC_PARSE_ERROR        1006L    /*!< Invalid driver init string */
214 #define XST_EMAC_COLLISION_ERROR    1007L    /*!< Excess deferral or late
215                          * collision on polled send */
216 /** @} */
217 /**
218 @name UART Status Codes 1051 - 1075
219 @{
220 */
221 /*********************** UART statuses 1051 - 1075 ***************************/
222 #define XST_UART
223 
224 #define XST_UART_INIT_ERROR         1051L
225 #define XST_UART_START_ERROR        1052L
226 #define XST_UART_CONFIG_ERROR       1053L
227 #define XST_UART_TEST_FAIL          1054L
228 #define XST_UART_BAUD_ERROR         1055L
229 #define XST_UART_BAUD_RANGE         1056L
230 
231 /** @} */
232 /**
233 @name IIC Status Codes 1076 - 1100
234 @{
235 */
236 /************************ IIC statuses 1076 - 1100 ***************************/
237 
238 #define XST_IIC_SELFTEST_FAILED         1076    /*!< self test failed            */
239 #define XST_IIC_BUS_BUSY                1077    /*!< bus found busy              */
240 #define XST_IIC_GENERAL_CALL_ADDRESS    1078    /*!< mastersend attempted with   */
241                          /* general call address        */
242 #define XST_IIC_STAND_REG_RESET_ERROR   1079    /*!< A non parameterizable reg   */
243                          /* value after reset not valid */
244 #define XST_IIC_TX_FIFO_REG_RESET_ERROR 1080    /*!< Tx fifo included in design  */
245                          /* value after reset not valid */
246 #define XST_IIC_RX_FIFO_REG_RESET_ERROR 1081    /*!< Rx fifo included in design  */
247                          /* value after reset not valid */
248 #define XST_IIC_TBA_REG_RESET_ERROR     1082    /*!< 10 bit addr incl in design  */
249                          /* value after reset not valid */
250 #define XST_IIC_CR_READBACK_ERROR       1083    /*!< Read of the control register */
251                          /* didn't return value written */
252 #define XST_IIC_DTR_READBACK_ERROR      1084    /*!< Read of the data Tx reg     */
253                          /* didn't return value written */
254 #define XST_IIC_DRR_READBACK_ERROR      1085    /*!< Read of the data Receive reg */
255                          /* didn't return value written */
256 #define XST_IIC_ADR_READBACK_ERROR      1086    /*!< Read of the data Tx reg     */
257                          /* didn't return value written */
258 #define XST_IIC_TBA_READBACK_ERROR      1087    /*!< Read of the 10 bit addr reg */
259                          /* didn't return written value */
260 #define XST_IIC_NOT_SLAVE               1088    /*!< The device isn't a slave    */
261 #define XST_IIC_ARB_LOST                 1089     /*!< Arbitration lost for master    */
262 /** @} */
263 /**
264 @name ATMC Status Codes 1101 - 1125
265 @{
266 */
267 /*********************** ATMC statuses 1101 - 1125 ***************************/
268 
269 #define XST_ATMC_ERROR_COUNT_MAX    1101L    /*!< the error counters in the ATM
270                            controller hit the max value
271                            which requires the statistics
272                            to be cleared */
273 /** @} */
274 /**
275 @name Flash Status Codes 1126 - 1150
276 @{
277 */
278 /*********************** Flash statuses 1126 - 1150 **************************/
279 
280 #define XST_FLASH_BUSY                1126L    /*!< Flash is erasing or programming
281                          */
282 #define XST_FLASH_READY               1127L    /*!< Flash is ready for commands */
283 #define XST_FLASH_ERROR               1128L    /*!< Flash had detected an internal
284                            error. Use XFlash_DeviceControl
285                            to retrieve device specific codes
286                          */
287 #define XST_FLASH_ERASE_SUSPENDED     1129L    /*!< Flash is in suspended erase state
288                          */
289 #define XST_FLASH_WRITE_SUSPENDED     1130L    /*!< Flash is in suspended write state
290                          */
291 #define XST_FLASH_PART_NOT_SUPPORTED  1131L    /*!< Flash type not supported by
292                            driver */
293 #define XST_FLASH_NOT_SUPPORTED       1132L    /*!< Operation not supported */
294 #define XST_FLASH_TOO_MANY_REGIONS    1133L    /*!< Too many erase regions */
295 #define XST_FLASH_TIMEOUT_ERROR       1134L    /*!< Programming or erase operation
296                            aborted due to a timeout */
297 #define XST_FLASH_ADDRESS_ERROR       1135L    /*!< Accessed flash outside its
298                            addressible range */
299 #define XST_FLASH_ALIGNMENT_ERROR     1136L    /*!< Write alignment error */
300 #define XST_FLASH_BLOCKING_CALL_ERROR 1137L    /*!< Couldn't return immediately from
301                            write/erase function with
302                            XFL_NON_BLOCKING_WRITE/ERASE
303                            option cleared */
304 #define XST_FLASH_CFI_QUERY_ERROR     1138L    /*!< Failed to query the device */
305 /** @} */
306 /**
307 @name SPI Status Codes 1151 - 1175
308 @{
309 */
310 /*********************** SPI statuses 1151 - 1175 ****************************/
311 
312 #define XST_SPI_MODE_FAULT          1151    /*!< master was selected as slave */
313 #define XST_SPI_TRANSFER_DONE       1152    /*!< data transfer is complete */
314 #define XST_SPI_TRANSMIT_UNDERRUN   1153    /*!< slave underruns transmit register */
315 #define XST_SPI_RECEIVE_OVERRUN     1154    /*!< device overruns receive register */
316 #define XST_SPI_NO_SLAVE            1155    /*!< no slave has been selected yet */
317 #define XST_SPI_TOO_MANY_SLAVES     1156    /*!< more than one slave is being
318                          * selected */
319 #define XST_SPI_NOT_MASTER          1157    /*!< operation is valid only as master */
320 #define XST_SPI_SLAVE_ONLY          1158    /*!< device is configured as slave-only
321                          */
322 #define XST_SPI_SLAVE_MODE_FAULT    1159    /*!< slave was selected while disabled */
323 #define XST_SPI_SLAVE_MODE          1160    /*!< device has been addressed as slave */
324 #define XST_SPI_RECEIVE_NOT_EMPTY   1161    /*!< device received data in slave mode */
325 
326 #define XST_SPI_COMMAND_ERROR       1162    /*!< unrecognised command - qspi only */
327 #define XST_SPI_POLL_DONE           1163        /*!< controller completed polling the
328                            device for status */
329 /** @} */
330 /**
331 @name OPB Arbiter Status Codes 1176 - 1200
332 @{
333 */
334 /********************** OPB Arbiter statuses 1176 - 1200 *********************/
335 
336 #define XST_OPBARB_INVALID_PRIORITY  1176    /*!< the priority registers have either
337                          * one master assigned to two or more
338                          * priorities, or one master not
339                          * assigned to any priority
340                          */
341 #define XST_OPBARB_NOT_SUSPENDED     1177    /*!< an attempt was made to modify the
342                          * priority levels without first
343                          * suspending the use of priority
344                          * levels
345                          */
346 #define XST_OPBARB_PARK_NOT_ENABLED  1178    /*!< bus parking by id was enabled but
347                          * bus parking was not enabled
348                          */
349 #define XST_OPBARB_NOT_FIXED_PRIORITY 1179    /*!< the arbiter must be in fixed
350                          * priority mode to allow the
351                          * priorities to be changed
352                          */
353 /** @} */
354 /**
355 @name INTC Status Codes 1201 - 1225
356 @{
357 */
358 /************************ Intc statuses 1201 - 1225 **************************/
359 
360 #define XST_INTC_FAIL_SELFTEST      1201    /*!< self test failed */
361 #define XST_INTC_CONNECT_ERROR      1202    /*!< interrupt already in use */
362 /** @} */
363 /**
364 @name TmrCtr Status Codes 1226 - 1250
365 @{
366 */
367 /********************** TmrCtr statuses 1226 - 1250 **************************/
368 
369 #define XST_TMRCTR_TIMER_FAILED     1226    /*!< self test failed */
370 /** @} */
371 /**
372 @name WdtTb Status Codes 1251 - 1275
373 @{
374 */
375 /********************** WdtTb statuses 1251 - 1275 ***************************/
376 
377 #define XST_WDTTB_TIMER_FAILED      1251L
378 /** @} */
379 /**
380 @name PlbArb status Codes 1276 - 1300
381 @{
382 */
383 /********************** PlbArb statuses 1276 - 1300 **************************/
384 
385 #define XST_PLBARB_FAIL_SELFTEST    1276L
386 /** @} */
387 /**
388 @name Plb2Opb Status Codes 1301 - 1325
389 @{
390 */
391 /********************** Plb2Opb statuses 1301 - 1325 *************************/
392 
393 #define XST_PLB2OPB_FAIL_SELFTEST   1301L
394 /** @} */
395 /**
396 @name Opb2Plb Status 1326 - 1350
397 @{
398 */
399 /********************** Opb2Plb statuses 1326 - 1350 *************************/
400 
401 #define XST_OPB2PLB_FAIL_SELFTEST   1326L
402 /** @} */
403 /**
404 @name SysAce Status Codes 1351 - 1360
405 @{
406 */
407 /********************** SysAce statuses 1351 - 1360 **************************/
408 
409 #define XST_SYSACE_NO_LOCK          1351L    /*!< No MPU lock has been granted */
410 /** @} */
411 /**
412 @name PCI Bridge Status Codes 1361 - 1375
413 @{
414 */
415 /********************** PCI Bridge statuses 1361 - 1375 **********************/
416 
417 #define XST_PCI_INVALID_ADDRESS     1361L
418 /** @} */
419 /**
420 @name FlexRay Constants 1400 - 1409
421 @{
422 */
423 /********************** FlexRay constants 1400 - 1409 *************************/
424 
425 #define XST_FR_TX_ERROR            1400
426 #define XST_FR_TX_BUSY            1401
427 #define XST_FR_BUF_LOCKED        1402
428 #define XST_FR_NO_BUF            1403
429 /** @} */
430 /**
431 @name USB constants 1410 - 1420
432 @{
433 */
434 /****************** USB constants 1410 - 1420  *******************************/
435 
436 #define XST_USB_ALREADY_CONFIGURED    1410
437 #define XST_USB_BUF_ALIGN_ERROR        1411
438 #define XST_USB_NO_DESC_AVAILABLE    1412
439 #define XST_USB_BUF_TOO_BIG        1413
440 #define XST_USB_NO_BUF            1414
441 /** @} */
442 /**
443 @name HWICAP constants 1421 - 1429
444 @{
445 */
446 /****************** HWICAP constants 1421 - 1429  *****************************/
447 
448 #define XST_HWICAP_WRITE_DONE        1421
449 
450 /** @} */
451 /**
452 @name AXI VDMA constants 1430 - 1440
453 @{
454 */
455 /****************** AXI VDMA constants 1430 - 1440  *****************************/
456 
457 #define XST_VDMA_MISMATCH_ERROR        1430
458 /** @} */
459 /**
460 @name NAND Flash Status Codes 1441 - 1459
461 @{
462 */
463 /*********************** NAND Flash statuses 1441 - 1459  *********************/
464 
465 #define XST_NAND_BUSY            1441L    /*!< Flash is erasing or
466                          * programming
467                          */
468 #define XST_NAND_READY            1442L    /*!< Flash is ready for commands
469                          */
470 #define XST_NAND_ERROR            1443L    /*!< Flash had detected an
471                          * internal error.
472                          */
473 #define XST_NAND_PART_NOT_SUPPORTED    1444L    /*!< Flash type not supported by
474                          * driver
475                          */
476 #define XST_NAND_OPT_NOT_SUPPORTED    1445L    /*!< Operation not supported
477                          */
478 #define XST_NAND_TIMEOUT_ERROR        1446L    /*!< Programming or erase
479                          * operation aborted due to a
480                          * timeout
481                          */
482 #define XST_NAND_ADDRESS_ERROR        1447L    /*!< Accessed flash outside its
483                          * addressible range
484                          */
485 #define XST_NAND_ALIGNMENT_ERROR    1448L    /*!< Write alignment error
486                          */
487 #define XST_NAND_PARAM_PAGE_ERROR    1449L    /*!< Failed to read parameter
488                          * page of the device
489                          */
490 #define XST_NAND_CACHE_ERROR        1450L    /*!< Flash page buffer error
491                          */
492 
493 #define XST_NAND_WRITE_PROTECTED    1451L    /*!< Flash is write protected
494                          */
495 /** @} */
496 
497 /**************************** Type Definitions *******************************/
498 
499 typedef s32 XStatus;
500 
501 /***************** Macros (Inline Functions) Definitions *********************/
502 
503 
504 /************************** Function Prototypes ******************************/
505 
506 #ifdef __cplusplus
507 }
508 #endif
509 
510 #endif /* end of protection macro */
511 /**
512 * @} End of "addtogroup common_status_codes".
513 */
514