summaryrefslogtreecommitdiff
path: root/common
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 /common
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 'common')
-rw-r--r--common/button.c4
-rw-r--r--common/keyboard_scan.c2
-rw-r--r--common/main.c6
-rw-r--r--common/power_button_x86.c2
-rw-r--r--common/system.c17
-rw-r--r--common/usb_pd_protocol.c2
6 files changed, 17 insertions, 16 deletions
diff --git a/common/button.c b/common/button.c
index 6a9ffa41c5..7eee2e41e1 100644
--- a/common/button.c
+++ b/common/button.c
@@ -178,7 +178,7 @@ static int is_recovery_boot(void)
if (system_jumped_to_this_image())
return 0;
if (!(system_get_reset_flags() &
- (RESET_FLAG_RESET_PIN | RESET_FLAG_POWER_ON)))
+ (EC_RESET_FLAG_RESET_PIN | EC_RESET_FLAG_POWER_ON)))
return 0;
if (!is_recovery_button_pressed())
return 0;
@@ -203,7 +203,7 @@ void button_init(void)
#ifdef CONFIG_BUTTON_TRIGGERED_RECOVERY
if (is_recovery_boot()) {
- system_clear_reset_flags(RESET_FLAG_AP_OFF);
+ system_clear_reset_flags(EC_RESET_FLAG_AP_OFF);
host_set_single_event(EC_HOST_EVENT_KEYBOARD_RECOVERY);
button_check_hw_reinit_required();
}
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index 954ff1319a..0f38692788 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -626,7 +626,7 @@ static uint32_t check_boot_key(const uint8_t *state)
return BOOT_KEY_NONE;
/* If reset was not caused by reset pin, refresh must be held down */
- if (!(system_get_reset_flags() & RESET_FLAG_RESET_PIN) &&
+ if (!(system_get_reset_flags() & EC_RESET_FLAG_RESET_PIN) &&
!(state[KEYBOARD_COL_REFRESH] & KEYBOARD_MASK_REFRESH))
return BOOT_KEY_NONE;
diff --git a/common/main.c b/common/main.c
index c5e63e7faa..90fa5df632 100644
--- a/common/main.c
+++ b/common/main.c
@@ -132,7 +132,7 @@ test_mockable __keep int main(void)
uart_init();
/* be less verbose if we boot for USB resume to meet spec timings */
- if (!(system_get_reset_flags() & RESET_FLAG_USB_RESUME)) {
+ if (!(system_get_reset_flags() & EC_RESET_FLAG_USB_RESUME)) {
if (system_jumped_to_this_image()) {
CPRINTS("UART initialized after sysjump");
} else {
@@ -211,9 +211,9 @@ test_mockable __keep int main(void)
* If system was reset by reset-pin, do not jump and wait for
* command from host
*/
- if (system_get_reset_flags() == RESET_FLAG_RESET_PIN) {
+ if (system_get_reset_flags() == EC_RESET_FLAG_RESET_PIN)
CPRINTS("Hard pin-reset detected, disable RW jump");
- } else
+ else
#endif
{
if (rwsig_check_signature())
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index e17800f1d8..6909815972 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -230,7 +230,7 @@ static void set_initial_pwrbtn_state(void)
CPRINTS("PB init-jumped");
}
return;
- } else if ((reset_flags & RESET_FLAG_AP_OFF) ||
+ } else if ((reset_flags & EC_RESET_FLAG_AP_OFF) ||
(keyboard_scan_get_boot_keys() == BOOT_KEY_DOWN_ARROW)) {
/*
* Reset triggered by keyboard-controlled reset, and down-arrow
diff --git a/common/system.c b/common/system.c
index db12aa5535..c7918b96f6 100644
--- a/common/system.c
+++ b/common/system.c
@@ -234,17 +234,18 @@ void system_encode_save_flags(int reset_flags, uint32_t *save_flags)
/* Save current reset reasons if necessary */
if (reset_flags & SYSTEM_RESET_PRESERVE_FLAGS)
- *save_flags = system_get_reset_flags() | RESET_FLAG_PRESERVED;
+ *save_flags = system_get_reset_flags() |
+ EC_RESET_FLAG_PRESERVED;
/* Add in AP off flag into saved flags. */
if (reset_flags & SYSTEM_RESET_LEAVE_AP_OFF)
- *save_flags |= RESET_FLAG_AP_OFF;
+ *save_flags |= EC_RESET_FLAG_AP_OFF;
/* Save reset flag */
if (reset_flags & (SYSTEM_RESET_HARD | SYSTEM_RESET_WAIT_EXT))
- *save_flags |= RESET_FLAG_HARD;
+ *save_flags |= EC_RESET_FLAG_HARD;
else
- *save_flags |= RESET_FLAG_SOFT;
+ *save_flags |= EC_RESET_FLAG_SOFT;
}
uint32_t system_get_reset_flags(void)
@@ -782,7 +783,7 @@ void system_common_pre_init(void)
* was not already logged. This must happen before calculating
* jump_data address because it might change panic pointer.
*/
- if (system_get_reset_flags() & RESET_FLAG_WATCHDOG) {
+ if (system_get_reset_flags() & EC_RESET_FLAG_WATCHDOG) {
uint32_t reason;
uint32_t info;
uint8_t exception;
@@ -818,7 +819,7 @@ void system_common_pre_init(void)
/* Yes, we jumped to this image */
jumped_to_image = 1;
/* Restore the reset flags */
- reset_flags = jdata->reset_flags | RESET_FLAG_SYSJUMP;
+ reset_flags = jdata->reset_flags | EC_RESET_FLAG_SYSJUMP;
/*
* If the jump data structure isn't the same size as the
@@ -904,8 +905,8 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd)
if (IS_ENABLED(CONFIG_POWER_BUTTON_INIT_IDLE)) {
CPRINTS("Clearing AP_OFF");
- chip_save_reset_flags(
- chip_read_reset_flags() & ~RESET_FLAG_AP_OFF);
+ chip_save_reset_flags(chip_read_reset_flags() &
+ ~EC_RESET_FLAG_AP_OFF);
}
/* Intentional fall-through */
case EC_REBOOT_HIBERNATE:
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index eab4a4d959..f7500ceb6a 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2527,7 +2527,7 @@ static void pd_partner_port_reset(int port)
/* If we just lost power, don't apply Rp. */
if (system_get_reset_flags() &
- (RESET_FLAG_BROWNOUT | RESET_FLAG_POWER_ON))
+ (EC_RESET_FLAG_BROWNOUT | EC_RESET_FLAG_POWER_ON))
return;
/*