diff options
author | Mike Baiocchi <baiocchi@us.ibm.com> | 2015-03-18 10:31:21 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-03-26 07:56:31 -0500 |
commit | 4c31ecf3b63f4f21e677d7359f64de22cd8fc1eb (patch) | |
tree | 11560f030b75578fb674ff89c9c3de412498600f /src | |
parent | 17a805b1efd4f1390d7acd273f4985a7d4bb08e7 (diff) | |
download | talos-hostboot-4c31ecf3b63f4f21e677d7359f64de22cd8fc1eb.tar.gz talos-hostboot-4c31ecf3b63f4f21e677d7359f64de22cd8fc1eb.zip |
Initialize I2C Switches in struct to zero
There are multiple uses for the I2C Switches in the misc_args_t
struct used in I2C operations. The struct was not defaulting the
switches value to zero and there were negative consequences of this
early in the IPL for the i2cPresence() function.
Fixes open-power/hostboot#18
Change-Id: I83d34770ff04cfe31bf07b320d8821c8fa80c705
CQ: SW2999529
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16447
Tested-by: Jenkins Server
Reviewed-by: MATTHEW A. PLOETZ <maploetz@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/usr/i2c/i2c.C | 4 | ||||
-rw-r--r-- | src/usr/i2c/i2c_common.H | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C index 1f2b8a095..f8583b8a1 100755 --- a/src/usr/i2c/i2c.C +++ b/src/usr/i2c/i2c.C @@ -688,7 +688,9 @@ bool i2cPresence( TARGETING::Target * i_target, - //Set Host vs FSI switches + // Set I2C Mode (Host vs FSI) for the target + args.switches.useHostI2C = 0; + args.switches.useFsiI2C = 0; i2cSetSwitches( i_target, args ); err = i2cSetBusVariables(i_target, diff --git a/src/usr/i2c/i2c_common.H b/src/usr/i2c/i2c_common.H index 68865a50d..1772ea2b2 100644 --- a/src/usr/i2c/i2c_common.H +++ b/src/usr/i2c/i2c_common.H @@ -75,7 +75,10 @@ struct misc_args_t polling_interval_ns(0), timeout_count(0), offset_length(0), - offset_buffer(NULL){}; + offset_buffer(NULL) + { + memset(&switches, 0x0, sizeof(switches)); + }; }; |