summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2018-10-29 11:33:56 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-10-30 01:04:59 -0700
commit97c6609f8dc889a2e70daea5147776bb6c2bdbe2 (patch)
tree0f31dc6007a878c731b6dc67c3ea385c706f07fb
parent7bff3d8b41741d91bdd8013b80d211fcdf738074 (diff)
downloadchrome-ec-97c6609f8dc889a2e70daea5147776bb6c2bdbe2.tar.gz
Octopus: Prevent possible i2c_unwedge watchdog reset in S5
When the system enters S5 and the motion_sensor_task was just about to gather data from its sensors, we can hit a scenario where the attempts to unwedge the I2C bus cause the EC to hit a watchdog reset. This change adds the configuration option to indicate that the sensors are unpowered in S5/G3, and therefore the low SCL line is expected. BRANCH=None BUG=b:116774375 TEST=Added sleep to motion_sensor_task to increase the probability of hitting this timing window, confirmed this change triggered the not powered check instead of attempting an unwedge Change-Id: I126a096afde24d0823e6d4fce7e0da3059b421f5 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1305121 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
-rw-r--r--baseboard/octopus/baseboard.c9
-rw-r--r--baseboard/octopus/baseboard.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 225ef9745d..37b467e005 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -170,6 +170,15 @@ void chipset_do_shutdown(void)
;
}
+int board_is_i2c_port_powered(int port)
+{
+ if (port != I2C_PORT_SENSOR)
+ return 1;
+
+ /* Sensor rails are off in S5/G3 */
+ return chipset_in_state(CHIPSET_STATE_ANY_OFF) ? 0 : 1;
+}
+
/******************************************************************************/
/* Power Delivery and charing functions */
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index 12f0dbb689..9dcdde6b24 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -70,6 +70,7 @@
/* Common EC defines */
#define CONFIG_I2C
#define CONFIG_I2C_MASTER
+#define CONFIG_I2C_BUS_MAY_BE_UNPOWERED
#define CONFIG_VBOOT_HASH
#define CONFIG_VSTORE
#define CONFIG_VSTORE_SLOT_COUNT 1