mirror of
https://xff.cz/git/u-boot/
synced 2025-10-27 00:24:09 +01:00
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>
This commit is contained in:
@@ -25,13 +25,16 @@
|
|||||||
#define debug_trace(fmt, b...)
|
#define debug_trace(fmt, b...)
|
||||||
#endif
|
#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)
|
static int wait_for_sync(struct cros_ec_dev *dev)
|
||||||
{
|
{
|
||||||
unsigned long start;
|
unsigned long start;
|
||||||
|
|
||||||
start = get_timer(0);
|
start = get_timer(0);
|
||||||
while (inb(EC_LPC_ADDR_HOST_CMD) & EC_LPC_STATUS_BUSY_MASK) {
|
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",
|
debug("%s: Timeout waiting for CROS_EC sync\n",
|
||||||
__func__);
|
__func__);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user