summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2015-06-22 14:04:28 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-06-26 11:23:23 -0500
commit460fdf36b1fe3bc1157738cd1158a73893a1454b (patch)
treecdb7d0fae76e93b744e24441995e0ee0ad6c7f2b /src/usr/ipmi
parent19ea1050e150038506ca38581c29468a063ea7c8 (diff)
downloadtalos-hostboot-460fdf36b1fe3bc1157738cd1158a73893a1454b.tar.gz
talos-hostboot-460fdf36b1fe3bc1157738cd1158a73893a1454b.zip
Changes to FRU inventory to support memory riser
Follow up to 118373. Update to use 122890 Add serial numbers/part numbers Change-Id: I5d3aee87a2672c193c6fcab78dfa60d661d130e2 RTC: 117702 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/18686 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Reviewed-by: ANDRES A. LUGO-REYES <aalugore@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r--src/usr/ipmi/ipmifruinv.C85
-rw-r--r--src/usr/ipmi/ipmifruinvprvt.H18
2 files changed, 91 insertions, 12 deletions
diff --git a/src/usr/ipmi/ipmifruinv.C b/src/usr/ipmi/ipmifruinv.C
index 49c5e7e1d..99d4ee819 100644
--- a/src/usr/ipmi/ipmifruinv.C
+++ b/src/usr/ipmi/ipmifruinv.C
@@ -747,13 +747,36 @@ errlHndl_t backplaneIpmiFruInv::buildBoardInfoArea(
if (l_errl) { break; }
//Set Product Serial number - ascii formatted data
- //TODO RTC:117702 use attribute when 122890 is available
- l_errl = addVpdData(io_data, PVPD::OPFR, PVPD::VS, true);
- if (l_errl) { break; }
+ TARGETING::ATTR_SERIAL_NUMBER_type l_sn = {'0'};
+ if( !( iv_target->
+ tryGetAttr<TARGETING::ATTR_SERIAL_NUMBER>
+ ( l_sn) ) )
+ {
+ // Should not fail. Need to use tryGetAttr due to complex type.
+ // Use zeros if fails.
+ TRACFCOMP(g_trac_ipmi,"backplaneIpmiFruInv::buildBoardInfoArea - "
+ "Error getting serial number attribute");
+ }
+ // The attribute size is 18. The vpd is 16. Only use 16.
+ addCommonAttrData(io_data,
+ (uint8_t *)&l_sn,
+ VPD_SN_PN_VPD_SIZE);
//Set Product Part number - ascii formatted data
- //TODO RTC:117702 use attribute when 122890 is available
- l_errl = addVpdData(io_data, PVPD::OPFR, PVPD::VP, true);
+ TARGETING::ATTR_PART_NUMBER_type l_pn = {'0'};
+ if( !( iv_target->
+ tryGetAttr<TARGETING::ATTR_PART_NUMBER>
+ ( l_pn) ) )
+ {
+ // Should not fail. Need to use tryGetAttr due to complex type.
+ // Use zeros if fails.
+ TRACFCOMP(g_trac_ipmi,"backplaneIpmiFruInv::buildBoardInfoArea - "
+ "Error getting part number attribute");
+ }
+ // The attribute size is 18. The vpd is 16. Only use 16.
+ addCommonAttrData(io_data,
+ (uint8_t *)&l_pn,
+ VPD_SN_PN_VPD_SIZE);
//Push Fru File ID Byte - NULL
io_data.push_back(IPMIFRUINV::TYPELENGTH_BYTE_NULL);
@@ -1051,14 +1074,36 @@ errlHndl_t membufIpmiFruInv::buildBoardInfoArea(
if (l_errl) { break; }
//Set Product Serial number - ascii formatted data
- //TODO RTC:117702 use attribute when 122890 is available
- l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::VS, true);
- if (l_errl) { break; }
+ TARGETING::ATTR_SERIAL_NUMBER_type l_sn = {'0'};
+ if( !( iv_target->
+ tryGetAttr<TARGETING::ATTR_SERIAL_NUMBER>
+ ( l_sn) ) )
+ {
+ // Should not fail. Need to use tryGetAttr due to complex type.
+ // Use zeros if fails.
+ TRACFCOMP(g_trac_ipmi,"membufIpmiFruInv::buildBoardInfoArea - "
+ "Error getting serial number attribute");
+ }
+ // The attribute size is 18. The vpd is 16. Only use 16.
+ addCommonAttrData(io_data,
+ (uint8_t *)&l_sn,
+ VPD_SN_PN_VPD_SIZE);
//Set Product Part number - ascii formatted data
- //TODO RTC:117702 use attribute when 122890 is available
- l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::VP, true);
- if (l_errl) { break; }
+ TARGETING::ATTR_PART_NUMBER_type l_pn = {'0'};
+ if( !( iv_target->
+ tryGetAttr<TARGETING::ATTR_PART_NUMBER>
+ ( l_pn) ) )
+ {
+ // Should not fail. Need to use tryGetAttr due to complex type.
+ // Use zeros if fails.
+ TRACFCOMP(g_trac_ipmi,"membufIpmiFruInv::buildBoardInfoArea - "
+ "Error getting part number attribute");
+ }
+ // The attribute size is 18. The vpd is 16. Only use 16.
+ addCommonAttrData(io_data,
+ (uint8_t *)&l_pn,
+ VPD_SN_PN_VPD_SIZE);
//Push Fru File ID Byte - NULL
io_data.push_back(IPMIFRUINV::TYPELENGTH_BYTE_NULL);
@@ -1268,6 +1313,24 @@ errlHndl_t IpmiFruInv::addCommonVpdData(
return l_errl;
}
+void IpmiFruInv::addCommonAttrData( std::vector<uint8_t> &io_data,
+ uint8_t * i_pAttrData,
+ size_t i_length)
+{
+ uint8_t l_offset = io_data.size();
+
+ //Determine how big data is and expand it to handle the attr data
+ //and the typelength byte
+ io_data.resize(l_offset + 1 + i_length);
+
+ //Add the type/length byte indicating ascii data.
+ io_data.at(l_offset) = i_length + IPMIFRUINV::TYPELENGTH_BYTE_ASCII;
+
+ //copy attr data
+ memcpy (&io_data[l_offset+1],i_pAttrData,i_length);
+}
+
+
void IPMIFRUINV::clearData(uint8_t i_fruId)
{
uint8_t l_clearData[] =
diff --git a/src/usr/ipmi/ipmifruinvprvt.H b/src/usr/ipmi/ipmifruinvprvt.H
index 57d6e13cd..cc036f854 100644
--- a/src/usr/ipmi/ipmifruinvprvt.H
+++ b/src/usr/ipmi/ipmifruinvprvt.H
@@ -212,8 +212,24 @@ class IpmiFruInv
bool i_ascii,
bool i_typeLengthByte);
- private:
+ /**
+ * @brief Add attribute data to IPMI Fru Inventory record
+ * @param[in/out] data, The container with record data
+ * @param[in] attrData, Pointer to attribute data
+ * @param[in] length, Length of data to add
+ */
+ void addCommonAttrData( std::vector<uint8_t> &io_data,
+ uint8_t * i_pAttrData,
+ size_t i_length);
+ // The ATTR_SERIAL_NUMBER and ATTR_PART_NUMBER are 18 bytes but the
+ // vpd data size is only 16. Only want to add the vpd data, not the pad.
+ enum vpdSize
+ {
+ VPD_SN_PN_VPD_SIZE = 16,
+ };
+
+ private:
/**
* @brief Compute and Add data checsum to data record
*
OpenPOWER on IntegriCloud