From b7ce5fe31120d6fb7866f2e3e6c66b93bf185127 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Sat, 7 May 2016 19:49:37 -0700 Subject: sconfig: Add 10bit addressing mode to i2c device type Use the second token for an i2c device entry in devicetree.cb to indicate if it should use 10-bit addressing or 7-bit. The default if not provided is to use 7-bit addressing, but it can be changed to 10-bit addressing with the ".1" suffix. For example: chip drivers/i2c/generic device i2c 3a.1 on end end Change-Id: I1d81a7e154fbc040def4d99ad07966fac242a472 Signed-off-by: Duncan Laurie Reviewed-on: https://review.coreboot.org/14788 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/device/device_util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/device') diff --git a/src/device/device_util.c b/src/device/device_util.c index 837dfb593f..b538212a83 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -202,7 +202,7 @@ u32 dev_path_encode(device_t dev) ret |= dev->path.pnp.port << 8 | dev->path.pnp.device; break; case DEVICE_PATH_I2C: - ret |= dev->bus->secondary << 8 | dev->path.pnp.device; + ret |= dev->path.i2c.mode_10bit << 8 | dev->path.i2c.device; break; case DEVICE_PATH_APIC: ret |= dev->path.apic.apic_id; @@ -334,7 +334,8 @@ int path_eq(struct device_path *path1, struct device_path *path2) (path1->pnp.device == path2->pnp.device); break; case DEVICE_PATH_I2C: - equal = (path1->i2c.device == path2->i2c.device); + equal = (path1->i2c.device == path2->i2c.device) && + (path1->i2c.mode_10bit == path2->i2c.mode_10bit); break; case DEVICE_PATH_APIC: equal = (path1->apic.apic_id == path2->apic.apic_id); -- cgit v1.2.3