summaryrefslogtreecommitdiff
path: root/chip/lm4/system.c
diff options
context:
space:
mode:
authorYou-Cheng Syu <youcheng@chromium.org>2019-04-09 13:04:34 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-08-26 07:49:42 -0700
commit555a4470c7e6373cb6d5397ea5e9278317bcb008 (patch)
tree092deb6e16531e651311625d61accc51708eafb6 /chip/lm4/system.c
parentb3470c02db3b03781cc4d7b0a4c7894a342cba1a (diff)
downloadchrome-ec-555a4470c7e6373cb6d5397ea5e9278317bcb008.tar.gz
include: Move RESET_FLAG_* into ec_commands.h as EC_RESET_FLAG_*
RESET_FLAGS_* are used when setting/reading the field ec_reset_flags of struct ec_response_uptime_info, which is defined in ec_commands.h. So it might be better to put those macros there. To be consistent with the other macros in the file, add "EC_" prefixes to them. BUG=b:109900671,b:118654976 BRANCH=none TEST=make buildall -j Cq-Depend: chrome-internal:1054910, chrome-internal:1054911, chrome-internal:1045539 Change-Id: If72ec25f1b34d8d46b74479fb4cd09252102aafa Signed-off-by: You-Cheng Syu <youcheng@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1520574 Tested-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Ready: Yu-Ping Wu <yupingso@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'chip/lm4/system.c')
-rw-r--r--chip/lm4/system.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/chip/lm4/system.c b/chip/lm4/system.c
index 5797e91da4..cf7705ff06 100644
--- a/chip/lm4/system.c
+++ b/chip/lm4/system.c
@@ -123,7 +123,7 @@ static void check_reset_cause(void)
* Note that this is also triggered by hibernation, because
* that de-powers the chip.
*/
- flags |= RESET_FLAG_POWER_ON;
+ flags |= EC_RESET_FLAG_POWER_ON;
} else if (!flags && (raw_reset_cause & 0x01)) {
/*
* LM4 signals the reset pin in RESC for all power-on resets,
@@ -131,42 +131,42 @@ static void check_reset_cause(void)
* this flag mutually-exclusive with power on flag, so we can
* use it to indicate a keyboard-triggered reset.
*/
- flags |= RESET_FLAG_RESET_PIN;
+ flags |= EC_RESET_FLAG_RESET_PIN;
}
if (raw_reset_cause & 0x04)
- flags |= RESET_FLAG_BROWNOUT;
+ flags |= EC_RESET_FLAG_BROWNOUT;
if (raw_reset_cause & 0x10)
- flags |= RESET_FLAG_SOFT;
+ flags |= EC_RESET_FLAG_SOFT;
if (raw_reset_cause & 0x28) {
/* Watchdog timer 0 or 1 */
- flags |= RESET_FLAG_WATCHDOG;
+ flags |= EC_RESET_FLAG_WATCHDOG;
}
/* Handle other raw reset causes */
if (raw_reset_cause && !flags)
- flags |= RESET_FLAG_OTHER;
+ flags |= EC_RESET_FLAG_OTHER;
if ((hib_status & 0x09) &&
(hib_wake_flags & HIBDATA_WAKE_HARD_RESET)) {
/* Hibernation caused by software-triggered hard reset */
- flags |= RESET_FLAG_HARD;
+ flags |= EC_RESET_FLAG_HARD;
/* Consume the hibernate reasons so we don't see them below */
hib_status &= ~0x09;
}
if ((hib_status & 0x01) && (hib_wake_flags & HIBDATA_WAKE_RTC))
- flags |= RESET_FLAG_RTC_ALARM;
+ flags |= EC_RESET_FLAG_RTC_ALARM;
if ((hib_status & 0x08) && (hib_wake_flags & HIBDATA_WAKE_PIN))
- flags |= RESET_FLAG_WAKE_PIN;
+ flags |= EC_RESET_FLAG_WAKE_PIN;
if (hib_status & 0x04)
- flags |= RESET_FLAG_LOW_BATTERY;
+ flags |= EC_RESET_FLAG_LOW_BATTERY;
/* Restore then clear saved reset flags */
flags |= hibdata_read(HIBDATA_INDEX_SAVED_RESET_FLAGS);
@@ -524,10 +524,10 @@ void system_reset(int flags)
/* Save current reset reasons if necessary */
if (flags & SYSTEM_RESET_PRESERVE_FLAGS)
- save_flags = system_get_reset_flags() | RESET_FLAG_PRESERVED;
+ save_flags = system_get_reset_flags() | EC_RESET_FLAG_PRESERVED;
if (flags & SYSTEM_RESET_LEAVE_AP_OFF)
- save_flags |= RESET_FLAG_AP_OFF;
+ save_flags |= EC_RESET_FLAG_AP_OFF;
hibdata_write(HIBDATA_INDEX_SAVED_RESET_FLAGS, save_flags);