summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-08-28 17:33:06 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-29 21:55:40 +0000
commit390498a9ff7f85095a14c9ede8f3dedfaf677e64 (patch)
treeb204ac8012296b82cfd07918f8474304e25450cc
parent61f2327f072b4600b1b5880da8a858ce528d59d0 (diff)
downloadchrome-ec-390498a9ff7f85095a14c9ede8f3dedfaf677e64.tar.gz
samus: automatically attempt to unwedge i2c bus 0
Define SCL and SDA for I2C port 0 so that it is automatically unwedged when it detects the bus has been wedged. Note, we can currently only use this on one I2C port. BUG=chrome-os-partner:31581 BRANCH=samus TEST=load onto samus p2b that is having i2c port 0 problems and wait for the bus to wedge, then verify it automatically unwedges: [868.755442 I2C0 Addr:16 bad status 0x41, SCL=1, SDA=0] [868.756013 I2C unwedge called with SDA held low] Change-Id: I0ffb6a725af97155f734e2570574144ba4044f22 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/215396 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
-rw-r--r--board/samus/board.c2
-rw-r--r--board/samus/gpio.inc3
2 files changed, 4 insertions, 1 deletions
diff --git a/board/samus/board.c b/board/samus/board.c
index b536143279..7a8ca30229 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -123,7 +123,7 @@ BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS);
/* I2C ports */
const struct i2c_port_t i2c_ports[] = {
- {"batt_chg", 0, 100},
+ {"batt_chg", 0, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA},
{"lightbar", 1, 400},
{"thermal", 5, 100},
};
diff --git a/board/samus/gpio.inc b/board/samus/gpio.inc
index c5f1e6070e..d090943f30 100644
--- a/board/samus/gpio.inc
+++ b/board/samus/gpio.inc
@@ -96,6 +96,9 @@ GPIO(USB2_CTL3, D, 4, GPIO_OUT_LOW, NULL) /* USB charger port 2 CTL3
GPIO(USB2_ENABLE, D, 5, GPIO_OUT_HIGH, NULL) /* USB charger port 2 enable */
GPIO(USB2_ILIM_SEL_L, D, 6, GPIO_OUT_HIGH, NULL) /* USB charger port 2 ILIM_SEL output */
+GPIO(I2C0_SCL, B, 2, GPIO_ODR_HIGH, NULL) /* I2C port 1 SCL */
+GPIO(I2C0_SDA, B, 3, GPIO_ODR_HIGH, NULL) /* I2C port 1 SDA */
+
ALTERNATE(A, 0x03, 1, MODULE_UART, 0) /* UART0 */
ALTERNATE(A, 0x40, 3, MODULE_I2C, 0) /* I2C1 SCL */
ALTERNATE(A, 0x80, 3, MODULE_I2C, GPIO_OPEN_DRAIN) /* I2C1 SDA */