summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2018-05-16 20:01:17 +0000
committerchrome-bot <chrome-bot@chromium.org>2018-05-17 19:34:46 -0700
commitc00edb39a0722fbf9af972f3bc3e931889c40185 (patch)
tree70782c8750992bae586db35fbfb3753873261c88 /board
parentc2455d4caf3be8248ed5275da6f149ebb0d417e0 (diff)
downloadchrome-ec-c00edb39a0722fbf9af972f3bc3e931889c40185.tar.gz
Revert "cr50: disable s3_terms during init"
This reverts commit c24d480d90699bf6aaf534d66dc48513d867bdd0. Reason for revert: Removing all s3 termination support. It's not necessary and it causes scarlet to boot into recovery. Original change's description: > cr50: disable s3_terms during init > > When cr50 resumes from deep sleep term_enabled is reset to 0, but not > all of the s3 termination settings are reset. Some of them are, because > some of the gpios are defined in gpio.inc and cr50 will handle setting > those up during init, but others like the sps pulldowns aren't. At this > point, the term_enabled setting does not actually match the state of > enabled terminations. > > After deep sleep reset if the AP is on, ccd update state will try to > disable the s3 terminations, but term_enabled is 0, so s3_term thinks > they're already disabled and wont do anything even though some of the > terminations are actually enabled. > > This change initializes all of the s3_term stuff to disable during hook > init. This way things are reset so they won't interfere with sps_init. > This will also make sure to align the system state with term_enabled, > before the ccd hook starts getting called. It is safer to start with > disabling the terminations, because it wont interfere with tpm > communication if the AP is on. If the AP is off, ccd_update_state will > re-enable the terminations around a second after init. > > BUG=b:62200096,b:79214702 > BRANCH=cr50 > TEST=firwmare_Cr50DeepSleepStress.reboot on bob > > Change-Id: I9a90c7f7703b1406b4c494db448a8ac84d040d1c > Signed-off-by: Mary Ruthven <mruthven@google.com> > Reviewed-on: https://chromium-review.googlesource.com/1043152 > Commit-Ready: Mary Ruthven <mruthven@chromium.org> > Tested-by: Mary Ruthven <mruthven@chromium.org> > Reviewed-by: Randall Spangler <rspangler@chromium.org> > Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Bug: b:62200096, b:79214702 Change-Id: If3467352030c65365c6851cd692aa5d0e9f47667 Reviewed-on: https://chromium-review.googlesource.com/1062686 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/cr50/s3_term.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/board/cr50/s3_term.c b/board/cr50/s3_term.c
index 53fc8b3e98..bb486d207e 100644
--- a/board/cr50/s3_term.c
+++ b/board/cr50/s3_term.c
@@ -4,7 +4,6 @@
*/
#include "console.h"
-#include "hooks.h"
#include "registers.h"
#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args)
@@ -13,7 +12,7 @@
#define AP_TX_TERM (1 << 0)
#define SPS_TERM (1 << 1)
-static uint8_t term_enabled;
+int term_enabled;
static void update_term_state(int term, int enable)
{
@@ -66,10 +65,9 @@ static void sps_term_enable(int term_enable)
update_term_state(SPS_TERM, term_enable);
}
-static void s3_term(int term_enable)
+void board_s3_term(int term_enable)
{
- /* If the board doesn't use s3_term, return before doing anything */
- if (!board_needs_s3_term())
+ if (!board_needs_s3_term() || (!term_enable == !term_enabled))
return;
CPRINTS("%sable S3 signal terminations", term_enable ? "En" : "Dis");
@@ -79,31 +77,9 @@ static void s3_term(int term_enable)
sps_term_enable(term_enable);
}
-/*
- * Disable all terminations after cr50 reset. CCD state will re-enable them if
- * needed. We just want to make sure any terminations enabled from the previous
- * boot don't interfere with any other peripheral initialization. The pins
- * s3_term controls may not be covered by the standard gpio init, so they won't
- * be reset unless s3_term resets them during init.
- */
-static void s3_term_init(void)
-{
- s3_term(0);
-}
-DECLARE_HOOK(HOOK_INIT, s3_term_init, HOOK_PRIO_FIRST);
-
-void board_s3_term(int term_enable)
-{
- /* Only update the terminations if something has changed */
- if (!term_enable == !term_enabled)
- return;
- s3_term(term_enable);
-}
-
static int command_s3term(int argc, char **argv)
{
- ccprintf("Terminations:%s%s%s\n",
- term_enabled ? "" : "None",
+ ccprintf("Terminations:%s%s\n",
term_enabled & AP_TX_TERM ? " AP" : "",
term_enabled & SPS_TERM ? " SPS" : "");
return EC_SUCCESS;