summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2015-05-27 00:54:56 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-05 03:22:06 +0000
commite856db125850bfc38e341b7df055efea5ae59026 (patch)
tree958460f351b3a6ed5aa2384bd34c2fd03f3b09ba /include/i2c.h
parent706fcb19ca29040a8182861aa2b44ef7496737e4 (diff)
downloadchrome-ec-e856db125850bfc38e341b7df055efea5ae59026.tar.gz
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 <RO/RW>", "i2cscan" is functional and no watchdog reset. BRANCH=none Change-Id: I181084822f0769173c724e48afb59d7099fa1566 Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/273710 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Alexandru Stan <amstan@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Tested-by: Divya Jyothi <divya.jyothi@intel.com> Commit-Queue: Divya Jyothi <divya.jyothi@intel.com>
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index 798c831318..dbc51eebbd 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -149,6 +149,11 @@ void i2c_lock(int port, int lock);
#define I2C_TIMEOUT_DEFAULT_US (100 * MSEC)
/**
+ * Prepare I2C module for sysjump.
+ */
+void i2c_prepare_sysjump(void);
+
+/**
* Set the timeout for an I2C transaction.
*
* @param port Port to set timeout for