kb94x: enter/exit idle mode gracefully

BRANCH=butterfly
ENE EC KB94X has hw limitation on WDT(maximum: 32 secs), which also
causes an interrupt at the 16th secs to wakeup EC from idle mode. This patch
implements a timer to exit idle mode when exceeding 12 secs -- EC would
be woke up by 64h port command and re-enter idle mode to continue EC ROM
reading.

BUG=chrome-os-partner:13986
TEST=manual
  VT2 console commands:
      flashrom -p internal:bus=lpc --wp-status
      flashrom -p internal:bus=lpc -r ec_bios.bin
  The fan should not spin up.

Original-Change-Id: I449902af2afecb98cad0ef87d06264012d399edd
Reviewed-on: https://gerrit.chromium.org/gerrit/34096
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Agnes Cheng <agnescheng@chromium.org>
Commit-Ready: David Hendricks <dhendrix@chromium.org>
(cherry picked from commit 433ff586555b422da17e59f191c2541b254c3564)

Change-Id: Id0aee9b373c6b5e34c491d2399db194324e14637
Reviewed-on: https://gerrit.chromium.org/gerrit/34616
Tested-by: Agnes Cheng <agnescheng@google.com>
Reviewed-by: Shawn Nematbakhsh <shawnn@google.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
1 file changed