blob: 6d8ea1a015009dc01931ac9fc3e8818b58e3cb8e [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001
2/*
3 * (C) Copyright 2016, ZIXC Corporation.
4 *
5 */
6
7#ifndef __BOOT_MODE__
8#define __BOOT_MODE__
9
xf.liaa4d92f2023-09-13 00:18:58 -070010extern unsigned char g_nor_flag;
11
lh9ed821d2023-04-07 01:36:19 -070012typedef enum
13{
14 TLOAD_MODE = 1,
15 ZLOAD_MODE = 0,
16 UNKNOWN_LOAD_MODE = 2
17}load_mode_t;
18
19
20typedef enum
21{
22 NORMAL_BOOT = 0,
23 FOTA_UPDATE_BOOT = 1,
24 UNKNOWN_BOOT_MODE
25} boot_mode_t;
26
27
28typedef enum
29{
30 RB_POWER_KEY = 0,
31 RB_USB_INSERT = 1,
32 RB_RTC = 2,
33 RB_POWER_KEY_LONG = 3,
34 RB_RESET_NOMAL = 4,
35 RB_RESET_USB_OFF = 5, /* */
36 RB_RESET_EXCEPT = 6,
37 RB_POWER_BOOST_IN = 7,
38 RB_RESET_ALARM = 8,
39 RB_AMT = 9,
40 RB_PRODUCTION = 10,
41 UNKNOWN_BOOT_REASON
42} boot_reason_t;
43
44typedef enum{
45 POWER_ON_NORMAL = 0,
46 POWER_ON_FOTA,
47 POWER_ON_CHARGING,
48 POWER_ON_RTC,
49 POWER_ON_RESET,
50 POWER_ON_HDT_TEST,
51 POWER_ON_EXCEPTRESET,
52 POWER_ON_LOCALUPDATE,
53 POWER_ON_BOOST_IN,
54 POWER_ON_AMT,
55 POWER_ON_PRODUCTION,
56 POWER_ON_INVALID,
57}boot_type_t;
58
59typedef enum
60{
61 FOTA_NORMAL = 0,
62 FOTA_UPDATE = 1,
63 FOTA_LOCALUPDATE = 2,
64 FOTA_RECOVERY = 3,
65} eFotaFlag_t;
66
67typedef enum
68{
69 FOTA_PS_NORMAL = 0,
70 FOTA_PS = 1
71} eFotaPsFlag_t;
72
73load_mode_t get_load_mode( void );
74int get_boot_reason(void);
75boot_reason_t read_boot_reason(void);
76int read_boot_flashtype(void);
77void set_boot_flashtype();
78void set_flash_opt(void);
79struct flash_ops *find_flash_type(void);
80int get_battery_detect_flag(void);
81int nvrw_flag_init(void);
82
83
84#endif /* __BOOT_MODE__ */