summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Baiocchi <baiocchi@us.ibm.com>2014-01-09 08:13:06 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-01-15 16:35:08 -0600
commit728120d7abd9c4d7ebfca8b212a2bdc4a4f93b4e (patch)
tree7d535ef36a6c6bec6501aee0a0baad502b127927
parentf2ebd48e3d24964ddaabbbc0c93a25ef843aae47 (diff)
downloadblackbird-hostboot-728120d7abd9c4d7ebfca8b212a2bdc4a4f93b4e.tar.gz
blackbird-hostboot-728120d7abd9c4d7ebfca8b212a2bdc4a4f93b4e.zip
Add Callouts to I2C and VPD drivers
Callouts were added to I2C, EEPROM, MVPD and CVPD (via IPVPD code), and SPD code. Change-Id: Ibcb14ea3a228a5175b6faed06189286b0e0526bc RTC: 69113 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7966 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/i2c/eepromddreasoncodes.H8
-rw-r--r--src/include/usr/i2c/i2creasoncodes.H7
-rw-r--r--src/include/usr/vpd/vpdreasoncodes.H16
-rw-r--r--src/usr/fsi/fsidd.C2
-rwxr-xr-xsrc/usr/i2c/eepromdd.C58
-rw-r--r--src/usr/i2c/errlud_i2c.C280
-rw-r--r--src/usr/i2c/errlud_i2c.H113
-rwxr-xr-xsrc/usr/i2c/i2c.C180
-rwxr-xr-xsrc/usr/i2c/i2c.H34
-rw-r--r--src/usr/i2c/makefile30
-rw-r--r--src/usr/i2c/plugins/EEPROM_COMP_ID_Parse.C27
-rw-r--r--src/usr/i2c/plugins/I2C_COMP_ID_Parse.C27
-rw-r--r--src/usr/i2c/plugins/errludP_i2c.H259
-rw-r--r--src/usr/i2c/plugins/i2cUdParserFactory.H70
-rwxr-xr-xsrc/usr/vpd/dimmPres.C2
-rw-r--r--src/usr/vpd/errlud_vpd.C95
-rw-r--r--src/usr/vpd/errlud_vpd.H75
-rw-r--r--src/usr/vpd/ipvpd.C110
-rw-r--r--src/usr/vpd/ipvpd.H7
-rw-r--r--src/usr/vpd/plugins/VPD_COMP_ID_Parse.C27
-rw-r--r--src/usr/vpd/plugins/errludP_vpd.H123
-rw-r--r--src/usr/vpd/plugins/vpdUdParserFactory.H50
-rw-r--r--src/usr/vpd/rtvpd_load.C9
-rw-r--r--src/usr/vpd/runtime/rt_vpd.C11
-rwxr-xr-xsrc/usr/vpd/spd.C214
-rw-r--r--src/usr/vpd/vpd.mk4
26 files changed, 1700 insertions, 138 deletions
diff --git a/src/include/usr/i2c/eepromddreasoncodes.H b/src/include/usr/i2c/eepromddreasoncodes.H
index 9c9b16214..495d72561 100644
--- a/src/include/usr/i2c/eepromddreasoncodes.H
+++ b/src/include/usr/i2c/eepromddreasoncodes.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* COPYRIGHT International Business Machines Corp. 2011,2014 */
/* */
/* p1 */
/* */
@@ -73,6 +73,12 @@ enum eepromReasonCode
EEPROM_OVERFLOW_ERROR = EEPROM_COMP_ID | 0x08,
};
+enum UserDetailsTypes
+{
+ EEPROM_UDT_NO_FORMAT = 0x0,
+ EEPROM_UDT_PARAMETERS = 0x1,
+};
+
}; // end EEPROM
#endif
diff --git a/src/include/usr/i2c/i2creasoncodes.H b/src/include/usr/i2c/i2creasoncodes.H
index 90da53c6f..407d1c3dc 100644
--- a/src/include/usr/i2c/i2creasoncodes.H
+++ b/src/include/usr/i2c/i2creasoncodes.H
@@ -80,6 +80,13 @@ enum i2cReasonCode
I2C_NACK_ONLY_FOUND = I2C_COMP_ID | 0x0B, // Only NACK found in status register
};
+
+enum UserDetailsTypes
+{
+ I2C_UDT_NO_FORMAT = 0x0,
+ I2C_UDT_PARAMETERS = 0x1,
+};
+
}; // end I2C
#endif
diff --git a/src/include/usr/vpd/vpdreasoncodes.H b/src/include/usr/vpd/vpdreasoncodes.H
index ac1b13c56..38f8b7d63 100644
--- a/src/include/usr/vpd/vpdreasoncodes.H
+++ b/src/include/usr/vpd/vpdreasoncodes.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -117,6 +117,20 @@ enum vpdReasonCode
VPD_MBOX_NOT_SUPPORTED_RT = VPD_COMP_ID | 0x1c,
};
+
+/**
+ * @enum VPD::UserDetailsTypes
+ *
+ * @brief UserDetailsTypes for VPD User Details Section
+ *
+ */
+
+enum UserDetailsTypes
+{
+ VPD_UDT_NO_FORMAT = 0x0,
+ VPD_UDT_PARAMETERS = 0x1,
+};
+
}; // end MVPD
#endif
diff --git a/src/usr/fsi/fsidd.C b/src/usr/fsi/fsidd.C
index 530753053..774cdbc5b 100644
--- a/src/usr/fsi/fsidd.C
+++ b/src/usr/fsi/fsidd.C
@@ -361,7 +361,7 @@ errlHndl_t FsiDD::write(TARGETING::Target* i_target,
if(l_err)
{
// stick the address in here for debug
- FSI::UdOperation( i_target, i_address, true ).addToLog(l_err);
+ FSI::UdOperation( i_target, i_address, false ).addToLog(l_err);
break;
}
diff --git a/src/usr/i2c/eepromdd.C b/src/usr/i2c/eepromdd.C
index ce9b4be85..f44f4f0e3 100755
--- a/src/usr/i2c/eepromdd.C
+++ b/src/usr/i2c/eepromdd.C
@@ -45,6 +45,7 @@
#include <i2c/eepromif.H>
#include <i2c/i2creasoncodes.H>
#include "eepromdd.H"
+#include "errlud_i2c.H"
// ----------------------------------------------
// Globals
@@ -168,7 +169,11 @@ errlHndl_t eepromPerformOp( DeviceFW::OperationType i_opType,
TWO_UINT32_TO_UINT64(
i2cInfo.offset,
io_buflen ),
- i2cInfo.devSize_KB );
+ i2cInfo.devSize_KB,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
+
break;
}
@@ -218,18 +223,23 @@ errlHndl_t eepromPerformOp( DeviceFW::OperationType i_opType,
EEPROM_PERFORM_OP,
EEPROM_INVALID_OPERATION,
i_opType,
- i2cInfo.chip );
+ i2cInfo.chip,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
break;
}
} while( 0 );
-
- // If there is an error, add target and trace to log
- if ( (err != NULL) && (i_target != NULL) )
+ // If there is an error, add parameter info to log
+ if ( err != NULL )
{
- err->collectTrace(EEPROM_COMP_NAME);
- ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(err);
+ EEPROM::UdEepromParms( i_opType,
+ i_target,
+ io_buflen,
+ i2cInfo )
+ .addToLog(err);
}
TRACDCOMP( g_trac_eeprom,
@@ -830,7 +840,11 @@ errlHndl_t eepromPrepareAddress ( void * io_buffer,
EEPROM_PREPAREADDRESS,
EEPROM_INVALID_DEVICE_TYPE,
i_i2cInfo.addrSize,
- i_i2cInfo.chip);
+ i_i2cInfo.chip,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
+
break;
}
@@ -928,7 +942,10 @@ errlHndl_t eepromReadAttributes ( TARGETING::Target * i_target,
EEPROM_READATTRIBUTES,
EEPROM_INVALID_CHIP,
o_i2cInfo.chip,
- TARGETING::get_huid(i_target) );
+ TARGETING::get_huid(i_target),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
break;
}
@@ -957,6 +974,14 @@ errlHndl_t eepromReadAttributes ( TARGETING::Target * i_target,
TARGETING::get_huid(i_target),
o_i2cInfo.chip);
+ // Could be FSP or HB code's fault
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ err->collectTrace( EEPROM_COMP_NAME );
+
break;
}
@@ -1004,7 +1029,10 @@ errlHndl_t eepromReadAttributes ( TARGETING::Target * i_target,
EEPROM_READATTRIBUTES,
EEPROM_INVALID_ADDR_OFFSET_SIZE,
TARGETING::get_huid(i_target),
- o_i2cInfo.addrSize);
+ o_i2cInfo.addrSize,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
break;
@@ -1078,7 +1106,10 @@ errlHndl_t eepromGetI2CMasterTarget ( TARGETING::Target * i_target,
EEPROM_GETI2CMASTERTARGET,
EEPROM_DIMM_I2C_MASTER_PATH_ERROR,
i_i2cInfo.chip,
- TARGETING::get_huid(i_target) );
+ TARGETING::get_huid(i_target),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
break;
}
@@ -1105,7 +1136,10 @@ errlHndl_t eepromGetI2CMasterTarget ( TARGETING::Target * i_target,
EEPROM_GETI2CMASTERTARGET,
EEPROM_TARGET_NULL,
i_i2cInfo.chip,
- TARGETING::get_huid(i_target) );
+ TARGETING::get_huid(i_target),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( EEPROM_COMP_NAME );
break;
}
diff --git a/src/usr/i2c/errlud_i2c.C b/src/usr/i2c/errlud_i2c.C
new file mode 100644
index 000000000..599c2ad6d
--- /dev/null
+++ b/src/usr/i2c/errlud_i2c.C
@@ -0,0 +1,280 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/i2c/errlud_i2c.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file errlud_fsi.C
+ *
+ * @brief Implementation of classes to log FSI FFDC
+ */
+#include "errlud_i2c.H"
+#include <i2c/i2creasoncodes.H>
+#include <i2c/eepromddreasoncodes.H>
+#include <devicefw/driverif.H>
+#include "eepromdd.H"
+#include "i2c.H"
+
+namespace I2C
+{
+
+//------------------------------------------------------------------------------
+// I2C User Details
+//------------------------------------------------------------------------------
+UdI2CParms::UdI2CParms( uint8_t i_opType,
+ TARGETING::Target * i_target,
+ uint64_t i_buflen,
+ int64_t i_accessType,
+ misc_args_t i_args )
+{
+ // Set up Ud instance variables
+ iv_CompId = I2C_COMP_ID;
+ iv_Version = 1;
+ iv_SubSection = I2C_UDT_PARAMETERS;
+
+ //***** Memory Layout *****
+ // 1 byte : Op Type Description
+ // 1 byte : Op Type (DeviceFW::OperationType)
+ // 4 bytes : Target HUID
+ // 8 bytes : Length of In/Out Buffer
+ // 8 bytes : Access Type (DeviceFW::AccessType)
+ // 1 byte : Port
+ // 1 byte : Engine
+ // 8 bytes : Device Address
+ // 1 byte : Flag: skip_mode_setup;
+ // 1 byte : Flag: with_stop;
+ // 1 byte : Flag: read_not_write;
+ // 8 bytes : Bus Speed (kbits/sec)
+ // 2 bytes : Bit Rate Divisor
+ // 8 bytes : Timeout Interval
+ // 8 bytes : Timeout Count;
+
+
+ char * l_pBuf = reinterpret_cast<char *>(
+ reallocUsrBuf(sizeof(uint8_t)*2
+ +sizeof(uint32_t)
+ +sizeof(uint64_t)*2
+ +sizeof(uint8_t)*2
+ +sizeof(uint64_t)
+ +sizeof(uint8_t)*3
+ +sizeof(uint64_t)
+ +sizeof(uint16_t)
+ +sizeof(uint64_t)*2 ) );
+ uint64_t tmp64 = 0;
+ uint32_t tmp32 = 0;
+ uint16_t tmp16 = 0;
+ uint8_t tmp8 = 0;
+
+ if( i_opType == DeviceFW::READ )
+ {
+ tmp8 = 0;
+ }
+ else if( i_opType == DeviceFW::WRITE )
+ {
+ tmp8 = 1;
+ }
+ else
+ {
+ tmp8 = 2;
+ }
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp8 = i_opType;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp32 = TARGETING::get_huid(i_target);
+ memcpy(l_pBuf, &tmp32, sizeof(tmp32));
+ l_pBuf += sizeof(tmp32);
+
+ tmp64 = i_buflen;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_accessType;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp8 = i_args.port;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp8 = i_args.engine;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp64 = i_args.devAddr;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp8 = i_args.skip_mode_setup;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp8 = i_args.with_stop;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp8 = i_args.read_not_write;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp64 = i_args.bus_speed;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp16 = i_args.bit_rate_divisor;
+ memcpy(l_pBuf, &tmp16, sizeof(tmp16));
+ l_pBuf += sizeof(tmp16);
+
+ tmp64 = i_args.timeout_interval;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_args.timeout_count;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+}
+
+//------------------------------------------------------------------------------
+UdI2CParms::~UdI2CParms()
+{
+
+}
+
+} // end I2C namespace
+
+namespace EEPROM
+{
+
+
+//------------------------------------------------------------------------------
+// EEPROM User Details
+//------------------------------------------------------------------------------
+UdEepromParms::UdEepromParms( uint8_t i_opType,
+ TARGETING::Target * i_target,
+ uint64_t i_buflen,
+ eeprom_addr_t i_i2cInfo )
+{
+ // Set up Ud instance variables
+ iv_CompId = EEPROM_COMP_ID;
+ iv_Version = 1;
+ iv_SubSection = EEPROM_UDT_PARAMETERS;
+
+ //***** Memory Layout *****
+ // 1 byte : Op Type Description
+ // 1 byte : Op Type (DeviceFW::OperationType)
+ // 4 bytes : Target HUID
+ // 8 bytes : Length of In/Out Buffer
+ // 8 bytes : Chip
+ // 8 bytes : Offset
+ // 8 bytes : Port
+ // 8 bytes : Engine
+ // 8 bytes : Device Address
+ // 1 byte : Address Size
+ // 8 bytes : Write Page Size
+ // 8 bytes : Device Size (in KB)
+ // 8 bytes : Write Cycle Time
+
+ char * l_pBuf = reinterpret_cast<char *>(
+ reallocUsrBuf(sizeof(uint8_t)*2
+ +sizeof(uint32_t)
+ +sizeof(uint64_t)*6
+ +sizeof(uint8_t)
+ +sizeof(uint64_t)*3 ));
+
+ uint64_t tmp64 = 0;
+ uint32_t tmp32 = 0;
+ uint8_t tmp8 = 0;
+
+ if( i_opType == DeviceFW::READ )
+ {
+ tmp8 = 0;
+ }
+ else if( i_opType == DeviceFW::WRITE )
+ {
+ tmp8 = 1;
+ }
+ else
+ {
+ tmp8 = 2;
+ }
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp8 = i_opType;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp32 = TARGETING::get_huid(i_target);
+ memcpy(l_pBuf, &tmp32, sizeof(tmp32));
+ l_pBuf += sizeof(tmp32);
+
+ tmp64 = i_buflen;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.chip;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.offset;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.port;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.engine;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.devAddr;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp8 = static_cast<uint8_t>(i_i2cInfo.addrSize);
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp64 = i_i2cInfo.writePageSize;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.devSize_KB;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_i2cInfo.writeCycleTime;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+}
+
+//------------------------------------------------------------------------------
+UdEepromParms::~UdEepromParms()
+{
+
+}
+
+} // end EEPROM namespace
diff --git a/src/usr/i2c/errlud_i2c.H b/src/usr/i2c/errlud_i2c.H
new file mode 100644
index 000000000..fcaf606c4
--- /dev/null
+++ b/src/usr/i2c/errlud_i2c.H
@@ -0,0 +1,113 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/i2c/errlud_i2c.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef ERRL_UD_I2C_H
+#define ERRL_UD_I2C_H
+
+/**
+ * @file errlud_i2c.H
+ *
+ * Defines the classes that logs and parses various I2C and EEPROM data
+ */
+
+#include <errl/errluserdetails.H>
+#include <devicefw/driverif.H>
+#include "i2c.H"
+#include "eepromdd.H"
+
+namespace I2C
+{
+
+/**
+ * @class UdI2CParms
+ *
+ * Adds I2C information to an error log as user detail data
+ */
+class UdI2CParms : public ERRORLOG::ErrlUserDetails
+{
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param i_opType Operation Type
+ * @param i_target Chip being detected/acted upon
+ * @param i_buflen Length of In/Out Buffer
+ * @param i_accessType Access Type
+ * @param i_args Miscellaneous Parameters
+ */
+ UdI2CParms( uint8_t i_opType,
+ TARGETING::Target * i_target,
+ uint64_t i_buflen,
+ int64_t i_accessType,
+ misc_args_t i_args );
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdI2CParms();
+
+ private:
+ // Disabled
+ UdI2CParms(UdI2CParms &);
+ UdI2CParms & operator=(UdI2CParms &);
+};
+
+} // end I2C namespace
+
+namespace EEPROM
+{
+/**
+ * @class UdEepromParms
+ *
+ * Adds EEPROM information to an error log as user detail data
+ */
+class UdEepromParms : public ERRORLOG::ErrlUserDetails
+{
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param i_opType Operation Type
+ * @param i_target Chip being detected/acted upon
+ * @param i_buflen Length of In/Out Buffer
+ * @param i_i2cInfo Miscellaneous Parameters
+ */
+ UdEepromParms( uint8_t i_opType,
+ TARGETING::Target * i_target,
+ uint64_t i_buflen,
+ eeprom_addr_t i_i2cInfo );
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdEepromParms();
+
+ private:
+ // Disabled
+ UdEepromParms(UdEepromParms &);
+ UdEepromParms & operator=(UdEepromParms &);
+};
+
+} // end EEPROM namespace
+
+
+#endif
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 1f5cf336a..cc86fafe7 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -44,6 +44,8 @@
#include <i2c/i2cif.H>
#include "i2c.H"
+#include "errlud_i2c.H"
+
// ----------------------------------------------
// Globals
// ----------------------------------------------
@@ -74,6 +76,40 @@ TRAC_INIT( & g_trac_i2cr, "I2CR", KILOBYTE );
namespace I2C
{
+/**
+ * @brief Addresses for each of the registers in each engine.
+ */
+static i2c_addrs_t masterAddrs[] =
+{
+ { /* Master 0 */
+ I2C_MASTER0_ADDR | 0x4, // FIFO
+ I2C_MASTER0_ADDR | 0x5, // Command Register
+ I2C_MASTER0_ADDR | 0x6, // Mode Register
+ I2C_MASTER0_ADDR | 0x8, // Interrupt Mask Register
+ I2C_MASTER0_ADDR | 0xA, // Interrupt Register
+ I2C_MASTER0_ADDR | 0xB, // Status Register (Read)
+ I2C_MASTER0_ADDR | 0xB, // Reset (Write)
+ },
+ { /* Master 1 */
+ I2C_MASTER1_ADDR | 0x4, // FIFO
+ I2C_MASTER1_ADDR | 0x5, // Command Register
+ I2C_MASTER1_ADDR | 0x6, // Mode Register
+ I2C_MASTER1_ADDR | 0x8, // Interrupt Mask Register
+ I2C_MASTER1_ADDR | 0xA, // Interrupt Register
+ I2C_MASTER1_ADDR | 0xB, // Status Register (Read)
+ I2C_MASTER1_ADDR | 0xB, // Reset (Write)
+ },
+ { /* Master 2 */
+ I2C_MASTER2_ADDR | 0x4, // FIFO
+ I2C_MASTER2_ADDR | 0x5, // Command Register
+ I2C_MASTER2_ADDR | 0x6, // Mode Register
+ I2C_MASTER2_ADDR | 0x8, // Interrupt Mask Register
+ I2C_MASTER2_ADDR | 0xA, // Interrupt Register
+ I2C_MASTER2_ADDR | 0xB, // Status Register (Read)
+ I2C_MASTER2_ADDR | 0xB, // Reset (Write)
+ }
+};
+
// Register the perform Op with the routing code for Procs.
DEVICE_REGISTER_ROUTE( DeviceFW::WILDCARD,
DeviceFW::I2C,
@@ -159,7 +195,10 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType,
I2C_PERFORM_OP,
I2C_MASTER_SENTINEL_TARGET,
i_opType,
- 0x0 );
+ 0x0,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "I2C", 256);
break;
}
@@ -345,7 +384,10 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType,
I2C_PERFORM_OP,
I2C_INVALID_OP_TYPE,
i_opType,
- userdata2 );
+ userdata2,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "I2C", 256);
// No Operation performed, so can break and skip the section
// that handles operation errors
@@ -390,10 +432,16 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType,
args.engine );
}
- // If there is an error, add target to log
- if ( (err != NULL) && (i_target != NULL) )
+ // If there is an error, add parameter info to log
+ if ( err != NULL )
{
- ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(err);
+
+ I2C::UdI2CParms( i_opType,
+ i_target,
+ io_buflen,
+ i_accessType,
+ args )
+ .addToLog(err);
}
TRACDCOMP( g_trac_i2c,
@@ -512,6 +560,21 @@ errlHndl_t i2cRead ( TARGETING::Target * i_target,
status.value,
userdata2 );
+ // For now limited in what we can call out:
+ // Could be an issue with Processor or its bus
+ // -- both on the same FRU
+ // @todo RTC 94872 - update this callout
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or HB code failed to do the procedure correctly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "I2C", 256);
+
break;
}
}
@@ -527,7 +590,7 @@ errlHndl_t i2cRead ( TARGETING::Target * i_target,
&fifo.value,
size,
DEVICE_SCOM_ADDRESS(
- masterAddrs[i_args.engine].fifo ) );
+ I2C::masterAddrs[i_args.engine].fifo ) );
TRACUCOMP( g_trac_i2c,
INFO_MRK"i2cRead() - FIFO[0x%lx] = 0x%016llx",
@@ -830,6 +893,22 @@ errlHndl_t i2cWaitForCmdComp ( TARGETING::Target * i_target,
status.value,
engine );
+
+ // For now limited in what we can call out:
+ // Could be an issue with Processor or its bus
+ // -- both on the same FRU
+ // @todo RTC 94872 - update this callout
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or HB code failed to do the procedure correctly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "I2C", 256);
+
break;
}
} while( 0 == status.command_complete ); /* Command Complete */
@@ -1014,7 +1093,20 @@ errlHndl_t i2cCheckForErrors ( TARGETING::Target * i_target,
i_statusVal.value,
intRegVal );
- // @todo RTC:69113 - Add target and I2C traces to the errorlog.
+ // For now limited in what we can call out:
+ // Could be an issue with Processor or its bus
+ // -- both on the same FRU
+ // @todo RTC 94872 - update this callout
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or HB code failed to do the procedure correctly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "I2C" );
break;
}
@@ -1040,7 +1132,20 @@ errlHndl_t i2cCheckForErrors ( TARGETING::Target * i_target,
i_statusVal.value,
intRegVal );
- // @todo RTC:69113 - Add target and I2C traces to the errorlog.
+ // For now limited in what we can call out:
+ // Could be an issue with Processor or its bus
+ // -- both on the same FRU
+ // @todo RTC 94872 - update this callout
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or HB code failed to do the procedure correctly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "I2C" );
break;
}
@@ -1130,6 +1235,21 @@ errlHndl_t i2cWaitForFifoSpace ( TARGETING::Target * i_target,
status.value,
0x0 );
+ // For now limited in what we can call out:
+ // Could be an issue with Processor or its bus
+ // -- both on the same FRU
+ // @todo RTC 94872 - update this callout
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or HB code failed to do the procedure correctly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "I2C", 256);
+
break;
}
}
@@ -1359,24 +1479,7 @@ errlHndl_t i2cSetupMasters ( void )
if( 0 == centList.size() )
{
TRACFCOMP( g_trac_i2c,
- ERR_MRK"i2cSetupMasters: No Centaur chips found!" );
-
- /*@
- * @errortype
- * @reasoncode I2C_NO_CENTAUR_FOUND
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid I2C_SETUP_MASTERS
- * @userdata1 <UNUSED>
- * @userdata2 <UNUSED>
- * @frucallout <NONE>
- * @devdesc No Centaur chips found to programm I2C bus
- * divisor
- */
- err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- I2C_SETUP_MASTERS,
- I2C_NO_CENTAUR_FOUND,
- 0x0, 0x0 );
- break;
+ INFO_MRK"i2cSetupMasters: No Centaur chips found!" );
}
TRACUCOMP( g_trac_i2c,
@@ -1468,24 +1571,7 @@ errlHndl_t i2cSetupMasters ( void )
if( 0 == procList.size() )
{
TRACFCOMP( g_trac_i2c,
- ERR_MRK"i2cSetupMasters: No Processor chips found!" );
-
- /*@
- * @errortype
- * @reasoncode I2C_NO_PROC_FOUND
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid I2C_SETUP_MASTERS
- * @userdata1 <UNUSED>
- * @userdata2 <UNUSED>
- * @frucallout <NONE>
- * @devdesc No Centaur chips found to programm I2C bus
- * divisor
- */
- err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- I2C_SETUP_MASTERS,
- I2C_NO_PROC_FOUND,
- 0x0, 0x0 );
- break;
+ INFO_MRK"i2cSetupMasters: No Processor chips found!" );
}
TRACUCOMP( g_trac_i2c,
@@ -1630,7 +1716,11 @@ errlHndl_t i2cSetBusVariables ( TARGETING::Target * i_target,
I2C_SET_BUS_VARIABLES,
I2C_INVALID_BUS_SPEED_MODE,
i_mode,
- 0x0 );
+ 0x0,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "I2C", 256);
+
break;
}
diff --git a/src/usr/i2c/i2c.H b/src/usr/i2c/i2c.H
index 329877376..aa23790d7 100755
--- a/src/usr/i2c/i2c.H
+++ b/src/usr/i2c/i2c.H
@@ -117,40 +117,6 @@ struct i2c_addrs_t
};
/**
- * @brief Addresses for each of the registers in each engine.
- */
-static i2c_addrs_t masterAddrs[] =
-{
- { /* Master 0 */
- I2C_MASTER0_ADDR | 0x4, // FIFO
- I2C_MASTER0_ADDR | 0x5, // Command Register
- I2C_MASTER0_ADDR | 0x6, // Mode Register
- I2C_MASTER0_ADDR | 0x8, // Interrupt Mask Register
- I2C_MASTER0_ADDR | 0xA, // Interrupt Register
- I2C_MASTER0_ADDR | 0xB, // Status Register (Read)
- I2C_MASTER0_ADDR | 0xB, // Reset (Write)
- },
- { /* Master 1 */
- I2C_MASTER1_ADDR | 0x4, // FIFO
- I2C_MASTER1_ADDR | 0x5, // Command Register
- I2C_MASTER1_ADDR | 0x6, // Mode Register
- I2C_MASTER1_ADDR | 0x8, // Interrupt Mask Register
- I2C_MASTER1_ADDR | 0xA, // Interrupt Register
- I2C_MASTER1_ADDR | 0xB, // Status Register (Read)
- I2C_MASTER1_ADDR | 0xB, // Reset (Write)
- },
- { /* Master 2 */
- I2C_MASTER2_ADDR | 0x4, // FIFO
- I2C_MASTER2_ADDR | 0x5, // Command Register
- I2C_MASTER2_ADDR | 0x6, // Mode Register
- I2C_MASTER2_ADDR | 0x8, // Interrupt Mask Register
- I2C_MASTER2_ADDR | 0xA, // Interrupt Register
- I2C_MASTER2_ADDR | 0xB, // Status Register (Read)
- I2C_MASTER2_ADDR | 0xB, // Reset (Write)
- }
-};
-
-/**
* @brief Structure used to pass important variables between functions
*/
struct misc_args_t
diff --git a/src/usr/i2c/makefile b/src/usr/i2c/makefile
index 568ecbd69..b1133f258 100644
--- a/src/usr/i2c/makefile
+++ b/src/usr/i2c/makefile
@@ -1,29 +1,29 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/i2c/makefile $
+# $Source: src/usr/i2c/makefile $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011,2014
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
#
-# The source code for this program is not published or other-
-# wise divested of its trade secrets, irrespective of what has
-# been deposited with the U.S. Copyright Office.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../..
MODULE = i2c
-OBJS = i2c.o eepromdd.o
+OBJS = i2c.o eepromdd.o errlud_i2c.o
SUBDIRS = test.d
diff --git a/src/usr/i2c/plugins/EEPROM_COMP_ID_Parse.C b/src/usr/i2c/plugins/EEPROM_COMP_ID_Parse.C
new file mode 100644
index 000000000..34d93b04a
--- /dev/null
+++ b/src/usr/i2c/plugins/EEPROM_COMP_ID_Parse.C
@@ -0,0 +1,27 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/i2c/plugins/EEPROM_COMP_ID_Parse.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "errludparser.H"
+#include "i2cUdParserFactory.H"
+
+ERRL_MAKE_UD_PARSER(EEPROM::UserDetailsParserFactory, hbfw::EEPROM_COMP_ID)
+
diff --git a/src/usr/i2c/plugins/I2C_COMP_ID_Parse.C b/src/usr/i2c/plugins/I2C_COMP_ID_Parse.C
new file mode 100644
index 000000000..db0618393
--- /dev/null
+++ b/src/usr/i2c/plugins/I2C_COMP_ID_Parse.C
@@ -0,0 +1,27 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/i2c/plugins/I2C_COMP_ID_Parse.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "errludparser.H"
+#include "i2cUdParserFactory.H"
+
+ERRL_MAKE_UD_PARSER(I2C::UserDetailsParserFactory, hbfw::I2C_COMP_ID)
+
diff --git a/src/usr/i2c/plugins/errludP_i2c.H b/src/usr/i2c/plugins/errludP_i2c.H
new file mode 100644
index 000000000..1756c098e
--- /dev/null
+++ b/src/usr/i2c/plugins/errludP_i2c.H
@@ -0,0 +1,259 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/i2c/plugins/errludP_i2c.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef ERRL_UDP_I2C_H
+#define ERRL_UDP_I2C_H
+
+/**
+ * @file errludP_i2c.H
+ *
+ * Defines the ErrlUserDetailsParser classes that parse I2C and EEPROM FFDC
+ */
+
+#include "errluserdetails.H"
+#include <string.h>
+
+/**
+ * Some macros to manipulate data types cleanly
+ */
+#define TO_UINT8(ptr) (*(reinterpret_cast<uint8_t*>(ptr)))
+#define TO_UINT16(ptr) (ntohs(*(reinterpret_cast<uint16_t*>(ptr))))
+#define TO_UINT32(ptr) (ntohl(*(reinterpret_cast<uint32_t*>(ptr))))
+#define TO_UINT64(ptr) (ntohll(*(reinterpret_cast<uint64_t*>(ptr))))
+
+namespace I2C
+{
+
+/**
+ * @class UdParserI2CParms
+ *
+ * Parses UdI2CParms
+ */
+class UdParserI2CParms : public ERRORLOG::ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ UdParserI2CParms() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdParserI2CParms() {}
+
+ /**
+ * @brief Parses string user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing detail data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ char* l_databuf = static_cast<char*>(i_pBuffer);
+ i_parser.PrintHeading("I2C Parameters");
+
+ //***** Memory Layout *****
+ // 1 byte : Op Type Description
+ // 1 byte : Op Type (DeviceFW::OperationType)
+ // 4 bytes : Target HUID
+ // 8 bytes : Length of In/Out Buffer
+ // 8 bytes : Access Type (DeviceFW::AccessType)
+ // 1 byte : Port
+ // 1 byte : Engine
+ // 8 bytes : Device Address
+ // 1 byte : Flag: skip_mode_setup;
+ // 1 byte : Flag: with_stop;
+ // 1 byte : Flag: read_not_write;
+ // 8 bytes : Bus Speed (kbits/sec)
+ // 2 bytes : Bit Rate Divisor
+ // 8 bytes : Timeout Interval
+ // 8 bytes : Timeout Count;
+
+ uint8_t op = TO_UINT8(l_databuf);
+ l_databuf += sizeof(uint8_t);
+
+ if( op == 0 )
+ {
+ i_parser.PrintHeading("I2C Read");
+ }
+ else if( op == 1 )
+ {
+ i_parser.PrintHeading("I2C Write");
+ }
+ else
+ {
+ i_parser.PrintHeading("Unknown I2C Operation");
+ }
+
+ i_parser.PrintNumber("Op Type Value","%.2lX",TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Target HUID","%.8lX",TO_UINT32(l_databuf));
+ l_databuf += sizeof(uint32_t);
+ i_parser.PrintNumber("Length I/O Buff","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Access Type","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Port","%.2lX",TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Engine","%.2lX",TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Device Address","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Flag: skip_mode_setup","%.2lX",
+ TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Flag: with_stop","%.2lX",TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Flag: read_not_write","%.2lX",
+ TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Bus Speed (kbits/sec)","%.16lX",
+ TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Bit Rate Divisor","%.4lX",TO_UINT16(l_databuf));
+ l_databuf += sizeof(uint16_t);
+ i_parser.PrintNumber("Timeout Interval","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Timeout Count","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+
+ }
+
+private:
+ // Disabled
+ UdParserI2CParms(const UdParserI2CParms&);
+ UdParserI2CParms & operator=(const UdParserI2CParms&);
+};
+
+} // end I2C namespace
+
+namespace EEPROM
+{
+
+/**
+ * @class UdParserEepromParms
+ *
+ * Parses UdEepromParms
+ */
+class UdParserEepromParms : public ERRORLOG::ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ UdParserEepromParms() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdParserEepromParms() {}
+
+ /**
+ * @brief Parses string user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing detail data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ char* l_databuf = static_cast<char*>(i_pBuffer);
+ i_parser.PrintHeading("EEPROM Parameters");
+
+ //***** Memory Layout *****
+ // 1 byte : Op Type Description
+ // 1 byte : Op Type (DeviceFW::OperationType)
+ // 4 bytes : Target HUID
+ // 8 bytes : Length of In/Out Buffer
+ // 8 bytes : Chip
+ // 8 bytes : Offset
+ // 8 bytes : Port
+ // 8 bytes : Engine
+ // 8 bytes : Device Address
+ // 1 byte : Address Size
+ // 8 bytes : Write Page Size
+ // 8 bytes : Device Size (in KB)
+ // 8 bytes : Write Cycle Time
+
+ uint8_t op = TO_UINT8(l_databuf);
+ l_databuf += sizeof(uint8_t);
+
+ if( op == 0 )
+ {
+ i_parser.PrintHeading("EEPROM Read");
+ }
+ else if( op == 1 )
+ {
+ i_parser.PrintHeading("EEPROM Write");
+ }
+ else
+ {
+ i_parser.PrintHeading("Unknown EEPROM Operation");
+ }
+
+ i_parser.PrintNumber("Op Type Value","%.2lX",TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Target HUID","%.8lX",TO_UINT32(l_databuf));
+ l_databuf += sizeof(uint32_t);
+ i_parser.PrintNumber("Length I/O Buff","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Chip","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Offset","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Port","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Engine","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Device Address","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Address Size","%.2lX",TO_UINT8(l_databuf));
+ l_databuf += sizeof(uint8_t);
+ i_parser.PrintNumber("Write Page Size","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Device Size (in KB)","%.16lX",
+ TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Write Cycle Time","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+
+ }
+
+private:
+ // Disabled
+ UdParserEepromParms(const UdParserEepromParms&);
+ UdParserEepromParms & operator=(const UdParserEepromParms&);
+};
+
+} // end EEPROM NAMESPACE
+
+#endif
diff --git a/src/usr/i2c/plugins/i2cUdParserFactory.H b/src/usr/i2c/plugins/i2cUdParserFactory.H
new file mode 100644
index 000000000..aacd401e8
--- /dev/null
+++ b/src/usr/i2c/plugins/i2cUdParserFactory.H
@@ -0,0 +1,70 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/i2c/plugins/i2cUdParserFactory.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#if !defined(_I2CUDPARSERFACTORY_H)
+#define _I2CUDPARSERFACTORY_H
+
+#include "errludparserfactory.H"
+#include "errludP_i2c.H"
+
+namespace I2C
+{
+ class UserDetailsParserFactory
+ : public ERRORLOG::ErrlUserDetailsParserFactory
+ {
+ public:
+ UserDetailsParserFactory()
+ {
+ registerParser<I2C::UdParserI2CParms>
+ (I2C_UDT_PARAMETERS);
+ }
+
+ private:
+
+ UserDetailsParserFactory(const UserDetailsParserFactory &);
+ UserDetailsParserFactory & operator=
+ (const UserDetailsParserFactory &);
+ };
+};
+
+namespace EEPROM
+{
+ class UserDetailsParserFactory
+ : public ERRORLOG::ErrlUserDetailsParserFactory
+ {
+ public:
+ UserDetailsParserFactory()
+ {
+ registerParser<EEPROM::UdParserEepromParms>
+ (EEPROM_UDT_PARAMETERS);
+ }
+
+ private:
+
+ UserDetailsParserFactory(const UserDetailsParserFactory &);
+ UserDetailsParserFactory & operator=
+ (const UserDetailsParserFactory &);
+ };
+};
+
+#endif
+
diff --git a/src/usr/vpd/dimmPres.C b/src/usr/vpd/dimmPres.C
index 8e4ae5b69..8d94532be 100755
--- a/src/usr/vpd/dimmPres.C
+++ b/src/usr/vpd/dimmPres.C
@@ -112,6 +112,8 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType,
0x0,
true /*Add HB Software Callout*/);
+ err->collectTrace( "SPD", 256);
+
break;
}
diff --git a/src/usr/vpd/errlud_vpd.C b/src/usr/vpd/errlud_vpd.C
new file mode 100644
index 000000000..13e4aa3d3
--- /dev/null
+++ b/src/usr/vpd/errlud_vpd.C
@@ -0,0 +1,95 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/vpd/errlud_vpd.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file errlud_vpd.C
+ *
+ * @brief Implementation of classes to log VPD FFDC
+ */
+#include "errlud_vpd.H"
+#include "ipvpd.H"
+#include <vpd/vpdreasoncodes.H>
+#include <string.h>
+
+namespace VPD
+{
+
+//------------------------------------------------------------------------------
+// VPD
+//------------------------------------------------------------------------------
+UdVpdParms::UdVpdParms( TARGETING::Target * i_target,
+ uint64_t i_buflen,
+ uint64_t i_record,
+ uint64_t i_keyword,
+ bool read_notWrite )
+
+{
+ // Set up Ud instance variables
+ iv_CompId =VPD_COMP_ID;
+ iv_Version = 1;
+ iv_SubSection = VPD_UDT_PARAMETERS;
+
+ //***** Memory Layout *****
+ // 1 byte : Read / Not-Write
+ // 4 bytes : Target HUID
+ // 8 bytes : Length of In/Out Buffer
+ // 8 bytes : Record
+ // 8 bytes : Keyword
+
+ char * l_pBuf = reinterpret_cast<char *>(
+ reallocUsrBuf(sizeof(uint8_t)
+ +sizeof(uint32_t)
+ +sizeof(uint64_t)*3));
+ uint32_t tmp64 = 0;
+ uint16_t tmp32 = 0;
+ uint8_t tmp8 = 0;
+
+ tmp8 = read_notWrite;
+ memcpy(l_pBuf, &tmp8, sizeof(tmp8));
+ l_pBuf += sizeof(tmp8);
+
+ tmp32 = TARGETING::get_huid(i_target);
+ memcpy(l_pBuf, &tmp32, sizeof(tmp32));
+ l_pBuf += sizeof(tmp32);
+
+ tmp64 = i_buflen;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_record;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+ tmp64 = i_keyword;
+ memcpy(l_pBuf, &tmp64, sizeof(tmp64));
+ l_pBuf += sizeof(tmp64);
+
+}
+
+//------------------------------------------------------------------------------
+UdVpdParms::~UdVpdParms()
+{
+
+}
+
+
+}
diff --git a/src/usr/vpd/errlud_vpd.H b/src/usr/vpd/errlud_vpd.H
new file mode 100644
index 000000000..c142bcc51
--- /dev/null
+++ b/src/usr/vpd/errlud_vpd.H
@@ -0,0 +1,75 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/vpd/errlud_vpd.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef ERRL_UD_VPD_H
+#define ERRL_UD_VPD_H
+
+/**
+ * @file errlud_vpd.H
+ *
+ * Defines the classes that logs and parses various VPD structures
+ */
+
+#include <errl/errluserdetails.H>
+#include "ipvpd.H"
+
+namespace VPD
+{
+
+/**
+ * @class UdVpdParms
+ *
+ * Adds VPD parameters information to an error log as user detail data
+ */
+class UdVpdParms : public ERRORLOG::ErrlUserDetails
+{
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param i_target Target being detected/acted upon
+ * @param i_buflen Length of In/Out buffer
+ * @param i_record Record
+ * @param i_keyword Keyword
+ * @param read_notWrite Read/not-Write (read=true; write=false)
+ */
+ UdVpdParms( TARGETING::Target * i_target,
+ uint64_t i_buflen,
+ uint64_t i_record,
+ uint64_t i_keyword,
+ bool read_notWrite );
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdVpdParms();
+
+ private:
+ // Disabled
+ UdVpdParms(UdVpdParms &);
+ UdVpdParms & operator=(UdVpdParms &);
+};
+
+
+}
+
+#endif
diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C
index 384ff46c2..57cebf13e 100644
--- a/src/usr/vpd/ipvpd.C
+++ b/src/usr/vpd/ipvpd.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -28,6 +28,7 @@
#include <trace/interface.H>
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
+#include <errl/errludtarget.H>
#include <targeting/common/targetservice.H>
#include <devicefw/driverif.H>
#include <vfs/vfs.H>
@@ -35,6 +36,7 @@
#include "vpd.H"
#include "ipvpd.H"
+#include "errlud_vpd.H"
// ------------------------
// Macros for unit testing
@@ -147,6 +149,17 @@ errlHndl_t IpVpdFacade::read ( TARGETING::Target * i_target,
} while( 0 );
+ // If there is an error, add parameter info to log
+ if ( err != NULL )
+ {
+ VPD::UdVpdParms( i_target,
+ io_buflen,
+ i_args.record,
+ i_args.keyword,
+ true ) // read
+ .addToLog(err);
+ }
+
TRACSSCOMP( g_trac_vpd,
EXIT_MRK"IpVpdFacade::read()" );
@@ -218,6 +231,17 @@ errlHndl_t IpVpdFacade::write ( TARGETING::Target * i_target,
} while( 0 );
+ // If there is an error, add parameter info to log
+ if ( err != NULL )
+ {
+ VPD::UdVpdParms( i_target,
+ io_buflen,
+ i_args.record,
+ i_args.keyword,
+ false ) // write
+ .addToLog(err);
+ }
+
TRACSSCOMP( g_trac_vpd,
EXIT_MRK"IpVpdFacade::Write()" );
@@ -266,8 +290,10 @@ errlHndl_t IpVpdFacade::translateRecord ( ipVpdRecord i_record,
VPD::VPD_IPVPD_TRANSLATE_RECORD,
VPD::VPD_RECORD_NOT_FOUND,
i_record,
- 0x0 );
+ 0x0,
+ true /*Add HB SW Callout*/ );
+ err->collectTrace( "VPD" );
break;
}
@@ -326,6 +352,13 @@ errlHndl_t IpVpdFacade::translateKeyword ( ipVpdKeyword i_keyword,
i_keyword,
0x0 );
+ // Could be FSP or HB code's fault
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ err->collectTrace( "VPD" );
break;
}
@@ -434,6 +467,21 @@ errlHndl_t IpVpdFacade::findRecordOffset ( const char * i_record,
VPD::VPD_RECORD_NOT_FOUND,
i_args.record,
i_args.keyword );
+
+ // Could be the VPD of the target wasn't set up properly
+ // -- DECONFIG so that we can possibly keep booting
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+ // Or FSP code didn't set up the VPD properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ // Or HB code didn't look for the record properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
// Add trace to the log so we know what record was being requested.
err->collectTrace( "VPD" );
}
@@ -490,7 +538,8 @@ errlHndl_t IpVpdFacade::retrieveKeyword ( const char * i_keywordName,
// check size of usr buffer with io_buflen
err = checkBufferSize( io_buflen,
- (size_t)keywordSize );
+ (size_t)keywordSize,
+ i_target );
if( err )
{
break;
@@ -635,6 +684,22 @@ errlHndl_t IpVpdFacade::findKeywordAddr ( const char * i_keywordName,
VPD::VPD_RECORD_MISMATCH,
offset,
i_offset );
+
+ // Could be the VPD of the target wasn't set up properly
+ // -- DECONFIG so that we can possibly keep booting
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or FSP code didn't set up the VPD properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ // Or HB code didn't look for the record properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
// Add trace so we see what record was being compared
err->collectTrace( "VPD" );
@@ -755,6 +820,21 @@ errlHndl_t IpVpdFacade::findKeywordAddr ( const char * i_keywordName,
TWO_UINT32_TO_UINT64( i_args.record,
i_args.keyword ) );
+ // Could be the VPD of the target wasn't set up properly
+ // -- DECONFIG so that we can possibly keep booting
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or FSP code didn't set up the VPD properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ // Or HB code didn't look for the record properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
// Add trace so we know what Record/Keyword was missing
err->collectTrace( "VPD" );
}
@@ -804,7 +884,8 @@ errlHndl_t IpVpdFacade::writeKeyword ( const char * i_keywordName,
// check size of usr buffer with io_buflen
err = checkBufferSize( i_buflen,
- keywordSize );
+ keywordSize,
+ i_target );
if( err )
{
break;
@@ -863,7 +944,8 @@ errlHndl_t IpVpdFacade::writeKeyword ( const char * i_keywordName,
// IpVpdFacade::checkBufferSize
// ------------------------------------------------------------------
errlHndl_t IpVpdFacade::checkBufferSize( size_t i_bufferSize,
- size_t i_expectedSize )
+ size_t i_expectedSize,
+ TARGETING::Target * i_target )
{
errlHndl_t err = NULL;
@@ -889,6 +971,24 @@ errlHndl_t IpVpdFacade::checkBufferSize( size_t i_bufferSize,
VPD::VPD_INSUFFICIENT_BUFFER_SIZE,
i_bufferSize,
i_expectedSize );
+
+ // Could be the VPD of the target wasn't set up properly
+ // -- DECONFIG so that we can possibly keep booting
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ // Or FSP code didn't set up the VPD properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_MED);
+
+ // Or HB code didn't look for the record properly
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "VPD" );
+
}
return err;
diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H
index 8a9f96b7b..bddbd0636 100644
--- a/src/usr/vpd/ipvpd.H
+++ b/src/usr/vpd/ipvpd.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -379,11 +379,14 @@ class IpVpdFacade
*
* @param[in] i_expectedSize - The minimum size the buffer should be.
*
+ * @param[in] i_target - Target device. (Only used for error callout)
+ *
* @return errlHndl_t - An error log will be returned if the buffer is not
* large enough.
*/
errlHndl_t checkBufferSize( size_t i_bufferSize,
- size_t i_expectedSize );
+ size_t i_expectedSize,
+ TARGETING::Target * i_target );
protected: // Variables
diff --git a/src/usr/vpd/plugins/VPD_COMP_ID_Parse.C b/src/usr/vpd/plugins/VPD_COMP_ID_Parse.C
new file mode 100644
index 000000000..b840fdc83
--- /dev/null
+++ b/src/usr/vpd/plugins/VPD_COMP_ID_Parse.C
@@ -0,0 +1,27 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/vpd/plugins/VPD_COMP_ID_Parse.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include "errludparser.H"
+#include "vpdUdParserFactory.H"
+
+ERRL_MAKE_UD_PARSER(VPD::UserDetailsParserFactory, hbfw::VPD_COMP_ID)
+
diff --git a/src/usr/vpd/plugins/errludP_vpd.H b/src/usr/vpd/plugins/errludP_vpd.H
new file mode 100644
index 000000000..bc47d8436
--- /dev/null
+++ b/src/usr/vpd/plugins/errludP_vpd.H
@@ -0,0 +1,123 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/vpd/plugins/errludP_vpd.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef ERRL_UDP_VPD_H
+#define ERRL_UDP_VPD_H
+
+/**
+ * @file errludP_vpd.H
+ *
+ * Defines the ErrlUserDetailsParser classes that parse VPD FFDC
+ */
+
+#include "errluserdetails.H"
+#include <string.h>
+
+/**
+ * Some macros to manipulate data types cleanly
+ */
+#define TO_UINT8(ptr) (*(reinterpret_cast<uint8_t*>(ptr)))
+#define TO_UINT16(ptr) (ntohs(*(reinterpret_cast<uint16_t*>(ptr))))
+#define TO_UINT32(ptr) (ntohl(*(reinterpret_cast<uint32_t*>(ptr))))
+#define TO_UINT64(ptr) (ntohll(*(reinterpret_cast<uint64_t*>(ptr))))
+
+namespace VPD
+{
+
+/**
+ * @class UdParserVpdParms
+ *
+ * Parses UdParserVpdParms
+ */
+class UdParserVpdParms : public ERRORLOG::ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ UdParserVpdParms() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdParserVpdParms() {}
+
+ /**
+ * @brief Parses string user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing detail data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ char* l_databuf = static_cast<char*>(i_pBuffer);
+ i_parser.PrintHeading("VPD Parameters");
+
+ //***** Memory Layout *****
+ // 1 byte : Read / Not-Write
+ // 4 bytes : Target HUID
+ // 8 bytes : Length of In/Out Buffer
+ // 8 bytes : Record
+ // 8 bytes : Keyword
+
+ uint8_t op = TO_UINT8(l_databuf);
+ l_databuf += sizeof(uint8_t);
+ if( op == 1 )
+ {
+ i_parser.PrintHeading("VPD Read");
+ }
+ else if( op == 0 )
+ {
+ i_parser.PrintHeading("VPD Write");
+ }
+ else
+ {
+ i_parser.PrintHeading("Unknown VPD Operation");
+ }
+
+ i_parser.PrintNumber("Target","%.8lX",TO_UINT32(l_databuf));
+ l_databuf += sizeof(uint32_t);
+ i_parser.PrintNumber("Length of I/O Buffer","%.16lX",
+ TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Record","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+ i_parser.PrintNumber("Keyword","%.16lX",TO_UINT64(l_databuf));
+ l_databuf += sizeof(uint64_t);
+
+ }
+
+private:
+ // Disabled
+ UdParserVpdParms(const UdParserVpdParms&);
+ UdParserVpdParms & operator=(const UdParserVpdParms&);
+};
+
+
+}
+
+#endif
diff --git a/src/usr/vpd/plugins/vpdUdParserFactory.H b/src/usr/vpd/plugins/vpdUdParserFactory.H
new file mode 100644
index 000000000..89a24193c
--- /dev/null
+++ b/src/usr/vpd/plugins/vpdUdParserFactory.H
@@ -0,0 +1,50 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/vpd/plugins/vpdUdParserFactory.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#if !defined(_VPDUDPARSERFACTORY_H)
+#define _VPDUDPARSERFACTORY_H
+
+#include "errludparserfactory.H"
+#include "errludP_vpd.H"
+
+namespace VPD
+{
+ class UserDetailsParserFactory
+ : public ERRORLOG::ErrlUserDetailsParserFactory
+ {
+ public:
+ UserDetailsParserFactory()
+ {
+ registerParser<VPD::UdParserVpdParms>
+ (VPD_UDT_PARAMETERS);
+ }
+
+ private:
+
+ UserDetailsParserFactory(const UserDetailsParserFactory &);
+ UserDetailsParserFactory & operator=
+ (const UserDetailsParserFactory &);
+ };
+};
+
+#endif
+
diff --git a/src/usr/vpd/rtvpd_load.C b/src/usr/vpd/rtvpd_load.C
index 77152da9f..f72b4fc02 100644
--- a/src/usr/vpd/rtvpd_load.C
+++ b/src/usr/vpd/rtvpd_load.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -85,11 +85,10 @@ errlHndl_t bld_vpd_image(PNOR::SectionId vpd_type,
VPD::VPD_BLD_RT_IMAGE,
VPD::VPD_INSUFFICIENT_SPACE_FOR_IMAGE,
i_size,
- (((uint64_t)vpd_type) << 32) + info.size );
-
- err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
- HWAS::SRCI_PRIORITY_HIGH);
+ (((uint64_t)vpd_type) << 32) + info.size,
+ true /*Add HB Software Callout*/);
+ err->collectTrace( "VPD", 256);
}
}
diff --git a/src/usr/vpd/runtime/rt_vpd.C b/src/usr/vpd/runtime/rt_vpd.C
index a80ad0ed8..da9f97ff9 100644
--- a/src/usr/vpd/runtime/rt_vpd.C
+++ b/src/usr/vpd/runtime/rt_vpd.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -105,6 +105,7 @@ errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
+ err->collectTrace( "VPD", 256);
}
}
else // interface not set
@@ -126,6 +127,8 @@ errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
+
+ err->collectTrace( "VPD", 256);
}
if(!err)
@@ -168,6 +171,8 @@ errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
+ err->collectTrace( "VPD", 256);
+
break;
}
}
@@ -276,6 +281,8 @@ errlHndl_t writePNOR ( uint64_t i_byteAddr,
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
+ err->collectTrace( "VPD", 256);
+
return err;
}
@@ -319,7 +326,7 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
-
+ err->collectTrace( "VPD", 256);
return err;
}
diff --git a/src/usr/vpd/spd.C b/src/usr/vpd/spd.C
index 172feadbc..3f6e61211 100755
--- a/src/usr/vpd/spd.C
+++ b/src/usr/vpd/spd.C
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/usr/spd/spd.C $ */
+/* $Source: src/usr/vpd/spd.C $ */
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -33,6 +33,7 @@
#include <trace/interface.H>
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
+#include <errl/errludtarget.H>
#include <targeting/common/targetservice.H>
#include <devicefw/driverif.H>
#include <vfs/vfs.H>
@@ -43,6 +44,7 @@
#include "spd.H"
#include "spdDDR3.H"
#include "spdDDR4.H"
+#include "errlud_vpd.H"
// ----------------------------------------------
// Trace definitions
@@ -134,6 +136,8 @@ errlHndl_t getModType ( modSpecTypes_t & o_memType,
*
* @param[in] i_memType - The memory type of the target.
*
+ * @param[in] i_target - Target (only used for callouts)
+ *
* @param[out] o_entry - The table entry corresponding to the keyword.
*
* @return errlHndl_t - NULL if successful, otherwise a pointer to
@@ -141,6 +145,7 @@ errlHndl_t getModType ( modSpecTypes_t & o_memType,
*/
errlHndl_t getKeywordEntry ( uint64_t i_keyword,
uint64_t i_memType,
+ TARGETING::Target * i_target,
const KeywordData *& o_entry );
@@ -231,10 +236,35 @@ errlHndl_t spdGetKeywordValue ( DeviceFW::OperationType i_opType,
memType,
keyword );
+ // User could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "SPD", 256);
+
break;
}
} while( 0 );
+ // If there is an error, add parameter info to log
+ if ( err != NULL )
+ {
+ VPD::UdVpdParms( i_target,
+ io_buflen,
+ 0,
+ keyword,
+ true ) // read
+ .addToLog(err);
+ }
+
TRACSSCOMP( g_trac_spd,
EXIT_MRK"spdGetKeywordValue()" );
@@ -305,10 +335,36 @@ errlHndl_t spdWriteKeywordValue ( DeviceFW::OperationType i_opType,
memType,
keyword );
+ // User could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "SPD", 256);
+
break;
}
} while( 0 );
+ // If there is an error, add parameter info to log
+ if ( err != NULL )
+ {
+ VPD::UdVpdParms( i_target,
+ io_buflen,
+ 0,
+ keyword,
+ false ) // write
+ .addToLog(err);
+ }
+
+
TRACSSCOMP( g_trac_spd,
EXIT_MRK"spdWriteKeywordValue()" );
@@ -425,7 +481,10 @@ errlHndl_t spdWriteData ( uint64_t i_offset,
VPD::VPD_SPD_WRITE_DATA,
VPD::VPD_INVALID_WRITE_METHOD,
i_offset,
- i_numBytes );
+ i_numBytes,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
@@ -458,6 +517,7 @@ errlHndl_t spdGetValue ( uint64_t i_keyword,
const KeywordData * entry = NULL;
err = getKeywordEntry( i_keyword,
i_DDRRev,
+ i_target,
entry );
if( err )
@@ -487,7 +547,10 @@ errlHndl_t spdGetValue ( uint64_t i_keyword,
VPD::VPD_NULL_ENTRY,
i_keyword,
TWO_UINT32_TO_UINT64( io_buflen,
- i_DDRRev ) );
+ i_DDRRev ),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
@@ -586,6 +649,7 @@ errlHndl_t spdWriteValue ( uint64_t i_keyword,
const KeywordData * entry = NULL;
err = getKeywordEntry( i_keyword,
i_DDRRev,
+ i_target,
entry );
if( err )
@@ -614,7 +678,10 @@ errlHndl_t spdWriteValue ( uint64_t i_keyword,
VPD::VPD_NULL_ENTRY,
i_keyword,
TWO_UINT32_TO_UINT64( io_buflen,
- i_DDRRev ) );
+ i_DDRRev ),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
@@ -643,7 +710,10 @@ errlHndl_t spdWriteValue ( uint64_t i_keyword,
VPD::VPD_KEYWORD_NOT_WRITABLE,
i_keyword,
TWO_UINT32_TO_UINT64( io_buflen,
- i_DDRRev ) );
+ i_DDRRev ),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
@@ -686,7 +756,10 @@ errlHndl_t spdWriteValue ( uint64_t i_keyword,
TWO_UINT16_ONE_UINT32_TO_UINT64(
entry->length,
entry->bitMask,
- i_DDRRev ) );
+ i_DDRRev ),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
@@ -816,7 +889,11 @@ errlHndl_t ddr3SpecialCases(const KeywordData & i_kwdData,
VPD::VPD_SPD_DDR3_SPECIAL_CASES,
VPD::VPD_INVALID_SPD_KEYWORD,
i_kwdData.keyword,
- 0x0 );
+ 0x0,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
+
break;
};
@@ -952,7 +1029,11 @@ errlHndl_t ddr4SpecialCases(const KeywordData & i_kwdData,
VPD::VPD_SPD_DDR4_SPECIAL_CASES,
VPD::VPD_INVALID_SPD_KEYWORD,
i_kwdData.keyword,
- 0x0 );
+ 0x0,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
+
break;
};
@@ -1006,6 +1087,20 @@ errlHndl_t spdSpecialCases ( const KeywordData & i_kwdData,
i_kwdData.keyword,
i_DDRRev );
+ // User could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "SPD", 256);
+
break;
}
} while( 0 );
@@ -1051,7 +1146,11 @@ errlHndl_t spdCheckSize ( size_t i_bufferSz,
VPD::VPD_INSUFFICIENT_BUFFER_SIZE,
i_keyword,
TWO_UINT32_TO_UINT64( i_bufferSz,
- i_expBufferSz ) );
+ i_expBufferSz ),
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
+
}
return err;
@@ -1150,7 +1249,10 @@ errlHndl_t spdReadBinaryFile ( uint64_t i_byteAddr,
VPD::VPD_SPD_READ_BINARY_FILE,
VPD::VPD_INSUFFICIENT_FILE_SIZE,
fileSize,
- tmpData );
+ tmpData,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
@@ -1247,6 +1349,19 @@ errlHndl_t checkModSpecificKeyword ( KeywordData i_kwdData,
TWO_UINT32_TO_UINT64( modType, i_memType ),
TWO_UINT32_TO_UINT64( i_kwdData.keyword,
i_kwdData.modSpec ) );
+
+ // HB code asked for an unsupprted keyword for this Module
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ // Or user could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->collectTrace( "SPD", 256);
+
break;
}
}
@@ -1276,6 +1391,19 @@ errlHndl_t checkModSpecificKeyword ( KeywordData i_kwdData,
TWO_UINT32_TO_UINT64( modType, i_memType ),
TWO_UINT32_TO_UINT64( i_kwdData.keyword,
i_kwdData.modSpec ) );
+
+ // HB code asked for an unsupprted keyword for this Module
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ // Or user could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->collectTrace( "SPD", 256);
+
break;
}
}
@@ -1305,6 +1433,19 @@ errlHndl_t checkModSpecificKeyword ( KeywordData i_kwdData,
TWO_UINT32_TO_UINT64( modType, i_memType ),
TWO_UINT32_TO_UINT64( i_kwdData.keyword,
i_kwdData.modSpec ) );
+
+ // HB code asked for an unsupprted keyword for this Module
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ // Or user could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->collectTrace( "SPD", 256);
+
break;
}
}
@@ -1334,6 +1475,19 @@ errlHndl_t checkModSpecificKeyword ( KeywordData i_kwdData,
TWO_UINT32_TO_UINT64( modType, i_memType ),
TWO_UINT32_TO_UINT64( i_kwdData.keyword,
i_kwdData.modSpec ) );
+
+ // HB code asked for an unsupprted keyword for this Module
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ // Or user could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->collectTrace( "SPD", 256);
+
break;
}
}
@@ -1363,6 +1517,19 @@ errlHndl_t checkModSpecificKeyword ( KeywordData i_kwdData,
TWO_UINT32_TO_UINT64( modType, i_memType ),
TWO_UINT32_TO_UINT64( i_kwdData.keyword,
i_kwdData.modSpec ) );
+
+ // HB code asked for an unsupprted keyword for this Module
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+
+ // Or user could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->collectTrace( "SPD", 256);
+
break;
}
@@ -1482,7 +1649,10 @@ errlHndl_t getModType ( modSpecTypes_t & o_modType,
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
VPD::VPD_SPD_GET_MOD_TYPE,
VPD::VPD_MOD_SPECIFIC_UNSUPPORTED,
- modTypeVal, i_memType);
+ modTypeVal, i_memType,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
}
else
{
@@ -1501,6 +1671,7 @@ errlHndl_t getModType ( modSpecTypes_t & o_modType,
// ------------------------------------------------------------------
errlHndl_t getKeywordEntry ( uint64_t i_keyword,
uint64_t i_memType,
+ TARGETING::Target * i_target,
const KeywordData *& o_entry )
{
errlHndl_t err = NULL;
@@ -1542,6 +1713,20 @@ errlHndl_t getKeywordEntry ( uint64_t i_keyword,
i_keyword,
i_memType );
+ // User could have installed a bad/unsupported dimm
+ err->addHwCallout( i_target,
+ HWAS::SRCI_PRIORITY_HIGH,
+ HWAS::DECONFIG,
+ HWAS::GARD_NULL );
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE,
+ HWAS::SRCI_PRIORITY_LOW);
+
+ err->collectTrace( "SPD", 256);
+
break;
}
@@ -1572,7 +1757,10 @@ errlHndl_t getKeywordEntry ( uint64_t i_keyword,
VPD::VPD_SPD_GET_KEYWORD_ENTRY,
VPD::VPD_KEYWORD_NOT_FOUND,
i_keyword,
- 0x0 );
+ 0x0,
+ true /*Add HB SW Callout*/ );
+
+ err->collectTrace( "SPD", 256);
break;
}
diff --git a/src/usr/vpd/vpd.mk b/src/usr/vpd/vpd.mk
index b893b94e8..2c6617ddb 100644
--- a/src/usr/vpd/vpd.mk
+++ b/src/usr/vpd/vpd.mk
@@ -5,7 +5,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2013
+# COPYRIGHT International Business Machines Corp. 2013,2014
#
# p1
#
@@ -21,4 +21,4 @@
#
# IBM_PROLOG_END_TAG
# common objects with runtime
-OBJS = ipvpd.o mvpd.o cvpd.o spd.o
+OBJS = ipvpd.o mvpd.o cvpd.o spd.o errlud_vpd.o
OpenPOWER on IntegriCloud