diff options
author | Bill Richardson <wfrichar@chromium.org> | 2016-03-30 17:45:12 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-03 10:27:39 -0700 |
commit | 9406cf384aba9554dd49eef17a3d4a4eb2947972 (patch) | |
tree | c6d209038d23287e03d96ef59cf81fd7c17b9296 /include | |
parent | e79b32eb3d2f61a23c2c9ac75003315c964f91c9 (diff) | |
download | chrome-ec-9406cf384aba9554dd49eef17a3d4a4eb2947972.tar.gz |
Cr50: Sleep only when SPS has been quiet for a while
This adds the SPI slave bus and TPM task to the things that
can prevent deep sleep. Even when things are quiet, we wait at
least a second
With this CL, it will wait at least one second after the last SPS
transaction before sleeping. Since most TPM-protocol commands are
built up of a number of back-to-back SPS messages, if we don't
wait we'll keep trying to sleep in the middle of active commands.
Even if everything is quiet, we wait 0.2 seconds anyway to give
the UART buffers time to drain.
BUG=chrome-os-partner:49955, chrome-os-partner:50721
BRANCH=none
TEST=make buildall; extensive tests on Cr50
Testing is a pain.
In addition to ALL the steps listed in commit
d917d3f1867e96369ff25bf6906043a5f488a6fb, loading the firmware
with the spiflash tool leaves SPS_CS_L low, so you have to drive
it high manually. The easiest way is to build and run
test/tpm_test/tpmtest.py for a few seconds then interrupt it with
Ctrl-C.
Note that because the system wakes from deep sleep when it sees
SPS_CS_L go low but it can't get ready fast enough to capture the
incoming bits, that first SPI transaction will be garbled or
lost. You'll have to either retry it, or wake the system another
way first.
Change-Id: Iae2fe5ef33869c48e98a3afecd6b98991a51a488
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336690
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/system.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h index 67a867f39e..220e0790e7 100644 --- a/include/system.h +++ b/include/system.h @@ -369,6 +369,13 @@ static inline void disable_sleep(uint32_t mask) } /** + * Postpone sleeping for at least this long, regardless of sleep_mask. + * + * @param Amount of time to postpone sleeping + */ +void delay_sleep_by(uint32_t us); + +/** * Use hibernate module to set up an RTC interrupt at a given * time from now * |