status.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  3. * Copyright 2016-2019 NXP
  4. * All rights reserved.
  5. *
  6. * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
  7. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  8. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  9. * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  10. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  11. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  12. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  13. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  14. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  15. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  16. * THE POSSIBILITY OF SUCH DAMAGE.
  17. */
  18. #ifndef STATUS_H
  19. #define STATUS_H
  20. /**
  21. * @page misra_violations MISRA-C:2012 violations
  22. *
  23. * @section [global]
  24. * Violates MISRA 2012 Advisory Rule 2.3, Global typedef not referenced.
  25. * status_t is referenced from all drivers.
  26. *
  27. * @section [global]
  28. * Violates MISRA 2012 Advisory Rule 2.5, Local macro not referenced.
  29. * The defined macro is used as include guard.
  30. *
  31. */
  32. /*******************************************************************************
  33. * Definitions
  34. ******************************************************************************/
  35. /*! @brief Status return codes.
  36. * Common error codes will be a unified enumeration (C enum) that will contain all error codes
  37. * (common and specific). There will be separate "error values spaces" (or slots), each of 256
  38. * positions, allocated per functionality.
  39. */
  40. typedef enum
  41. {
  42. /* Generic error codes */
  43. STATUS_SUCCESS = 0x000U, /*!< Generic operation success status */
  44. STATUS_ERROR = 0x001U, /*!< Generic operation failure status */
  45. STATUS_BUSY = 0x002U, /*!< Generic operation busy status */
  46. STATUS_TIMEOUT = 0x003U, /*!< Generic operation timeout status */
  47. STATUS_UNSUPPORTED = 0x004U, /*!< Generic operation unsupported status */
  48. /* MCU specific error codes */
  49. STATUS_MCU_GATED_OFF = 0x100U, /*!< Module is gated off */
  50. STATUS_MCU_TRANSITION_FAILED = 0x101U, /*!< Error occurs during transition. */
  51. STATUS_MCU_INVALID_STATE = 0x102U, /*!< Unsupported in current state. */
  52. STATUS_MCU_NOTIFY_BEFORE_ERROR = 0x103U, /*!< Error occurs during send "BEFORE" notification. */
  53. STATUS_MCU_NOTIFY_AFTER_ERROR = 0x104U, /*!< Error occurs during send "AFTER" notification. */
  54. /* I2C specific error codes */
  55. STATUS_I2C_RECEIVED_NACK = 0x200U, /*!< NACK signal received */
  56. STATUS_I2C_TX_UNDERRUN = 0x201U, /*!< TX underrun error */
  57. STATUS_I2C_RX_OVERRUN = 0x202U, /*!< RX overrun error */
  58. STATUS_I2C_ARBITRATION_LOST = 0x203U, /*!< Arbitration lost */
  59. STATUS_I2C_ABORTED = 0x204U, /*!< A transfer was aborted */
  60. STATUS_I2C_BUS_BUSY = 0x205U, /*!< I2C bus is busy, cannot start transfer */
  61. /* CAN specific error codes */
  62. STATUS_CAN_BUFF_OUT_OF_RANGE = 0x300U, /*!< The specified MB index is out of the configurable range */
  63. STATUS_CAN_NO_TRANSFER_IN_PROGRESS = 0x301U, /*!< There is no transmission or reception in progress */
  64. /* Security specific error codes */
  65. STATUS_SEC_SEQUENCE_ERROR = 0x402U, /*!< The sequence of commands or subcommands is out of
  66. sequence */
  67. STATUS_SEC_KEY_NOT_AVAILABLE = 0x403U, /*!< A key is locked due to failed boot measurement or
  68. an active debugger */
  69. STATUS_SEC_KEY_INVALID = 0x404U, /*!< A function is called to perform an operation with
  70. a key that is not allowed for the given operation */
  71. STATUS_SEC_KEY_EMPTY = 0x405U, /*!< Attempt to use a key that has not been initialized yet */
  72. STATUS_SEC_NO_SECURE_BOOT = 0x406U, /*!< The conditions for a secure boot process are not met */
  73. STATUS_SEC_KEY_WRITE_PROTECTED = 0x407U, /*!< Request for updating a write protected key slot,
  74. or activating debugger with write protected key(s) */
  75. STATUS_SEC_KEY_UPDATE_ERROR = 0x408U, /*!< Key update did not succeed due to errors in
  76. verification of the messages */
  77. STATUS_SEC_RNG_SEED = 0x409U, /*!< Returned by CMD_RND and CMD_DEBUG if the seed has not
  78. been initialized before */
  79. STATUS_SEC_NO_DEBUGGING = 0x40AU, /*!< DEBUG command authentication failed */
  80. STATUS_SEC_MEMORY_FAILURE = 0x40CU, /*!< General memory technology failure
  81. (multibit ECC error, common fault detected) */
  82. STATUS_SEC_HSM_INTERNAL_MEMORY_ERROR = 0x410U, /*!< An internal memory error encountered while
  83. executing the command */
  84. STATUS_SEC_INVALID_COMMAND = 0x411U, /*!< Command value out of range */
  85. STATUS_SEC_TRNG_ERROR = 0x412U, /*!< One or more statistical tests run on the TRNG output failed */
  86. STATUS_SEC_HSM_FLASH_BLOCK_ERROR = 0x413U, /*!< Error reading, programming or erasing one of the HSM flash blocks */
  87. STATUS_SEC_INTERNAL_CMD_ERROR = 0x414U, /*!< An internal command processor error while executing a command */
  88. STATUS_SEC_MAC_LENGTH_ERROR = 0x415U, /*!< MAC/Message length out of range */
  89. STATUS_SEC_INVALID_ARG = 0x421U, /*!< Invalid command argument */
  90. STATUS_SEC_TRNG_CLOCK_ERROR = 0x423U, /*!< TRNG not provided with a stable clock */
  91. /* SPI specific error codes */
  92. STATUS_SPI_TX_UNDERRUN = 0x500U, /*!< TX underrun error */
  93. STATUS_SPI_RX_OVERRUN = 0x501U, /*!< RX overrun error */
  94. STATUS_SPI_ABORTED = 0x502U, /*!< A transfer was aborted */
  95. /* UART specific error codes */
  96. STATUS_UART_TX_UNDERRUN = 0x600U, /*!< TX underrun error */
  97. STATUS_UART_RX_OVERRUN = 0x601U, /*!< RX overrun error */
  98. STATUS_UART_ABORTED = 0x602U, /*!< A transfer was aborted */
  99. STATUS_UART_FRAMING_ERROR = 0x603U, /*!< Framing error */
  100. STATUS_UART_PARITY_ERROR = 0x604U, /*!< Parity error */
  101. STATUS_UART_NOISE_ERROR = 0x605U, /*!< Noise error */
  102. /* I2S specific error codes */
  103. STATUS_I2S_TX_UNDERRUN = 0x700U, /*!< TX underrun error */
  104. STATUS_I2S_RX_OVERRUN = 0x701U, /*!< RX overrun error */
  105. STATUS_I2S_ABORTED = 0x702U, /*!< A transfer was aborted */
  106. /* SBC specific error codes */
  107. SBC_NVN_ERROR = 0x801U, /*!< Unsuccessful attempt writing to non volatile memory
  108. (0x73 and 0x74). Set device to factory settings. */
  109. SBC_COMM_ERROR = 0x802U, /*!< Data transfer was aborted */
  110. SBC_CMD_ERROR = 0x804U, /*!< Wrong command. */
  111. SBC_ERR_NA = 0x808U, /*!< Feature/device not available */
  112. SBC_MTPNV_LOCKED = 0x810U, /*!< Unable to write MTPNV cells, NVMPS = 0 */
  113. /* FLASH specific error codes */
  114. STATUS_FLASH_ERROR_ENABLE = 0x901U, /*!< It's impossible to enable an operation */
  115. STATUS_FLASH_ERROR_NO_BLOCK = 0x902U, /*!< No blocks have been enabled for Array Integrity check */
  116. STATUS_FLASH_INPROGRESS = 0x903U, /*!< InProgress status */
  117. /* SAI specific error codes */
  118. STATUS_SAI_ABORTED = 0xA00U, /*!< SAI aborted status */
  119. /* ENET specific error codes */
  120. STATUS_ENET_RX_QUEUE_EMPTY = 0xA01U, /*!< There is no available frame in the receive queue */
  121. STATUS_ENET_TX_QUEUE_FULL = 0xA02U, /*!< There is no available space for the frame in the transmit queue */
  122. STATUS_ENET_BUFF_NOT_FOUND = 0xA03U, /*!< The specified buffer was not found in the queue */
  123. /* FCCU specific error codes */
  124. STATUS_FCCU_ERROR_CONFIG_TIMEOUT = 0xB01U, /*!< FCCU triggers TimeOut when try to enter in Config State */
  125. STATUS_FCCU_ERROR_INIT_FCCU = 0xB02U, /*!< FCCU Initializing FCCU Module */
  126. STATUS_FCCU_ERROR_SET_CONFIG = 0xB03U, /*!< FCCU Fail to Enter in Config Mode */
  127. STATUS_FCCU_ERROR_SET_NORMAL = 0xB04U, /*!< FCCU Fail to Enter in Normal Mode */
  128. STATUS_FCCU_ERROR_APPLY_NCF_CONFIG = 0xB05U, /*!< FCCU Fail to set NoCritical Faults */
  129. STATUS_FCCU_ERROR_UPDATE_FREEZE = 0xB06U, /*!< FCCU Fail to update Freez Status registers */
  130. STATUS_FCCU_ERROR_CLEAR_FREEZE = 0xB07U, /*!< FCCU Fail to Clear Freez Status registers */
  131. STATUS_FCCU_ERROR_SET_EOUT = 0xB08U, /*!< FCCU Fail to Set Eout Configuration */
  132. STATUS_FCCU_ERROR_FAULT_DETECTED = 0xB09U, /*!< FCCU Faults Detected */
  133. STATUS_FCCU_ERROR_OTHER = 0xB0AU, /*!< FCCU other Error */
  134. /* EMIOS specific error codes */
  135. STATUS_EMIOS_WRONG_MODE = 0xC00U, /*!< EMIOS unsuccessful attempt selecting wrong mode. */
  136. STATUS_EMIOS_CNT_BUS_OVERFLOW = 0xC01U, /*!< EMIOS counter bus overflow. */
  137. STATUS_EMIOS_WRONG_CNT_BUS = 0xC02U, /*!< EMIOS unsuccessful attempt selecting wrong counter bus. */
  138. STATUS_EMIOS_ENABLE_GLOBAL_FRZ = 0xC03U, /*!< EMIOS must set global allow enter debug mode first. */
  139. /* EEE specific error codes */
  140. STATUS_EEE_ERROR_NO_ENOUGH_SPACE = 0xD00U, /*!< The data is too big to fit in any of the block */
  141. STATUS_EEE_ERROR_NO_ENOUGH_BLOCK = 0xD01U, /*!< The block numbers is not enough for round robin */
  142. STATUS_EEE_ERROR_DATA_NOT_FOUND = 0xD02U, /*!< The required data is not found in the EEPROM emulation */
  143. STATUS_EEE_ERROR_NOT_IN_CACHE = 0xD03U, /*!< The required data is not in the cache table */
  144. STATUS_EEE_ERROR_PROGRAM_INDICATOR = 0xD04U, /*!< Failed to make block indicator to non-blank for several times */
  145. STATUS_EEE_HVOP_INPROGRESS = 0xD05U, /*!< The high voltage operation is in progress */
  146. /* uSDHC specific error codes */
  147. STATUS_USDHC_OUT_OF_RANGE = 0xE00U, /*!< The size of data to be sent is larger than maximum size of ADMA table */
  148. STATUS_USDHC_PREPARE_ADMA_FAILED = 0xE01U, /*!< Failed to prepare the ADMA table */
  149. /* TDM specific error codes */
  150. STATUS_TDM_DIARY_FULL = 0xF01U, /*!< No empty flash left in diary region */
  151. /* PHY specific error codes */
  152. STATUS_PHY_ACCESS_FAILED = 0x1001U, /*!< Could not access PHY registers */
  153. STATUS_PHY_INCOMPATIBLE_DEVICE = 0x1002U, /*!< The selected PHY driver is not compatible with the device */
  154. /* ESCI specific error codes */
  155. STATUS_ESCI_FRAME_FORMAT_ERROR = 0x1102U, /*!< Frame format error */
  156. /* ZIPWIRE specific error codes */
  157. STATUS_ZIPWIRE_TIMEOUT_ERR = 0x1300U, /*!< Channel timeout */
  158. STATUS_ZIPWIRE_TRANSACTION_ID_ERR = 0x1301U, /*!< Transaction ID error */
  159. STATUS_ZIPWIRE_ACK_ERR = 0x1302U, /*!< Error on received ACK */
  160. /* CMU specific error codes */
  161. STATUS_CMU_FREQ_HIGHER = 0x1404U, /*!< Frequency higher than high reference event status */
  162. STATUS_CMU_FREQ_LOWER = 0x1402U, /*!< Frequency lower than high reference event status */
  163. STATUS_CMU_OSC_FREQ_LOWER = 0x1403U, /*!< Oscillator frequency less than fCLKMT0_RMN / 2CMU_CSR[RCDIV] */
  164. STATUS_CMU_OSC_FREQ_LOWER_REF_CLOCK = 0x1401U, /*!< Frequency less than reference clock event status. */
  165. } status_t;
  166. #endif /* STATUS_H */
  167. /*******************************************************************************
  168. * EOF
  169. ******************************************************************************/