summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-06-25 11:42:28 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-26 04:07:08 +0000
commit62c32d5010d8d12ca53ac9205d7172300f9f22ea (patch)
tree7b03d8ac9f4123df4fe7e34c42a0c32a0ea8e524
parentee378a97e26eff37577144d0166d4a0398a9ae7d (diff)
downloadchrome-ec-62c32d5010d8d12ca53ac9205d7172300f9f22ea.tar.gz
Swap system_jumped_to_this_image with _late for common code
EFS2 boards need to call system_jumped_late in HOOK_INIT to avoid running init code twice per boot. system_jumped_to_this_image and system_jumped_late are functionally equivalent for non EFS2 boards. BUG=chromium:1072743 BRANCH=none TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Iecfd4f6d3e9d43cea535cfd503d6bcf7b79bc4fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2267684 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--chip/npcx/shi.c2
-rw-r--r--common/als.c2
-rw-r--r--common/keyboard_scan.c2
-rw-r--r--common/system.c3
-rw-r--r--driver/charger/isl923x.c2
5 files changed, 5 insertions, 6 deletions
diff --git a/chip/npcx/shi.c b/chip/npcx/shi.c
index d97963bc3f..f3b94cc304 100644
--- a/chip/npcx/shi.c
+++ b/chip/npcx/shi.c
@@ -945,7 +945,7 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, shi_enable, HOOK_PRIO_DEFAULT);
static void shi_reenable_on_sysjump(void)
{
#if !(DEBUG_SHI)
- if (system_jumped_to_this_image() && chipset_in_state(CHIPSET_STATE_ON))
+ if (system_jumped_late() && chipset_in_state(CHIPSET_STATE_ON))
#endif
shi_enable();
}
diff --git a/common/als.c b/common/als.c
index cf136ef50f..2e9c7ba96c 100644
--- a/common/als.c
+++ b/common/als.c
@@ -90,7 +90,7 @@ static void als_task_init(void)
* Enable ALS task in S0 only and may need to re-enable
* when sysjumped.
*/
- if (system_jumped_to_this_image() &&
+ if (system_jumped_late() &&
chipset_in_state(CHIPSET_STATE_ON))
als_task_enable();
}
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index 82c811dd92..f964ad7509 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -676,7 +676,7 @@ static uint32_t check_boot_key(const uint8_t *state)
* re-triggering events in RW firmware that were already processed by
* RO firmware.
*/
- if (system_jumped_to_this_image())
+ if (system_jumped_late())
return BOOT_KEY_NONE;
/* If reset was not caused by reset pin, refresh must be held down */
diff --git a/common/system.c b/common/system.c
index 8b3e294336..6a26161f67 100644
--- a/common/system.c
+++ b/common/system.c
@@ -281,8 +281,7 @@ int system_jumped_to_this_image(void)
int system_jumped_late(void)
{
- return !(reset_flags & EC_RESET_FLAG_EFS)
- && (reset_flags & EC_RESET_FLAG_SYSJUMP);
+ return !(reset_flags & EC_RESET_FLAG_EFS) && jumped_to_image;
}
int system_add_jump_tag(uint16_t tag, int version, int size, const void *data)
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index 67ef8b80a7..ce2d6bfc69 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -516,7 +516,7 @@ static void isl923x_init(int chgnum)
* No need to proceed with the rest of init if we sysjump'd to
* this image as the input current limit has already been set.
*/
- if (system_jumped_to_this_image())
+ if (system_jumped_late())
return;
/*