diff options
author | Mary Ruthven <mruthven@google.com> | 2019-01-29 16:08:02 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-06 06:51:02 -0800 |
commit | 36469aa61c23e0e0180541db54f29a292e3d9845 (patch) | |
tree | 2c991489d44ec62b4e912319dcdb878be8ec2911 /chip/g/rbox.c | |
parent | b559bd558a357afd29ba4898d22374b3b2050f02 (diff) | |
download | chrome-ec-36469aa61c23e0e0180541db54f29a292e3d9845.tar.gz |
cr50: use closed loop reset based on board property
Use the closed loop reset when cr50 needs to reset the device. Cr50
expects the board to reset in three places: board_reboot_ap,
board_reboot_ec, or during init after any cr50 reset other than deep
sleep. This change modifies these to use the closed loop reset if the
board property is set.
In board_reboot_ap and board_reboot_ec it calls board_closed_loop_reset
instead of doing the normal reset steps if the board property is set. In
init_ap_detect call board_closed_loop_reset if cr50 just resumed from any
reset other than hibernate. Don't trigger the tpm_rst_isr manually.
BUG=b:123544145
BRANCH=cr50
TEST=manual
Flash firmware that supports resetting the AP when EC_RST_L is
asserted.
Reboot cr50 and verify deferred_tpm_rst_isr is only called after
tpm_rst_asserted.
Open Cr50. Verify the AP is reset
Flash old Mistral firmware which seems to take around 12 seconds
for the warm reset to happen.
Boot the AP.
Reboot cr50 while the AP is up.
The AP wont reset for a while.
While the AP is still up, verify Cr50 keeps EC_RST_L asserted,
the AP state is Unknown, and tpm commands fail while the AP is
in this state.
Eventually the AP resets. Make sure the TPM becomes usable again
and the AP state is on.
Change-Id: I6f0e8728717f1ed35c96b2669f1796078ebf93f7
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1447001
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip/g/rbox.c')
-rw-r--r-- | chip/g/rbox.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chip/g/rbox.c b/chip/g/rbox.c index 005ed547c1..6399f0b612 100644 --- a/chip/g/rbox.c +++ b/chip/g/rbox.c @@ -62,6 +62,18 @@ static void rbox_release_ec_reset(void) GREG32(PINMUX, HOLD) = 0; /* + * If the board uses closed loop reset, the short EC_RST_L pulse may + * not actually put the system in reset. Don't release EC_RST_L here. + * Let ap_state.c handle it once it sees the system is reset. + * + * Release PINMUX HOLD, so the board can detect changes on TPM_RST_L. + */ + if (!(system_get_reset_flags() & RESET_FLAG_HIBERNATE) && + board_uses_closed_loop_reset()) { + return; + } + + /* * After a POR, if the power button is held, then delay releasing * EC_RST_L. */ |