summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/i2c.C
diff options
context:
space:
mode:
authorMike Baiocchi <baiocchi@us.ibm.com>2014-01-28 17:57:55 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-02-12 17:45:59 -0600
commiteae7f944c060fb1926f8ecb9886273a3e7010246 (patch)
tree1855fed783b299823da20930f4dd5a7729f59887 /src/usr/i2c/i2c.C
parentf9674984fd314ca807bc2515fd828c2567d39191 (diff)
downloadblackbird-hostboot-eae7f944c060fb1926f8ecb9886273a3e7010246.tar.gz
blackbird-hostboot-eae7f944c060fb1926f8ecb9886273a3e7010246.zip
Update Default I2C Bus Speed to 1MHz
Currently Hostboot only supports I2C interactions with the SBE SEEPROMs which can run at the faster 1MHz bus speed. Therefore, I am changing the default to run at 1MHz while keeping the ability to set the speed to 400KHz that PHYP needs (via i2cSetupMaster()). Change-Id: I99eb2933502803816e52d1c88d7570bb11319c47 RTC: 80614 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8413 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/i2c/i2c.C')
-rwxr-xr-xsrc/usr/i2c/i2c.C24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index cc86fafe7..9709026b8 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -1659,7 +1659,7 @@ errlHndl_t i2cSetupMasters ( void )
// ------------------------------------------------------------------
-// i2cSetClockVariables
+// i2cSetBusVariables
// ------------------------------------------------------------------
errlHndl_t i2cSetBusVariables ( TARGETING::Target * i_target,
i2c_bus_setting_mode_t i_mode,
@@ -1672,12 +1672,14 @@ errlHndl_t i2cSetBusVariables ( TARGETING::Target * i_target,
do
{
+ // @todo RTC:80614 - sync up reading attributes eventually,
+ // but for now, unless requested for 400KHz, default to 1MHz
+ if ( i_mode != SET_I2C_BUS_400KHZ )
+ {
+ i_mode = SET_I2C_BUS_1MHZ;
+ }
- // @todo RTC:80614 - Read I2C bus speed attributes from I2C Master
- // For now, hardcode to 400KHz
- i_mode = SET_I2C_BUS_400KHZ;
-
- if (i_mode == SET_I2C_BUS_400KHZ)
+ if ( i_mode == SET_I2C_BUS_400KHZ )
{
io_args.bus_speed = 400;
@@ -1686,8 +1688,16 @@ errlHndl_t i2cSetBusVariables ( TARGETING::Target * i_target,
I2C_CLOCK_DIVISOR_400KHZ);
io_args.timeout_count = I2C_TIMEOUT_COUNT(
io_args.timeout_interval);
+ }
-
+ else if ( i_mode == SET_I2C_BUS_1MHZ )
+ {
+ io_args.bus_speed = 1024;
+ io_args.bit_rate_divisor = I2C_CLOCK_DIVISOR_1MHZ;
+ io_args.timeout_interval = I2C_TIMEOUT_INTERVAL(
+ I2C_CLOCK_DIVISOR_1MHZ);
+ io_args.timeout_count = I2C_TIMEOUT_COUNT(
+ io_args.timeout_interval);
}
/* @todo RTC:80614 - sync up reading attributes with MRW
OpenPOWER on IntegriCloud