[coreboot-gerrit] Change in coreboot[master]: soc/intel/common/block/i2c: Ignore disabled I2C devices

Furquan Shaikh (Code Review) gerrit at coreboot.org
Sat Jun 10 03:01:14 CEST 2017


Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/20140


Change subject: soc/intel/common/block/i2c: Ignore disabled I2C devices
......................................................................

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: Id9a790e338a0e6f32c199f5f437203e1525df208
Signed-off-by: Furquan Shaikh <furquan at chromium.org>
---
M src/soc/intel/common/block/i2c/i2c.c
1 file changed, 7 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/20140/1

diff --git a/src/soc/intel/common/block/i2c/i2c.c b/src/soc/intel/common/block/i2c/i2c.c
index fe220b5..6debe88 100644
--- a/src/soc/intel/common/block/i2c/i2c.c
+++ b/src/soc/intel/common/block/i2c/i2c.c
@@ -41,7 +41,7 @@
 
 	/* devfn -> dev */
 	dev = dev_find_slot(0, devfn);
-	if (!dev)
+	if (!dev || !dev->enabled)
 		return (uintptr_t)NULL;
 
 	/* dev -> bar0 */
@@ -119,7 +119,12 @@
 		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);
 

-- 
To view, visit https://review.coreboot.org/20140
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9a790e338a0e6f32c199f5f437203e1525df208
Gerrit-Change-Number: 20140
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>



More information about the coreboot-gerrit mailing list