diff options
author | Mathew King <mathewk@chromium.org> | 2019-10-25 15:27:03 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-31 17:52:13 +0000 |
commit | 613e2347878e7374f229e9ee1567d67588137587 (patch) | |
tree | 9bc551fce8d5fdf7f29762af1cb3df52db25b2ff | |
parent | 605efb789928c1061802996c81ec3621edb0eafc (diff) | |
download | chrome-ec-613e2347878e7374f229e9ee1567d67588137587.tar.gz |
cr50: Move 30 ms ec_rst delay to after falling edge
Platfoms with closed EC require at least 30 ms to put the EC in reset.
In order to support flashrom over CCD move this 30 ms delay from before
the deassertion of EC reset to after assertion.
BUG=b:142100741
TEST=Run flashrom over CCD without failures
BRANCH=cr50
Change-Id: Ia8bb207a4407733f3cf77c52ac9063cc7bec3f94
Signed-off-by: Mathew King <mathewk@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1881752
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | board/cr50/board.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 606e8ffb82..b5bde68718 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -1071,29 +1071,23 @@ void assert_ec_rst(void) task_disable_irq(bitbang_config.rx_irq); wait_ec_rst(1); + + /* + * On closed source set1, the EC requires a minimum 30 ms pulse to + * properly reset. Ensure EC reset is always asserted for more than + * this time. + */ + if (board_uses_closed_source_set1()) + msleep(30); } -static void deassert_ec_rst_now(void) +void deassert_ec_rst(void) { wait_ec_rst(0); if (uart_bitbang_is_enabled()) task_enable_irq(bitbang_config.rx_irq); } -DECLARE_DEFERRED(deassert_ec_rst_now); - -void deassert_ec_rst(void) -{ - /* - * On closed source set1, the EC requires a minimum 30 ms pulse to - * properly reset. Ensure EC reset is never de-asesrted for less - * than this time. - */ - if (board_uses_closed_source_set1()) - hook_call_deferred(&deassert_ec_rst_now_data, 30 * MSEC); - else - deassert_ec_rst_now(); -} int is_ec_rst_asserted(void) { |