summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2014-01-30 16:22:49 (GMT)
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-30 18:49:32 (GMT)
commit89390d98fec6d30a5e591c4662b6a1cfecfb7a0d (patch)
tree68dcb9807b6204bce0e2e69cfe0f0b55c90a13a9
parenta763dccf01a1c3836ab1381e09b7677026ad74dd (diff)
downloaddepthcharge-stabilize-5414.B.tar.gz
depthcharge-stabilize-5414.B.tar.xz
EC: LPC: Increase command timeout to 5000mstest-5394.Bstabilize-5414.Bstabilize-5412.B
This is the same command timeout used in the upper layer for proto3 and allows enough time for flash erase to complete. BUG=chrome-os-partner:25268 BRANCH=baytrail TEST=build and boot on rambi Change-Id: I87a50911bd575a7c3bac361f12868a555f89a2c8 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/184452 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/drivers/ec/cros/lpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/ec/cros/lpc.c b/src/drivers/ec/cros/lpc.c
index 81b937b..7aecb1f 100644
--- a/src/drivers/ec/cros/lpc.c
+++ b/src/drivers/ec/cros/lpc.c
@@ -26,11 +26,14 @@
#include "base/container_of.h"
#include "drivers/ec/cros/lpc.h"
+/* Timeout waiting for a flash erase command to complete */
+static const int CROS_EC_CMD_TIMEOUT_MS = 5000;
+
static int wait_for_sync(void)
{
uint64_t start = timer_us(0);
while (inb(EC_LPC_ADDR_HOST_CMD) & EC_LPC_STATUS_BUSY_MASK) {
- if (timer_us(start) > 1000 * 1000) {
+ if (timer_us(start) > CROS_EC_CMD_TIMEOUT_MS * 1000) {
printf("%s: Timeout waiting for CrosEC sync\n",
__func__);
return -1;