• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  * Description: Provides error numers \n
16  *
17  * History: \n
18  * 2022-06-01, Create file. \n
19  */
20 
21 #ifndef ERRCODE_H
22 #define ERRCODE_H
23 
24 #include <stdint.h>
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 #endif /* __cplusplus */
31 
32 /**
33  * @defgroup common_errcode Error Code Definition
34  * @ingroup  common
35  * @{
36  */
37 
38 /**
39  * @brief  Definition of error code.
40  */
41 typedef uint32_t errcode_t;
42 
43 /*
44 * 1 COMMON ERR (0x8000_0000 - 0x8000_0079)
45 */
46 #define ERRCODE_SUCC                                        0UL
47 #define ERRCODE_FAIL                                        0xFFFFFFFF
48 #define ERRCODE_INVALID_PARAM                               0x80000001
49 #define ERRCODE_NOT_SUPPORT                                 0x80000002
50 
51 #define ERRCODE_MEMSET                                      0x80000003
52 #define ERRCODE_MEMCPY                                      0x80000004
53 #define ERRCODE_MALLOC                                      0x80000005
54 
55 /*
56 * 2 soc osa (0x8000_0080 - 0x8000_1000)
57 *
58 * HASH Error
59 */
60 #define ERRCODE_HASH_REG_ADDR_INVALID                       0x80000080
61 #define ERRCODE_HASH_INVALID_PARAMETER                      0x80000081
62 #define ERRCODE_HASH_UNSUPPORTED                            0x80000082
63 #define ERRCODE_HASH_FAILED_MEM                             0x80000083
64 #define ERRCODE_HASH_BUSY                                   0x80000084
65 #define ERRCODE_HASH_TIMEOUT                                0x80000085
66 
67 /*
68 * 3 DRIVER (0x8000_1000 - 0x8000_3000)
69 *
70 * Gpio Error.
71 */
72 #define ERRCODE_GPIO_DIR_SET_FAIL                           0x80001000
73 #define ERRCODE_GPIO_NOT_INIT                               0x80001001
74 #define ERRCODE_GPIO_RELEASE_FAIL                           0x80001002
75 #define ERRCODE_GPIO_REG_ADDR_INVALID                       0x80001003
76 #define ERRCODE_GPIO_INIT_TRX_STATE_FAIL                    0x80001004
77 #define ERRCODE_GPIO_ADD_QUEUE_FAIL                         0x80001005
78 #define ERRCODE_GPIO_STATE_MISMATCH                         0x80001006
79 #define ERRCODE_GPIO_NOT_IMPLEMENT                          0x80001007
80 #define ERRCODE_GPIO_ALREADY_SET_CALLBACK                   0x80001008
81 
82 /* CALENDAR Error */
83 #define ERRCODE_CALENDAR_NOT_INIT                           0x80001020
84 #define ERRCODE_CALENDAR_INVALID_PARAMETER                  0x80001021
85 #define ERRCODE_CALENDAR_GET_DATETIME_FAILURE               0x80001022
86 #define ERRCODE_CALENDAR_GET_TIMESTAMP_FAILURE              0x80001023
87 #define ERRCODE_CALENDAR_FAILURE                            0x80001024
88 
89 /* Uart Error. */
90 #define ERRCODE_UART_NOT_INIT                               0x80001040
91 #define ERRCODE_UART_CLAIM_FAIL                             0x80001041
92 #define ERRCODE_UART_RELEASE_FAIL                           0x80001042
93 #define ERRCODE_UART_REG_ADDR_INVALID                       0x80001043
94 #define ERRCODE_UART_INIT_TRX_STATE_FAIL                    0x80001044
95 #define ERRCODE_UART_ADD_QUEUE_FAIL                         0x80001045
96 #define ERRCODE_UART_STATE_MISMATCH                         0x80001046
97 #define ERRCODE_UART_NOT_IMPLEMENT                          0x80001047
98 #define UART_DMA_CFG_PARAM_INVALID                          0x80001048
99 #define UART_DMA_BUFF_NULL                                  0x80001049
100 #define UART_DMA_SHAKING_INVALID_OR_UART_FUNCS_NULL         0x8000104A
101 #define UART_DMA_CONFIGURE_FAIL                             0x8000104B
102 #define UART_DMA_START_TRANSFER_FAIL                        0x8000104C
103 #define UART_DMA_TRANSFER_TIMEOUT                           0x8000104D
104 #define UART_DMA_TRANSFER_ERROR                             0x8000104E
105 
106 /* PWM Error */
107 #define ERRCODE_PWM_NOT_INIT                                0x80001080
108 #define ERRCODE_PWM_NOT_OPEN                                0x80001081
109 #define ERRCODE_PWM_INVALID_PARAMETER                       0x80001082
110 #define ERRCODE_PWM_REG_ADDR_INVALID                        0x80001083
111 #define ERRCODE_PWM_NOT_POWER_ON                            0x80001084
112 
113 /* DMA Error */
114 #define ERRCODE_DMA_NOT_INIT                                0x80001100
115 #define ERRCODE_DMA_REG_ADDR_INVALID                        0x80001101
116 #define ERRCODE_DMA_INVALID_PARAMETER                       0x80001102
117 #define ERRCODE_DMA_RET_NO_AVAIL_CH                         0x80001103
118 #define ERRCODE_DMA_RET_ERROR_CONFIG                        0x80001104
119 #define ERRCODE_DMA_RET_HANDSHAKING_USING                   0x80001105
120 #define ERRCODE_DMA_LLI_CFG_ERROR                           0x80001106
121 #define ERRCODE_DMA_CH_BUSY                                 0x80001107
122 #define ERRCODE_DMA_RET_ERROR_ADDRESS_ALIGN                 0x80001108
123 #define ERRCODE_DMA_RET_TOO_MANY_DATA_TO_TRANSFER           0x80001109
124 #define ERRCODE_DMA_RET_ADDRESS_ACCESS_ERROR                0x80001110
125 
126 /* ADC Error */
127 #define ERRCODE_ADC_REG_ADDR_INVALID                        0x80001140
128 #define ERRCODE_ADC_INVALID_PARAMETER                       0x80001141
129 #define ERRCODE_ADC_SCAN_NOT_DISABLE                        0x80001142
130 #define ERRCODE_ADC_INVALID_SAMPLE_VALUE                    0x80001143
131 #define ERRCODE_ADC_INVALID_CH_TYPE                         0x80001144
132 #define ERRCODE_ADC_TIMEOUT                                 0x80001145
133 
134 /* Systick Error. */
135 #define ERRCODE_SYSTICK_NOT_INIT                            0x80001160
136 #define ERRCODE_SYSTICK_NOT_CLEARED                         0x80001161
137 #define ERRCODE_SYSTICK_REG_ADDR_INVALID                    0x80001162
138 #define ERRCODE_SYSTICK_NOT_IMPLEMENT                       0x80001163
139 #define ERRCODE_SYSTICK_INIT_STATE_FAIL                     0x80001164
140 
141 /* TCXO Error */
142 #define ERRCODE_TCXO_REG_ADDR_INVALID                       0x80001180
143 
144 /* Pinmux Error */
145 #define ERRCODE_PIN_INVALID_PARAMETER                       0x80001190
146 #define ERRCODE_PIN_MODE_NO_FUNC                            0x80001191
147 #define ERRCODE_PIN_NOT_INIT                                0x80001192
148 
149 /* Watchdog Error */
150 #define ERRCODE_WDT_REG_ADDR_INVALID                        0x80001200
151 
152 /* QDEC Error */
153 #define ERRCODE_QDEC_INVALID_STATE                          0x80001210
154 #define ERRCODE_QDEC_INVALID_PARAMETER                      0x80001211
155 #define ERRCODE_QDEC_DOUBLE_TRANSITION                      0x80001212
156 #define ERRCODE_QDEC_REG_ADDR_INVALID                       0x80001213
157 
158 /* KEYSCAN Error */
159 #define ERRCODE_KEYSCAN_NOT_INIT                            0x80001220
160 #define ERRCODE_KEYSCAN_NOT_POWER_ON                        0x80001221
161 #define ERRCODE_KEYSCAN_POWER_ON                            0x80001222
162 #define ERRCODE_KEYSCAN_NULL                                0x80001223
163 #define ERRCODE_KEYSCAN_MAP_WRONG_SIZE                      0x80001224
164 #define ERRCODE_KEYSCAN_SAFE_FUNC_FAIL                      0x80001225
165 #define ERRCODE_KEYSCAN_NOT_ALLOW_TO_SLEEP                  0x80001226
166 
167 /* TRNG Error */
168 #define ERRCODE_TRNG_REG_ADDR_INVALID                       0x80001230
169 #define ERRCODE_TRNG_INVALID_PARAMETER                      0x80001231
170 #define ERRCODE_TRNG_TIMEOUT                                0x80001232
171 
172 /* PKE Error */
173 #define ERRCODE_PKE_REG_ADDR_INVALID                        0x80001240
174 #define ERRCODE_PKE_INVALID_PARAMETER                       0x80001241
175 #define ERRCODE_PKE_UNSUPPORTED                             0x80001242
176 #define ERRCODE_PKE_INVALID_PADDING                         0x80001243
177 #define ERRCODE_PKE_ENV_NOT_READY                           0x80001244
178 #define ERRCODE_PKE_FAILED_MEM                              0x80001245
179 #define ERRCODE_PKE_TIMEOUT                                 0x80001246
180 
181 /* KM Error */
182 #define ERRCODE_KM_REG_ADDR_INVALID                         0x80001260
183 #define ERRCODE_KM_INVALID_PARAMETER                        0x80001261
184 #define ERRCODE_KM_UNSUPPORTED                              0x80001262
185 #define ERRCODE_KM_ENV_NOT_READY                            0x80001263
186 #define ERRCODE_KM_KEYSLOT_BUSY                             0x80001264
187 #define ERRCODE_KM_FAILED_MEM                               0x80001265
188 #define ERRCODE_KM_TIMEOUT                                  0x80001266
189 
190 /* Cipher Error */
191 #define ERRCODE_CIPHER_REG_ADDR_INVALID                     0x80001280
192 #define ERRCODE_CIPHER_INVALID_PARAMETER                    0x80001281
193 #define ERRCODE_CIPHER_UNSUPPORTED                          0x80001282
194 #define ERRCODE_CIPHER_FAILED_MEM                           0x80001283
195 #define ERRCODE_CIPHER_ENV_NOT_READY                        0x80001284
196 #define ERRCODE_CIPHER_SIZE_NOT_ALIGNED                     0x80001285
197 #define ERRCODE_CIPHER_BUSY                                 0x80001286
198 #define ERRCODE_CIPHER_TIMEOUT                              0x80001287
199 
200 /* I2C Error. */
201 #define ERRCODE_I2C_NOT_INIT                                0x80001300
202 #define ERRCODE_I2C_ALREADY_INIT                            0x80001301
203 #define ERRCODE_I2C_INVALID_PARAMETER                       0x80001302
204 #define ERRCODE_I2C_NOT_IMPLEMENT                           0x80001303
205 #define ERRCODE_I2C_EVENT_INIT_FAILURE                      0x80001304
206 #define ERRCODE_I2C_RATE_INVALID                            0x80001305
207 #define ERRCODE_I2C_ADDRESS_INVLID                          0x80001306
208 #define ERRCODE_I2C_PERMISSION_INVALID                      0x80001307
209 #define ERRCODE_I2C_NO_VALID_DATA                           0x80001308
210 #define ERRCODE_I2C_SEND_PARAM_INVALID                      0x80001309
211 #define ERRCODE_I2C_RECEIVE_PARAM_INVALID                   0x80001310
212 #define ERRCODE_I2C_WAIT_EXCEPTION                          0x80001311
213 #define ERRCODE_I2C_WAIT_CONTINUE                           0x80001312
214 #define ERRCODE_I2C_TIMEOUT                                 0x80001313
215 #define ERRCODE_I2C_ACK_ERR                                 0x80001314
216 #define ERRCODE_I2C_MUTEX_PROC_FAIL                         0x80001315
217 #define ERRCODE_I2C_DMA_CONFIG_ERROR                        0x80001316
218 #define ERRCODE_I2C_DMA_TRANSFER_ERROR                      0x80001317
219 
220 /* TIMER error */
221 #define ERRCODE_TIMER_NO_ENOUGH                             0x80001320
222 #define ERRCODE_TIEMR_NOT_CREATED                           0x80001321
223 #define ERRCODE_TIMER_INVALID_REG_ADDR                      0x80001322
224 #define ERRCODE_TIMER_INVALID_STATE                         0x80001323
225 #define ERRCODE_TIMER_NOT_INIT                              0x80001324
226 
227 /* SPI/QSPI Error. */
228 #define ERRCODE_SPI_CONFIG_FAIL                             0x80001330
229 #define ERRCODE_SPI_REG_ADDR_INVALID                        0x80001331
230 #define ERRCODE_SPI_MODE_MISMATCH                           0x80001332
231 #define ERRCODE_SPI_TIMEOUT                                 0x80001333
232 #define ERRCODE_SPI_RX_FIFO_FULL                            0x80001334
233 #define ERRCODE_SPI_SLAVE_SELECT_INVALID                    0x80001335
234 #define ERRCODE_SPI_DMA_CONFIG_ERROR                        0x80001336
235 #define ERRCODE_SPI_DMA_TRANSFER_ERROR                      0x80001337
236 #define ERRCODE_SPI_INVALID_BYTES                           0x80001338
237 #define ERRCODE_SPI_STATE_MISMATCH                          0x8000133A
238 #define ERRCODE_SPI_ADD_QUEUE_FAIL                          0x8000133B
239 #define ERRCODE_SPI_DMA_IRQ_MODE_MUTEX                      0x8000133C
240 #define ERRCODE_SPI_INVALID_TMODE                           0x8000133E
241 #define ERRCODE_SPI_BUSY                                    0x8000133F
242 
243 /* SFC error */
244 #define ERRCODE_SFC_DMA_BUSY                                0x80001339
245 #define ERRCODE_SFC_INVALID_PARAM                           0x8000133F
246 #define ERRCODE_SFC_NOT_INIT                                0x80001340
247 #define ERRCODE_SFC_FLASH_NOT_SUPPORT                       0x80001341
248 #define ERRCODE_SFC_ADDRESS_OVERSTEP                        0x80001342
249 #define ERRCODE_SFC_REG_ADDR_INVALID                        0x80001343
250 #define ERRCODE_SFC_FLASH_TIMEOUT_WAIT_READY                0x80001344
251 #define ERRCODE_SFC_CMD_ERROR                               0x80001345
252 #define ERRCODE_SFC_CMD_NOT_SUPPORT                         0x80001346
253 #define ERRCODE_SFC_ERASE_FORM_ERROR                        0x80001347
254 #define ERRCODE_SFC_DEFAULT_INIT                            0x80001348
255 #define ERRCODE_SFC_PORT_INVALID_PARAM                      0x80001349
256 
257 /* MPU Error. */
258 #define ERRCODE_MPU_NOT_INIT                                0x80001350
259 #define ERRCODE_MPU_INVALID_PARAMETER                       0x80001351
260 #define ERRCODE_MPU_CONFIG_FAILED                           0x80001352
261 #define ERRCODE_MPU_REG_ADDR_INVALID                        0x80001353
262 #define ERRCODE_MPU_DREGION_ERROR                           0x80001354
263 #define ERRCODE_MPU_ADDR_ERROR                              0x80001355
264 
265 #define ERRCODE_TSENSOR_NOT_INIT                            0x80001360
266 #define ERRCODE_TSENSOR_INVALID_PARAMETER                   0x80001361
267 #define ERRCODE_TSENSOR_REG_ADDR_INVALID                    0x80001362
268 #define ERRCODE_TSENSOR_GET_TEMP_INVALID                    0x80001363
269 #define ERRCODE_TSENSOR_WORKMODE_ERROR                      0x80001364
270 
271 /* PSRAM Error. */
272 #define ERRCODE_PSRAM_RET_UNINIT                            0x80001370
273 #define ERRCODE_PSRAM_RET_INITED                            0x80001371
274 #define ERRCODE_PSRAM_RET_TIMEOUT                           0x80001372
275 #define ERRCODE_PSRAM_RET_WRONG_PARA                        0x80001373
276 #define ERRCODE_PSRAM_RET_WRONG_DEVICE                      0x80001374
277 #define ERRCODE_PSRAM_RET_XIP_EN                            0x80001375
278 #define ERRCODE_PSRAM_RET_XIP_DIS                           0x80001376
279 #define ERRCODE_PSRAM_RET_SLEEP                             0x80001377
280 #define ERRCODE_PSRAM_RET_WAKE                              0x80001378
281 #define ERRCODE_PSRAM_RET_ERROR                             0x80001379
282 
283 /* EDGE Error */
284 #define ERRCODE_EDGE_NOT_INITED                             0x80001380
285 #define ERRCODE_EDGE_INVALID_PARAMETER                      0x80001381
286 #define ERRCODE_EDGE_REG_ADDR_INVALID                       0x80001382
287 
288 /* EMBED FLASH ERROR. */
289 #define ERRCODE_EFLASH_NOT_INIT                             0x80001385
290 #define ERRCODE_EFLASH_INVALID_PARAMETER                    0x80001386
291 #define ERRCODE_EFLASH_REG_ADDR_INVALID                     0x80001387
292 
293 /* EFUSE error */
294 #define ERRCODE_EFUSE_INVALID_PARAM                         0x80001390
295 #define ERRCODE_EFUSE_NOT_INIT                              0x80001391
296 #define ERRCODE_EFUSE_REG_ADDR_INVALID                      0x80001392
297 
298 /* MEM_MONTINOR Error */
299 #define ERRCODE_MEM_MONITOR_INVALID_PARAMETER               0x80001400
300 #define ERRCODE_MEM_MONITOR_REG_ADDR_INVALID                0x80001401
301 #define ERRCODE_MEM_MONITOR_WORKMODE_ERROR                  0x80001402
302 #define ERRCODE_MEM_MONITOR_GET_TEMP_INVALID                0x80001403
303 
304 /* PDM Error. */
305 #define ERRCODE_PDM_REG_ADDR_INVALID                        0x80001380
306 /* SIO Error. */
307 #define ERRCODE_I2S_NOT_INIT                                0x80001410
308 #define ERRCODE_I2S_NOT_CONFIG                              0x80001411
309 #define ERRCODE_PCM_NOT_INIT                                0x80001412
310 #define ERRCODE_PCM_NOT_CONFIG                              0x80001413
311 #define ERRCODE_SIO_REG_ADDR_INVALID                        0x80001414
312 
313 /* CAN-FD Error. */
314 #define ERRCODE_CAN_FD_INITED                               0x80001420
315 #define ERRCODE_CAN_FD_INVALID_ADDR                         0x80001421
316 #define ERRCODE_CAN_FD_NOT_INIT                             0x80001422
317 #define ERRCODE_CAN_FD_SEND_TIMEOUT                         0x80001423
318 #define ERRCODE_CAN_FD_RX_FIFO_EMPTY                        0x80001424
319 #define ERRCODE_CAN_ACTIVE_STS                              0x80001425
320 #define ERRCODE_CAN_PASSIVE_STS                             0x80001426
321 #define ERRCODE_CAN_BUS_OFF                                 0x80001427
322 
323 /* RTC error */
324 #define ERRCODE_RTC_NOT_INITED                              0x80001405
325 #define ERRCODE_RTC_REG_ADDR_INVALID                        0x80001406
326 #define ERRCODE_RTC_NO_ENOUGH                               0x80001407
327 #define ERRCODE_RTC_NOT_CREATED                             0x80001408
328 
329 /* SECURITY_UNIFIED Error */
330 #define ERROR_SECURITY_INVALID_PARAM               0x80001500  /* input param's value is not in valid range. */
331 #define ERROR_SECURITY_PARAM_IS_NULL               0x80001501  /* input param is NULL and required not NULL. */
332 #define ERROR_SECURITY_NOT_INIT                    0x80001502  /* call other functions before call init function. */
333 #define ERROR_SECURITY_UNSUPPORT                   0x80001503  /* some configuration is unsupport. */
334 #define ERROR_SECURITY_UNEXPECTED                  0x80001504  /* reture when unexpected error occurs. */
335 #define ERROR_SECURITY_CHN_BUSY                    0x80001505  /* try to create channel but all channels are busy. */
336 #define ERROR_SECURITY_CTX_CLOSED                  0x80001506  /* using one ctx to do something but has been closed. */
337 #define ERROR_SECURITY_NOT_SET_CONFIG              0x80001507  /* not set_config but need for symc. */
338 #define ERROR_SECURITY_NOT_ATTACHED                0x80001508  /* not attach but need for symc. */
339 #define ERROR_SECURITY_NOT_MAC_START               0x80001509  /* not mac_start but need for symc. */
340 #define ERROR_SECURITY_INVALID_HANDLE              0x8000150A  /* pass one invalid handle. */
341 #define ERROR_SECURITY_GET_PHYS_ADDR               0x8000150B  /* transfer from virt_addr to phys_addr failed. */
342 #define ERROR_SECURITY_SYMC_LEN_NOT_ALIGNED        0x8000150C  /* length isn't aligned to 16-Byte except CTR/CCM/GCM. */
343 /* the phys_addr writing to register is not aligned to 4-Byte. */
344 #define ERROR_SECURITY_SYMC_ADDR_NOT_ALIGNED       0x8000150D
345 #define ERROR_SECURITY_PKE_RSA_SAME_DATA           0x8000150E  /* rsa exp_mod  the input is equal to output. */
346 #define ERROR_SECURITY_PKE_RSA_CRYPTO_V15_CHECK    0x8000150F  /* rsa crypto v15 padding check failed. */
347 #define ERROR_SECURITY_PKE_RSA_CRYPTO_OAEP_CHECK   0x80001510  /* rsa crypto oaep padding check failed. */
348 #define ERROR_SECURITY_PKE_RSA_VERIFY_V15_CHECK    0x80001511  /* rsa verify v15 padding check failed. */
349 #define ERROR_SECURITY_PKE_RSA_VERIFY_PSS_CHECK    0x80001512  /* rsa verify pss padding check failed. */
350 #define ERROR_SECURITY_PKE_RSA_GEN_KEY             0x80001513  /* rsa generate key failed. */
351 #define ERROR_SECURITY_PKE_ECDSA_VERIFY_CHECK      0x80001514  /* ecdsa verify check failed. */
352 /* Outer's Error Code. 0x40 ~ 0x5F. */
353 #define ERROR_SECURITY_MEMCPY_S                    0x80001540  /* call memcpy_s failed. */
354 #define ERROR_SECURITY_MALLOC                      0x80001541  /* call xxx_malloc failed. */
355 #define ERROR_SECURITY_MUTEX_INIT                  0x80001542  /* call xxx_mutex_init failed. */
356 #define ERROR_SECURITY_MUTEX_LOCK                  0x80001543  /* call xxx_lock failed. */
357 /* Specific Error Code for UAPI. 0x60 ~ 0x6F. */
358 #define ERROR_SECURITY_DEV_OPEN_FAILED             0x80001560  /* open dev failed. */
359 #define ERROR_SECURITY_COUNT_OVERFLOW              0x80001561  /* call init too many times. */
360 /* Specific Error Code for Dispatch. 0x70 ~ 0x7F. */
361 #define ERROR_SECURITY_CMD_DISMATCH                0x80001570  /* cmd is dismatched. */
362 #define ERROR_SECURITY_COPY_FROM_USER              0x80001571  /* call copy_from_user failed. */
363 #define ERROR_SECURITY_COPY_TO_USER                0x80001572  /* call copy_to_user failed. */
364 /* parse user's mem handle to kernel's mem handle failed. */
365 #define ERROR_SECURITY_MEM_HANDLE_GET              0x80001573
366 #define ERROR_SECURITY_GET_OWNER                   0x80001574  /* call crypto_get_owner failed. */
367 /* Specific Error Code for KAPI. 0x80 ~ 0x8F. */
368 #define ERROR_SECURITY_PROCESS_NOT_INIT            0x80001580  /* one process not call kapi_xxx_init first. */
369 #define ERROR_SECURITY_MAX_PROCESS                 0x80001581  /* process's num is over the limit. */
370 #define ERROR_SECURITY_MEMORY_ACCESS               0x80001582  /* access the memory that does not belong to itself.  */
371 #define ERROR_SECURITY_INVALID_PROCESS             0x80001583  /* the process accesses resources of other processes. */
372 /* Specific Error Code for DRV. 0x90 ~ 0x9F. */
373 
374 /* Specific Error Code for HAL. 0xA0 ~ 0xAF. */
375 #define ERROR_SECURITY_HASH_LOGIC                  0x800015A0  /* hash logic's error occurs. */
376 #define ERROR_SECURITY_PKE_LOGIC                   0x800015A1  /* pke logic's error occurs. */
377 #define ERROR_SECURITY_INVALID_CPU_TYPE            0x800015A2  /* logic get the invalid cpu type. */
378 #define ERROR_SECURITY_INVALID_REGISTER_VALUE      0x800015A3  /* value in register is invalid. */
379 #define ERROR_SECURITY_INVALID_PHYS_ADDR           0x800015A4  /* phys_addr is invalid. */
380 /* Specific Error Code for Timeout. 0xB0 ~ 0xBF. */
381 #define ERROR_SECURITY_GET_TRNG_TIMEOUT            0x800015B0  /* logic get rnd timeout. */
382 #define ERROR_SECURITY_HASH_CLEAR_CHN_TIMEOUT      0x800015B1  /* clear hash channel timeout. */
383 #define ERROR_SECURITY_HASH_CALC_TIMEOUT           0x800015B2  /* hash calculation timeout. */
384 #define ERROR_SECURITY_SYMC_CLEAR_CHN_TIMEOUT      0x800015B3  /* clear symc channel timeout. */
385 #define ERROR_SECURITY_SYMC_CALC_TIMEOUT           0x800015B4  /* symc crypto timeout. */
386 #define ERROR_SECURITY_SYMC_GET_TAG_TIMEOUT        0x800015B5  /* symc get tag timeout. */
387 #define ERROR_SECURITY_PKE_LOCK_TIMEOUT            0x800015B6  /* pke lock timeout. */
388 #define ERROR_SECURITY_PKE_WAIT_DONE_TIMEOUT       0x800015B7  /* pke wait done timeout. */
389 #define ERROR_SECURITY_PKE_ROBUST_WARNING          0x800015B8  /* pke wait done timeout. */
390 
391 /*
392 *
393 * PARTITION Error
394 */
395 #define ERRCODE_PARTITION_INIT_ERR                          0x80003000
396 #define ERRCODE_PARTITION_NOT_SUPPORT                       0x80003001
397 #define ERRCODE_PARTITION_INVALID_PARAMS                    0x80003002
398 #define ERRCODE_PARTITION_CONFIG_NOT_FOUND                  0x80003003
399 #define ERRCODE_IMAGE_CONFIG_NOT_FOUND                      0x80003004
400 
401 /* AT Error */
402 #define ERRCODE_AT_CHANNEL_BUSY                             0x80003020
403 #define ERRCODE_AT_CMD_TOO_LONG                             0x80003021
404 #define ERRCODE_AT_CMD_REPEAT                               0x80003022
405 #define ERRCODE_AT_CMD_TABLE_PARA_ERROR                     0x80003023
406 #define ERRCODE_AT_MSG_SEND_ERROR                           0x80003024
407 
408 /* UPG error */
409 #define ERRCODE_UPG_NOT_INIT                                0x80003040
410 #define ERRCODE_UPG_ALREADY_INIT                            0x80003041
411 #define ERRCODE_UPG_INVALID_PARAMETER                       0x80003042
412 #define ERRCODE_UPG_WRONG_IMAGE_NUM                         0x80003043
413 #define ERRCODE_UPG_INVALID_IMAGE_ID                        0x80003044
414 #define ERRCODE_UPG_NULL_POINTER                            0x80003045
415 #define ERRCODE_UPG_NOT_SUPPORTED                           0x80003046
416 #define ERRCODE_UPG_NOT_NEED_TO_UPDATE                      0x80003047
417 #define ERRCODE_UPG_FLASH_ERASE_ERROR                       0x80003048
418 #define ERRCODE_UPG_FLASH_WRITE_ERROR                       0x80003049
419 #define ERRCODE_UPG_FLAG_NOT_INITED                         0x80003050
420 #define ERRCODE_UPG_NO_ENOUGH_SPACE                         0x80003051
421 #define ERRCODE_UPG_PARTITION_ALIGN_ERROR                   0x80003052
422 #define ERRCODE_UPG_INVALID_PREPARE_INFO                    0x80003053
423 #define ERRCODE_UPG_NOT_PREPARED                            0x80003054
424 #define ERRCODE_UPG_INVALID_BUFF_LEN                        0x80003055
425 #define ERRCODE_UPG_INVALID_OFFSET                          0x80003056
426 #define ERRCODE_UPG_FILE_OPEN_FAIL                          0x80003057
427 #define ERRCODE_UPG_FILE_WRITE_FAIL                         0x80003058
428 #define ERRCODE_UPG_FILE_SEEK_FAIL                          0x80003059
429 #define ERRCODE_UPG_FILE_READ_FAIL                          0x80003060
430 #define ERRCODE_UPG_EMPTY_FILE                              0x80003061
431 #define ERRCODE_UPG_DECOMPRESS_FAIL                         0x80003062
432 #define ERRCODE_UPG_VERIFICATION_KEY_ERROR                  0x80003063
433 #define ERRCODE_UPG_CHECK_FOTA_ERROR                        0x80003064
434 #define ERRCODE_UPG_SET_IMG_ERROR                           0x80003065
435 #define ERRCODE_UPG_BACKUP_UPDATE_ERROR                     0x80003066
436 #define ERRCODE_UPG_RETRY_ALL_FAIL                          0x80003067
437 #define ERRCODE_UPG_VERSION_ERROR                           0x80003068
438 
439 /* NV error */
440 #define ERRCODE_NV_KEY_NOT_IN_WRITE_QUEUE                   0x80003080
441 #define ERRCODE_NV_KEY_NOT_FOUND                            0x80003081
442 #define ERRCODE_NV_GET_BUFFER_TOO_SMALL                     0x80003082
443 #define ERRCODE_NV_INVALID_PARAMS                           0x80003083
444 #define ERRCODE_NV_RPC_ERROR                                0x80003084
445 #define ERRCODE_NV_TRYING_TO_MODIFY_A_PERMANENT_KEY         0x80003085
446 #define ERRCODE_NV_BUFFER_TOO_SMALL                         0x80003086
447 #define ERRCODE_NV_NO_ENOUGH_SPACE                          0x80003087
448 #define ERRCODE_NV_ILLEGAL_OPERATION                        0x80003088
449 #define ERRCODE_NV_SEM_WAIT_ERR                             0x80003089
450 #define ERRCODE_NV_NOT_INITIALISED                          0x80003090
451 #define ERRCODE_NV_NOTIFY_LIST_FULL                         0x80003091
452 #define ERRCODE_NV_INIT_FAILED                              0x80003092
453 #define ERRCODE_NV_ZERO_LENGTH_COPY                         0x80003093
454 #define ERRCODE_NV_NOTIFY_SEGMENT_ERR                       0x80003094
455 #define ERRCODE_NV_READ_FLASH_ERR                           0x80003095
456 #define ERRCODE_NV_DATA_MISMATCH                            0x80003096
457 #define ERRCODE_NV_LENGTH_MISMATCH                          0x80003097
458 #define ERRCODE_NV_KEY_HASH_BUFFER_NOT_ALLOCATED            0x80003098
459 #define ERRCODE_NV_KEY_DATA_BUFFER_NOT_ALLOCATED            0x80003099
460 #define ERRCODE_NV_INVALID_KEY_HEADER                       0x80003100
461 #define ERRCODE_NV_SEARCH_PATTERN_MISMATCH                  0x80003101
462 #define ERRCODE_NV_SEARCH_KEY_TYPE_MISMATCH                 0x80003102
463 #define ERRCODE_NV_SEARCH_KEY_STATE_MISMATCH                0x80003103
464 #define ERRCODE_NV_HASH_MISMATCH                            0x80003104
465 #define ERRCODE_NV_PAGE_NOT_FOUND                           0x80003105
466 #define ERRCODE_NV_INVALID_PAGE                             0x80003106
467 #define ERRCODE_NV_INVALID_STORE                            0x80003107
468 #define ERRCODE_NV_DEFRAGMENTATION_NEEDED                   0x80003108
469 #define ERRCODE_NV_HASH_UNAVAILABLE                         0x80003109
470 #define ERRCODE_NV_AES_UNAVAILABLE                          0x80003110
471 #define ERRCODE_NV_BUFFER_PRIMED_PREMATURELY                0x80003111
472 #define ERRCODE_NV_KEY_HASH_BUFFER_TOO_SMALL                0x80003112
473 #define ERRCODE_NV_WRITE_BUFFER_NOT_ALLOCATED               0x80003113
474 #define ERRCODE_NV_WRITE_BUFFER_TOO_SMALL                   0x80003114
475 #define ERRCODE_NV_WRITE_VETOED                             0x80003115
476 #define ERRCODE_NV_KEY_HEADER_BUFFER_NOT_ALLOCATED          0x80003116
477 #define ERRCODE_NV_STATE_INVALID                            0x80003117
478 
479 /* FLASH error */
480 #define ERRCODE_FLASH_TASK_COMPLETED                        0x80003130
481 #define ERRCODE_FLASH_INVALID_PARAM_BEYOND_ADDR             0x80003131
482 #define ERRCODE_FLASH_TASK_PE_VETO                          0x80003132
483 #define ERRCODE_FLASH_CONFIG_FAIL                           0x80003133
484 #define ERRCODE_FLASH_SPI_TRANS_FAIL                        0x80003134
485 #define ERRCODE_FLASH_TIMEOUT                               0x80003135
486 #define ERRCODE_FLASH_FALSE_MODE                            0x80003136
487 #define ERRCODE_FLASH_SPI_CONFIG_FAIL                       0x80003137
488 #define ERRCODE_FLASH_SPI_INIT_FAIL                         0x80003138
489 #define ERRCODE_FLASH_INIT_FAIL                             0x80003139
490 
491 /* IPC Error. */
492 #define ERRCODE_IPC_NOT_INIT                                0x80003140
493 #define ERRCODE_IPC_INVALID_PARAMETER                       0x80003141
494 #define ERRCODE_IPC_REG_ADDR_INVALID                        0x80003142
495 #define ERRCODE_IPC_NOT_REGISTER_HAL_FUNCS                  0x80003143
496 #define ERRCODE_IPC_UNDEFINED_ACTION                        0x80003144
497 #define ERRCODE_IPC_ASYNC_BUF_OVERFLOW                      0x80003145
498 #define ERRCODE_IPC_MAILBOX_STATUS_BUSY                     0x80003146
499 #define ERRCODE_IPC_MAILBOX_STATUS_IDLE                     0x80003147
500 
501 /* Testsuite Error. */
502 #define ERRCODE_TEST_SUITE_STATUS_RETURN_CONTROL            0x80003160
503 #define ERRCODE_TEST_SUITE_OK                               0x80003161
504 #define ERRCODE_TEST_SUITE_UNKNOWN_FUNCTION                 0x80003162
505 #define ERRCODE_TEST_SUITE_ERROR_TIMED_OUT                  0x80003163
506 #define ERRCODE_TEST_SUITE_ERROR_BAD_PARAMS                 0x80003164
507 #define ERRCODE_TEST_SUITE_ERROR_PIN_ALLOCATION             0x80003165
508 #define ERRCODE_TEST_SUITE_ERROR_PIN_DEALLOCATION           0x80003166
509 #define ERRCODE_TEST_SUITE_ERROR_UNEXPECTED_INTERRUPT       0x80003167
510 #define ERRCODE_TEST_SUITE_ALLOC_FAILED                     0x80003168
511 #define ERRCODE_TEST_SUITE_CONFIG_FAILED                    0x80003169
512 #define ERRCODE_TEST_SUITE_UNKNOWN_COMMAND                  0x80003170
513 #define ERRCODE_TEST_SUITE_UNRECOGNIZED_COMMAND             0x80003171
514 #define ERRCODE_TEST_SUITE_TEST_FAILED                      0x80003172
515 
516 /* DIAG Error */
517 #define ERRCODE_DIAG_STAT_INVALID_ID                        0x80003180 /* stat id is invalid */
518 #define ERRCODE_DIAG_NO_INITILIZATION                       0x80003181 /* diag not initilizate */
519 #define ERRCODE_DIAG_NOT_FOUND                              0x80003182 /* diag id not found */
520 #define ERRCODE_DIAG_INVALID_PARAMETER                      0x80003183 /* parameter invalid */
521 /* If the return value is ERRCODE_DIAG_CONSUMED, it indicates that the user sends a response (local connection)
522    to the host through the diag_send_ack_packet_prv API. The DIAG framework does not automatically */
523 #define ERRCODE_DIAG_CONSUMED                               0x80003184
524 #define ERRCODE_DIAG_TOO_SMALL_BUFFER                       0x80003185 /* too small buffer */
525 #define ERRCODE_DIAG_NO_MORE_DATA                           0x80003186 /* uart receive no more data */
526 #define ERRCODE_DIAG_NOT_ENOUGH_MEMORY                      0x80003187 /* malloc memory fail */
527 #define ERRCODE_DIAG_INVALID_HEAP_ADDR                      0x80003188 /* addr out of heap range */
528 #define ERRCODE_DIAG_NOT_CONNECT                            0x80003189 /* diag not connect */
529 #define ERRCODE_DIAG_BUSY                                   0x8000318A /* channel is busy */
530 #define ERRCODE_DIAG_TOO_LARGE_FRAME                        0x8000318B /* too large frame */
531 #define ERRCODE_DIAG_RAM_ALIGN                              0x8000318C /* ram addr not align */
532 #define ERRCODE_DIAG_NOT_SUPPORT                            0x8000318D /* not support */
533 #define ERRCODE_DIAG_QUEUE_FULL                             0x8000318E /* queue full */
534 #define ERRCODE_DIAG_MSG_CFG_NOT_ALLOW                      0x8000318F /* msg config allow send msg to pc */
535 #define ERRCODE_DIAG_TOO_LARGE_MSG                          0x80003190 /* too large msg */
536 #define ERRCODE_DIAG_INVALID_CODE_ADDR                      0x80003191 /* invalid code addr */
537 #define ERRCODE_DIAG_OBJ_NOT_FOUND                          0x80003192 /* object not found */
538 #define ERRCODE_DIAG_BLOCK_EMPTY                            0x80003193 /* buffer list is empty */
539 #define ERRCODE_DIAG_NOT_ENOUGH_SHARE_SPACE                 0x80003194 /* share space not enough */
540 #define ERRCODE_DIAG_CORRUPT_SHARED_MEMORY                  0x80003195 /* share space ctrl is corrupt */
541 #define ERRCODE_DIAG_NO_NEXT_MESSAGE                        0x80003196 /* no more msg in share mempry */
542 #define ERRCODE_DIAG_KV_NOT_SUPPORT_ID                      0x80003197 /* not support kv id */
543 #define ERRCODE_DIAG_BAD_DATA                               0x80003198 /* bad data */
544 #define ERRCODE_DIAG_CRC_ERROR                              0x80003199 /* crc error */
545 
546 /* Logfile Error */
547 #define ERRCODE_DFX_LOGFILE_INTERAL_FAIL                    0x80003210
548 #define ERRCODE_DFX_LOGFILE_RECORD_INVALID                  0x80003211
549 #define ERRCODE_DFX_LOGFILE_WRITE_FAIL                      0x80003212
550 #define ERRCODE_DFX_LOGFILE_OPEN_FAIL                       0x80003213
551 #define ERRCODE_DFX_LOGFILE_EVENT_FAILURE                   0x80003214
552 #define ERRCODE_DFX_LOGFILE_MUTEX_FAILURE                   0x80003215
553 #define ERRCODE_DFX_LOGFILE_TIMER_FAILURE                   0x80003216
554 #define ERRCODE_DFX_LOGFILE_THREAD_FAILURE                  0x80003217
555 #define ERRCODE_DFX_LOGFILE_ALREADY_OPEN                    0x80003218
556 #define ERRCODE_DFX_LOGFILE_MKDIR_FATAL                     0x80003219
557 #define ERRCODE_DFX_LOGFILE_SUSPENDED                       0x8000321A
558 #define ERRCODE_DFX_LOGFILE_FLASH_PREPARE_FAIL              0x80003220
559 #define ERRCODE_DFX_LOGFILE_NOT_ENOUGH_SPACE                0x80003221
560 
561 /* PM Error */
562 #define ERRCODE_PM_ERROR                                    0x80003230
563 #define ERRCODE_PM_INVALID_PARAMETER                        0x80003231
564 #define ERRCODE_PM_MEM_ALLOC_ERROR                          0x80003232
565 #define ERRCODE_PM_RET_MEM_FREE_ERROR                       0x80003233
566 #define ERRCODE_PM_CUSTOM_MODE_EXISTS                       0x80003234
567 #define ERRCODE_PM_SLEEP_THRESHOLD_TOO_SMALL                0x80003235
568 #define ERRCODE_PM_SWITCH_FUNC_NULL                         0x80003236
569 #define ERRCODE_PM_PF_IS_OFF                                0x80003237
570 #define ERRCODE_PM_SWITCH_FUNC_FAIL                         0x80003238
571 #define ERRCODE_PM_RECORD_REQ_STS_FAIL                      0x80003239
572 #define ERRCODE_PM_WFI_PROCESS                              0x80003240
573 #define ERRCODE_PM_WORK_PROCESS                             0x80003241
574 #define ERRCODE_PM_DEEPSLEEP_PROCESS                        0x80003242
575 #define ERRCODE_PM_LIGHTSLEEP_PROCESS                       0x80003243
576 #define ERRCODE_PM_SERV_ID_NOT_ENABLE                       0x80003244
577 #define ERRCODE_PM_MODE_DOWNGRADED                          0x80003245
578 #define ERRCODE_PM_MODE_ONLY_REMOVE_VOTE                    0x80003246
579 #define ERRCODE_PM_MODE_ONLY_JOIN_VOTE                      0x80003247
580 
581 /* SDIO Device Error. */
582 #define ERRCODE_SDIO_NOT_INIT                               0x80003250
583 #define ERRCODE_SDIO_INVALID_PARAMETER                      0x80003251
584 #define ERRCODE_SDIO_REG_ADDR_INVALID                       0x80003252
585 #define ERRCODE_SDIO_ERR_OVERFLOW                           0x80003253
586 #define ERRCODE_SDIO_ERR_MSG_TO_HOST_NOT_READ               0x80003254
587 #define ERRCODE_SDIO_ERR_INIT_CARD_RDY_TIMEOUT              0x80003255
588 #define ERRCODE_SDIO_ERR_INIT_FUN1_RDY_TIMEOUT              0x80003256
589 #define ERRCODE_SDIO_ERR_STATUS                             0x80003257
590 
591 /* Security Related Error. */
592 #define ERRCODE_SEC_KEY_GEN_INVALID_PARAM                   0x80003280
593 #define ERRCODE_SEC_IAMGE_ID_INVALID                        0x80003281
594 
595 #define ERRCODE_SEC_IMAGE_MSID_INVALID                      0x80003290
596 #define ERRCODE_SEC_IMAGE_DIE_ID_INVALID                    0x80003291
597 #define ERRCODE_SEC_IMAGE_KEY_INVALID_PARAM                 0x80003292
598 #define ERRCODE_SEC_IMAGE_KEY_ID_INVALID                    0x80003293
599 #define ERRCODE_SEC_IMAGE_KEY_VERSION_INVALID               0x80003294
600 #define ERRCODE_SEC_IMAGE_KEY_AREA_VERIFY_FAILED            0x80003295
601 #define ERRCODE_SEC_IMAGE_KEY_LENGTH_INVALID                0x80003296
602 
603 #define ERRCODE_SEC_IMAGE_INFO_INVALID_PARAM                0x800032a0
604 #define ERRCODE_SEC_IMAGE_INFO_ID_INVALID                   0x800032a1
605 #define ERRCODE_SEC_IMAGE_INFO_VERSION_INVALID              0x800032a2
606 #define ERRCODE_SEC_IMAGE_INFO_AREA_VERIFY_FAILED           0x800032a3
607 
608 #define ERRCODE_SEC_IMAGE_CODE_INVALID_PARAM                0x800032b0
609 #define ERRCODE_SEC_IMAGE_CODE_CHECK_FAILED                 0x800032b1
610 #define ERRCODE_SEC_IMAGE_CODE_GET_HASH_FAILED              0x800032b2
611 
612 /* SYS ctrl Related Error. */
613 #define ERRCODE_SYS_COMMU_INVALID_PARAM                     0x80003301
614 #define ERRCODE_SYS_COMMU_NO_RESOURCE                       0x80003302
615 /*
616 * 5 Wi - Fi (0x8000_4000 - 0x8000_5000)
617 */
618 
619 /*
620 * 6 AUDIO (0x8000_5000 - 0x8000_5800)
621 */
622 
623 /*
624 * 7 NFC (0x8000_5800 - 0x8000_6000)
625 */
626 
627 /*
628 * 8 BT (0x8000_6000 - 0x8000_7000)
629 */
630 
631 /*
632 * 9 DISPLAY (0x8000_7000 - 0x8000_8000)
633 */
634 
635 /*
636 * 10 PLC (0x8000_8000 - 0x8000_9000)
637 */
638 
639 /*
640 * 11 EPMU (0x8000_9000 - 0x8000_9400)
641 */
642 #define ERRCODE_EPMU_CONFIG_ERR                             0x80009000
643 #define ERRCODE_EPMU_STAT_ERR                               0x80009001
644 #define ERRCODE_EPMU_NULL_PTR                               0x80009002
645 #define ERRCODE_EPMU_UNSUPPORT                              0x80009003
646 #define ERRCODE_EPMU_ADDR_ERR                               0x80009004
647 #define ERRCODE_EPMU_BUS_ERR                                0x80009005
648 #define ERRCODE_EPMU_TIMEOUT                                0x80009006
649 #define ERRCODE_EPMU_NV_ERR                                 0x80009007
650 
651 /*
652 * 12 GLP (0x8000_9400 - 0x8000_9800)
653 */
654 
655 /*
656 * 13 RADAR (0x8000_9800 - 0x8000_9C00)
657 */
658 
659 /*
660 * 14 TIOT_HOST (0x8000_9C00 - 0x8000_A000)
661 */
662 
663 /*
664 * 15 GNSS (0x8000_A000 - 0x8000_A400)
665 */
666 
667 
668 /**
669  * @}
670  */
671 
672 #ifdef __cplusplus
673 #if __cplusplus
674 }
675 
676 #endif /* __cplusplus */
677 #endif /* __cplusplus */
678 
679 #endif
680