EC: LPC: Increase command timeout to 5000ms
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>
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;