diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2017-03-15 10:13:10 -0700 |
---|---|---|
committer | Vadim Bendebury <vbendeb@chromium.org> | 2017-03-16 00:05:39 +0000 |
commit | a366047d2f0e5a3d1a866d2e6b848e14e0b14d02 (patch) | |
tree | 9c0662f7f34450b070284f118a62f95c394371d7 | |
parent | 6fc0993257ab99b6d992f5f1a2e8248117049011 (diff) | |
download | chrome-ec-a366047d2f0e5a3d1a866d2e6b848e14e0b14d02.tar.gz |
cr50: use plt_rst_l low level as a sleep wake trigger
When an x86 based system is reset, a pulse on the plt_rst_l line is
generated. This pulse is supposed to reset the system and the pulse'
rising edge is an interrupt trigger for H1 to reset the TPM. If H1 is
in sleep state at the time of the rising edge, the interrupt request
could be lost.
Luckily, the minimum plt_rst_l pulse duration is 1 ms, and the worst
case max time to wake up from sleep for H1 150 us. Let's wake up on
low level of plt_rst_l, this way by the time the rising edge comes
along the H1 would be awake and ready to process the interrupt.
BRANCH=cr50
BUG=b:35995492
TEST=verified that platform_KernelErrorPaths.CORRUPT_STACK passes
hundreds of times on a system were it was failing after a few
runs before this fix.
- verified that suspend_stress_test still succeeds at least 300
iterations
Change-Id: Ib9984efa08bdd185a95716dc9e48077cf4bb3c2a
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455579
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit 43abc6d9dec5fbea7f4f29f4b238bb21d5c8ea1f)
Reviewed-on: https://chromium-review.googlesource.com/456047
-rw-r--r-- | board/cr50/board.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index ade07be2a5..5079af1f89 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -473,10 +473,19 @@ static void configure_board_specific_gpios(void) /* Enbale the input */ GWRITE_FIELD(PINMUX, DIOM3_CTL, IE, 1); - /* Set to be edge sensitive */ - GWRITE_FIELD(PINMUX, EXITEDGE0, DIOM3, 1); - /* Select rising edge polarity */ - GWRITE_FIELD(PINMUX, EXITINV0, DIOM3, 0); + /* + * Make plt_rst_l routed to DIOM3 a low level sensitive wake + * source. This way when a plt_rst_l pulse comes along while + * H1 is in sleep, the H1 wakes from sleep first, enabling all + * necessary clocks, and becomes ready to generate an + * interrupt on the rising edge of plt_rst_l. + * + * It takes at most 150 us to wake up, and the pulse is at + * least 1ms long. + */ + GWRITE_FIELD(PINMUX, EXITEDGE0, DIOM3, 0); + GWRITE_FIELD(PINMUX, EXITINV0, DIOM3, 1); + /* Enable powerdown exit on DIOM3 */ GWRITE_FIELD(PINMUX, EXITEN0, DIOM3, 1); } else { |