• 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 
16 #ifndef __HI_BOOT_ERR_H__
17 #define __HI_BOOT_ERR_H__
18 
19 /* Generic errno */
20 #define HI_ERR_SUCCESS                                  0x3CA5965A
21 #define HI_ERR_FAILURE                                  0xC35A69A5
22 #define HI_ERR_MALLOC_FAILUE                            0x80000000
23 #define HI_ERR_TIMEOUT                                  0x80000001
24 
25 /* gpio errno */
26 #define HI_ERR_GPIO_INVALID_PARAMETER                   0x80001040
27 #define HI_ERR_GPIO_REPEAT_INIT                         0x80001041
28 #define HI_ERR_GPIO_NOT_INIT                            0x80001042
29 #define HI_ERR_GPIO_NOT_SUPPORT                         0x80001043
30 
31 /* Flash errno */
32 #define HI_ERR_FLASH_NOT_INIT                           0x800010C0
33 #define HI_ERR_FLASH_INVALID_PARAMETER                  0x800010C1
34 #define HI_ERR_FLASH_INVALID_PARAM_BEYOND_ADDR          0x800010C2
35 #define HI_ERR_FLASH_INVALID_PARAM_SIZE_ZERO            0x800010C3
36 #define HI_ERR_FLASH_INVALID_PARAM_ERASE_NOT_ALIGN      0x800010C4
37 #define HI_ERR_FLASH_INVALID_PARAM_IOCTRL_DATA_NULL     0x800010C5
38 #define HI_ERR_FLASH_INVALID_PARAM_DATA_NULL            0x800010C6
39 #define HI_ERR_FLASH_INVALID_PARAM_PAD1                 0x800010C7
40 #define HI_ERR_FLASH_INVALID_PARAM_PAD2                 0x800010C8
41 #define HI_ERR_FLASH_INVALID_PARAM_PAD3                 0x800010C9
42 #define HI_ERR_FLASH_INVALID_PARAM_PAD4                 0x800010CA
43 #define HI_ERR_FLASH_TIME_OUT_WAIT_READY                0x800010CB
44 #define HI_ERR_FLASH_QUAD_MODE_READ_REG1                0x800010CC
45 #define HI_ERR_FLASH_QUAD_MODE_READ_REG2                0x800010CD
46 #define HI_ERR_FLASH_QUAD_MODE_COMPARE_REG              0x800010CE
47 #define HI_ERR_FLASH_NO_MATCH_FLASH                     0x800010CF
48 #define HI_ERR_FLASH_WRITE_ENABLE                       0x800010D0
49 #define HI_ERR_FLASH_NO_MATCH_ERASE_SIZE                0x800010D1
50 #define HI_ERR_FLASH_MAX_SPI_OP                         0x800010D2
51 #define HI_ERR_FLASH_NOT_SUPPORT_IOCTRL_ID              0x800010D3
52 #define HI_ERR_FLASH_INVALID_CHIP_ID                    0x800010D4
53 #define HI_ERR_FLASH_RE_INIT                            0x800010D5
54 #define HI_ERR_FLASH_WRITE_NOT_SUPPORT_ERASE            0x800010D6
55 #define HI_ERR_FLASH_WRITE_COMPARE_WRONG                0x800010D7
56 #define HI_ERR_FLASH_WAIT_CFG_START_TIME_OUT            0x800010D8
57 #define HI_ERR_FLASH_PATITION_INIT_FAIL                 0x800010D9
58 #define HI_ERR_FLASH_INITILIZATION                      0x800010DA
59 #define HI_ERR_FLASH_ERASE_NOT_4K_ALIGN                 0x800010DB
60 
61 /* efuse errno */
62 #define HI_ERR_EFUSE_INVALIDATE_ID                      0x80001200
63 #define HI_ERR_EFUSE_INVALIDATE_PARA                    0x80001201
64 #define HI_ERR_EFUSE_WRITE_ERR                          0x80001202
65 #define HI_ERR_EFUSE_INVALIDATE_AUTH                    0x80001203
66 #define HI_ERR_EFUSE_BUSY                               0x80001204
67 #define HI_ERR_EFUSE_TIMEOUT                            0x80001205
68 
69 /* cipher errno */
70 #define HI_ERR_CIPHER_NOT_INIT                          0x80001240
71 #define HI_ERR_CIPHER_INVALID_POINT                     0x80001241
72 #define HI_ERR_CIPHER_INVALID_PARAMETER                 0x80001242
73 #define HI_ERR_CIPHER_NO_AVAILABLE_RNG                  0x80001243
74 #define HI_ERR_CIPHER_FAILED_MEM                        0x80001244
75 #define HI_ERR_CIPHER_OVERFLOW                          0x80001245
76 #define HI_ERR_CIPHER_TIMEOUT                           0x80001246
77 #define HI_ERR_CIPHER_UNSUPPORTED                       0x80001247
78 #define HI_ERR_CIPHER_REGISTER_IRQ                      0x80001248
79 #define HI_ERR_CIPHER_ILLEGAL_KEY                       0x80001249
80 #define HI_ERR_CIPHER_INVALID_ADDR                      0x8000124A
81 #define HI_ERR_CIPHER_INVALID_LENGTH                    0x8000124B
82 #define HI_ERR_CIPHER_ILLEGAL_DATA                      0x8000124C
83 #define HI_ERR_CIPHER_RSA_SIGN                          0x8000124D
84 #define HI_ERR_CIPHER_RSA_VERIFY                        0x8000124E
85 #define HI_ERR_CIPHER_RESULT_WARNING                    0x8000124F
86 #define HI_ERR_CIPHER_FLUSH_DCACHE_FAILED               0x80001250
87 
88 #define HI_ERR_YMODEM_ERR_TIMEOUT                       0xC35A69A6
89 #define HI_ERR_YMODEM_ERR_CANCEL                        0xC35A69A7
90 #define HI_ERR_YMODEM_ERR_FRAME                         0xC35A69A8
91 #define HI_ERR_YMODEM_ERR_CS                            0xC35A69A9
92 #define HI_ERR_YMODEM_ERR_EOT                           0xC35A69AA
93 #define HI_ERR_YMODEM_ERR_SEQ                           0xC35A69AB
94 #define HI_ERR_YMODEM_ERR_LENTH                         0xC35A69AC
95 
96 /* upgrade common error */
97 #define HI_ERR_UPG_NULL_POINTER                         0x80001300
98 #define HI_ERR_UPG_PARAMETER                            0x80001301
99 #define HI_ERR_UPG_BACKUP_ADDR                          0x80001302
100 #define HI_ERR_UPG_BUSY                                 0x80001303
101 #define HI_ERR_UPG_FLASH_BAD                            0x80001304
102 #define HI_ERR_UPG_START_ADDR                           0x80001305
103 #define HI_ERR_UPG_INITILIZATION_ALREADY                0x80001306
104 #define HI_ERR_UPG_FILE_LEN                             0x80001307
105 #define HI_ERR_UPG_NOT_START                            0x80001308
106 #define HI_ERR_UPG_MALLOC_FAIL                          0x80001309
107 #define HI_ERR_UPG_BOOT_MAGIC                           0x8000130A
108 #define HI_ERR_UPG_BOOT_LEN                             0x8000130B
109 #define HI_ERR_UPG_FILE_LEN_OVER                        0x8000130C
110 #define HI_ERR_UPG_FILE_LEN_ZERO                        0x8000130D
111 
112 /* upgrade file check error */
113 #define HI_ERR_UPG_IMAGE_ID                             0x80001340
114 #define HI_ERR_UPG_FILE_TYPE                            0x80001341
115 #define HI_ERR_UPG_HEAD_LEN                             0x80001342
116 #define HI_ERR_UPG_SIGN_ALG                             0x80001343
117 #define HI_ERR_UPG_RSA_KEY_LEN                          0x80001344
118 #define HI_ERR_UPG_RSA_HEAD_SIGN                        0x80001345
119 #define HI_ERR_UPG_ECC_KEY_LEN                          0x80001346
120 #define HI_ERR_UPG_ECC_HEAD_SIGN                        0x80001347
121 #define HI_ERR_UPG_COMMON_SHA256                        0x80001348
122 #define HI_ERR_UPG_SECTION_SHA256                       0x80001349
123 #define HI_ERR_UPG_KERNEL_VER                           0x8000134A
124 #define HI_ERR_UPG_BOOT_VER                             0x8000134B
125 #define HI_ERR_UPG_DECOMPRESS_FILE_CRC                  0x8000134C
126 #define HI_ERR_UPG_CRC                                  0x8000134D
127 
128 /* lzma-decode */
129 #define HI_ERR_LZMA_DECODE                              0x80001360
130 
131 /* lzma-common */
132 #define HI_ERR_LZMA_PARAM                               0x80001380
133 #define HI_ERR_LZMA_LEN                                 0x80001381
134 
135 /* NV */
136 #define HI_ERR_NV_FILE_ERR                              0x80003000
137 #define HI_ERR_NV_MEMCPY_FAIL                           0x80003001
138 #define HI_ERR_NV_WRITE_FILE_FAIL                       0x80003002
139 #define HI_ERR_NV_UPDATA_DATA_FAIL                      0x80003003
140 #define HI_ERR_NV_UPDATA_FILE_FAIL                      0x80003004
141 #define HI_ERR_NV_NOT_SUPPORT_WRITE                     0x80003005
142 #define HI_ERR_NV_FSEC_TOTAL_NUM_INVALID                0x80003006
143 #define HI_ERR_NV_FAIL_N_TIMES                          0x80003007
144 #define HI_ERR_NV_SEM_FAIL                              0x80003008
145 #define HI_ERR_NV_LEN_ERR                               0x80003009
146 #define HI_ERR_NV_NOT_FOUND                             0x8000300A
147 #define HI_ERR_NV_FULL                                  0x8000300B
148 #define HI_ERR_NV_NOT_ENOUGH_MEMORY                     0x8000300C
149 #define HI_ERR_NV_NOT_SUPPORT                           0x8000300D
150 #define HI_ERR_NV_NOT_SUPPORT_ID                        0x8000300E
151 #define HI_ERR_NV_BAD_DATA                              0x8000300F
152 #define HI_ERR_NV_INVALID_TYPE                          0x80003010
153 /* Read NVIM Failure */
154 #define HI_ERR_NV_ERROR_READ                            0x80003011
155 /* Write Error for Length Overflow */
156 #define HI_ERR_NV_NOT_SUPPORT_LENTH                     0x80003012
157 /* Write Error for Flash Bad Block */
158 #define HI_ERR_NV_BAD_BLOCK                             0x80003013
159 /* Write Error for Unknown Reason */
160 #define HI_ERR_NV_ERROR_WRITE                           0x80003014
161 #define HI_ERR_NV_INITILIZATION                         0x80003015
162 #define HI_ERR_NV_INVALID_PARAMETER                     0x80003016
163 
164 /* CRC */
165 #define HI_ERR_CRC_INVALID_PARAMETER                    0x800031C0
166 
167 /* upgrade common error */
168 #define HI_ERR_UPG_COMMON                               0x80003060
169 #define HI_ERR_UPG_LOW_KERNEL_VER                       (HI_ERR_UPG_COMMON + 0x13)
170 #define HI_ERR_UPG_FULL_KERNEL_VER                      (HI_ERR_UPG_COMMON + 0x14)
171 #define HI_ERR_UPG_LOW_BOOT_VER                         (HI_ERR_UPG_COMMON + 0x15)
172 #define HI_ERR_UPG_FULL_BOOT_VER                        (HI_ERR_UPG_COMMON + 0x16)
173 #define HI_ERR_UPG_FIRST_PACKET_OFFSET                  (HI_ERR_UPG_COMMON + 0x17)
174 #define HI_ERR_UPG_UPDATE_VER_TIMEOUT                   (HI_ERR_UPG_COMMON + 0x18)
175 #define HI_ERR_UPG_UPDATE_VER_FAIL                      (HI_ERR_UPG_COMMON + 0x19)
176 #define HI_ERR_UPG_UPDATE_VER_INVALID_PARAM             (HI_ERR_UPG_COMMON + 0x1A)
177 #define HI_ERR_UPG_KERNEL_VER_OVER                      (HI_ERR_UPG_COMMON + 0x1B)
178 #define HI_ERR_UPG_BOOT_VER_OVER                        (HI_ERR_UPG_COMMON + 0x1C)
179 
180 #define EOK              HI_ERR_SUCCESS
181 
182 #endif
183