diff options
Diffstat (limited to 'src/usr/diag/prdf/test')
-rw-r--r-- | src/usr/diag/prdf/test/prdfTest_BadDqBitmap.H | 227 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdf_hb_common_test.mk | 4 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C | 8 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H | 4 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdfsimScrDB.C | 4 |
5 files changed, 238 insertions, 9 deletions
diff --git a/src/usr/diag/prdf/test/prdfTest_BadDqBitmap.H b/src/usr/diag/prdf/test/prdfTest_BadDqBitmap.H new file mode 100644 index 000000000..4b4fa8fea --- /dev/null +++ b/src/usr/diag/prdf/test/prdfTest_BadDqBitmap.H @@ -0,0 +1,227 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/test/prdfTest_BadDqBitmap.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __TEST_PRDFBADDQBITMAP_H +#define __TEST_PRDFBADDQBITMAP_H + +/** + * @file prdfTest_BadDqBitmap.H + * + * @brief prdf testing reading and writing the BAD_DQ_BITMAP attribute + */ + +#ifdef __HOSTBOOT_MODULE + #include <cxxtest/TestSuite.H> + #include <errl/errlentry.H> + #include <errl/errlmanager.H> +#else + #include <cxxtest/TestSuite.h> + #include <fsp/FipsGlobalFixture.H> + #include <errlentry.H> +#endif + +#include <prdfTrace.H> +#include <prdfMain.H> +#include "prdfsimMacros.H" +#include <prdfMemDqBitmap.H> +#include <prdfPlatServices.H> +#include <prdfTargetServices.H> + +class WriteBadDqBitmap: public CxxTest::TestSuite +{ + +public: + + void TestNimbusReadWriteBadDqBitmap(void) + { + using namespace PRDF; + using namespace TARGETING; + using namespace PlatServices; + + TargetHandle_t masterProc = nullptr; + targetService().masterProcChipTargetHandle(masterProc); + + // Nimbus only test + if ( MODEL_NIMBUS == masterProc->getAttr<ATTR_MODEL>() ) + { + TS_INFO("- TestNimbusReadWriteBadDqBitmap - Start -"); + + uint32_t rc = SUCCESS; + + // Get an MCBIST + TargetHandle_t mcb = getConnectedChild(masterProc, TYPE_MCBIST, 0); + if ( nullptr == mcb ) + { + TS_FAIL( "ERROR: Failed to get MCBIST" ); + } + // Get an MCA + TargetHandle_t mca = getConnectedChild( mcb, TYPE_MCA, 0 ); + if ( nullptr == mca ) + { + TS_FAIL( "ERROR: Failed to get MCA" ); + } + + // Make arbitrary initial data + MemRank rank( 0, 0 ); + const uint8_t initialBitmap[DQ_BITMAP::BITMAP_SIZE] = + { 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x00 }; + BitmapData initialData; + memcpy( initialData[0].bitmap, initialBitmap, + sizeof(initialData[0].bitmap) ); + + // Set with the initial data + MemDqBitmap setBitmap( mca, rank, initialData ); + rc = setBadDqBitmap( mca, rank, setBitmap ); + if ( SUCCESS != rc ) + { + TS_FAIL( "ERROR: setBadDqBitmap failed " ); + } + + // Read the data back + MemDqBitmap getBitmap; + rc = getBadDqBitmap( mca, rank, getBitmap ); + if ( SUCCESS != rc ) + { + TS_FAIL( "ERROR: getBadDqBitmap failed" ); + } + + BitmapData newData = getBitmap.getData(); + + // Compare the read data to the initial data. The last byte (byte 9) + // is for spares so we won't worry about comparing that. + for ( uint8_t n = 0; n < (DQ_BITMAP::BITMAP_SIZE-1); n++ ) + { + if ( newData.at(0).bitmap[n] != initialBitmap[n] ) + { + TS_FAIL( "TestNimbusReadWriteBadDqBitmap: Incorrect data " + "found. newData[%d]=0x%x initialBitmap[%d]=0x%x", + n, newData.at(0).bitmap[n], n, initialBitmap[n] ); + } + } + + // Clear the vpd just in case + rc = clearBadDqBitmap( mca, rank ); + if ( SUCCESS != rc ) + { + TS_FAIL( "ERROR: clearBadDqBitmap failed" ); + } + + TS_INFO("- TestNimbusReadWriteBadDqBitmap - End -"); + } + + } + + void TestAxoneReadWriteBadDqBitmap(void) + { + using namespace PRDF; + using namespace TARGETING; + using namespace PlatServices; + + TargetHandle_t masterProc = nullptr; + targetService().masterProcChipTargetHandle(masterProc); + + // Axone only test + if ( MODEL_AXONE == masterProc->getAttr<ATTR_MODEL>() ) + { + TS_INFO("- TestAxoneReadWriteBadDqBitmap - Start -"); + + uint32_t rc = SUCCESS; + + // Get an OCMB + TargetHandle_t mc = getConnectedChild( masterProc, TYPE_MC, 0 ); + if ( nullptr == mc ) + { + TS_FAIL( "ERROR: Failed to get MC" ); + } + TargetHandle_t omic = getConnectedChild( mc, TYPE_OMIC, 0 ); + if ( nullptr == omic ) + { + TS_FAIL( "ERROR: Failed to get OMIC" ); + } + TargetHandle_t omi = getConnectedChild( omic, TYPE_OMI, 0 ); + if ( nullptr == omi ) + { + TS_FAIL( "ERROR: Failed to get OMI" ); + } + TargetHandle_t ocmb = getConnectedChild( omi, TYPE_OCMB_CHIP, 0 ); + if ( nullptr == ocmb ) + { + TS_FAIL( "ERROR: Failed to get OCMB" ); + } + // Make arbitrary initial data + MemRank rank( 0 ); + const uint8_t initialBitmap[DQ_BITMAP::BITMAP_SIZE] = + { 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0x00 }; + BitmapData initialData; + memcpy( initialData[0].bitmap, initialBitmap, + sizeof(initialData[0].bitmap) ); + + // Set with the initial data + MemDqBitmap setBitmap( ocmb, rank, initialData ); + rc = setBadDqBitmap( ocmb, rank, setBitmap ); + if ( SUCCESS != rc ) + { + TS_FAIL( "ERROR: setBadDqBitmap failed " ); + } + + // Read the data back + MemDqBitmap getBitmap; + rc = getBadDqBitmap( ocmb, rank, getBitmap ); + if ( SUCCESS != rc ) + { + TS_FAIL( "ERROR: getBadDqBitmap failed" ); + } + + BitmapData newData = getBitmap.getData(); + + // Compare the read data to the initial data. The last byte (byte 9) + // is for spares so we won't worry about comparing that. + for ( uint8_t n = 0; n < (DQ_BITMAP::BITMAP_SIZE-1); n++ ) + { + if ( newData.at(0).bitmap[n] != initialBitmap[n] ) + { + TS_FAIL( "TestAxoneReadWriteBadDqBitmap: Incorrect data " + "found. newData[%d]=0x%x initialBitmap[%d]=0x%x", + n, newData.at(0).bitmap[n], n, initialBitmap[n] ); + } + } + + // Clear the vpd just in case + rc = clearBadDqBitmap( ocmb, rank ); + if ( SUCCESS != rc ) + { + TS_FAIL( "ERROR: clearBadDqBitmap failed" ); + } + + TS_INFO("- TestAxoneReadWriteBadDqBitmap - End -"); + + } + + } + +//------------------------------------------------------------------------------ + +}; +#endif diff --git a/src/usr/diag/prdf/test/prdf_hb_common_test.mk b/src/usr/diag/prdf/test/prdf_hb_common_test.mk index a148e0c24..5d1e7ea36 100755 --- a/src/usr/diag/prdf/test/prdf_hb_common_test.mk +++ b/src/usr/diag/prdf/test/prdf_hb_common_test.mk @@ -70,6 +70,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/cache/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/lib/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include EXTRAINCDIR += ${ROOTPATH}/src/import/ @@ -91,8 +92,9 @@ TESTS += ${PRD_USR_TEST_PATH}/prdfTest.H TESTS += ${PRD_USR_TEST_PATH}/prdfTest_XBus.H TESTS += ${PRD_USR_TEST_PATH}/prdfTest_ABus.H TESTS += ${PRD_USR_TEST_PATH}/prdfTest_ProcCentFir.H +TESTS += ${PRD_USR_TEST_PATH}/prdfTest_BadDqBitmap.H TESTS += ${PRD_USR_TEST_PATH}/prdfTest_Ex.H -TESTS += $(if $(CONFIG_AXONE_BRING_UP),,${PRD_USR_TEST_PATH}/prdfTest_NimbusTpLFir.H) +TESTS += ${PRD_USR_TEST_PATH}/prdfTest_NimbusTpLFir.H #@TODO RTC:178802 #TESTS += ${PRD_USR_TEST_PATH}/prdfTest_Mcs.H diff --git a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C index 3e3079883..d6b02b5ee 100755 --- a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C +++ b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -43,7 +43,7 @@ SimScomAccessor::~SimScomAccessor() uint32_t SimScomAccessor::Access(TARGETING::TargetHandle_t i_target, BitString & bs, uint64_t registerId, - MopRegisterAccess::Operation operation) const + RegisterAccess::Operation operation) const { PRDF_DENTER("SimScomAccessor::Access()"); uint32_t rc = SUCCESS; @@ -53,8 +53,8 @@ uint32_t SimScomAccessor::Access(TARGETING::TargetHandle_t i_target, { switch (operation) { - case MopRegisterAccess::WRITE: l_op = ScrDB::WRITE; break; - case MopRegisterAccess::READ: l_op = ScrDB::READ; break; + case RegisterAccess::WRITE: l_op = ScrDB::WRITE; break; + case RegisterAccess::READ: l_op = ScrDB::READ; break; default: PRDF_ERR( "SimScomAccessor::Access() unsupported operation: 0x%X", operation ); rc = PRD_SCANCOM_FAILURE; diff --git a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H index b8a610f75..f5566eb54 100755 --- a/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H +++ b/src/usr/diag/prdf/test/prdfsimHomRegisterAccess.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -73,7 +73,7 @@ class SimScomAccessor : public ScomAccessor virtual uint32_t Access(TARGETING::TargetHandle_t i_target, BitString & bs, uint64_t registerId, - MopRegisterAccess::Operation operation) const; + RegisterAccess::Operation operation) const; private: diff --git a/src/usr/diag/prdf/test/prdfsimScrDB.C b/src/usr/diag/prdf/test/prdfsimScrDB.C index 6308ba423..a6a67bd9c 100755 --- a/src/usr/diag/prdf/test/prdfsimScrDB.C +++ b/src/usr/diag/prdf/test/prdfsimScrDB.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -24,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include "prdfsimScrDB.H" -#include <iipMopRegisterAccess.h> +#include <prdfHomRegisterAccess.H> #include <prdfTrace.H> #include <prdfPlatServices.H> #include "prdfsimServices.H" |