diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2015-03-16 13:23:05 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-03-26 14:48:54 -0500 |
commit | 43c7aed1a01cf20acd11307ce08aab99eb5bcd1c (patch) | |
tree | f23dd8a3aef9f6d1905dd1822a019b8ae7724184 /src/usr/vpd/ipvpd.C | |
parent | b0b7adcd0c1a072d6ee70c126dee95d570a86bef (diff) | |
download | talos-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/usr/vpd/ipvpd.C')
-rw-r--r-- | src/usr/vpd/ipvpd.C | 63 |
1 files changed, 63 insertions, 0 deletions
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| | |