From f7f3f249ee14785e0f5164c290521dd7f331859c Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Thu, 30 Mar 2017 17:08:09 -0700 Subject: g: rbox: Let pins stabilize before releasing EC. When releasing the PINMUX hold, some of the output levels may change. Therefore, it's probably best to let those outputs stabilize before letting the EC out of reset and sample them. BUG=b:36659750 BRANCH=master,cr50 TEST=Flash Cr50. Verify that WP_L is stable before EC is released from reset. Change-Id: Ie2967c5e97f28240e1724b4531655c5dd08a3f29 Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/464257 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Mary Ruthven --- chip/g/rbox.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chip/g/rbox.c b/chip/g/rbox.c index e7be79538c..2be1e19c11 100644 --- a/chip/g/rbox.c +++ b/chip/g/rbox.c @@ -42,11 +42,15 @@ void rbox_powerbtn_press(void) static void rbox_release_ec_reset(void) { + /* Unfreeze the PINMUX */ + GREG32(PINMUX, HOLD) = 0; + + /* Allow some time for outputs to stabilize. */ + usleep(500); + /* Let the EC go (the RO bootloader asserts it ASAP after POR) */ GREG32(RBOX, ASSERT_EC_RST) = 0; - /* And unfreeze the PINMUX */ - GREG32(PINMUX, HOLD) = 0; } DECLARE_HOOK(HOOK_INIT, rbox_release_ec_reset, HOOK_PRIO_LAST); -- cgit v1.2.1