cros_ec: Allow command to timeout while erasing.

While waiting for a large sector to be erase, the EC can stall.
For instance, with STM32F4: [RM0402 Reference manual]:
"""Any attempt to read the Flash memory on STM32F4xx while it is being
written or erased, causes the bus to stall. Read operations are
processed correctly once the program operation has completed. This
means that code or data fetches cannot be performed while a
write/erase operation is ongoing."""

Allow FLASH_ERASE_GET_RESULT command to timeout. Fails when more than
10s are elapsed.

BUG=b:38506987
BRANCH=none
TEST=Upgrading rose in a loop.
flashrom -V -p ec:type=tp -w /tmp/ec.bin
Check small pages are erased fast, check there are no error.

Change-Id: I35d968fb8a398bd9433e0780d149ac624ff837f5
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/511805
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
1 file changed