summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorBill Hoffa <wghoffa@us.ibm.com>2015-03-30 11:09:17 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-04-09 21:41:06 -0500
commitd772a3ce71840dd90b4c1d294e51dc00e18588b0 (patch)
tree7b5af60bdd17f25ed3794be2feebf1c3f6fcb802 /src/usr/ipmi
parent190797041cf52f4c02d84582fce18ec77a7c475a (diff)
downloadtalos-hostboot-d772a3ce71840dd90b4c1d294e51dc00e18588b0.tar.gz
talos-hostboot-d772a3ce71840dd90b4c1d294e51dc00e18588b0.zip
Update VPD Fields Use for Fru Inventory
Change-Id: Iaa4802e72e355acd03cb88e58c40d1069dd76ef5 RTC:125044 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16766 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/ipmi')
-rw-r--r--src/usr/ipmi/ipmifruinv.C101
-rw-r--r--src/usr/ipmi/ipmifruinvprvt.H6
2 files changed, 46 insertions, 61 deletions
diff --git a/src/usr/ipmi/ipmifruinv.C b/src/usr/ipmi/ipmifruinv.C
index 7c9eb853a..4f0d7d709 100644
--- a/src/usr/ipmi/ipmifruinv.C
+++ b/src/usr/ipmi/ipmifruinv.C
@@ -35,6 +35,8 @@
#include <ipmi/ipmifruinv.H>
#include "ipmifru.H"
#include "ipmifruinvprvt.H"
+#include <stdio.h>
+#include <assert.h>
extern trace_desc_t * g_trac_ipmi;
@@ -401,7 +403,7 @@ errlHndl_t isdimmIpmiFruInv::buildProductInfoArea(std::vector<uint8_t> &io_data)
l_errl = addVpdData(io_data, SPD::BASIC_MEMORY_TYPE);
if (l_errl) { break; }
//Set Product Part/Model Number
- l_errl = addVpdData(io_data, SPD::MODULE_PART_NUMBER);
+ l_errl = addVpdData(io_data, SPD::MODULE_PART_NUMBER, true);
if (l_errl) { break; }
//Set Product Version
l_errl = addVpdData(io_data, SPD::MODULE_REVISION_CODE);
@@ -411,8 +413,7 @@ errlHndl_t isdimmIpmiFruInv::buildProductInfoArea(std::vector<uint8_t> &io_data)
if (l_errl) { break; }
//Add Asset Tag
- io_data.push_back(uint8_t(1)); //Asset Tag is One Byte for now
- io_data.push_back(uint8_t(0));
+ io_data.push_back(uint8_t(0)); //No Asset Tag needed - O bytes
//FRU File ID - Empty
io_data.push_back(IPMIFRUINV::TYPELENGTH_BYTE_NULL);
@@ -434,7 +435,8 @@ errlHndl_t isdimmIpmiFruInv::buildProductInfoArea(std::vector<uint8_t> &io_data)
}
errlHndl_t isdimmIpmiFruInv::addVpdData(std::vector<uint8_t> &io_data,
- uint8_t i_keyword)
+ uint8_t i_keyword,
+ bool i_ascii)
{
size_t l_vpdSize = 0;
errlHndl_t l_errl = NULL;
@@ -463,12 +465,22 @@ errlHndl_t isdimmIpmiFruInv::addVpdData(std::vector<uint8_t> &io_data,
uint8_t l_offset = io_data.size();
io_data.resize(l_offset + 1 + l_vpdSize);
- //Add on the data to the type/length byte indicating it is binary
- io_data.at(l_offset) = l_vpdSize;
+ //Add on the data to the type/length byte indicating it is ascii
+ // otherwise leave it as binary
+ if (i_ascii)
+ {
+ io_data.at(l_offset) = l_vpdSize
+ + IPMIFRUINV::TYPELENGTH_BYTE_ASCII;
+ }
+ else
+ {
+ io_data.at(l_offset) = l_vpdSize;
+ }
+ l_offset += 1;
//Read the VPD data directly into fru inventory data buffer
- l_errl = deviceRead(iv_target,&io_data[l_offset+1], l_vpdSize,
- DEVICE_SPD_ADDRESS(i_keyword));
+ l_errl = deviceRead(iv_target,&io_data[l_offset], l_vpdSize,
+ DEVICE_SPD_ADDRESS(i_keyword));
}
else
{
@@ -534,10 +546,10 @@ errlHndl_t procIpmiFruInv::buildBoardInfoArea(std::vector<uint8_t> &io_data)
l_errl = addVpdData(io_data, MVPD::VINI, MVPD::DR, true);
if (l_errl) { break; }
//Set Board Info serial number
- l_errl = addVpdData(io_data, MVPD::VINI, MVPD::SN);
+ l_errl = addVpdData(io_data, MVPD::VRML, MVPD::SN, true);
if (l_errl) { break; }
//Set Board part number
- l_errl = addVpdData(io_data, MVPD::VINI, MVPD::FN);
+ l_errl = addVpdData(io_data, MVPD::VRML, MVPD::PN, true);
if (l_errl) { break; }
//Set Board FRU File ID
l_errl = addVpdData(io_data, MVPD::VINI, MVPD::VZ);
@@ -760,47 +772,18 @@ errlHndl_t backplaneIpmiFruInv::buildBoardInfoArea(
//Set Product Name - ascii formatted data
//@fixme RTC Story 118373
- l_errl = addVpdData(io_data, CVPD::OSYS, CVPD::DR, true);
-
- //Support Legacy VPD without OSYS record
- if (l_errl)
- {
-
- TRACFCOMP(g_trac_ipmi,
- "backplaneIpmiFruInv::buildChassisBoardInfoArea - "
- " Using Legacy Chassis VPD Data without OSYS record");
-
- //Delete errorlog and use Legacy VPD Fields
- delete l_errl;
- l_errl = NULL;
- //Set Product Name - ascii formatted data
- //@fixme RTC Story 118373
- l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::DR, true);
- if (l_errl) { break; }
-
- //Set Product Serial number - ascii formatted data
- //@fixme RTC Story 118373
- l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::VS, true);
- if (l_errl) { break; }
-
- //Set Product Part number - ascii formatted data
- //@fixme RTC Story 118373
- l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::VP, true);
- if (l_errl) { break; }
+ l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::DR, true);
+ if (l_errl) { break; }
- }
- else
- {
- //Set serial number - ascii formatted field
- //@fixme RTC Story 118373
- l_errl = addVpdData(io_data, CVPD::OSYS, CVPD::SS, true);
- if (l_errl) { break; }
+ //Set Product Serial number - ascii formatted data
+ //@fixme RTC Story 118373
+ l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::VS, true);
+ if (l_errl) { break; }
- //Set chassis part number - ascii formatted field
- //@fixme RTC Story 118373
- l_errl = addVpdData(io_data, CVPD::OSYS, CVPD::MM, true);
- if (l_errl) { break; }
- }
+ //Set Product Part number - ascii formatted data
+ //@fixme RTC Story 118373
+ l_errl = addVpdData(io_data, CVPD::OPFR, CVPD::VP, true);
+ if (l_errl) { break; }
//Push Fru File ID Byte - NULL
io_data.push_back(IPMIFRUINV::TYPELENGTH_BYTE_NULL);
@@ -950,22 +933,22 @@ void IpmiFruInv::addEcidData(const TARGETING::TargetHandle_t& i_target,
{
// Create Custom ECID Field
// - First put in 'ECID:' to make it obvious what this is
- uint8_t l_data[] = {IPMIFRUINV::TYPELENGTH_BYTE_ASCII + 5,'E','C','I','D',
- ':', IPMIFRUINV::TYPELENGTH_BYTE_NULL + 16};
+ uint8_t l_data[] = {IPMIFRUINV::TYPELENGTH_BYTE_ASCII + 37,'E','C','I','D',
+ ':'};
// @todo-RTC:124687 - Refactor multiple reallocations
io_data.insert( io_data.end(),
&l_data[0],
&l_data[0] + (uint8_t(sizeof(l_data) / sizeof(uint8_t))));
- uint8_t* l_vDataPtr = (uint8_t*) &i_ecidInfo[0];
- //Insert first 64 bits of ECID data
- io_data.insert(io_data.end(),
- &l_vDataPtr[0], &l_vDataPtr[0]+8);
- l_vDataPtr = (uint8_t*) &i_ecidInfo[1];
- //Insert second 64 bits of ECID data
- io_data.insert(io_data.end(),
- &l_vDataPtr[0], &l_vDataPtr[0]+8);
+ CPPASSERT(sizeof(ATTR_ECID_type) == 16);
+ CPPASSERT((sizeof(i_ecidInfo) / sizeof(ATTR_ECID_type)) == 2);
+
+ char l_ecidAscii[33];
+ sprintf(l_ecidAscii, "%.16llX%.16llX", i_ecidInfo[0], i_ecidInfo[1]);
+
+ uint8_t* l_vDataPtr = (uint8_t*) &l_ecidAscii[0];
+ io_data.insert(io_data.end(), &l_vDataPtr[0], &l_vDataPtr[0]+32);
return;
}
diff --git a/src/usr/ipmi/ipmifruinvprvt.H b/src/usr/ipmi/ipmifruinvprvt.H
index aed5dfc1d..2573a84cf 100644
--- a/src/usr/ipmi/ipmifruinvprvt.H
+++ b/src/usr/ipmi/ipmifruinvprvt.H
@@ -303,9 +303,11 @@ class isdimmIpmiFruInv : public IpmiFruInv
* record
* @param[in/out] data, The container with record data
* @param[in] keyword, Indicates where in the VPD to get more data
-
+ * @param[in] ascii, Indicates if VPD field is in ascii format or not
*/
- errlHndl_t addVpdData(std::vector<uint8_t> &io_data, uint8_t i_keyword);
+ errlHndl_t addVpdData(std::vector<uint8_t> &io_data,
+ uint8_t i_keyword,
+ bool i_ascii=false);
};
OpenPOWER on IntegriCloud