diff options
| author | Matthew Raybuck <matthew.raybuck@ibm.com> | 2019-05-14 14:32:05 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-05-29 15:52:24 -0500 |
| commit | ae7fd02c211501aa83e81e9593c28017633da629 (patch) | |
| tree | ec62ec25ea1708b48374f55d27c7b5510d5b90cd /src/usr/vpd/test | |
| parent | e60c6842b51dd9c79e85c921471c7bb409995473 (diff) | |
| download | talos-hostboot-ae7fd02c211501aa83e81e9593c28017633da629.tar.gz talos-hostboot-ae7fd02c211501aa83e81e9593c28017633da629.zip | |
Refactor keyword support for various DIMM types
The existing keyword logic didn't use bitmasking when searching for the
correct keyword entry. This commit refactors the code to allow for
bitmasking and changing the NA module specific keyword to mean that no
keyword was found for the given target rather than its previous
ambiguous meaning that could be confused with the ALL module specific
keyword.
Change-Id: I661b70c4eff2740911cd63f8c1042ee8a084d63a
RTC:203788
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77357
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-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>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Glenn Miles <milesg@ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/vpd/test')
| -rwxr-xr-x | src/usr/vpd/test/spdtest.H | 130 |
1 files changed, 115 insertions, 15 deletions
diff --git a/src/usr/vpd/test/spdtest.H b/src/usr/vpd/test/spdtest.H index bd7f6ef5b..a2e4c7b70 100755 --- a/src/usr/vpd/test/spdtest.H +++ b/src/usr/vpd/test/spdtest.H @@ -43,6 +43,7 @@ #include <vpd/spdenums.H> #include "../spdDDR3.H" #include "../spdDDR4.H" +#include "../spdDDR4_DDIMM.H" #include "../spd.H" extern trace_desc_t* g_trac_spd; @@ -117,16 +118,31 @@ class SPDTest: public CxxTest::TestSuite uint8_t memType = 0x0; err = getMemType( theTarget, memType ); + if( err ) + { + fails++; + TS_FAIL("testSpdRead- Failure reading Basic memory type!" ); + errlCommit( err, + VPD_COMP_ID ); + break; + } + // Get the module type. + modSpecTypes_t modType = NA; + err = getModType(modType, + theTarget, + memType, + VPD::AUTOSELECT); if( err ) { fails++; - TS_FAIL( "testSpdRead- Failure reading Basic memory type!" ); + TS_FAIL("testSpdRead- Failure reading memory module type!"); errlCommit( err, VPD_COMP_ID ); - break;; + break; } + for( uint64_t keyword = SPD::SPD_FIRST_NORM_KEYWORD; keyword <= SPD::SPD_LAST_NORM_KEYWORD; keyword++ ) { @@ -154,14 +170,29 @@ class SPDTest: public CxxTest::TestSuite } else if( SPD_DDR4_TYPE == memType ) { + size_t dataSize = (modType == DDIMM) + ? (sizeof(ddr4DDIMMData)/sizeof(ddr4DDIMMData[0])) + : (sizeof(ddr4Data)/sizeof(ddr4Data[0])); + for( entry = 0; - entry < (sizeof(ddr4Data)/sizeof(ddr4Data[0])); + entry < dataSize; entry++ ) { - if( keyword == ddr4Data[entry].keyword ) + if (modType == DDIMM) { - theSize = ddr4Data[entry].length; - break; + if( keyword == ddr4DDIMMData[entry].keyword ) + { + theSize = ddr4DDIMMData[entry].length; + break; + } + } + else + { + if( keyword == ddr4Data[entry].keyword ) + { + theSize = ddr4Data[entry].length; + break; + } } } } @@ -304,6 +335,21 @@ class SPDTest: public CxxTest::TestSuite break; } + // Get the module type. + modSpecTypes_t modType = NA; + err = getModType(modType, + theTarget, + memType, + VPD::AUTOSELECT); + if( err ) + { + fails++; + TS_FAIL("testSpdRead- Failure reading memory module type!"); + errlCommit( err, + VPD_COMP_ID ); + break; + } + // Get the size if( SPD_DDR3_TYPE == memType ) { @@ -320,14 +366,29 @@ class SPDTest: public CxxTest::TestSuite } else if( SPD_DDR4_TYPE == memType ) { + size_t dataSize = (modType == DDIMM) + ? (sizeof(ddr4DDIMMData)/sizeof(ddr4DDIMMData[0])) + : (sizeof(ddr4Data)/sizeof(ddr4Data[0])); + for( uint32_t entry = 0; - entry < (sizeof(ddr4Data)/sizeof(ddr4Data[0])); + entry < dataSize; entry++ ) { - if( SPD::DIMM_BAD_DQ_DATA == ddr4Data[entry].keyword ) + if (modType == DDIMM) { - theSize = ddr4Data[entry].length; - break; + if( SPD::DIMM_BAD_DQ_DATA == ddr4DDIMMData[entry].keyword ) + { + theSize = ddr4DDIMMData[entry].length; + break; + } + } + else + { + if( SPD::DIMM_BAD_DQ_DATA == ddr4Data[entry].keyword ) + { + theSize = ddr4Data[entry].length; + break; + } } } } @@ -343,6 +404,14 @@ class SPDTest: public CxxTest::TestSuite break; } + if( 0 == theSize ) + { + // memType not supported or Keyword not supported on + // this memType + cmds++; + break; + } + // Allocate data buffer origData = static_cast<uint8_t*>(malloc( theSize )); @@ -892,6 +961,21 @@ class SPDTest: public CxxTest::TestSuite break; } + // Get the module type. + modSpecTypes_t modType = NA; + err = getModType(modType, + theTarget, + memType, + VPD::AUTOSELECT); + if( err ) + { + fails++; + TS_FAIL("testSpdRead- Failure reading memory module type!"); + errlCommit( err, + VPD_COMP_ID ); + break; + } + // The real Keyword read testing for( uint64_t keyword = SPD::SPD_FIRST_MOD_SPEC; keyword <= SPD::SPD_LAST_MOD_SPEC; keyword++ ) @@ -922,15 +1006,31 @@ class SPDTest: public CxxTest::TestSuite } else if( SPD_DDR4_TYPE == memType ) { + size_t dataSize = (modType == DDIMM) + ? (sizeof(ddr4DDIMMData)/sizeof(ddr4DDIMMData[0])) + : (sizeof(ddr4Data)/sizeof(ddr4Data[0])); + for( entry = 0; - entry < (sizeof(ddr4Data)/sizeof(ddr4Data[0])); + entry < dataSize; entry++ ) { - if( keyword == ddr4Data[entry].keyword ) + if (modType == DDIMM) { - kwdData = ddr4Data[entry]; - theSize = ddr4Data[entry].length; - break; + if( keyword == ddr4DDIMMData[entry].keyword ) + { + kwdData = ddr4DDIMMData[entry]; + theSize = ddr4DDIMMData[entry].length; + break; + } + } + else + { + if( keyword == ddr4Data[entry].keyword ) + { + kwdData = ddr4Data[entry]; + theSize = ddr4Data[entry].length; + break; + } } } } |

