UPSTREAM: soc/intel/common/block/i2c: Ignore disabled I2C devices

If I2C device is disabled:
1. BAR for the device will be 0
2. There is no need to generate ACPI tables for the device

TEST=Verified that if an i2c device is disabled statically in
devicetree or dynamically in mainboard, then coreboot does not die
looking for missing resources.

Change-Id: I3617894691853f18b1ebb6f1fe26202d8d3ff502
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: d629e433dd
Original-Change-Id: Id9a790e338a0e6f32c199f5f437203e1525df208
Original-Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/20140
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/539205
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
Furquan Shaikh 2017-06-09 17:54:00 -07:00 committed by chrome-bot
parent 52a2297743
commit 46f2add6c0

View file

@ -41,7 +41,7 @@ uintptr_t lpss_i2c_base_address(unsigned int bus)
/* devfn -> dev */
dev = dev_find_slot(0, devfn);
if (!dev)
if (!dev || !dev->enabled)
return (uintptr_t)NULL;
/* dev -> bar0 */
@ -119,7 +119,12 @@ static void lpss_i2c_acpi_fill_ssdt(struct device *dev)
I2C_SPEED_FAST_PLUS,
I2C_SPEED_HIGH,
};
int i, bus = lpss_i2c_dev_to_bus(dev);
int i, bus;
if (!dev->enabled)
return;
bus = lpss_i2c_dev_to_bus(dev);
bcfg = i2c_get_soc_cfg(bus, dev);