xstatus.h 22 KB

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