From d001bfff76a260d15c3eba8f697b15b493faaa32 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Thu, 7 Apr 2022 11:44:02 -0500 Subject: dedede: Update pp3300_a_pgood when lost Recently, we made a change that would cause the PP3300_A_PGOOD to follow that of the enable, but it failed to update the local variable. This can cause us to assert DSW_PWROK which can violate the Intel PDG requirement which may lead to RTC corruption. This commit simply updates the local variable in step with the logic that was recently added. BUG=b:218596390 BRANCH=firmware-dedede-13606.B TEST=Build and flash magolor, boot to S0, suspend to S0ix, issue `apshutdown` on EC console, verify that DUT shuts down to S5 and that DSW_PWROK isn't asserted durng this process. Signed-off-by: Aseda Aboagye Change-Id: I420b6e0d29b17bc07b02b3598ec5c099afecfa57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3576652 Tested-by: Aseda Aboagye Auto-Submit: Aseda Aboagye Reviewed-by: Diana Z Commit-Queue: Diana Z --- baseboard/dedede/baseboard.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/baseboard/dedede/baseboard.c b/baseboard/dedede/baseboard.c index 1986f58e34..60b3949e93 100644 --- a/baseboard/dedede/baseboard.c +++ b/baseboard/dedede/baseboard.c @@ -138,9 +138,12 @@ __override int intel_x86_get_pg_ec_dsw_pwrok(void) * therefore this value may be stale. Assume that the PGOOD * follows the enable signal for this case only. */ - if (!gpio_get_level(GPIO_EN_PP3300_A)) + if (!gpio_get_level(GPIO_EN_PP3300_A)) { CPRINTS("EN_PP3300_A is low, assuming PG is low!"); - return gpio_get_level(GPIO_EN_PP3300_A); + atomic_clear(&pp3300_a_pgood); + } else { + atomic_or(&pp3300_a_pgood, 1); + } } return pp3300_a_pgood; } -- cgit v1.2.1