summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2019-07-17 10:09:58 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-08-15 14:44:10 -0500
commitca543f7327a268c71e73253874e5e3e77230dd23 (patch)
tree92f95a72524e1658a377f5bea3d19d8553001d5d /src/usr
parent491ac02e84c7fcc32d28fbf80a0f4c2015589dc3 (diff)
downloadtalos-hostboot-ca543f7327a268c71e73253874e5e3e77230dd23.tar.gz
talos-hostboot-ca543f7327a268c71e73253874e5e3e77230dd23.zip
Add OSYS record MM/SS keyword checks for PVPD
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>
Diffstat (limited to 'src/usr')
-rwxr-xr-xsrc/usr/vpd/vpd.C81
1 files changed, 75 insertions, 6 deletions
diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C
index 0ee7c9bcb..339fd3dab 100755
--- a/src/usr/vpd/vpd.C
+++ b/src/usr/vpd/vpd.C
@@ -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
{
@@ -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);
OpenPOWER on IntegriCloud