summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/eepromdd.C
diff options
context:
space:
mode:
authorMike Baiocchi <baiocchi@us.ibm.com>2014-08-26 00:08:39 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-10-28 03:20:29 -0500
commitb08e186c26f57cdbf396af57f84002018c0c3350 (patch)
treecb46f059e165d0f2eb0de3ce152f78c5f1dd85a5 /src/usr/i2c/eepromdd.C
parentf3f4aa436ae1c0aac413f6cde928f77f1a156600 (diff)
downloadtalos-hostboot-b08e186c26f57cdbf396af57f84002018c0c3350.tar.gz
talos-hostboot-b08e186c26f57cdbf396af57f84002018c0c3350.zip
Enable FSI-based I2C Device Driver Support
This commit adds FSI I2C Device Driver read and write support. The majority of interfaces are common, with the main difference being the registers that are being used. The FSI Device Driver also had to be udpated to support non-4-byte reads and writes. Change-Id: Ife3cfaedc6f23a161192710d1e9f1e74a942d399 RTC: 109926 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13300 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: ANIRUDH BAGEPALLI <abagepa@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/i2c/eepromdd.C')
-rwxr-xr-xsrc/usr/i2c/eepromdd.C129
1 files changed, 60 insertions, 69 deletions
diff --git a/src/usr/i2c/eepromdd.C b/src/usr/i2c/eepromdd.C
index b913665e9..41297cfaf 100755
--- a/src/usr/i2c/eepromdd.C
+++ b/src/usr/i2c/eepromdd.C
@@ -379,7 +379,7 @@ errlHndl_t eepromRead ( TARGETING::Target * i_target,
err_NACK = err;
TRACFCOMP( g_trac_eeprom, ERR_MRK"eepromRead(): "
- "NACK Error rc=0x%X, eid=%d, tgt=0x%X, "
+ "NACK Error rc=0x%X, eid=0x%X, tgt=0x%X, "
"retry/MAX=%d/%d. Save error and retry",
err_NACK->reasonCode(),
err_NACK->eid(),
@@ -1046,8 +1046,9 @@ errlHndl_t eepromReadAttributes ( TARGETING::Target * i_target,
} while( 0 );
- TRACUCOMP(g_trac_eeprom,"eepromReadAttributes() %d/%d/0x%X "
+ TRACUCOMP(g_trac_eeprom,"eepromReadAttributes() tgt=0x%X, %d/%d/0x%X "
"wpw=0x%X, dsKb=0x%X, aS=%d (%d), wct=%d",
+ TARGETING::get_huid(i_target),
o_i2cInfo.port, o_i2cInfo.engine, o_i2cInfo.devAddr,
o_i2cInfo.writePageSize, o_i2cInfo.devSize_KB,
o_i2cInfo.addrSize, eepromData.byteAddrOffset,
@@ -1076,85 +1077,75 @@ errlHndl_t eepromGetI2CMasterTarget ( TARGETING::Target * i_target,
do
{
- if( TARGETING::TYPE_DIMM == i_target->getAttr<TARGETING::ATTR_TYPE>() )
- {
- TARGETING::TargetService& tS = TARGETING::targetService();
-
- // For DIMMs we need to get the parent that contains the
- // I2C Master that talks to the DIMM EEPROM
+ TARGETING::TargetService& tS = TARGETING::targetService();
- // The path was read from the attribute via eepromReadAttributes()
- // and passed to this function in i_i2cInfo
+ // The path from i_target to its I2C Master was read from the
+ // attribute via eepromReadAttributes() and passed to this function
+ // in i_i2cInfo.i2cMasterPath
+ // check that the path exists
+ bool exists = false;
+ tS.exists( i_i2cInfo.i2cMasterPath,
+ exists );
- // check that the path exists
- bool exists = false;
- tS.exists( i_i2cInfo.i2cMasterPath,
- exists );
-
- if( !exists )
- {
- TRACFCOMP( g_trac_eeprom,
- ERR_MRK"eepromGetI2CMasterTarget() - i2cMasterPath attribute path "
- "doesn't exist!" );
+ if( !exists )
+ {
+ TRACFCOMP( g_trac_eeprom,
+ ERR_MRK"eepromGetI2CMasterTarget() - "
+ "i2cMasterPath attribute path doesn't exist!" );
- /*@
- * @errortype
- * @reasoncode EEPROM_DIMM_I2C_MASTER_PATH_ERROR
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid EEPROM_GETI2CMASTERTARGET
- * @userdata1 Attribute Chip Type Enum
- * @userdata2 HUID of target
- * @devdesc DIMM I2C master entity path doesn't exist.
- */
- err = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- EEPROM_GETI2CMASTERTARGET,
- EEPROM_DIMM_I2C_MASTER_PATH_ERROR,
- i_i2cInfo.chip,
- TARGETING::get_huid(i_target),
- true /*Add HB SW Callout*/ );
+ /*@
+ * @errortype
+ * @reasoncode EEPROM_DIMM_I2C_MASTER_PATH_ERROR
+ * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid EEPROM_GETI2CMASTERTARGET
+ * @userdata1 Attribute Chip Type Enum
+ * @userdata2 HUID of target
+ * @devdesc DIMM I2C master entity path doesn't exist.
+ */
+ err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ EEPROM_GETI2CMASTERTARGET,
+ EEPROM_DIMM_I2C_MASTER_PATH_ERROR,
+ i_i2cInfo.chip,
+ TARGETING::get_huid(i_target),
+ true /*Add HB SW Callout*/ );
- err->collectTrace( EEPROM_COMP_NAME );
+ err->collectTrace( EEPROM_COMP_NAME );
- break;
- }
+ break;
+ }
- // Since it exists, convert to a target
- o_target = tS.toTarget( i_i2cInfo.i2cMasterPath );
+ // Since it exists, convert to a target
+ o_target = tS.toTarget( i_i2cInfo.i2cMasterPath );
- if( NULL == o_target )
- {
- TRACFCOMP( g_trac_eeprom,
- ERR_MRK"eepromGetI2CMasterTarget() - I2C Master "
- "Path target was NULL!" );
+ if( NULL == o_target )
+ {
+ TRACFCOMP( g_trac_eeprom,
+ ERR_MRK"eepromGetI2CMasterTarget() - I2C Master "
+ "Path target was NULL!" );
- /*@
- * @errortype
- * @reasoncode EEPROM_TARGET_NULL
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid EEPROM_GETI2CMASTERTARGET
- * @userdata1 Attribute Chip Type Enum
- * @userdata2 HUID of target
- * @devdesc I2C master path target is null.
- */
- err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- EEPROM_GETI2CMASTERTARGET,
- EEPROM_TARGET_NULL,
- i_i2cInfo.chip,
- TARGETING::get_huid(i_target),
- true /*Add HB SW Callout*/ );
+ /*@
+ * @errortype
+ * @reasoncode EEPROM_TARGET_NULL
+ * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid EEPROM_GETI2CMASTERTARGET
+ * @userdata1 Attribute Chip Type Enum
+ * @userdata2 HUID of target
+ * @devdesc I2C master path target is null.
+ */
+ err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ EEPROM_GETI2CMASTERTARGET,
+ EEPROM_TARGET_NULL,
+ i_i2cInfo.chip,
+ TARGETING::get_huid(i_target),
+ true /*Add HB SW Callout*/ );
- err->collectTrace( EEPROM_COMP_NAME );
+ err->collectTrace( EEPROM_COMP_NAME );
- break;
- }
- }
- else
- {
- // Since current target is not a DIMM, use the target we have
- o_target = i_target;
+ break;
}
+
} while( 0 );
TRACDCOMP( g_trac_eeprom,
OpenPOWER on IntegriCloud