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