diff options
author | Simon Glass <sjg@chromium.org> | 2020-11-09 07:14:44 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-11-14 15:23:41 -0700 |
commit | 4cb862fe28332f187f636b37b48fb0fbaf3432ec (patch) | |
tree | 140ce14d38fcb4a65dd542b061b3ad7a932dca4e | |
parent | d237e9c7c00d131d808761d0fe7f44768598c074 (diff) | |
download | u-boot-4cb862fe28332f187f636b37b48fb0fbaf3432ec.zip u-boot-4cb862fe28332f187f636b37b48fb0fbaf3432ec.tar.gz u-boot-4cb862fe28332f187f636b37b48fb0fbaf3432ec.tar.bz2 |
cros_ec: Increase command timeout for flash erase
Erasing the flash can take over a second on some devices and the EC is
not responsive during this time. Update the timeout to 5 seconds to cope
with this.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | drivers/misc/cros_ec_lpc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/cros_ec_lpc.c b/drivers/misc/cros_ec_lpc.c index 63702f9..e0002b9 100644 --- a/drivers/misc/cros_ec_lpc.c +++ b/drivers/misc/cros_ec_lpc.c @@ -25,13 +25,16 @@ #define debug_trace(fmt, b...) #endif +/* Timeout waiting for a flash erase command to complete */ +static const int CROS_EC_CMD_TIMEOUT_MS = 5000; + static int wait_for_sync(struct cros_ec_dev *dev) { unsigned long start; start = get_timer(0); while (inb(EC_LPC_ADDR_HOST_CMD) & EC_LPC_STATUS_BUSY_MASK) { - if (get_timer(start) > 1000) { + if (get_timer(start) > CROS_EC_CMD_TIMEOUT_MS) { debug("%s: Timeout waiting for CROS_EC sync\n", __func__); return -1; |