diff options
author | Andrew McRae <amcrae@google.com> | 2022-04-28 15:38:28 +1000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-05 23:46:37 +0000 |
commit | ade735848a985bb90073a320938d42064e788cee (patch) | |
tree | 2ed22a79dae9627df37d2f473ad4820fb946b4be /zephyr/subsys/ap_pwrseq/signal_gpio.c | |
parent | 526043e053cb65b9fe9b54262e829710e060ae40 (diff) | |
download | chrome-ec-ade735848a985bb90073a320938d42064e788cee.tar.gz |
zephyr: Move system pre-init earlier
The system_common_pre_init() function detects whether
a warm boot (sysjump) has been performed, and sets the
reset flags accordingly.
A number of modules rely on detecting whether a warm
boot has happened (e.g the GPIO init, AP power sequence etc.),
and previously the check was performed as part of the
main EC task initialisation, after the kernel and application
init phases. With more Zephyr based modules using SYS_INIT,
moving the check will allow modules using POST_KERNEL and
APPLICATION phase initialisation to check this flag as needed.
BUG=b:230691031
TEST=zmake testall; zmake build nivviks; flash and run
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: I772b57c32b3176a539d464d5d301ff9b87b9d8ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3612983
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Diffstat (limited to 'zephyr/subsys/ap_pwrseq/signal_gpio.c')
-rw-r--r-- | zephyr/subsys/ap_pwrseq/signal_gpio.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/zephyr/subsys/ap_pwrseq/signal_gpio.c b/zephyr/subsys/ap_pwrseq/signal_gpio.c index e28df96e6b..cd43db537e 100644 --- a/zephyr/subsys/ap_pwrseq/signal_gpio.c +++ b/zephyr/subsys/ap_pwrseq/signal_gpio.c @@ -6,7 +6,7 @@ #include <power_signals.h> #include <signal_gpio.h> #include <drivers/gpio.h> -#include "sysjump.h" +#include "system.h" #define MY_COMPAT intel_ap_pwrseq_gpio @@ -121,11 +121,8 @@ void power_signal_gpio_init(void) /* * If there has been a sysjump, do not set the output * to the deasserted state. - * We can't use system_jumped_late() since that is not - * initialised at this point. */ - struct jump_data *jdata = get_jump_data(); - gpio_flags_t out_flags = (jdata && jdata->magic == JUMP_DATA_MAGIC) ? + gpio_flags_t out_flags = system_jumped_to_this_image() ? GPIO_OUTPUT : GPIO_OUTPUT_INACTIVE; for (int i = 0; i < ARRAY_SIZE(gpio_config); i++) { |