summaryrefslogtreecommitdiff
path: root/power
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 /power
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 'power')
-rw-r--r--power/mt817x.c14
-rw-r--r--power/mt8183.c2
-rw-r--r--power/rk3288.c12
-rw-r--r--power/rk3399.c2
-rw-r--r--power/sdm845.c14
-rw-r--r--power/skylake.c7
6 files changed, 26 insertions, 25 deletions
diff --git a/power/mt817x.c b/power/mt817x.c
index f13e04a1e3..368712965b 100644
--- a/power/mt817x.c
+++ b/power/mt817x.c
@@ -410,7 +410,7 @@ enum power_state power_chipset_init(void)
* Force the AP shutdown unless we are doing SYSJUMP. Otherwise,
* the AP could stay in strange state.
*/
- if (!(reset_flags & RESET_FLAG_SYSJUMP)) {
+ if (!(reset_flags & EC_RESET_FLAG_SYSJUMP)) {
CPRINTS("not sysjump; forcing AP shutdown");
chipset_turn_off_power_rails();
@@ -446,8 +446,8 @@ enum power_state power_chipset_init(void)
}
/* Leave power off only if requested by reset flags */
- if (!(reset_flags & RESET_FLAG_AP_OFF) &&
- !(reset_flags & RESET_FLAG_SYSJUMP)) {
+ if (!(reset_flags & EC_RESET_FLAG_AP_OFF) &&
+ !(reset_flags & EC_RESET_FLAG_SYSJUMP)) {
CPRINTS("reset_flag 0x%x", reset_flags);
auto_power_on = 1;
}
@@ -528,12 +528,12 @@ static int check_for_power_on_event(void)
{
int ap_off_flag;
- ap_off_flag = system_get_reset_flags() & RESET_FLAG_AP_OFF;
- system_clear_reset_flags(RESET_FLAG_AP_OFF);
+ ap_off_flag = system_get_reset_flags() & EC_RESET_FLAG_AP_OFF;
+ system_clear_reset_flags(EC_RESET_FLAG_AP_OFF);
/* check if system is already ON */
if (is_power_good_asserted()) {
if (ap_off_flag) {
- CPRINTS("system is on, but RESET_FLAG_AP_OFF is on");
+ CPRINTS("system is on, but EC_RESET_FLAG_AP_OFF is on");
return POWER_ON_CANCEL;
} else {
CPRINTS("system is on, thus clear " "auto_power_on");
@@ -543,7 +543,7 @@ static int check_for_power_on_event(void)
}
} else {
if (ap_off_flag) {
- CPRINTS("RESET_FLAG_AP_OFF is on");
+ CPRINTS("EC_RESET_FLAG_AP_OFF is on");
power_off();
return POWER_ON_CANCEL;
}
diff --git a/power/mt8183.c b/power/mt8183.c
index af560c04e4..683e6d274e 100644
--- a/power/mt8183.c
+++ b/power/mt8183.c
@@ -168,7 +168,7 @@ enum power_state power_chipset_init(void)
CPRINTS("already in S0");
return POWER_S0;
}
- } else if (system_get_reset_flags() & RESET_FLAG_AP_OFF) {
+ } else if (system_get_reset_flags() & EC_RESET_FLAG_AP_OFF) {
/* Force shutdown from S5 if the PMIC is already up. */
if (power_get_signals() & IN_PGOOD_PMIC) {
forcing_shutdown = 1;
diff --git a/power/rk3288.c b/power/rk3288.c
index 111f7c7fd9..a44df2ffbc 100644
--- a/power/rk3288.c
+++ b/power/rk3288.c
@@ -215,7 +215,7 @@ enum power_state power_chipset_init(void)
* Force the AP shutdown unless we are doing SYSJUMP. Otherwise,
* the AP could stay in strange state.
*/
- if (!(reset_flags & RESET_FLAG_SYSJUMP)) {
+ if (!(reset_flags & EC_RESET_FLAG_SYSJUMP)) {
CPRINTS("not sysjump; forcing AP shutdown");
chipset_turn_off_power_rails();
@@ -235,8 +235,8 @@ enum power_state power_chipset_init(void)
}
/* Leave power off only if requested by reset flags */
- if (!(reset_flags & RESET_FLAG_AP_OFF) &&
- !(reset_flags & RESET_FLAG_SYSJUMP)) {
+ if (!(reset_flags & EC_RESET_FLAG_AP_OFF) &&
+ !(reset_flags & EC_RESET_FLAG_SYSJUMP)) {
CPRINTS("auto_power_on set due to reset_flag 0x%x",
system_get_reset_flags());
auto_power_on = 1;
@@ -289,14 +289,14 @@ static int check_for_power_on_event(void)
{
int ap_off_flag;
- ap_off_flag = system_get_reset_flags() & RESET_FLAG_AP_OFF;
- system_clear_reset_flags(RESET_FLAG_AP_OFF);
+ ap_off_flag = system_get_reset_flags() & EC_RESET_FLAG_AP_OFF;
+ system_clear_reset_flags(EC_RESET_FLAG_AP_OFF);
/* check if system is already ON */
if (power_get_signals() & IN_POWER_GOOD) {
if (ap_off_flag) {
CPRINTS(
"system is on, but "
- "RESET_FLAG_AP_OFF is on");
+ "EC_RESET_FLAG_AP_OFF is on");
return 0;
} else {
CPRINTS(
diff --git a/power/rk3399.c b/power/rk3399.c
index f72c43d4d1..9f146fccf9 100644
--- a/power/rk3399.c
+++ b/power/rk3399.c
@@ -241,7 +241,7 @@ enum power_state power_chipset_init(void)
CPRINTS("already in S0");
return POWER_S0;
}
- } else if (!(system_get_reset_flags() & RESET_FLAG_AP_OFF))
+ } else if (!(system_get_reset_flags() & EC_RESET_FLAG_AP_OFF))
/* Auto-power on */
chipset_exit_hard_off();
diff --git a/power/sdm845.c b/power/sdm845.c
index c229ddd4b9..ac5b814ad3 100644
--- a/power/sdm845.c
+++ b/power/sdm845.c
@@ -407,7 +407,7 @@ enum power_state power_chipset_init(void)
* Force the AP shutdown unless we are doing SYSJUMP. Otherwise,
* the AP could stay in strange state.
*/
- if (!(reset_flags & RESET_FLAG_SYSJUMP)) {
+ if (!(reset_flags & EC_RESET_FLAG_SYSJUMP)) {
CPRINTS("not sysjump; forcing system shutdown");
set_system_power(0);
init_power_state = POWER_G3;
@@ -423,8 +423,8 @@ enum power_state power_chipset_init(void)
}
/* Leave power off only if requested by reset flags */
- if (!(reset_flags & RESET_FLAG_AP_OFF) &&
- !(reset_flags & RESET_FLAG_SYSJUMP)) {
+ if (!(reset_flags & EC_RESET_FLAG_AP_OFF) &&
+ !(reset_flags & EC_RESET_FLAG_SYSJUMP)) {
CPRINTS("auto_power_on set due to reset_flag 0x%x",
system_get_reset_flags());
auto_power_on = 1;
@@ -553,12 +553,12 @@ static uint8_t check_for_power_on_event(void)
{
int ap_off_flag;
- ap_off_flag = system_get_reset_flags() & RESET_FLAG_AP_OFF;
- system_clear_reset_flags(RESET_FLAG_AP_OFF);
+ ap_off_flag = system_get_reset_flags() & EC_RESET_FLAG_AP_OFF;
+ system_clear_reset_flags(EC_RESET_FLAG_AP_OFF);
/* check if system is already ON */
if (power_get_signals() & IN_POWER_GOOD) {
if (ap_off_flag) {
- CPRINTS("system is on, but RESET_FLAG_AP_OFF is on");
+ CPRINTS("system is on, but EC_RESET_FLAG_AP_OFF is on");
return POWER_ON_CANCEL;
}
CPRINTS("system is on, thus clear auto_power_on");
@@ -567,7 +567,7 @@ static uint8_t check_for_power_on_event(void)
return POWER_ON_BY_IN_POWER_GOOD;
}
if (ap_off_flag) {
- CPRINTS("RESET_FLAG_AP_OFF is on");
+ CPRINTS("EC_RESET_FLAG_AP_OFF is on");
power_off();
return POWER_ON_CANCEL;
}
diff --git a/power/skylake.c b/power/skylake.c
index ce6b823b5e..d51f6079ff 100644
--- a/power/skylake.c
+++ b/power/skylake.c
@@ -158,18 +158,19 @@ void chipset_handle_reboot(void)
* conditions are not met.
*/
if (!(flags &
- (RESET_FLAG_WATCHDOG | RESET_FLAG_SOFT | RESET_FLAG_HARD)))
+ (EC_RESET_FLAG_WATCHDOG | EC_RESET_FLAG_SOFT |
+ EC_RESET_FLAG_HARD)))
return;
/* Preserve AP off request. */
- if (flags & RESET_FLAG_AP_OFF) {
+ if (flags & EC_RESET_FLAG_AP_OFF) {
/* Do not issue PMIC reset if board cannot save reset flags */
if (!board_has_working_reset_flags()) {
ccprintf("Skip PMIC reset due to board issue.\n");
cflush();
return;
}
- chip_save_reset_flags(RESET_FLAG_AP_OFF);
+ chip_save_reset_flags(EC_RESET_FLAG_AP_OFF);
}
#ifdef CONFIG_CHIP_PANIC_BACKUP