Snow:Recover from stray pulses on i2c battery line
Snow:Recover from stray pulses on i2c battery line

The I2C peripheral on the EC can get confused if there is a very
specific kind of noise introduced to the line.  This can be manifested
by jiggling the battery jack.  It gets the I2C into a state where
everything seems fine outwardly, but the device refuses to even transmit
START bits on the line.  It appears that one of the stray pulses on the
i2c bus gets the device off set from the actual bytes, leaving it
misinterpreting everything and waiting forever.  In this case, there is
only one way to recover (as you can't directly access these aspects of
the internal state) and that is to do a software reset of the i2c
peripheral.

Here I add some code to check for the condition where the EC was unable
to even send a START bit, and do a software reset of the i2c to recover.

BUG=chrome-os-partner:13161
TEST=With a faulty-battery-jack-board: Boot board, test that i2c works
by running "pmu" on the EC console.  Jiggle battery jack repeatedly
until errors are displayed on console.  Try to run pmu again.  Make sure
that it recovers gracefully, and do this many times.
BRANCH=snow

Change-Id: I91b8ef0c6f6079bc63f4a6a1bc91f67d19db9fc0
Signed-off-by: Charlie Mooney <c4f45ade001857f07012a75265a97cb07f1531f2@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32286
Reviewed-by: David Hendricks <3b0deacc4b5357f519084f1ea34bd42bf5d34545@chromium.org>

longsleep/ec,longsleep/ec,alterapraxisptyltd/chromium-ec,mtk09422/chromiumos-platform-ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,md5555/ec,md5555/ec,thehobn/ec,fourier49/BZ_DEV_EC,fourier49/BIZ_EC,thehobn/ec,alterapraxisptyltd/chromium-ec,thehobn/ec,mtk09422/chromiumos-platform-ec,thehobn/ec,fourier49/BZ_DEV_EC,fourier49/BIZ_EC,coreboot/chrome-ec,mtk09422/chromiumos-platform-ec,alterapraxisptyltd/chromium-ec,fourier49/BIZ_EC,coreboot/chrome-ec,longsleep/ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,eatbyte/chromium-ec,md5555/ec,gelraen/cros-ec,coreboot/chrome-ec,gelraen/cros-ec,gelraen/cros-ec,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics,eatbyte/chromium-ec,fourier49/BZ_DEV_EC,longsleep/ec,eatbyte/chromium-ec,md5555/ec,mtk09422/chromiumos-platform-ec,fourier49/BZ_DEV_EC,gelraen/cros-ec,akappy7/ChromeOS_EC_LED_Diagnostics,akappy7/ChromeOS_EC_LED_Diagnostics,eatbyte/chromium-ec,coreboot/chrome-ec,alterapraxisptyltd/chromium-ec