summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-03-15 10:13:10 -0700
committerVadim Bendebury <vbendeb@chromium.org>2017-03-15 23:58:51 +0000
commit43abc6d9dec5fbea7f4f29f4b238bb21d5c8ea1f (patch)
tree39479d2a9814f8d285a56135f8d2a85bdd84ef29 /board
parent597a3bc943fd2517ec877bacf9357687fbffdc0b (diff)
downloadchrome-ec-43abc6d9dec5fbea7f4f29f4b238bb21d5c8ea1f.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>
Diffstat (limited to 'board')
-rw-r--r--board/cr50/board.c17
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 {