From e856db125850bfc38e341b7df055efea5ae59026 Mon Sep 17 00:00:00 2001 From: Kevin K Wong Date: Wed, 27 May 2015 00:54:56 -0700 Subject: i2c/mec1322: Lock all I2C port before sysjump. sysjump could happen anytime during an I2C transaction. After sysjump and EC reset, I2C pin will be programmed back as GPIO instead of alternate function, which will cause the I2C transacation to failed. MEC1322 I2C also depends on interrupt to handle the I2C transaction, however, sysjump will disable interrupt, which will cause watchdog timeout/reset since interupt for I2C transaction are disabled. BUG=none TEST=After "sysjump ", "i2cscan" is functional and no watchdog reset. BRANCH=none Change-Id: I181084822f0769173c724e48afb59d7099fa1566 Signed-off-by: Kevin K Wong Reviewed-on: https://chromium-review.googlesource.com/273710 Reviewed-by: Randall Spangler Reviewed-by: Alexandru Stan Reviewed-by: Alec Berg Tested-by: Divya Jyothi Commit-Queue: Divya Jyothi --- include/i2c.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/i2c.h') diff --git a/include/i2c.h b/include/i2c.h index 798c831318..dbc51eebbd 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -148,6 +148,11 @@ void i2c_lock(int port, int lock); /* Default maximum time we allow for an I2C transfer */ #define I2C_TIMEOUT_DEFAULT_US (100 * MSEC) +/** + * Prepare I2C module for sysjump. + */ +void i2c_prepare_sysjump(void); + /** * Set the timeout for an I2C transaction. * -- cgit v1.2.1