diff options
author | Diana Z <dzigterman@chromium.org> | 2020-07-22 16:55:29 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-24 01:10:53 +0000 |
commit | 73745ba8e0ea7725fc40a60356b40f146ff9673b (patch) | |
tree | ca2e0793381ed02395e76c196146d0f37e0185cb /baseboard | |
parent | d53b71c17f7845a591fe4099b53717ec28bf5ccf (diff) | |
download | chrome-ec-73745ba8e0ea7725fc40a60356b40f146ff9673b.tar.gz |
Dedede: Store PP3300_A status before sysjumps
Since the chipset task inits before the ADCs, we'll need to provide
pp3300_a_good by preserving it in the sysjump tags.
BRANCH=None
BUG=b:161887378,b:159863180
TEST=on drawlat, boot to S0 and sysjump back and forth between RO and
RW. Observe that the DUT remains at the ChromeOS login screen the whole
time.
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I3086f0bb2cd4b97c988c2365148b75b99954f380
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2314642
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/dedede/baseboard.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/baseboard/dedede/baseboard.c b/baseboard/dedede/baseboard.c index 3f6977cc86..0a88006a33 100644 --- a/baseboard/dedede/baseboard.c +++ b/baseboard/dedede/baseboard.c @@ -14,6 +14,7 @@ #include "hooks.h" #include "host_command.h" #include "intel_x86.h" +#include "system.h" /******************************************************************************/ /* @@ -124,6 +125,31 @@ __override int intel_x86_get_pg_ec_dsw_pwrok(void) return pp3300_a_pgood; } +/* Store away PP300_A good status before sysjumps */ +#define BASEBOARD_SYSJUMP_TAG 0x4242 /* BB */ +#define BASEBOARD_HOOK_VERSION 1 + +static void pp3300_a_pgood_preserve(void) +{ + system_add_jump_tag(BASEBOARD_SYSJUMP_TAG, BASEBOARD_HOOK_VERSION, + sizeof(pp3300_a_pgood), &pp3300_a_pgood); +} +DECLARE_HOOK(HOOK_SYSJUMP, pp3300_a_pgood_preserve, HOOK_PRIO_DEFAULT); + +static void pp3300_a_pgood_restore(void) +{ + const int *stored; + int version, size; + + stored = (const int *)system_get_jump_tag(BASEBOARD_SYSJUMP_TAG, + &version, &size); + if (stored && (version == BASEBOARD_HOOK_VERSION) && + (size == sizeof(pp3300_a_pgood))) + /* Valid PP3300 status found, restore before CHIPSET init */ + pp3300_a_pgood = *stored; +} +DECLARE_HOOK(HOOK_INIT, pp3300_a_pgood_restore, HOOK_PRIO_FIRST); + __override int intel_x86_get_pg_ec_all_sys_pwrgd(void) { /* |