Skip to content

Commit

Permalink
Add OSYS record MM/SS keyword checks for PVPD
Browse files Browse the repository at this point in the history
For planar VPD (PVPD) there is an additional PN/SN keyword
pair we must check when determining if the hardware matches
what we have cached in the EECACHE section of pnor. This commit
adds this extra check for NODE targets which PVPD eeproms are
associated with.

Change-Id: I257045144597d250683e67c24e240bd6be468218
RTC: 210350
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/80562
Reviewed-by: Matt Derksen <mderkse1@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>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Aug 15, 2019
1 parent 491ac02 commit ca543f7
Showing 1 changed file with 75 additions and 6 deletions.
81 changes: 75 additions & 6 deletions src/usr/vpd/vpd.C
Expand Up @@ -711,6 +711,7 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
vpdRecord l_record = 0;
vpdKeyword l_keywordPN = 0;
vpdKeyword l_keywordSN = 0;
TARGETING::TYPE l_type = i_target->getAttr<TARGETING::ATTR_TYPE>();

do
{
Expand Down Expand Up @@ -764,12 +765,80 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
// Check the serial number and part number of the system if the previous
// record/key pair matched. Note that this time the record/key pairs are
// OSYS/SS and OSYS/MM for serial number and part number, respectively
// @TODO RTC 210350 Handle this case.
// if (l_type == TARGETING::TYPE_NODE &&
// (l_matchSN && l_matchPN))
// {
//
// }
if (l_type == TARGETING::TYPE_NODE &&
(l_matchSN && l_matchPN))
{
// If we have a NODE, use pvpd api
IpVpdFacade* l_ipvpd = &(Singleton<PvpdFacade>::instance());
bool l_zeroPN = false;
bool l_zeroSN = false;
l_err = l_ipvpd->cmpSeepromToZero(i_target,
PVPD::OSYS,
PVPD::MM,
l_zeroPN);
if(l_err)
{
TRACDCOMP(g_trac_vpd,ERR_MRK"VPD::ensureEepromCacheIsInSync: "
"cmpSeepromToZero returned an error. Assuming this error is "
"related to OSYS/MM not being present in SEEPROM. Skipping "
"this error. HUID: 0x%.8X",
TARGETING::get_huid(i_target));
delete l_err;
l_err = nullptr;
l_zeroPN = true;

}

l_err = l_ipvpd->cmpSeepromToZero(i_target,
PVPD::OSYS,
PVPD::SS,
l_zeroSN);
if(l_err)
{
TRACDCOMP(g_trac_vpd,ERR_MRK"VPD::ensureEepromCacheIsInSync: "
"cmpSeepromToZero returned an error. Assuming this error is "
"related to OSYS/SS not being present in SEEPROM. Skipping "
"this error. HUID: 0x%.8X",
TARGETING::get_huid(i_target));
delete l_err;
l_err = nullptr;
l_zeroSN = true;
}

//Only compare the SN/PN between SEEPROM and EECACHE if they are
//nonzero.
if(!l_zeroPN)
{
l_err = cmpEecacheToEeprom(i_target,
i_eepromType,
PVPD::MM,
PVPD::OSYS,
l_matchPN);
if(l_err)
{
TRACFCOMP(g_trac_vpd,ERR_MRK"VPD::ensureEepromCacheIsInSync: Error"
" checking for EECACHE/SEEPROM PN match for NODE target 0x%.8X",
TARGETING::get_huid(i_target));
break;
}
}

if(!l_zeroSN)
{
l_err = cmpEecacheToEeprom(i_target,
i_eepromType,
PVPD::SS,
PVPD::OSYS,
l_matchSN);
if(l_err)
{
TRACFCOMP(g_trac_vpd,ERR_MRK"VPD::ensureEepromCacheIsInSync: Error"
" checking for EECACHE/SEEPROM SN match for NODE target 0x%.8X",
TARGETING::get_huid(i_target));
break;
}
}
}

o_isInSync = (l_matchPN && l_matchSN);

Expand Down

0 comments on commit ca543f7

Please sign in to comment.