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>
This commit is contained in:
parent
cc8e992fc3
commit
f5202a640b
|
@ -87,6 +87,9 @@ static int lpss_i2c_early_init_bus(unsigned int bus)
|
||||||
/* Take device out of reset */
|
/* Take device out of reset */
|
||||||
lpss_reset_release(base);
|
lpss_reset_release(base);
|
||||||
|
|
||||||
|
/* Ensure controller is in D0 state */
|
||||||
|
lpss_set_power_state(tree_dev, STATE_D0);
|
||||||
|
|
||||||
/* Initialize the controller */
|
/* Initialize the controller */
|
||||||
if (dw_i2c_init(bus, config) < 0) {
|
if (dw_i2c_init(bus, config) < 0) {
|
||||||
printk(BIOS_ERR, "I2C%u failed to initialize\n", bus);
|
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)
|
if (!base_address)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Ensure controller is in D0 state */
|
||||||
|
lpss_set_power_state(dev, STATE_D0);
|
||||||
|
|
||||||
/* Take device out of reset if its not done before */
|
/* Take device out of reset if its not done before */
|
||||||
if (lpss_is_controller_in_reset(base_address))
|
if (lpss_is_controller_in_reset(base_address))
|
||||||
lpss_reset_release(base_address);
|
lpss_reset_release(base_address);
|
||||||
|
|
Loading…
Reference in New Issue