summaryrefslogtreecommitdiffstats
path: root/src/usr/i2c/runtime/rt_i2c.C
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2019-03-14 12:56:21 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-03-15 14:18:49 -0500
commita5c403221e3e469c8d1fb26a56c5eb44228589e1 (patch)
tree760e11ae60260c58f5886860d0fc4f157e81171e /src/usr/i2c/runtime/rt_i2c.C
parent3830dc6e8fb052cdf2738cd473d5653c4682e063 (diff)
downloadtalos-hostboot-a5c403221e3e469c8d1fb26a56c5eb44228589e1.tar.gz
talos-hostboot-a5c403221e3e469c8d1fb26a56c5eb44228589e1.zip
Fixing runtime i2c operation
Base i2c operations were updated with new parameter for UCD work, but runtime i2c was not updated. Also fixing orphaning error log memory and potentially calling toString on a nullptr. Change-Id: I6c912e71b22da80b166e13dc66bdf0e5a51abfbb CQ:SW459731 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73361 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/i2c/runtime/rt_i2c.C')
-rwxr-xr-xsrc/usr/i2c/runtime/rt_i2c.C20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/usr/i2c/runtime/rt_i2c.C b/src/usr/i2c/runtime/rt_i2c.C
index 9ae1e7b44..16f62c76e 100755
--- a/src/usr/i2c/runtime/rt_i2c.C
+++ b/src/usr/i2c/runtime/rt_i2c.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,6 +37,7 @@
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
#include <errl/errludtarget.H>
+#include <errl/hberrltypes.H>
#include <devicefw/driverif.H>
#include <i2c/i2creasoncodes.H>
#include <runtime/interface.h>
@@ -81,6 +82,11 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType,
// Address, Port, Engine, Device Addr.
// Other args set below
misc_args_t args;
+
+ // Read in the sub-operation
+ const auto subop =
+ static_cast<DeviceFW::I2C_SUBOP>(va_arg(i_args,uint64_t));
+
args.port = va_arg( i_args, uint64_t );
args.engine = va_arg( i_args, uint64_t );
args.devAddr = va_arg( i_args, uint64_t );
@@ -111,22 +117,30 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType,
}
else
{
+ TRACFCOMP(g_trac_i2c, ERR_MRK"Invalid Offset length: 0x%.8X."
+ "Previous parameters: i2c subop 0x%.8X, "
+ "port 0x%.8X, engine 0x%.8X, deviceAddr 0x%.8X",
+ args.offset_length, subop,
+ args.port, args.engine, args.devAddr);
/*@
* @errortype
* @moduleid I2C_PERFORM_OP
* @reasoncode I2C_RUNTIME_INVALID_OFFSET_LENGTH
* @userdata1 Offset length
- * @userdata2 Op type
+ * @userdata2[0:31] Operation Type
+ * @userdata2[32:64] Target
* @devdesc I2C offset length is invalid
*/
err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_INFORMATIONAL,
I2C_PERFORM_OP,
I2C_RUNTIME_INVALID_OFFSET_LENGTH,
args.offset_length,
- i_opType);
+ TWO_UINT32_TO_UINT64(i_opType,
+ TARGETING::get_huid(i_target)));
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
+ return err;
}
}
OpenPOWER on IntegriCloud