• 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  * Description: Common Boot for Standard Application Core
15  *
16  * Create: 2023-01-09
17  */
18 
19 #ifndef BOOT_DEBUG_H
20 #define BOOT_DEBUG_H
21 
22 #include <stdint.h>
23 
24 typedef enum {
25     HI_BOOT_ENTER_C = 0x5A01,               /* 从汇编进入到c代码 */
26     HI_BOOT_CHIP_INIT,                      /* CHIP初始化完成 */
27     HI_BOOT_WAIT_UART_INTERRUPT,            /* 进入等待UART阶段 */
28     HI_BOOT_WAIT_LOAD_LOADERBOOT,           /* 等待下载loaderboot阶段 */
29     HI_BOOT_START_LOAD_LOADERBOOT,          /* 进入加载loaderboot阶段 */
30     HI_BOOT_START_LOAD_FLASHBOOT,           /* 进入加载flashboot阶段 */
31     HI_BOOT_START_LOAD_TAIL_FLASHBOOT,      /* 进入加载备份flashboot阶段 */
32     HI_BOOT_START_LOADERBOOT_VERIFY,        /* 启动loaderboot安全认证 */
33     HI_BOOT_START_FLASHBOOT_VERIFY,         /* 启动flashboot安全认证 */
34     HI_BOOT_START_TAIL_FLASHBOOT_VERIFY,    /* 启动备份flashboot安全认证 */
35     HI_BOOT_DECYPT_BOOT,                    /* 进入解密boot阶段 */
36     HI_BOOT_BOOT_ROOT_VERIFY,               /* 启动根密钥验证 */
37     HI_BOOT_BOOT_SUBKEY_VERIFY,             /* 根密钥验证通过,启动二级密钥验证 */
38     HI_BOOT_BOOT_CODE_VERIFY,               /* 二级密钥验证通过,启动校验code内容 */
39     HI_BOOT_OMIT_VERIFY,                    /* 非安全启动检验flashboot完整性 */
40     HI_BOOT_OMIT_TAIL_VERIFY,               /* 非安全启动检验备份flashboot完整性 */
41     HI_BOOT_START_REPAIR_FLASHBOOT,         /* 开始修复主flashboot */
42     HI_BOOT_LOADER_START,                   /* 跳转引导loaderboot启动 */
43     HI_BOOT_FLASH_START,                    /* 跳转引导flashboot启动 */
44     HI_BOOT_NOIOT_START,                    /* 跳转引导noiot启动 */
45     HI_BOOT_SOFT_REBOOT,                    /* boot安全认证失败,重启单板 */
46     HI_BOOT_IDX_MAX,                        /* 启动状态最大值 */
47 } hi_boot_start_status;
48 
49 void set_boot_status(hi_boot_start_status status);
50 uint16_t get_boot_status(void);
51 
52 #endif