[coreboot-gerrit] Patch set updated for coreboot: 96bf3ed ibexpeak: add smbus_write_byte

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Tue Jan 28 11:55:51 CET 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4839

-gerrit

commit 96bf3edabeed1555ce13178d8c0a81841e448fdc
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Mon Jan 27 23:57:44 2014 +0100

    ibexpeak: add smbus_write_byte
    
    Change-Id: I045f1cff794d3c965c502fff98dd2442af2143bd
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/southbridge/intel/ibexpeak/smbus.c | 14 ++++++++++++++
 src/southbridge/intel/ibexpeak/smbus.h |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/southbridge/intel/ibexpeak/smbus.c b/src/southbridge/intel/ibexpeak/smbus.c
index ad7c8f9..9ef5bcb 100644
--- a/src/southbridge/intel/ibexpeak/smbus.c
+++ b/src/southbridge/intel/ibexpeak/smbus.c
@@ -58,8 +58,22 @@ static int lsmbus_read_byte(device_t dev, u8 address)
 	return do_smbus_read_byte(res->base, device, address);
 }
 
+static int lsmbus_write_byte(device_t dev, u8 address, u8 val)
+{
+	u16 device;
+	struct resource *res;
+	struct bus *pbus;
+
+	device = dev->path.i2c.device;
+	pbus = get_pbus_smbus(dev);
+	res = find_resource(pbus->dev, 0x20);
+
+	return do_smbus_write_byte(res->base, device, address, val);
+}
+
 static struct smbus_bus_operations lops_smbus_bus = {
 	.read_byte	= lsmbus_read_byte,
+	.write_byte	= lsmbus_write_byte,
 };
 
 static void smbus_set_subsystem(device_t dev, unsigned vendor, unsigned device)
diff --git a/src/southbridge/intel/ibexpeak/smbus.h b/src/southbridge/intel/ibexpeak/smbus.h
index 6858e7d..cf57685 100644
--- a/src/southbridge/intel/ibexpeak/smbus.h
+++ b/src/southbridge/intel/ibexpeak/smbus.h
@@ -99,8 +99,6 @@ static int do_smbus_read_byte(unsigned smbus_base, unsigned device, unsigned add
 	return byte;
 }
 
-#ifdef __PRE_RAM__
-
 static  int do_smbus_write_byte(unsigned smbus_base, unsigned device, unsigned address, unsigned data)
 {
 	unsigned char global_status_register;
@@ -144,6 +142,8 @@ static  int do_smbus_write_byte(unsigned smbus_base, unsigned device, unsigned a
 	return 0;
 }
 
+#ifdef __PRE_RAM__
+
 static int do_smbus_block_write(unsigned smbus_base, unsigned device,
 			      unsigned cmd, unsigned bytes, const u8 *buf)
 {



More information about the coreboot-gerrit mailing list