1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 #ifndef __HI_ERRNO_H__
19 #define __HI_ERRNO_H__
20 
21 /* ****************************************************************************
22  * 1、通用错误码。注意0x8000 0000最好别用,产生截断误判为成功
23  * ************************************************************************** */
24 #define  HI_ERR_SUCCESS                                     0
25 #define  HI_ERR_FAILURE                                     (hi_u32)(-1)
26 #define  HI_ERR_S_FAILURE                                   (-1)
27 #define  HI_ERR_MALLOC_FAILUE                               0x80000001
28 #define  HI_ERR_TIMEOUT                                     0x80000002
29 #define  HI_ERR_RECVING                                     0x80000003
30 #define  HI_ERR_MEMCPY_S                                    0x80000004
31 #define  HI_ERR_MEMSET_S                                    0x80000005
32 #define  HI_ERR_SPRINTF_S                                   0x80000006
33 #define  HI_ERR_STRCPY_S                                    0x80000007
34 
35 /* ****************************************************************************
36  * 2、系统适配层:错误码
37  * *************************************************************************** */
38 /* 任务 */
39 #define HI_ERR_TASK_INVALID_PARAM                           0x80000080
40 #define HI_ERR_TASK_CREATE_FAIL                             0x80000081
41 #define HI_ERR_TASK_DELETE_FAIL                             0x80000082
42 #define HI_ERR_TASK_SUPPEND_FAIL                            0x80000083
43 #define HI_ERR_TASK_RESUME_FAIL                             0x80000084
44 #define HI_ERR_TASK_GET_PRI_FAIL                            0x80000085
45 #define HI_ERR_TASK_SET_PRI_FAIL                            0x80000086
46 #define HI_ERR_TASK_LOCK_FAIL                               0x80000087
47 #define HI_ERR_TASK_UNLOCK_FAIL                             0x80000088
48 #define HI_ERR_TASK_DELAY_FAIL                              0x80000089
49 #define HI_ERR_TASK_GET_INFO_FAIL                           0x8000008A
50 #define HI_ERR_TASK_REGISTER_SCHEDULE_FAIL                  0x8000008B
51 #define HI_ERR_TASK_NOT_CREATED                             0x8000008C
52 
53 /* 中断ISR */
54 #define HI_ERR_ISR_INVALID_PARAM                            0x800000C0
55 #define HI_ERR_ISR_REQ_IRQ_FAIL                             0x800000C1
56 #define HI_ERR_ISR_ADD_JOB_MALLOC_FAIL                      0x800000C2
57 #define HI_ERR_ISR_ADD_JOB_SYS_FAIL                         0x800000C3
58 #define HI_ERR_ISR_DEL_IRQ_FAIL                             0x800000C4
59 #define HI_ERR_ISR_ALREADY_CREATED                          0x800000C5
60 #define HI_ERR_ISR_NOT_CREATED                              0x800000C6
61 #define HI_ERR_ISR_ENABLE_IRQ_FAIL                          0x800000C7
62 #define HI_ERR_ISR_IRQ_ADDR_NOK                             0x800000C8
63 
64 /* 内存 */
65 #define HI_ERR_MEM_INVALID_PARAM                            0x80000100
66 #define HI_ERR_MEM_CREAT_POOL_FAIL                          0x80000101
67 #define HI_ERR_MEM_CREATE_POOL_NOT_ENOUGH_HANDLE            0x80000102
68 #define HI_ERR_MEM_FREE_FAIL                                0x80000103
69 #define HI_ERR_MEM_RE_INIT                                  0x80000104
70 #define HI_ERR_MEM_NOT_INIT                                 0x80000105
71 #define HI_ERR_MEM_CREAT_POOL_MALLOC_FAIL                   0x80000106
72 #define HI_ERR_MEM_GET_INFO_FAIL                            0x80000107
73 #define HI_ERR_MEM_GET_OS_INFO_NOK                          0x80000108
74 
75 /* OSTIMER定时器 */
76 #define HI_ERR_TIMER_FAILURE                                0x80000140
77 #define HI_ERR_TIMER_INVALID_PARAM                          0x80000141
78 #define HI_ERR_TIMER_CREATE_HANDLE_FAIL                     0x80000142
79 #define HI_ERR_TIMER_START_FAIL                             0x80000143
80 #define HI_ERR_TIMER_HANDLE_NOT_CREATE                      0x80000144
81 #define HI_ERR_TIMER_HANDLE_INVALID                         0x80000145
82 #define HI_ERR_TIMER_STATUS_INVALID                         0x80000146
83 #define HI_ERR_TIMER_STATUS_START                           0x80000147
84 #define HI_ERR_TIMER_INVALID_MODE                           0x80000148
85 #define HI_ERR_TIMER_EXPIRE_INVALID                         0x80000149
86 #define HI_ERR_TIMER_FUNCTION_NULL                          0x8000014A
87 #define HI_ERR_TIMER_HANDLE_MAXSIZE                         0x8000014B
88 #define HI_ERR_TIMER_MALLOC_FAIL                            0x8000014C
89 #define HI_ERR_TIMER_NOT_INIT                               0x8000014D
90 
91 /* 信号量 */
92 #define HI_ERR_SEM_INVALID_PARAM                            0x80000180
93 #define HI_ERR_SEM_CREATE_FAIL                              0x80000181
94 #define HI_ERR_SEM_DELETE_FAIL                              0x80000182
95 #define HI_ERR_SEM_WAIT_FAIL                                0x80000183
96 #define HI_ERR_SEM_SIG_FAIL                                 0x80000184
97 #define HI_ERR_SEM_WAIT_TIME_OUT                            0x80000185
98 
99 /* 互斥锁 */
100 #define HI_ERR_MUX_INVALID_PARAM                            0x800001C0
101 #define HI_ERR_MUX_CREATE_FAIL                              0x800001C1
102 #define HI_ERR_MUX_DELETE_FAIL                              0x800001C2
103 #define HI_ERR_MUX_PEND_FAIL                                0x800001C3
104 #define HI_ERR_MUX_POST_FAIL                                0x800001C4
105 
106 /* 消息 */
107 #define HI_ERR_MSG_INVALID_PARAM                            0x80000200
108 #define HI_ERR_MSG_CREATE_Q_FAIL                            0x80000201
109 #define HI_ERR_MSG_DELETE_Q_FAIL                            0x80000202
110 #define HI_ERR_MSG_WAIT_FAIL                                0x80000203
111 #define HI_ERR_MSG_SEND_FAIL                                0x80000204
112 #define HI_ERR_MSG_GET_Q_INFO_FAIL                          0x80000205
113 #define HI_ERR_MSG_Q_DELETE_FAIL                            0x80000206
114 #define HI_ERR_MSG_WAIT_TIME_OUT                            0x80000207
115 
116 /* 事件 */
117 #define HI_ERR_EVENT_INVALID_PARAM                          0x80000240
118 #define HI_ERR_EVENT_CREATE_NO_HADNLE                       0x80000241
119 #define HI_ERR_EVENT_CREATE_SYS_FAIL                        0x80000242
120 #define HI_ERR_EVENT_SEND_FAIL                              0x80000243
121 #define HI_ERR_EVENT_WAIT_FAIL                              0x80000244
122 #define HI_ERR_EVENT_CLEAR_FAIL                             0x80000245
123 #define HI_ERR_EVENT_RE_INIT                                0x80000246
124 #define HI_ERR_EVENT_NOT_ENOUGH_MEMORY                      0x80000247
125 #define HI_ERR_EVENT_NOT_INIT                               0x80000248
126 #define HI_ERR_EVENT_DELETE_FAIL                            0x80000249
127 #define HI_ERR_EVENT_WAIT_TIME_OUT                          0x8000024A
128 
129 /* os维测 */
130 #define HI_ERR_OSSTAT_INVALID_PARAM                         0x80000280
131 #define HI_ERR_OSSTAT_SYSTEM_CALL_ERROR                     0x80000281
132 
133 /* liteos fpb */
134 #define HI_ERR_FPB_COMP_REPEAT                              0x800002C0
135 #define HI_ERR_FPB_NO_COMP                                  0x800002C1
136 #define HI_ERR_FPB_TYPE                                     0x800002C2
137 #define HI_ERR_FPB_NO_FREE_COMP                             0x800002C3
138 #define HI_ERR_FPB_ADDR_NOT_ALIGN                           0x800002C4
139 #define HI_ERR_FPB_TARGET_ADDR                              0x800002C5
140 #define HI_ERR_FPB_BUSY                                     0x800002C6 /* ????????? */
141 #define HI_ERR_FPB_ERROR_INPUT                              0x800002C7
142 
143 /* CPU */
144 #define HI_ERR_CPUP_NOT_INIT                                0x80000300
145 #define HI_ERR_CPUP_INVALID_PARAM                           0x80000301
146 #define HI_ERR_CPU_CLK_INVALID_PARAM                        0x80000302
147 
148 /* file system */
149 #define HI_ERR_FS_INVALID_PARAM                             0x80000400
150 #define HI_ERR_FS_NO_DEVICE                                 0x80000401
151 #define HI_ERR_FS_NO_SPACE                                  0x80000402  /* No space left on device */
152 #define HI_ERR_FS_BAD_DESCRIPTOR                            0x80000403
153 #define HI_ERR_FS_FILE_EXISTS                               0x80000404
154 #define HI_ERR_FS_NOT_FOUND                                 0x80000405
155 #define HI_ERR_FS_NAME_TOO_LONG                             0x80000406
156 #define HI_ERR_FS_READ_ONLY_FS                              0x80000407 /* Read-only file system */
157 #define HI_ERR_FS_IO_ERROR                                  0x80000408
158 #define HI_ERR_FS_NO_MORE_FILES                             0x80000409
159 
160 /* ****************************************************************************
161  * 3、驱动:错误码
162  * *************************************************************************** */
163 /* 串口 */
164 #define HI_ERR_UART_INVALID_PARAMETER                       0x80001000
165 #define HI_ERR_UART_INVALID_SUSPEND                         0x80001001
166 #define HI_ERR_UART_INVALID_PARITY                          0x80001002
167 #define HI_ERR_UART_INVALID_DATA_BITS                       0x80001003
168 #define HI_ERR_UART_INVALID_STOP_BITS                       0x80001004
169 #define HI_ERR_UART_INVALID_BAUD                            0x80001005
170 #define HI_ERR_UART_INVALID_COM_PORT                        0x80001006
171 #define HI_ERR_UART_NOT_SUPPORT_DMA                         0x80001007
172 
173 /* gpio */
174 #define HI_ERR_GPIO_INVALID_PARAMETER                       0x80001040
175 #define HI_ERR_GPIO_REPEAT_INIT                             0x80001041
176 #define HI_ERR_GPIO_NOT_INIT                                0x80001042
177 #define HI_ERR_GPIO_NOT_SUPPORT                             0x80001043
178 
179 /* 看门狗 */
180 #define HI_ERR_WATCHDOG_PARA_ERROR                          0x80001080
181 
182 /* Flash */
183 #define HI_ERR_FLASH_NOT_INIT                               0x800010C0
184 #define HI_ERR_FLASH_INVALID_PARAM                          0x800010C1
185 #define HI_ERR_FLASH_INVALID_PARAM_BEYOND_ADDR              0x800010C2
186 #define HI_ERR_FLASH_INVALID_PARAM_SIZE_ZERO                0x800010C3
187 #define HI_ERR_FLASH_INVALID_PARAM_ERASE_NOT_ALIGN          0x800010C4
188 #define HI_ERR_FLASH_INVALID_PARAM_IOCTRL_DATA_NULL         0x800010C5
189 #define HI_ERR_FLASH_INVALID_PARAM_DATA_NULL                0x800010C6
190 #define HI_ERR_FLASH_INVALID_PARAM_PAD1                     0x800010C7
191 #define HI_ERR_FLASH_INVALID_PARAM_PAD2                     0x800010C8
192 #define HI_ERR_FLASH_INVALID_PARAM_PAD3                     0x800010C9
193 #define HI_ERR_FLASH_INVALID_PARAM_PAD4                     0x800010CA
194 #define HI_ERR_FLASH_TIME_OUT_WAIT_READY                    0x800010CB
195 #define HI_ERR_FLASH_QUAD_MODE_READ_REG1                    0x800010CC
196 #define HI_ERR_FLASH_QUAD_MODE_READ_REG2                    0x800010CD
197 #define HI_ERR_FLASH_QUAD_MODE_COMPARE_REG                  0x800010CE
198 #define HI_ERR_FLASH_NO_MATCH_FLASH                         0x800010CF
199 #define HI_ERR_FLASH_WRITE_ENABLE                           0x800010D0
200 #define HI_ERR_FLASH_NO_MATCH_ERASE_SIZE                    0x800010D1
201 #define HI_ERR_FLASH_MAX_SPI_OP                             0x800010D2
202 #define HI_ERR_FLASH_NOT_SUPPORT_IOCTRL_ID                  0x800010D3
203 #define HI_ERR_FLASH_INVALID_CHIP_ID                        0x800010D4
204 #define HI_ERR_FLASH_RE_INIT                                0x800010D5
205 #define HI_ERR_FLASH_WRITE_NOT_SUPPORT_ERASE                0x800010D6
206 #define HI_ERR_FLASH_WRITE_COMPARE_WRONG                    0x800010D7
207 #define HI_ERR_FLASH_WAIT_CFG_START_TIME_OUT                0x800010D8
208 #define HI_ERR_FLASH_PATITION_INIT_FAIL                     0x800010D9
209 #define HI_ERR_FLASH_INITILIZATION                          0x800010DA
210 #define HI_ERR_FLASH_ERASE_NOT_4K_ALIGN                     0x800010DB
211 #define HI_ERR_FLASH_PROTECT_NOT_SUPPORT                    0x800010DC
212 #define HI_ERR_FLASH_PROTECT_NOT_INIT                       0x800010DD
213 #define HI_ERR_FLASH_PROTECT_RE_INIT                        0x800010DE
214 #define HI_ERR_FLASH_PROTECT_NOT_FIND_CHIP                  0x800010DF
215 #define HI_ERR_FLASH_MEMCPY_FAIL                            0x800010E0
216 
217 /* HRTIMER定时器 */
218 #define HI_ERR_HRTIMER_ALREADY_INIT                         0x80001100
219 #define HI_ERR_HRTIMER_NOT_INIT                             0x80001101
220 #define HI_ERR_HRTIMER_HAVE_NO_AVAILABLE_HANDLE             0x80001102
221 #define HI_ERR_HRTIMER_NOT_CREATE_HANDLE                    0x80001103
222 #define HI_ERR_HRTIMER_IN_START_STATUS                      0x80001104
223 #define HI_ERR_HRTIMER_NOT_START                            0x80001105
224 #define HI_ERR_HRTIMER_INVALID_ID                           0x80001106
225 #define HI_ERR_HRTIMER_INVALID_PARAMETER                    0x80001107
226 #define HI_ERR_HRTIMER_MALLOC_FAILUE                        0x80001108
227 
228 /* hardware timer */
229 #define HI_ERR_HWTIMER_INVALID_PARAMETER                    0x80001140
230 #define HI_ERR_HWTIMER_INITILIZATION_ALREADY                0x80001141
231 #define HI_ERR_HWTIMER_NO_INIT                              0x80001142
232 
233 /* i2c */
234 #define HI_ERR_I2C_NOT_INIT                                 0x80001180
235 #define HI_ERR_I2C_INVALID_PARAMETER                        0x80001181
236 #define HI_ERR_I2C_TIMEOUT_START                            0x80001182
237 #define HI_ERR_I2C_TIMEOUT_WAIT                             0x80001183
238 #define HI_ERR_I2C_TIMEOUT_STOP                             0x80001184
239 #define HI_ERR_I2C_TIMEOUT_RCV_BYTE                         0x80001185
240 #define HI_ERR_I2C_TIMEOUT_RCV_BYTE_PROC                    0x80001186
241 #define HI_ERR_I2C_WAIT_SEM_FAIL                            0x80001187
242 #define HI_ERR_I2C_START_ACK_ERR                            0x80001188
243 #define HI_ERR_I2C_WAIT_ACK_ERR                             0x80001189
244 
245 /* spi */
246 #define HI_ERR_SPI_NOT_INIT                                 0x800011C0
247 #define HI_ERR_SPI_REINIT                                   0x800011C1
248 #define HI_ERR_SPI_PARAMETER_WRONG                          0x800011C2
249 #define HI_ERR_SPI_BUSY                                     0x800011C3
250 #define HI_ERR_SPI_WRITE_TIMEOUT                            0x800011C4
251 #define HI_ERR_SPI_READ_TIMEOUT                             0x800011C5
252 #define HI_ERR_SPI_NOT_SUPPORT_DMA                          0x800011C6
253 
254 /* efuse */
255 #define HI_ERR_EFUSE_INVALIDATE_ID                          0x80001200
256 #define HI_ERR_EFUSE_INVALIDATE_PARA                        0x80001201
257 #define HI_ERR_EFUSE_WRITE_ERR                              0x80001202
258 #define HI_ERR_EFUSE_INVALIDATE_AUTH                        0x80001203
259 #define HI_ERR_EFUSE_BUSY                                   0x80001204
260 #define HI_ERR_EFUSE_TIMEOUT                                0x80001205
261 
262 /* cipher */
263 #define HI_ERR_CIPHER_NOT_INIT                              0x80001240
264 #define HI_ERR_CIPHER_INVALID_POINT                         0x80001241
265 #define HI_ERR_CIPHER_INVALID_PARAMETER                     0x80001242
266 #define HI_ERR_CIPHER_NO_AVAILABLE_RNG                      0x80001243
267 #define HI_ERR_CIPHER_FAILED_MEM                            0x80001244
268 #define HI_ERR_CIPHER_OVERFLOW                              0x80001245
269 #define HI_ERR_CIPHER_TIMEOUT                               0x80001246
270 #define HI_ERR_CIPHER_UNSUPPORTED                           0x80001247
271 #define HI_ERR_CIPHER_REGISTER_IRQ                          0x80001248
272 #define HI_ERR_CIPHER_ILLEGAL_KEY                           0x80001249
273 #define HI_ERR_CIPHER_INVALID_ADDR                          0x8000124A
274 #define HI_ERR_CIPHER_INVALID_LENGTH                        0x8000124B
275 #define HI_ERR_CIPHER_ILLEGAL_DATA                          0x8000124C
276 #define HI_ERR_CIPHER_RSA_SIGN                              0x8000124D
277 #define HI_ERR_CIPHER_RSA_VERIFY                            0x8000124E
278 #define HI_ERR_CIPHER_RESULT_WARNING                        0x8000124F
279 #define HI_ERR_CIPHER_FLUSH_DCACHE_FAILED                   0x80001250
280 
281 /* sdio */
282 #define HI_ERR_SDIO_INVALID_PARAMETER                       0x80001280
283 
284 /* tsensor */
285 #define HI_ERR_TSENSOR_INVALID_PARAMETER                    0x800012C0
286 
287 /* adc */
288 #define HI_ERR_ADC_PARAMETER_WRONG                          0x80001300
289 #define HI_ERR_ADC_INVALID_CHANNEL_ID                       0x80001301
290 #define HI_ERR_ADC_TIMEOUT                                  0x80001302
291 #define HI_ERR_ADC_NOT_INIT                                 0x80001303
292 
293 /* pmw */
294 #define HI_ERR_PWM_NO_INIT                                  0x80001340
295 #define HI_ERR_PWM_INITILIZATION_ALREADY                    0x80001341
296 #define HI_ERR_PWM_INVALID_PARAMETER                        0x80001342
297 
298 
299 /* dma */
300 #define HI_ERR_DMA_INVALID_PARA                             0x80001380
301 #define HI_ERR_DMA_NOT_INIT                                 0x80001381
302 #define HI_ERR_DMA_BUSY                                     0x80001382
303 #define HI_ERR_DMA_TRANSFER_FAIL                            0x80001383
304 #define HI_ERR_DMA_TRANSFER_TIMEOUT                         0x80001384
305 #define HI_ERR_DMA_GET_NOTE_FAIL                            0x80001385
306 #define HI_ERR_DMA_LLI_NOT_CREATE                           0x80001386
307 #define HI_ERR_DMA_CH_IRQ_ENABLE_FAIL                       0x80001387
308 /* audio */
309 #define HI_ERR_AUDIO_BUSY                                   0x800013C0
310 #define HI_ERR_AUDIO_INVALID_PARAMETER                      0x800013C1
311 
312 /* i2s */
313 #define HI_ERR_I2S_INVALID_PARAMETER                        0x80001400
314 #define HI_ERR_I2S_WRITE_TIMEOUT                            0x80001401
315 
316 /* ****************************************************************************
317  * 4、中间应用:错误码
318  * *************************************************************************** */
319 /* NV */
320 #define HI_ERR_NV_FILE_ERR                                  0x80003000
321 #define HI_ERR_NV_MEMCPY_FAIL                               0x80003001
322 #define HI_ERR_NV_WRITE_FILE_FAIL                           0x80003002
323 #define HI_ERR_NV_UPDATA_DATA_FAIL                          0x80003003
324 #define HI_ERR_NV_UPDATA_FILE_FAIL                          0x80003004
325 #define HI_ERR_NV_NOT_SUPPORT_WRITE                         0x80003005
326 #define HI_ERR_NV_FSEC_TOTAL_NUM_INVALID                    0x80003006 /* 工厂NV项个数非法 */
327 #define HI_ERR_NV_FAIL_N_TIMES                              0x80003007
328 #define HI_ERR_NV_SEM_FAIL                                  0x80003008
329 #define HI_ERR_NV_LEN_ERR                                   0x80003009
330 #define HI_ERR_NV_NOT_FOUND                                 0x8000300A
331 #define HI_ERR_NV_FULL                                      0x8000300B
332 #define HI_ERR_NV_NOT_ENOUGH_MEMORY                         0x8000300C
333 #define HI_ERR_NV_NOT_SUPPORT                               0x8000300D
334 #define HI_ERR_NV_NOT_SUPPORT_ID                            0x8000300E
335 #define HI_ERR_NV_BAD_DATA                                  0x8000300F
336 #define HI_ERR_NV_INVALID_TYPE                              0x80003010
337 /* NV读取失败" "Read NVIM Failure" */
338 #define HI_ERR_NV_ERROR_READ                                0x80003011
339 /* NV写失败,长度过长""Write Error for Length Overflow" */
340 #define HI_ERR_NV_NOT_SUPPORT_LENTH                         0x80003012
341 /* NV写失败,Flash坏块" "Write Error for Flash Bad Block" */
342 #define HI_ERR_NV_BAD_BLOCK                                 0x80003013
343 /* NV写失败,其他错误" "Write Error for Unknown Reason" */
344 #define HI_ERR_NV_ERROR_WRITE                               0x80003014
345 #define HI_ERR_NV_INITILIZATION                             0x80003015
346 #define HI_ERR_NV_INVALID_PARAMETER                         0x80003016
347 
348 /* 低功耗 */
349 #define HI_ERR_LOWPOWER_INVALID_PARAMETER                   0x80003040
350 
351 /* upgrade common error */
352 #define HI_ERR_UPG_COMMON                                   0x80003060
353 #define HI_ERR_UPG_NULL_POINTER                             (HI_ERR_UPG_COMMON + 0x0)
354 #define HI_ERR_UPG_PARAMETER                                (HI_ERR_UPG_COMMON + 0x1)
355 #define HI_ERR_UPG_BACKUP_ADDR                              (HI_ERR_UPG_COMMON + 0x2)
356 #define HI_ERR_UPG_BUSY                                     (HI_ERR_UPG_COMMON + 0x3)
357 #define HI_ERR_UPG_FLASH_BAD                                (HI_ERR_UPG_COMMON + 0x4)
358 #define HI_ERR_UPG_START_ADDR                               (HI_ERR_UPG_COMMON + 0x5)
359 #define HI_ERR_UPG_INITILIZATION_ALREADY                    (HI_ERR_UPG_COMMON + 0x6)
360 #define HI_ERR_UPG_FILE_LEN                                 (HI_ERR_UPG_COMMON + 0x7)
361 #define HI_ERR_UPG_NOT_START                                (HI_ERR_UPG_COMMON + 0x8)
362 #define HI_ERR_UPG_MALLOC_FAIL                              (HI_ERR_UPG_COMMON + 0x9)
363 #define HI_ERR_UPG_GET_SECTION_HEAD                         (HI_ERR_UPG_COMMON + 0xA)
364 #define HI_ERR_UPG_BUF_LEN                                  (HI_ERR_UPG_COMMON + 0xB)
365 #define HI_ERR_UPG_FLASH_SIZE                               (HI_ERR_UPG_COMMON + 0xC)
366 #define HI_ERR_UPG_NV_SIZE                                  (HI_ERR_UPG_COMMON + 0xD)
367 #define HI_ERR_UPG_ALREADY_FINISH                           (HI_ERR_UPG_COMMON + 0xE)
368 #define HI_ERR_UPG_RSA_KEY_ADDR                             (HI_ERR_UPG_COMMON + 0xF)
369 #define HI_ERR_UPG_ECC_KEY_ADDR                             (HI_ERR_UPG_COMMON + 0x10)
370 #define HI_ERR_UPG_FILE_LEN_OVER                            (HI_ERR_UPG_COMMON + 0x11)
371 #define HI_ERR_UPG_STOP                                     (HI_ERR_UPG_COMMON + 0x12)
372 #define HI_ERR_UPG_LOW_FIRMWARE_VER                         (HI_ERR_UPG_COMMON + 0x13)
373 #define HI_ERR_UPG_FULL_FIRMWARE_VER                        (HI_ERR_UPG_COMMON + 0x14)
374 #define HI_ERR_UPG_LOW_BOOT_VER                             (HI_ERR_UPG_COMMON + 0x15)
375 #define HI_ERR_UPG_FULL_BOOT_VER                            (HI_ERR_UPG_COMMON + 0x16)
376 #define HI_ERR_UPG_FIRST_PACKET_OFFSET                      (HI_ERR_UPG_COMMON + 0x17)
377 #define HI_ERR_UPG_MEMCPY_FAIL                              (HI_ERR_UPG_COMMON + 0x18)
378 
379 /* upgrade file check error */
380 #define HI_ERR_UPG_CHECK                                     0x80003080
381 #define HI_ERR_UPG_IMAGE_ID                                 (HI_ERR_UPG_CHECK + 0x0)
382 #define HI_ERR_UPG_FILE_TYPE                                (HI_ERR_UPG_CHECK + 0x1)
383 #define HI_ERR_UPG_HEAD_LEN                                 (HI_ERR_UPG_CHECK + 0x2)
384 #define HI_ERR_UPG_SIGN_ALG                                 (HI_ERR_UPG_CHECK + 0x3)
385 #define HI_ERR_UPG_RSA_KEY_LEN                              (HI_ERR_UPG_CHECK + 0x4)
386 #define HI_ERR_UPG_RSA_HEAD_SIGN                            (HI_ERR_UPG_CHECK + 0x5)
387 #define HI_ERR_UPG_ECC_KEY_LEN                              (HI_ERR_UPG_CHECK + 0x6)
388 #define HI_ERR_UPG_ECC_HEAD_SIGN                            (HI_ERR_UPG_CHECK + 0x7)
389 #define HI_ERR_UPG_COMMON_SHA256                            (HI_ERR_UPG_CHECK + 0x8)
390 #define HI_ERR_UPG_SECTION_SHA256                           (HI_ERR_UPG_CHECK + 0x9)
391 #define HI_ERR_UPG_FIRMWARE_VER                             (HI_ERR_UPG_CHECK + 0xA)
392 #define HI_ERR_UPG_BOOT_VER                                 (HI_ERR_UPG_CHECK + 0xB)
393 #define HI_ERR_UPG_BOOT_HEAD                                (HI_ERR_UPG_CHECK + 0xC)
394 #define HI_ERR_UPG_BOOT_LEN                                 (HI_ERR_UPG_CHECK + 0xD)
395 #define HI_ERR_UPG_BOOT_ROOT_KEY                            (HI_ERR_UPG_CHECK + 0xE)
396 #define HI_ERR_UPG_BOOT_ROOT_KEY_LEN                        (HI_ERR_UPG_CHECK + 0xF)
397 #define HI_ERR_UPG_BOOT_KEY_ID                              (HI_ERR_UPG_CHECK + 0x10)
398 #define HI_ERR_UPG_BOOT_SIGN_ALG                            (HI_ERR_UPG_CHECK + 0x11)
399 #define HI_ERR_UPG_BOOT_SUB_KEY                             (HI_ERR_UPG_CHECK + 0x12)
400 #define HI_ERR_UPG_BOOT_SUB_KEY_CAT                         (HI_ERR_UPG_CHECK + 0x13)
401 #define HI_ERR_UPG_BOOT_SUB_KEY_RSIM                        (HI_ERR_UPG_CHECK + 0x14)
402 #define HI_ERR_UPG_BOOT_DIE_ID                              (HI_ERR_UPG_CHECK + 0x15)
403 #define HI_ERR_UPG_BOOT_HASH                                (HI_ERR_UPG_CHECK + 0x16)
404 #define HI_ERR_UPG_BOOT_SUB_KEY_LEN                         (HI_ERR_UPG_CHECK + 0x17)
405 
406 /* DIAG */
407 #define HI_ERR_DIAG_NOT_FOUND                               0x800030C0
408 #define HI_ERR_DIAG_INVALID_ID                              0x800030C1
409 #define HI_ERR_DIAG_FULL                                    0x800030C2
410 #define HI_ERR_DIAG_CONSUMED                                0x800030C3
411 #define HI_ERR_DIAG_CONTINUE                                0x800030C4
412 #define HI_ERR_DIAG_TOO_SMALL_BUFFER                        0x800030C5
413 #define HI_ERR_DIAG_NO_MORE_DATA                            0x800030C6
414 #define HI_ERR_DIAG_NOT_ENOUGH_MEMORY                       0x800030C7
415 #define HI_ERR_DIAG_INVALID_HEAP_ADDR                       0x800030C8
416 #define HI_ERR_DIAG_NOT_CONNECT                             0x800030C9
417 #define HI_ERR_DIAG_BUSY                                    0x800030CA
418 #define HI_ERR_DIAG_TOO_LARGE_FRAME                         0x800030CB
419 #define HI_ERR_DIAG_RAM_ALIGN                               0x800030CC
420 #define HI_ERR_DIAG_NOT_SUPPORT                             0x800030CD
421 #define HI_ERR_DIAG_UNAVAILABLE                             0x800030CE
422 #define HI_ERR_DIAG_CFG_NOT_ALLOW                           0x800030CF
423 #define HI_ERR_DIAG_INVALID_CODE_ADDR                       0x800030D0
424 #define HI_ERR_DIAG_OBJ_NOT_FOUND                           0x800030D1
425 #define HI_ERR_DIAG_QUEUE_FULL                              0x800030D2
426 #define HI_ERR_DIAG_NO_MORE_MEMORY                          0x800030D3
427 #define HI_ERR_DIAG_SYSTEM_CALL_ERROR                       0x800030D4
428 #define HI_ERR_DIAG_NO_INIT                                 0x800030D5
429 #define HI_ERR_DIAG_INVALID_PARAMETER                       0x800030D6
430 #define HI_ERR_DIAG_STAT_NOT_SUPPORT                        0x800030D7
431 #define HI_ERR_DIAG_ID_OR_CALLBACK_ALREADY_REGISTERED       0x800030D8
432 #define HI_ERR_DIAG_SET_CONN_ACK_INFO                       0x800030D9
433 #define HI_ERR_DIAG_CMD_NUM_EXCEED_UPPER_LIMIT              0x800030DA
434 #define HI_ERR_DIAG_MEMCPY_FAIL                             0x800030DB
435 
436 /* reset 复位 */
437 #define HI_ERR_RESET_TOO_LARGE_DATA                         0x80003100
438 #define HI_ERR_RESET_INVALID_PARAMETER                      0x80003101
439 
440 /* syserror */
441 #define HI_ERR_SYSERROR_NOT_FOUND                           0x80003140
442 #define HI_ERR_SYSERROR_INVALID_PARAMETER                   0x80003141
443 
444 
445 /* APP */
446 #define HI_ERR_APP_INITILIZATION_ALREADY                    0x80003180
447 #define HI_ERR_APP_INVALID_PARAMETER                        0x80003181
448 
449 /* CRC */
450 #define HI_ERR_CRC_INVALID_PARAMETER                        0x800031C0
451 
452 
453 /* sigma */
454 #define HI_ERR_SIGMA_INVALID_PARAMETER                      0x80003200
455 
456 /* data collect */
457 #define HI_ERR_DATACOLLECT_INVALID_PARAMETER                0x80003240
458 #define HI_ERR_DATACOLLECT_BUSY                             0x80003241
459 
460 /* AT */
461 #define HI_ERR_AT_NAME_OR_FUNC_REPEAT_REGISTERED           0x80003280
462 #define HI_ERR_AT_INVALID_PARAMETER                        0x80003281
463 
464 /* ****************************************************************************
465  * 5、协议栈:错误码
466  * *************************************************************************** */
467 /* wifi */
468 /* 说明:wifi错误码hi_err_code_enum 将base基值修改为起始值,其他错误码一次延顺 */
469 /* dmac */
470 #define HI_ERR_WIFI_DMAC_NOT_SUPPORT                        0x80004000
471 
472 /* hmac */
473 #define HI_ERR_WIFI_HMAC_INVALID_PARAMETER                  0x80004040
474 
475 /* wal */
476 #define HI_ERR_WIFI_WAL_MALLOC_FAIL                         0x80004080
477 #define HI_ERR_WIFI_WAL_FAILURE                             0x80004081
478 #define HI_ERR_WIFI_WAL_BUSY                                0x80004082
479 #define HI_ERR_WIFI_WAL_INVALID_PARAMETER                   0x80004083
480 
481 /* ****************************************************************************
482  * 6、Hisi保留 unit128个
483  * 7、客户使用预留 unit64个
484  * *************************************************************************** */
485 #endif /* __HI_ERRNO_H__ */
486