summaryrefslogtreecommitdiff
path: root/drivers/misc/cros_ec_lpc.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-11-15 10:13:22 -0500
committerTom Rini <trini@konsulko.com>2020-11-15 10:13:22 -0500
commitcd0d3749afdad4f4fd03bc005fe5efaad0e09417 (patch)
tree2b36d72786e953e1c59e332aeeda08a00acbc5ca /drivers/misc/cros_ec_lpc.c
parentde865f7ee1d9b6dff6e265dee44509c8274ea606 (diff)
parenta3e458524c15710e4ac9ce1556a5f0898084d09a (diff)
Merge tag 'dm-pull-15nov20' of git://git.denx.de/u-boot-dm
Minor fixes/improvements to 'patman status'
Diffstat (limited to 'drivers/misc/cros_ec_lpc.c')
-rw-r--r--drivers/misc/cros_ec_lpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/cros_ec_lpc.c b/drivers/misc/cros_ec_lpc.c
index 63702f90fbc..e0002b9753f 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;