diff options
author | You-Cheng Syu <youcheng@chromium.org> | 2019-04-09 13:04:34 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-08-26 07:49:42 -0700 |
commit | 555a4470c7e6373cb6d5397ea5e9278317bcb008 (patch) | |
tree | 092deb6e16531e651311625d61accc51708eafb6 /chip/stm32 | |
parent | b3470c02db3b03781cc4d7b0a4c7894a342cba1a (diff) | |
download | chrome-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/stm32')
-rw-r--r-- | chip/stm32/flash-f.c | 2 | ||||
-rw-r--r-- | chip/stm32/flash-stm32f3.c | 2 | ||||
-rw-r--r-- | chip/stm32/flash-stm32h7.c | 4 | ||||
-rw-r--r-- | chip/stm32/flash-stm32l.c | 2 | ||||
-rw-r--r-- | chip/stm32/flash-stm32l4.c | 2 | ||||
-rw-r--r-- | chip/stm32/system.c | 26 |
6 files changed, 19 insertions, 19 deletions
diff --git a/chip/stm32/flash-f.c b/chip/stm32/flash-f.c index 5bfec02a62..14182c54a4 100644 --- a/chip/stm32/flash-f.c +++ b/chip/stm32/flash-f.c @@ -689,7 +689,7 @@ int flash_pre_init(void) * If we have already jumped between images, an earlier image could * have applied write protection. Nothing additional needs to be done. */ - if (reset_flags & RESET_FLAG_SYSJUMP) + if (reset_flags & EC_RESET_FLAG_SYSJUMP) return EC_SUCCESS; if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) { diff --git a/chip/stm32/flash-stm32f3.c b/chip/stm32/flash-stm32f3.c index efa74c90cd..a413d98d43 100644 --- a/chip/stm32/flash-stm32f3.c +++ b/chip/stm32/flash-stm32f3.c @@ -175,7 +175,7 @@ int flash_physical_restore_state(void) * If we have already jumped between images, an earlier image could * have applied write protection. Nothing additional needs to be done. */ - if (reset_flags & RESET_FLAG_SYSJUMP) { + if (reset_flags & EC_RESET_FLAG_SYSJUMP) { prev = (const struct flash_wp_state *)system_get_jump_tag( FLASH_SYSJUMP_TAG, &version, &size); if (prev && version == FLASH_HOOK_VERSION && diff --git a/chip/stm32/flash-stm32h7.c b/chip/stm32/flash-stm32h7.c index 960f478cd2..5f5d1ef528 100644 --- a/chip/stm32/flash-stm32h7.c +++ b/chip/stm32/flash-stm32h7.c @@ -465,7 +465,7 @@ int flash_pre_init(void) * If we have already jumped between images, an earlier image could * have applied write protection. Nothing additional needs to be done. */ - if (reset_flags & RESET_FLAG_SYSJUMP) + if (reset_flags & EC_RESET_FLAG_SYSJUMP) return EC_SUCCESS; if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) { @@ -499,7 +499,7 @@ int flash_pre_init(void) * write-protect. If it didn't, then the flash write protect registers * have been permanently committed and we can't fix that. */ - if (reset_flags & RESET_FLAG_POWER_ON) { + if (reset_flags & EC_RESET_FLAG_POWER_ON) { stuck_locked = 1; return EC_ERROR_ACCESS_DENIED; } diff --git a/chip/stm32/flash-stm32l.c b/chip/stm32/flash-stm32l.c index ef4f19e09d..a151a26cf8 100644 --- a/chip/stm32/flash-stm32l.c +++ b/chip/stm32/flash-stm32l.c @@ -436,7 +436,7 @@ int flash_pre_init(void) * If we have already jumped between images, an earlier image could * have applied write protection. Nothing additional needs to be done. */ - if (reset_flags & RESET_FLAG_SYSJUMP) + if (reset_flags & EC_RESET_FLAG_SYSJUMP) return EC_SUCCESS; if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) { diff --git a/chip/stm32/flash-stm32l4.c b/chip/stm32/flash-stm32l4.c index 97594733c0..c138780d34 100644 --- a/chip/stm32/flash-stm32l4.c +++ b/chip/stm32/flash-stm32l4.c @@ -450,7 +450,7 @@ int flash_pre_init(void) * If we have already jumped between images, an earlier image could * have applied write protection. Nothing additional needs to be done. */ - if (reset_flags & RESET_FLAG_SYSJUMP) + if (reset_flags & EC_RESET_FLAG_SYSJUMP) return EC_SUCCESS; if (prot_flags & EC_FLASH_PROTECT_GPIO_ASSERTED) { diff --git a/chip/stm32/system.c b/chip/stm32/system.c index d5884375c9..7cc0881dc2 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -188,25 +188,25 @@ static void check_reset_cause(void) * IWDG or WWDG, if the watchdog was not used as an hard reset * mechanism */ - if (!(flags & RESET_FLAG_HARD)) - flags |= RESET_FLAG_WATCHDOG; + if (!(flags & EC_RESET_FLAG_HARD)) + flags |= EC_RESET_FLAG_WATCHDOG; } if (raw_cause & RESET_CAUSE_SFT) - flags |= RESET_FLAG_SOFT; + flags |= EC_RESET_FLAG_SOFT; if (raw_cause & RESET_CAUSE_POR) - flags |= RESET_FLAG_POWER_ON; + flags |= EC_RESET_FLAG_POWER_ON; if (raw_cause & RESET_CAUSE_PIN) - flags |= RESET_FLAG_RESET_PIN; + flags |= EC_RESET_FLAG_RESET_PIN; if (pwr_status & RESET_CAUSE_SBF) /* Hibernated and subsequently awakened */ - flags |= RESET_FLAG_HIBERNATE; + flags |= EC_RESET_FLAG_HIBERNATE; if (!flags && (raw_cause & RESET_CAUSE_OTHER)) - flags |= RESET_FLAG_OTHER; + flags |= EC_RESET_FLAG_OTHER; /* * WORKAROUND: as we cannot de-activate the watchdog during @@ -215,8 +215,8 @@ static void check_reset_cause(void) * watchdog initialized this time. * The RTC deadline (if any) is already set. */ - if ((flags & (RESET_FLAG_HIBERNATE | RESET_FLAG_WATCHDOG)) == - (RESET_FLAG_HIBERNATE | RESET_FLAG_WATCHDOG)) { + if ((flags & EC_RESET_FLAG_HIBERNATE) && + (flags & EC_RESET_FLAG_WATCHDOG)) { __enter_hibernate(0, 0); } @@ -358,18 +358,18 @@ 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; /* Remember that the software asked us to hard reboot */ if (flags & SYSTEM_RESET_HARD) - save_flags |= RESET_FLAG_HARD; + save_flags |= EC_RESET_FLAG_HARD; #ifdef CONFIG_STM32_RESET_FLAGS_EXTENDED if (flags & SYSTEM_RESET_AP_WATCHDOG) - save_flags |= RESET_FLAG_AP_WATCHDOG; + save_flags |= EC_RESET_FLAG_AP_WATCHDOG; bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, save_flags & 0xffff); bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS_2, save_flags >> 16); |