WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
non_os_reboot.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2018-2020. All rights reserved.
3 * Description: Reboot interface.
4 */
5
6#ifndef NON_OS_REBOOT_H
7#define NON_OS_REBOOT_H
8
9#include "core.h"
10#include "errcode.h"
11#include "common_def.h"
12#if EXCEPTION_TEST_ENABLE == YES && defined(SUPPORT_IPC)
13#include "ipc_actions.h"
14#endif
15
21#define REBOOT_POWER_ON_TRIGGER_STATUS 0xdead0001UL
22#define REBOOT_SOFT_RESET_TRIGER_STATUS 0xdead0002UL
23#define REBOOT_NMI_WDGTIMEOUT_TRIGGER_STATUS 0xdead0003UL
24#define REBOOT_NMI_XIP_CTRL_TRIGER_STATUS 0xdead0004UL
25#define REBOOT_NMI_XIP_CACHE_TRIGGER_STATUS 0xdead0005UL
26#define REBOOT_HARD_FAULT_TRIGER_STATUS 0xdead0006UL
27#define REBOOT_SOFT_PANIC_TRIGGER_STATUS 0xdead0007UL
28#define REBOOT_OTHER_CORE_ABNORMAL_TRIGER_STATUS 0xdead0008UL
29#define REBOOT_HARD_WDGTIMEOUT_TRIGER_STATUS 0xdead0009UL
30#define REBOOT_BT_WDGTIMEOUT_TRIGER_STATUS 0xdead000aUL
31#define REBOOT_ULP_WDGTIMEOUT_TRIGER_STATUS 0xdead000bUL
32#define REBOOT_UPG_COMPLETION_TRIGER_STATUS 0xdead000cUL
33#define REBOOT_ULP_PIN_RST_TRIGER_STATUS 0xdead000dUL
34#define REBOOT_UNDEFINED_TRIGER_STATUS 0xdeadaaaaUL
35#define STANDARD_REBOOT_MAGIC 0xdeaddeadUL
36#define ABNORMAL_REBOOT_MAGIC 0xdeadbeafUL
37
45typedef enum {
46 REBOOT_CAUSE_UNKNOWN = 0x0000, // !< Used as a default for the reboot_reset_reason variable
47 REBOOT_CAUSE_BT_RESET_UNKNOWN = 0x8000, // !< REBOOT_CAUSE_BT_RESET_UNKNOWN
57 REBOOT_CAUSE_BT_STD_WDT_FRST = 0x800b, /* force reboot */
58 REBOOT_CAUSE_BT_STD_CHIP_WDT_FRST = 0x800c, /* force reboot */
61 REBOOT_CAUSE_BT_BUCK1_PROTECT_FRST = 0x8010, /* buck1 protect */
62 REBOOT_CAUSE_BT_BUCK2_PROTECT_FRST = 0x8020, /* buck2 protect */
63
64 REBOOT_CAUSE_BT_MONITOR_REBOOT_REQ = 0x8100, // !< Start of custom reset reasons
68
70 REBOOT_CAUSE_GNSS_NMI = 0x7001, // !< watchdog is nmi interrupt
74
80 REBOOT_CAUSE_PROTOCOL_WDT_FRST = 0x4005, /* force reboot */
84 REBOOT_CAUSE_PROTOCOL_RPC_TIMEOUT = 0x4100, // !< Start of custom reset reasons
86
94 REBOOT_CAUSE_APPLICATION_WDT_FRST = 0x2007, /* force reboot */
104
105 REBOOT_CAUSE_UPG_COMPLETION = 0x2040, // !< Start of custom reset reasons
108
110
111 REBOOT_CAUSE_APPLICATION_RPC_TIMEOUT = 0x2100, // !< Start of custom reset reasons
112
115
116typedef enum {
118 VETO_REBOOT_REASON_WR_NV, /* 写NV项过程中,在超时内,不强制重启 */
119 VETO_REBOOT_REASON_WR_MR_DOC, /* 写表档案过程中,在超时内,不强制重启 */
126
127 /* STA在抄控器对其做整表测试时,不允许重启 */
129 /* 台区识别时不允许重启 */
131 /* STA上电11小时内,锁定网络状态下,不允许重启 */
133 /* 进入测试模式后 24 小时内不允许重启 */
135 VETO_REBOOT_REASON_UPG, /* 升级过程中, 不强制重启。 */
137 VETO_REBOOT_REASON_NO_PB, /* 无法收到PB块,导致频偏设置长时间超时(1000分钟),不强制重启 */
138
139 /* CCO在写组网系列号的时候,不允许重启; */
141 /* CCO/STA在写SNID的时候,不允许重启; */
143 /* STA在写关联随机数的时候,不允许重启 */
147
148#ifdef IPC_NEW
149typedef struct {
150 uint16_t req_reboot_reason;
151 uint16_t core;
152} req_reboot_msg;
153#endif
154
159void reboot_init(void);
160
165void reboot_deinit(void);
166
167#if CORE == MASTER_BY_ALL
172void reboot_chip(void);
173
179#endif
180
187void reboot_system(reboot_cause_t cause);
188
194
195#if CORE == APPS && EXCEPTION_TEST_ENABLE == YES && defined(SUPPORT_IPC)
201void exception_test(ipc_exception_test_command_e exception_test_command);
202#endif
203
204/*
205* @brief 延时重启,在一段时间内投票反对重启,仅影响uapi_reboot_system_check_veto接口。
206* @param reason 延时原因
207* @param sec 延时时间
208* @retval 返回实际延时时间。如果系统未对最大延时时间进行配置返回传入时间。如果系统进行了限制则返回时间小于最大延时时间。
209*/
210uint32_t uapi_reboot_vote_against(veto_reboot_reason_t reason, uint32_t sec);
211
212/*
213* @brief 去延时重启
214* @param reason 延时原因
215* @retval 返回实际延时时间。如果系统未对最大延时时间进行配置返回传入时间。如果系统进行了限制则返回时间小于最大延时时间。
216*/
218
219/*
220* @brief 重启。受延时重启影响
221* @param reason 重启原因
222*/
224
228#endif
reboot_cause_t reboot_get_security_reboot_reason(void)
Gets the last reason that the security core rebooted
Definition non_os_reboot.c:171
void uapi_reboot_unvote_against(veto_reboot_reason_t reason)
Definition non_os_reboot.c:260
void reboot_deinit(void)
De-initialise the reboot subsystem
Definition non_os_reboot.c:52
void reboot_system(reboot_cause_t cause)
Perform a software reboot of the entire system.
Definition non_os_reboot.c:126
void uapi_reboot_system_check_veto(reboot_cause_t reason)
Definition non_os_reboot.c:266
reboot_cause_t
This is a special enum, it is split into three sections Only 16 bits are used. Bits 13 to 15 are flag...
Definition non_os_reboot.h:45
void reboot_chip(void)
Perform a chip reboot.
Definition non_os_reboot.c:58
veto_reboot_reason_t
Definition non_os_reboot.h:116
reboot_cause_t reboot_get_reset_reason(void)
Gets the reason of the last reset
Definition non_os_reboot.c:165
void reboot_init(void)
Initialise the reboot subsystem
Definition non_os_reboot.c:42
uint32_t uapi_reboot_vote_against(veto_reboot_reason_t reason, uint32_t sec)
Definition non_os_reboot.c:254
@ REBOOT_CAUSE_APPLICATION_CHIP_WDT
Definition non_os_reboot.h:95
@ REBOOT_CAUSE_APPLICATION_STD_BT_WDT_FRST
Definition non_os_reboot.h:101
@ REBOOT_CAUSE_GNSS_GLOBAL
Definition non_os_reboot.h:69
@ REBOOT_CAUSE_BT_MONITOR_REBOOT_REQ
Definition non_os_reboot.h:64
@ REBOOT_CAUSE_UNKNOWN
Definition non_os_reboot.h:46
@ REBOOT_CAUSE_BT_XIP_HARDFAULT
Definition non_os_reboot.h:59
@ REBOOT_CAUSE_BT_REGIONS_UPDATED
Definition non_os_reboot.h:65
@ REBOOT_CAUSE_BT_PANIC
Definition non_os_reboot.h:56
@ REBOOT_CAUSE_PROTOCOL_AXI_LOCK
Definition non_os_reboot.h:78
@ REBOOT_CAUSE_APPLICATION_WDT_FRST
Definition non_os_reboot.h:94
@ REBOOT_CAUSE_PROTOCOL_AXI_LOCK_TO_BT
Definition non_os_reboot.h:79
@ REBOOT_CAUSE_PROTOCOL_WDT_FRST
Definition non_os_reboot.h:80
@ REBOOT_CAUSE_APPLICATION_STD_ULP_PIN_FRST
Definition non_os_reboot.h:103
@ REBOOT_CAUSE_PROTOCOL1_ADDR_MON
Definition non_os_reboot.h:83
@ REBOOT_CAUSE_APPLICATION_SLDM
Definition non_os_reboot.h:109
@ REBOOT_CAUSE_APPLICATION_STD_CHIP_WDT_FRST
Definition non_os_reboot.h:100
@ REBOOT_CAUSE_BT_STANDARD_CHIP_WATCHDOG
Definition non_os_reboot.h:50
@ REBOOT_CAUSE_APPLICATION_UNKNOWN_ISR
Definition non_os_reboot.h:93
@ REBOOT_CAUSE_PROTOCOL_GLOBAL
Definition non_os_reboot.h:75
@ REBOOT_CAUSE_GNSS_END
Definition non_os_reboot.h:73
@ REBOOT_CAUSE_APPLICATION_MDMA
Definition non_os_reboot.h:98
@ REBOOT_CAUSE_PROTOCOL_ADDR_MON
Definition non_os_reboot.h:82
@ REBOOT_CAUSE_UPG_COMPLETION
Definition non_os_reboot.h:105
@ REBOOT_CAUSE_APPLICATION_GLOBAL
Definition non_os_reboot.h:87
@ REBOOT_CAUSE_BT_UPDATER_CHIP_WATCHDOG
Definition non_os_reboot.h:51
@ REBOOT_CAUSE_PROTOCOL_WATCHDOG
Definition non_os_reboot.h:77
@ REBOOT_CAUSE_BT_BUCK1_PROTECT_FRST
Definition non_os_reboot.h:61
@ REBOOT_CAUSE_BT_RESET_UNKNOWN
Definition non_os_reboot.h:47
@ REBOOT_CAUSE_APPLICATION_HARDFAULT
Definition non_os_reboot.h:91
@ REBOOT_CAUSE_BT_WATCHDOG
Definition non_os_reboot.h:49
@ REBOOT_CAUSE_BT_RPC_TIMEOUT
Definition non_os_reboot.h:52
@ REBOOT_CAUSE_APPLICATION_SYSRESETREQ
Definition non_os_reboot.h:88
@ REBOOT_CAUSE_BT_END
Definition non_os_reboot.h:67
@ REBOOT_CAUSE_PROTOCOL_RPC_TIMEOUT
Definition non_os_reboot.h:84
@ REBOOT_CAUSE_PROTOCOL1_WATCHDOG
Definition non_os_reboot.h:81
@ REBOOT_CAUSE_APPLICATION_PANIC
Definition non_os_reboot.h:90
@ REBOOT_CAUSE_BT_BUCK2_PROTECT_FRST
Definition non_os_reboot.h:62
@ REBOOT_CAUSE_APPLICATION_WATCHDOG
Definition non_os_reboot.h:89
@ REBOOT_CAUSE_GNSS_PANIC
Definition non_os_reboot.h:72
@ REBOOT_CAUSE_GNSS_NMI
Definition non_os_reboot.h:70
@ REBOOT_CAUSE_APPLICATION_XIP_CACHE
Definition non_os_reboot.h:97
@ REBOOT_CAUSE_BT_SYSRESETREQ
Definition non_os_reboot.h:48
@ REBOOT_CAUSE_MON_MEM_ALMOST_EMPTY
Definition non_os_reboot.h:106
@ REBOOT_CAUSE_BT_FOTA_UPGRADE
Definition non_os_reboot.h:66
@ REBOOT_CAUSE_DFU_UPG_FAIL
Definition non_os_reboot.h:107
@ REBOOT_CAUSE_APPLICATION_RPC_TIMEOUT
Definition non_os_reboot.h:111
@ REBOOT_CAUSE_PROTOCOL_SYSRESETREQ
Definition non_os_reboot.h:76
@ REBOOT_CAUSE_APPLICATION_XIP_CTRL
Definition non_os_reboot.h:96
@ REBOOT_CAUSE_APPLICATION_SMDMA
Definition non_os_reboot.h:99
@ REBOOT_CAUSE_POWER_ON
Definition non_os_reboot.h:113
@ REBOOT_CAUSE_BT_STD_CHIP_WDT_FRST
Definition non_os_reboot.h:58
@ REBOOT_CAUSE_BT_UNKNOWN_ISR
Definition non_os_reboot.h:55
@ REBOOT_CAUSE_BT_NNMIFAULT
Definition non_os_reboot.h:54
@ REBOOT_CAUSE_BT_HARDFAULT
Definition non_os_reboot.h:53
@ REBOOT_CAUSE_PROTOCOL_END
Definition non_os_reboot.h:85
@ REBOOT_CAUSE_APPLICATION_STD_ULP_WDT_FRST
Definition non_os_reboot.h:102
@ REBOOT_CAUSE_BT_SSB_EXCEPTION_REBOOT
Definition non_os_reboot.h:60
@ REBOOT_CAUSE_GNSS_HARDFAULT
Definition non_os_reboot.h:71
@ REBOOT_CAUSE_BT_STD_WDT_FRST
Definition non_os_reboot.h:57
@ REBOOT_CAUSE_APPLICATION_NNMIFAULT
Definition non_os_reboot.h:92
@ VETO_REBOOT_REASON_LOCK_NETWORK
Definition non_os_reboot.h:132
@ VETO_REBOOT_REASON_UPG
Definition non_os_reboot.h:135
@ VETO_REBOOT_REASON_SUIT_NET
Definition non_os_reboot.h:140
@ VETO_REBOOT_REASON_USR_RESERVED_5
Definition non_os_reboot.h:123
@ VETO_REBOOT_REASON_NO_PB
Definition non_os_reboot.h:137
@ VETO_REBOOT_REASON_WR_MR_DOC
Definition non_os_reboot.h:119
@ VETO_REBOOT_REASON_SYS_RST_DELAY_ENTER_PHY_TEST_MODE
Definition non_os_reboot.h:134
@ VETO_REBOOT_REASON_USR_RESERVED_3
Definition non_os_reboot.h:121
@ VETO_REBOOT_REASON_USR_RESERVED_4
Definition non_os_reboot.h:122
@ VETO_REBOOT_REASON_BOOT_UPG
Definition non_os_reboot.h:136
@ VETO_REBOOT_REASON_WR_NV
Definition non_os_reboot.h:118
@ VETO_REBOOT_REASON_WRT_SNID
Definition non_os_reboot.h:142
@ VETO_REBOOT_REASON_USR_RESERVED_2
Definition non_os_reboot.h:120
@ VETO_REBOOT_REASON_RELATING_RANDOM_NUM
Definition non_os_reboot.h:144
@ VETO_REBOOT_REASON_USR_RESERVED_7
Definition non_os_reboot.h:125
@ VETO_REBOOT_REASON_MAX
Definition non_os_reboot.h:145
@ VETO_REBOOT_REASON_USR_RESERVED_6
Definition non_os_reboot.h:124
@ VETO_REBOOT_REASON_TF_IDENTIFY
Definition non_os_reboot.h:130
@ VETO_REBOOT_REASON_NDM_METER_CHECK
Definition non_os_reboot.h:128
@ VETO_REBOOT_REASON_RESERVE
Definition non_os_reboot.h:117