diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 31 | ||||
-rw-r--r-- | include/reset_flag_desc.inc | 2 | ||||
-rw-r--r-- | include/system.h | 26 |
3 files changed, 30 insertions, 29 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 206d88f195..a43fea7f58 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -13,7 +13,7 @@ #endif #ifdef __cplusplus -extern "C"{ +extern "C" { #endif /* @@ -440,7 +440,7 @@ extern "C"{ * parent structure that the alignment will still be true given the packing of * the parent structure. This is particularly important if the sub-structure * will be passed as a pointer to another function, since that function will - * not know about the misaligment caused by the parent structure's packing. + * not know about the misalignment caused by the parent structure's packing. * * Also be very careful using __packed - particularly when nesting non-packed * structures inside packed ones. In fact, DO NOT use __packed directly; @@ -5379,6 +5379,29 @@ struct ec_params_set_cbi { */ #define EC_CMD_GET_UPTIME_INFO 0x0121 +/* Reset causes */ +#define EC_RESET_FLAG_OTHER BIT(0) /* Other known reason */ +#define EC_RESET_FLAG_RESET_PIN BIT(1) /* Reset pin asserted */ +#define EC_RESET_FLAG_BROWNOUT BIT(2) /* Brownout */ +#define EC_RESET_FLAG_POWER_ON BIT(3) /* Power-on reset */ +#define EC_RESET_FLAG_WATCHDOG BIT(4) /* Watchdog timer reset */ +#define EC_RESET_FLAG_SOFT BIT(5) /* Soft reset trigger by core */ +#define EC_RESET_FLAG_HIBERNATE BIT(6) /* Wake from hibernate */ +#define EC_RESET_FLAG_RTC_ALARM BIT(7) /* RTC alarm wake */ +#define EC_RESET_FLAG_WAKE_PIN BIT(8) /* Wake pin triggered wake */ +#define EC_RESET_FLAG_LOW_BATTERY BIT(9) /* Low battery triggered wake */ +#define EC_RESET_FLAG_SYSJUMP BIT(10) /* Jumped directly to this image */ +#define EC_RESET_FLAG_HARD BIT(11) /* Hard reset from software */ +#define EC_RESET_FLAG_AP_OFF BIT(12) /* Do not power on AP */ +#define EC_RESET_FLAG_PRESERVED BIT(13) /* Some reset flags preserved from + * previous boot + */ +#define EC_RESET_FLAG_USB_RESUME BIT(14) /* USB resume triggered wake */ +#define EC_RESET_FLAG_RDD BIT(15) /* USB Type-C debug cable */ +#define EC_RESET_FLAG_RBOX BIT(16) /* Fixed Reset Functionality */ +#define EC_RESET_FLAG_SECURITY BIT(17) /* Security threat */ +#define EC_RESET_FLAG_AP_WATCHDOG BIT(18) /* AP experienced a watchdog reset */ + struct ec_response_uptime_info { /* * Number of milliseconds since the last EC boot. Sysjump resets @@ -5399,8 +5422,8 @@ struct ec_response_uptime_info { uint32_t ap_resets_since_ec_boot; /* - * The set of flags which describe the EC's most recent reset. See - * include/system.h RESET_FLAG_* for details. + * The set of flags which describe the EC's most recent reset. + * See EC_RESET_FLAG_* for details. */ uint32_t ec_reset_flags; diff --git a/include/reset_flag_desc.inc b/include/reset_flag_desc.inc index 425332b31b..3d22b64633 100644 --- a/include/reset_flag_desc.inc +++ b/include/reset_flag_desc.inc @@ -4,7 +4,7 @@ */ /* - * Reset flag descriptions. Must be in same order as bits of RESET_FLAG_ + * Reset flag descriptions. Must be in same order as bits of EC_RESET_FLAG_ * constants. */ "other", diff --git a/include/system.h b/include/system.h index d09d4121b3..b215dadbf4 100644 --- a/include/system.h +++ b/include/system.h @@ -14,29 +14,7 @@ #include "console.h" #include "timer.h" -/* Reset causes */ -#define RESET_FLAG_OTHER BIT(0) /* Other known reason */ -#define RESET_FLAG_RESET_PIN BIT(1) /* Reset pin asserted */ -#define RESET_FLAG_BROWNOUT BIT(2) /* Brownout */ -#define RESET_FLAG_POWER_ON BIT(3) /* Power-on reset */ -#define RESET_FLAG_WATCHDOG BIT(4) /* Watchdog timer reset */ -#define RESET_FLAG_SOFT BIT(5) /* Soft reset trigger by core */ -#define RESET_FLAG_HIBERNATE BIT(6) /* Wake from hibernate */ -#define RESET_FLAG_RTC_ALARM BIT(7) /* RTC alarm wake */ -#define RESET_FLAG_WAKE_PIN BIT(8) /* Wake pin triggered wake */ -#define RESET_FLAG_LOW_BATTERY BIT(9) /* Low battery triggered wake */ -#define RESET_FLAG_SYSJUMP BIT(10) /* Jumped directly to this image */ -#define RESET_FLAG_HARD BIT(11) /* Hard reset from software */ -#define RESET_FLAG_AP_OFF BIT(12) /* Do not power on AP */ -#define RESET_FLAG_PRESERVED BIT(13) /* Some reset flags preserved from - * previous boot */ -#define RESET_FLAG_USB_RESUME BIT(14) /* USB resume triggered wake */ -#define RESET_FLAG_RDD BIT(15) /* USB Type-C debug cable */ -#define RESET_FLAG_RBOX BIT(16) /* Fixed Reset Functionality */ -#define RESET_FLAG_SECURITY BIT(17) /* Security threat */ -#define RESET_FLAG_AP_WATCHDOG BIT(18) /* AP experienced a watchdog reset */ - -/* Per chip implementation to save/read raw RESET_FLAG_ flags. */ +/* Per chip implementation to save/read raw EC_RESET_FLAG_ flags. */ void chip_save_reset_flags(uint32_t flags); uint32_t chip_read_reset_flags(void); @@ -81,7 +59,7 @@ void system_encode_save_flags(int reset_flags, uint32_t *save_flags); /** * Get the reset flags. * - * @return Reset flags (RESET_FLAG_*), or 0 if the cause is unknown. + * @return Reset flags (EC_RESET_FLAG_*), or 0 if the cause is unknown. */ uint32_t system_get_reset_flags(void); |