summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCorey Swenson <cswenson@us.ibm.com>2015-03-16 13:23:05 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-03-26 14:48:54 -0500
commit43c7aed1a01cf20acd11307ce08aab99eb5bcd1c (patch)
treef23dd8a3aef9f6d1905dd1822a019b8ae7724184 /src
parentb0b7adcd0c1a072d6ee70c126dee95d570a86bef (diff)
downloadtalos-hostboot-43c7aed1a01cf20acd11307ce08aab99eb5bcd1c.tar.gz
talos-hostboot-43c7aed1a01cf20acd11307ce08aab99eb5bcd1c.zip
Fix VPD cache records/keywords
The CVPD should be checking OPFR:VS/VP first, then VINI:SN/PN The MVPD should be checking VRML:SN/PN not VINI:SN/PN Change-Id: If792fae2964011c1ca80e8cc08235477dc8a7a3b RTC: 124992 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16396 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@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')
-rw-r--r--src/include/usr/vpd/mvpdenums.H1
-rw-r--r--src/usr/vpd/ipvpd.C63
-rw-r--r--src/usr/vpd/ipvpd.H21
-rw-r--r--src/usr/vpd/mvpd.H1
-rwxr-xr-xsrc/usr/vpd/vpd.C42
5 files changed, 124 insertions, 4 deletions
diff --git a/src/include/usr/vpd/mvpdenums.H b/src/include/usr/vpd/mvpdenums.H
index 950245f44..fd4ddaf09 100644
--- a/src/include/usr/vpd/mvpdenums.H
+++ b/src/include/usr/vpd/mvpdenums.H
@@ -79,6 +79,7 @@ enum mvpdRecord
LWPE = 0x20,
VWML = 0x21,
MER0 = 0x22,
+ VRML = 0x23,
// Last Record
MVPD_LAST_RECORD,
diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C
index a0682d283..b409c503f 100644
--- a/src/usr/vpd/ipvpd.C
+++ b/src/usr/vpd/ipvpd.C
@@ -409,6 +409,69 @@ errlHndl_t IpVpdFacade::cmpPnorToSeeprom ( TARGETING::Target * i_target,
return l_err;
}
+// ------------------------------------------------------------------
+// IpVpdFacade::cmpSeepromToZero
+// ------------------------------------------------------------------
+errlHndl_t IpVpdFacade::cmpSeepromToZero ( TARGETING::Target * i_target,
+ VPD::vpdRecord i_record,
+ VPD::vpdKeyword i_keyword,
+ bool &o_match )
+{
+ errlHndl_t l_err = NULL;
+
+ TRACSSCOMP( g_trac_vpd, ENTER_MRK"cmpSeepromToZero() " );
+
+ o_match = false;
+
+ input_args_t l_seepromArgs;
+ l_seepromArgs.record = i_record;
+ l_seepromArgs.keyword = i_keyword;
+ l_seepromArgs.location = VPD::SEEPROM;
+
+ do
+ {
+ // Get the SEEPROM size
+ size_t l_sizeSeeprom = 0;
+ l_err = read( i_target,
+ NULL,
+ l_sizeSeeprom,
+ l_seepromArgs );
+ if( l_err || (l_sizeSeeprom == 0) )
+ {
+ break;
+ }
+
+ // Get the SEEPROM data
+ uint8_t l_dataSeeprom[l_sizeSeeprom];
+ l_err = read( i_target,
+ l_dataSeeprom,
+ l_sizeSeeprom,
+ l_seepromArgs );
+ if( l_err )
+ {
+ break;
+ }
+
+ // Compare the SEEPROM data to zero
+ uint8_t l_zero[l_sizeSeeprom];
+ memset(l_zero,0,l_sizeSeeprom);
+
+ if( memcmp( l_zero,
+ l_dataSeeprom,
+ l_sizeSeeprom ) != 0 )
+ {
+ break;
+ }
+
+ o_match = true;
+
+ } while(0);
+
+ TRACSSCOMP( g_trac_vpd, EXIT_MRK"cmpSeepromToZero()" );
+
+ return l_err;
+}
+
/* IPVPD PNOR FORMAT
|-----------------------------------------------------------|----|
|TOC0|TOC1|...........................................|TOC31| |
diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H
index 2350bdd9e..7a38c3e28 100644
--- a/src/usr/vpd/ipvpd.H
+++ b/src/usr/vpd/ipvpd.H
@@ -254,6 +254,27 @@ class IpVpdFacade
bool &o_match );
/**
+ * @brief This function compares the specified record/keyword
+ * in SEEPROM to zero and returns the result. A mismatch
+ * will not return an error.
+ *
+ * @param[in] i_target - Target device
+ *
+ * @param[in] i_record - Record to compare
+ *
+ * @param[in] i_keyword - Keyword to compare
+ *
+ * @param[out] o_match - Result of compare
+ *
+ * @return errlHndl_t - NULL if successful, otherwise a pointer to the
+ * error log.
+ */
+ errlHndl_t cmpSeepromToZero ( TARGETING::Target * i_target,
+ VPD::vpdRecord i_record,
+ VPD::vpdKeyword i_keyword,
+ bool &o_match );
+
+ /**
* @brief This function will perform the steps required to load the
* MVPD data from SEEPROM into the PNOR cache.
*
diff --git a/src/usr/vpd/mvpd.H b/src/usr/vpd/mvpd.H
index 60a8491f7..e9fe90523 100644
--- a/src/usr/vpd/mvpd.H
+++ b/src/usr/vpd/mvpd.H
@@ -88,6 +88,7 @@ namespace MVPD
{ LWPE, "LWPE" },
{ VWML, "VWML" },
{ MER0, "MER0" },
+ { VRML, "VRML" },
// -------------------------------------------------------------------
// DO NOT USE!! This is for test purposes ONLY!
{ MVPD_TEST_RECORD, "TEST" },
diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C
index 3533af9d1..fa32478e5 100755
--- a/src/usr/vpd/vpd.C
+++ b/src/usr/vpd/vpd.C
@@ -445,16 +445,16 @@ errlHndl_t ensureCacheIsInSync ( TARGETING::Target * i_target )
if( l_type == TARGETING::TYPE_PROC )
{
- l_record = MVPD::VINI;
+ l_record = MVPD::VRML;
l_keywordPN = MVPD::PN;
l_keywordSN = MVPD::SN;
}
else if( l_type == TARGETING::TYPE_MEMBUF )
{
l_ipvpd = &(Singleton<CvpdFacade>::instance());
- l_record = CVPD::VINI;
- l_keywordPN = CVPD::PN;
- l_keywordSN = CVPD::SN;
+ l_record = CVPD::OPFR;
+ l_keywordPN = CVPD::VP;
+ l_keywordSN = CVPD::VS;
}
else if( l_type == TARGETING::TYPE_DIMM )
{
@@ -486,6 +486,40 @@ errlHndl_t ensureCacheIsInSync ( TARGETING::Target * i_target )
do
{
+ // Make sure we are comparing the correct pn/sn for CVPD
+ if( l_type == TARGETING::TYPE_MEMBUF )
+ {
+ bool l_zeroPN;
+ l_err = l_ipvpd->cmpSeepromToZero( i_target,
+ l_record,
+ l_keywordPN,
+ l_zeroPN );
+ if (l_err)
+ {
+ TRACFCOMP(g_trac_vpd,ERR_MRK"VPD::ensureCacheIsInSync: Error checking if OPFR:VP == 0");
+ break;
+ }
+
+ bool l_zeroSN;
+ l_err = l_ipvpd->cmpSeepromToZero( i_target,
+ l_record,
+ l_keywordSN,
+ l_zeroSN );
+ if (l_err)
+ {
+ TRACFCOMP(g_trac_vpd,ERR_MRK"VPD::ensureCacheIsInSync: Error checking if OPFR:VS == 0");
+ break;
+ }
+
+ // If VP and VS are zero, use VINI instead
+ if( l_zeroPN && l_zeroSN )
+ {
+ l_record = CVPD::VINI;
+ l_keywordPN = CVPD::PN;
+ l_keywordSN = CVPD::SN;
+ }
+ }
+
// Compare the Part Numbers in PNOR/SEEPROM
bool l_matchPN = false;
if( ( l_type == TARGETING::TYPE_PROC ) ||
OpenPOWER on IntegriCloud