diff options
author | Aamir Bohra <aamir.bohra@intel.com> | 2019-07-12 14:37:55 +0530 |
---|---|---|
committer | Subrata Banik <subrata.banik@intel.com> | 2019-07-16 05:40:23 +0000 |
commit | f5202a640b8f032936c831627a83a356108d94e6 (patch) | |
tree | 157304729525cd24d3d3b053a5df89600e271778 /src | |
parent | cc8e992fc3a6bf2e109ad9810296a67115a327aa (diff) | |
download | coreboot-f5202a640b8f032936c831627a83a356108d94e6.tar.xz |
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 <aamir.bohra@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34273
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/common/block/i2c/i2c.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/i2c/i2c.c b/src/soc/intel/common/block/i2c/i2c.c index d551c51abf..854a61a884 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); |