From f5202a640b8f032936c831627a83a356108d94e6 Mon Sep 17 00:00:00 2001 From: Aamir Bohra Date: Fri, 12 Jul 2019 14:37:55 +0530 Subject: soc/intel/common/block/i2c: Set controller state to active in i2c init Set the controller state to D0 during the i2c init sequence, this ensures the controller is up and active. BUG=b:135941367 TEST=Verify no timeouts seen during I2C controller enumeration sequence Change-Id: I247ede44b8d1d6871e3e813b63f99a7f6398dd72 Signed-off-by: Aamir Bohra Reviewed-on: https://review.coreboot.org/c/coreboot/+/34273 Reviewed-by: Furquan Shaikh Reviewed-by: Subrata Banik Reviewed-by: Karthik Ramasubramanian Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/i2c/i2c.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/soc/intel/common/block/i2c/i2c.c b/src/soc/intel/common/block/i2c/i2c.c index d551c51abf88..854a61a884a1 100644 --- a/src/soc/intel/common/block/i2c/i2c.c +++ b/src/soc/intel/common/block/i2c/i2c.c @@ -87,6 +87,9 @@ static int lpss_i2c_early_init_bus(unsigned int bus) /* Take device out of reset */ lpss_reset_release(base); + /* Ensure controller is in D0 state */ + lpss_set_power_state(tree_dev, STATE_D0); + /* Initialize the controller */ if (dw_i2c_init(bus, config) < 0) { printk(BIOS_ERR, "I2C%u failed to initialize\n", bus); @@ -162,6 +165,9 @@ static void dw_i2c_device_init(struct device *dev) if (!base_address) return; + /* Ensure controller is in D0 state */ + lpss_set_power_state(dev, STATE_D0); + /* Take device out of reset if its not done before */ if (lpss_is_controller_in_reset(base_address)) lpss_reset_release(base_address); -- cgit v1.2.3