summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build/configs/simics_axone.config11
-rw-r--r--src/makefile4
-rw-r--r--src/usr/cxxtest/HBconfig6
-rw-r--r--src/usr/fapi2/test/fapi2MvpdTestCxx.H19
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C41
-rw-r--r--src/usr/runtime/test/hdatservicetest.H41
-rw-r--r--src/usr/runtime/test/makefile4
-rw-r--r--src/usr/runtime/test/test_checkHbResMemLimit.H38
-rw-r--r--src/usr/runtime/test/testpreverifiedlidmgr.H37
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/attribute_types_hb.xml17
-rw-r--r--src/usr/targeting/common/xmltohb/simics_AXONE.system.xml4
-rw-r--r--src/usr/targeting/common/xmltohb/target_types_hb.xml3
-rw-r--r--src/usr/util/test/makefile9
-rw-r--r--src/usr/util/test/testlidmgr.H6
-rw-r--r--src/usr/util/test/testmclmgr.H3
-rw-r--r--src/usr/xscom/test/xscomtest.H9
16 files changed, 234 insertions, 18 deletions
diff --git a/src/build/configs/simics_axone.config b/src/build/configs/simics_axone.config
index a71f5e2f7..385c86063 100644
--- a/src/build/configs/simics_axone.config
+++ b/src/build/configs/simics_axone.config
@@ -1,3 +1,4 @@
+#fetch dimm spd via i2c
set DJVPD_READ_FROM_HW
# You can enabled MVPD read from HW but adds time to IPL
@@ -6,7 +7,13 @@ set DJVPD_READ_FROM_HW
#skip enabling checkstop analysis until OCC is ready in simics
unset IPLTIME_CHECKSTOP_ANALYSIS
-set AXONE_BRING_UP
-
+#enable EEPROM caching
set SUPPORT_EEPROM_CACHING
+#run cxx testcases during boot
+set EARLY_TESTCASES
+
+#Try to keep a list of things this does
+# - skipping setting voltages in istep 8.12, nothing on other side of AVSbus
+# in simics currently.
+set AXONE_BRING_UP
diff --git a/src/makefile b/src/makefile
index 022711c91..b7f731b89 100644
--- a/src/makefile
+++ b/src/makefile
@@ -244,7 +244,7 @@ TESTCASE_MODULES += $(if $(CONFIG_VPO_COMPILE),,testmdia)
TESTCASE_MODULES += testpirformat
TESTCASE_MODULES += testi2c
TESTCASE_MODULES += testmbox
-TESTCASE_MODULES += testrtloader
+TESTCASE_MODULES += $(if $(CONFIG_EARLY_TESTCASES),,testrtloader)
TESTCASE_MODULES += testsbe
TESTCASE_MODULES += testsbeio
TESTCASE_MODULES += testerrl
@@ -255,7 +255,7 @@ TESTCASE_MODULES += testscom
TESTCASE_MODULES += $(if $(CONFIG_VPO_COMPILE),,testruntime)
TESTCASE_MODULES += testintr
TESTCASE_MODULES += testfapi2
-TESTCASE_MODULES += $(if $(CONFIG_FSP_BUILD),,testnvram)
+TESTCASE_MODULES += $(if $(CONFIG_EARLY_TESTCASES) && $(FSP_BUILD) ,,testnvram)
TESTCASE_MODULES += testsmf
TESTCASE_MODULES += testexpscom
diff --git a/src/usr/cxxtest/HBconfig b/src/usr/cxxtest/HBconfig
new file mode 100644
index 000000000..aa2fd1b24
--- /dev/null
+++ b/src/usr/cxxtest/HBconfig
@@ -0,0 +1,6 @@
+config EARLY_TESTCASES
+ default n
+ help
+ Execute unit tests at the end of the istep specified in
+ EARLY_TESTCASES_ISTEP and then shut down.
+
diff --git a/src/usr/fapi2/test/fapi2MvpdTestCxx.H b/src/usr/fapi2/test/fapi2MvpdTestCxx.H
index dab243795..224879070 100644
--- a/src/usr/fapi2/test/fapi2MvpdTestCxx.H
+++ b/src/usr/fapi2/test/fapi2MvpdTestCxx.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -320,10 +320,15 @@ public:
void testMvpdGetPoundVBucket(void)
{
+ FAPI_INF("MvpdGetPoundVBucket Test entry... ");
int numTests = 0;
int numFails = 0;
+
+#ifdef CONFIG_EARLY_TESTCASES
+ // Requires some prereqs of step7
+ FAPI_INF("Skipping poundv tests");
+#else
fapi2::ReturnCode l_rc;
- FAPI_INF("MvpdGetPoundVBucket Test entry... ");
// Create a vector of TARGETING::Target pointers
TARGETING::TargetHandleList l_chipletList;
@@ -403,6 +408,7 @@ public:
FAPI_INF("Bucket for HUID: 0x%X is = %d", l_huid, voltageData.bucketId);
}
+#endif
FAPI_INF("MvpdGetPoundVBucket:: Test Complete. %d/%d fails", numFails , numTests);
FAPI_INF("MvpdGetPoundVBucket Test exit... ");
}
@@ -411,9 +417,14 @@ public:
{
int numTests = 0;
int numFails = 0;
- fapi2::ReturnCode l_rc;
FAPI_INF("MvpdGetPoundWBucket Test entry... ");
+#ifdef CONFIG_EARLY_TESTCASES
+ // Requires some prereqs of step7
+ FAPI_INF("Skipping poundv tests");
+#else
+ fapi2::ReturnCode l_rc;
+
// Create a vector of TARGETING::Target pointers
TARGETING::TargetHandleList l_chipletList;
@@ -471,6 +482,8 @@ public:
FAPI_INF("Bucket for HUID: 0x%X is = %d", l_huid, vdmData.bucketId);
}
+#endif
+
FAPI_INF("MvpdGetPoundWBucket:: Test Complete. %d/%d fails",
numFails,
numTests);
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 6500d1013..e9915aaf4 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -93,6 +93,8 @@
#include <devicefw/userif.H>
#include <p9_perv_scom_addresses.H>
// ---------------------------
+#include <initservice/extinitserviceif.H>
+
namespace ISTEPS_TRACE
{
@@ -871,6 +873,9 @@ errlHndl_t IStepDispatcher::doIstep(uint32_t i_istep,
do {
+ TARGETING::Target* l_pTopLevel = NULL;
+ TARGETING::targetService().getTopLevelTarget(l_pTopLevel);
+
// If the step has valid work to be done, then execute it.
if(NULL != theStep)
{
@@ -973,8 +978,6 @@ errlHndl_t IStepDispatcher::doIstep(uint32_t i_istep,
}
// Zero ATTR_RECONFIGURE_LOOP
- TARGETING::Target* l_pTopLevel = NULL;
- TARGETING::targetService().getTopLevelTarget(l_pTopLevel);
l_pTopLevel->setAttr<TARGETING::ATTR_RECONFIGURE_LOOP>(0);
// Read ATTR_ISTEP_PAUSE_ENABLE attribute
@@ -1122,6 +1125,40 @@ errlHndl_t IStepDispatcher::doIstep(uint32_t i_istep,
INFO_MRK"doIstep: Empty Istep, nothing to do!" );
}
+#ifdef CONFIG_EARLY_TESTCASES
+ // Check to see if we should run testcases here
+ TARGETING::ATTR_EARLY_TESTCASES_ISTEP_type l_runCxxIstep =
+ l_pTopLevel->getAttr<TARGETING::ATTR_EARLY_TESTCASES_ISTEP>();
+ if( (((i_istep & 0xFF) << 8) | (i_substep & 0xFF))
+ == l_runCxxIstep )
+ {
+ TRACFCOMP(g_trac_initsvc, "doIstep: Executing CXX testcases!");
+ uint32_t l_status = SHUTDOWN_STATUS_GOOD;
+
+ // - Run CXX testcases
+ err = INITSERVICE::executeUnitTests();
+ if(err)
+ {
+ errlCommit (err, INITSVC_COMP_ID);
+ l_status = SHUTDOWN_STATUS_UT_FAILED;
+ }
+
+ // - Call shutdown using payload base, and payload entry.
+ // NOTE: this call will not return if successful.
+ TARGETING::Target* l_pSys = NULL;
+ TARGETING::targetService().getTopLevelTarget( l_pSys );
+ uint64_t payloadBase =
+ l_pSys->getAttr<TARGETING::ATTR_PAYLOAD_BASE>();
+ payloadBase = (payloadBase * MEGABYTE);
+ uint64_t payloadEntry =
+ l_pSys->getAttr<TARGETING::ATTR_PAYLOAD_ENTRY>();
+ INITSERVICE::doShutdown( l_status,
+ false,
+ payloadBase,
+ payloadEntry );
+ }
+#endif
+
} while (0); // if there was an error break here
if (!err && theStep)
diff --git a/src/usr/runtime/test/hdatservicetest.H b/src/usr/runtime/test/hdatservicetest.H
index cfd70ddfb..0fff39e5b 100644
--- a/src/usr/runtime/test/hdatservicetest.H
+++ b/src/usr/runtime/test/hdatservicetest.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,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. */
@@ -38,6 +40,7 @@
#include "../hdatstructs.H"
#include "../errlud_hdat.H"
#include <runtime/runtime_reasoncodes.H>
+#include <vfs/vfs.H>
/*
* To test with a custom HDAT do the following:
@@ -441,6 +444,42 @@ class HdatServiceTest: public CxxTest::TestSuite
#endif
}
+ // Handle the case where we are running the testcases before the
+ // libruntime.so module has been loaded
+ bool iv_loaded_libruntime;
+
+ HdatServiceTest()
+ : CxxTest::TestSuite(), iv_loaded_libruntime(false)
+ {
+ // Need to load up the runtime module if it isn't already loaded
+ if ( !VFS::module_is_loaded( "libruntime.so" ) )
+ {
+ errlHndl_t errhdl = VFS::module_load( "libruntime.so" );
+ if ( errhdl )
+ {
+ TS_FAIL("HdatServiceTest> Failed to load libruntime.so");
+ errlCommit(errhdl,RUNTIME_COMP_ID);
+ }
+ else
+ {
+ iv_loaded_libruntime = true;
+ }
+ }
+ }
+
+ ~HdatServiceTest()
+ {
+ if( iv_loaded_libruntime )
+ {
+ errlHndl_t errhdl = VFS::module_unload( "libruntime.so" );
+ if ( errhdl )
+ {
+ TS_FAIL("HdatServiceTest> Failed to unload libruntime.so");
+ errlCommit(errhdl,RUNTIME_COMP_ID);
+ }
+ }
+ }
+
};
diff --git a/src/usr/runtime/test/makefile b/src/usr/runtime/test/makefile
index b948c1a16..a5fec043d 100644
--- a/src/usr/runtime/test/makefile
+++ b/src/usr/runtime/test/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2012,2018
+# Contributors Listed Below - COPYRIGHT 2012,2019
# [+] International Business Machines Corp.
#
#
@@ -24,7 +24,7 @@
# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
MODULE = testruntime
-TESTS += testpreverifiedlidmgr.H
+TESTS += $(if $(CONFIG_EARLY_TESTCASES),,testpreverifiedlidmgr.H)
TESTS += test_checkHbResMemLimit.H
#@TODO RTC 132750
#TESTS += hdatservicetest.H
diff --git a/src/usr/runtime/test/test_checkHbResMemLimit.H b/src/usr/runtime/test/test_checkHbResMemLimit.H
index e2ab9ca41..234f26426 100644
--- a/src/usr/runtime/test/test_checkHbResMemLimit.H
+++ b/src/usr/runtime/test/test_checkHbResMemLimit.H
@@ -32,6 +32,7 @@
#include <runtime/interface.h>
#include <runtime/runtime_reasoncodes.H>
#include <vmmconst.h>
+#include <vfs/vfs.H>
extern trace_desc_t* g_trac_runtime;
@@ -151,6 +152,43 @@ public:
}while(0);
TRACFCOMP(g_trac_runtime, "testAddressBelowHbResMemRange finished");
}
+
+
+ // Handle the case where we are running the testcases before the
+ // libruntime.so module has been loaded
+ bool iv_loaded_libruntime;
+
+ CheckHbResMemLimitTest()
+ : CxxTest::TestSuite(), iv_loaded_libruntime(false)
+ {
+ // Need to load up the runtime module if it isn't already loaded
+ if ( !VFS::module_is_loaded( "libruntime.so" ) )
+ {
+ errlHndl_t errhdl = VFS::module_load( "libruntime.so" );
+ if ( errhdl )
+ {
+ TS_FAIL("CheckHbResMemLimitTest> Failed to load libruntime.so");
+ errlCommit(errhdl,RUNTIME_COMP_ID);
+ }
+ else
+ {
+ iv_loaded_libruntime = true;
+ }
+ }
+ }
+
+ ~CheckHbResMemLimitTest()
+ {
+ if( iv_loaded_libruntime )
+ {
+ errlHndl_t errhdl = VFS::module_unload( "libruntime.so" );
+ if ( errhdl )
+ {
+ TS_FAIL("CheckHbResMemLimitTest> Failed to unload libruntime.so");
+ errlCommit(errhdl,RUNTIME_COMP_ID);
+ }
+ }
+ }
};
diff --git a/src/usr/runtime/test/testpreverifiedlidmgr.H b/src/usr/runtime/test/testpreverifiedlidmgr.H
index 78fcbd95c..7b47bf98f 100644
--- a/src/usr/runtime/test/testpreverifiedlidmgr.H
+++ b/src/usr/runtime/test/testpreverifiedlidmgr.H
@@ -33,6 +33,7 @@
#include <runtime/populate_hbruntime.H>
#include <pnor/pnorif.H>
#include <runtime/common/runtime_utils.H>
+#include <vfs/vfs.H>
extern trace_desc_t* g_trac_runtime;
@@ -138,6 +139,42 @@ class PreVerifiedLidMgrTest : public CxxTest::TestSuite
TRACFCOMP( g_trac_runtime, EXIT_MRK"testLoadFromPnor complete" );
}
+
+ // Handle the case where we are running the testcases before the
+ // libruntime.so module has been loaded
+ bool iv_loaded_libruntime;
+
+ PreVerifiedLidMgrTest()
+ : CxxTest::TestSuite(), iv_loaded_libruntime(false)
+ {
+ // Need to load up the runtime module if it isn't already loaded
+ if ( !VFS::module_is_loaded( "libruntime.so" ) )
+ {
+ errlHndl_t errhdl = VFS::module_load( "libruntime.so" );
+ if ( errhdl )
+ {
+ TS_FAIL("PreVerifiedLidMgrTest> Failed to load libruntime.so");
+ errlCommit(errhdl,RUNTIME_COMP_ID);
+ }
+ else
+ {
+ iv_loaded_libruntime = true;
+ }
+ }
+ }
+
+ ~PreVerifiedLidMgrTest()
+ {
+ if( iv_loaded_libruntime )
+ {
+ errlHndl_t errhdl = VFS::module_unload( "libruntime.so" );
+ if ( errhdl )
+ {
+ TS_FAIL("PreVerifiedLidMgrTest> Failed to unload libruntime.so");
+ errlCommit(errhdl,RUNTIME_COMP_ID);
+ }
+ }
+ }
};
#endif
diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
index c0cd729ed..89fad2f17 100755
--- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
@@ -175,6 +175,23 @@
</attribute>
<attribute>
+ <id>EARLY_TESTCASES_ISTEP</id>
+ <description>
+ Indicates which istep we should execute the CXX testcases after, if
+ CONFIG_EARLY_TESTCASES is set.
+ Format: 0xMMmm, where MM=major step, mm=minor step, e.g. 6.9=0x0609.
+ </description>
+ <simpleType>
+ <uint16_t>
+ <!-- Default to running as soon as Hostboot is able -->
+ <default>0x0609</default>
+ </uint16_t>
+ </simpleType>
+ <persistency>non-volatile</persistency>
+ <readable/>
+ </attribute>
+
+ <attribute>
<id>EEPROM_PAGE_ARRAY</id>
<description>
Used to keep track of which EEPROM page the current I2C master bus is set to
diff --git a/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml b/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml
index 124c0b13a..58ddcf9bd 100644
--- a/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml
+++ b/src/usr/targeting/common/xmltohb/simics_AXONE.system.xml
@@ -343,6 +343,10 @@
<id>X_EREPAIR_THRESHOLD_MNFG</id>
<default>0</default>
</attribute>
+ <attribute>
+ <id>EARLY_TESTCASES_ISTEP</id>
+ <default>0x0609</default>
+ </attribute>
</targetInstance>
<!-- ===================================================================== -->
diff --git a/src/usr/targeting/common/xmltohb/target_types_hb.xml b/src/usr/targeting/common/xmltohb/target_types_hb.xml
index a9cd859be..713eb7aa9 100644
--- a/src/usr/targeting/common/xmltohb/target_types_hb.xml
+++ b/src/usr/targeting/common/xmltohb/target_types_hb.xml
@@ -268,6 +268,9 @@
<id>DRTM_PAYLOAD_ADDR_MB_HB</id>
</attribute>
<attribute>
+ <id>EARLY_TESTCASES_ISTEP</id>
+ </attribute>
+ <attribute>
<id>FORCE_PRE_PAYLOAD_DRTM</id>
</attribute>
<attribute>
diff --git a/src/usr/util/test/makefile b/src/usr/util/test/makefile
index e6c4c69f8..43242d9dc 100644
--- a/src/usr/util/test/makefile
+++ b/src/usr/util/test/makefile
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2012,2014
+# Contributors Listed Below - COPYRIGHT 2012,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.
@@ -24,7 +26,10 @@ ROOTPATH = ../../../..
MODULE = testutil
-TESTS = *.H
+TESTS += $(if $(CONFIG_EARLY_TESTCASES),,testmclmgr.H)
+TESTS += $(if $(CONFIG_EARLY_TESTCASES),,testtcemgr.H)
+TESTS += $(if $(CONFIG_EARLY_TESTCASES),,testlidmgr.H)
+TESTS += threadpool.H
include ${ROOTPATH}/config.mk
diff --git a/src/usr/util/test/testlidmgr.H b/src/usr/util/test/testlidmgr.H
index 1644b1432..74342824c 100644
--- a/src/usr/util/test/testlidmgr.H
+++ b/src/usr/util/test/testlidmgr.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2017 */
+/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -47,6 +47,7 @@ public:
*/
void testLidInPnorTest(void)
{
+ UTIL_FT(INFO_MRK"testLidInPnorTest> Begin");
errlHndl_t l_errl = NULL;
size_t l_lidSize = 0;
UtilLidMgr l_lidMgr(Util::TEST_LIDID);
@@ -129,6 +130,7 @@ public:
}
delete[] l_ptrTest;
}while(0);
+ UTIL_FT(INFO_MRK"testLidInPnorTest> End");
}
/**
@@ -137,6 +139,7 @@ public:
*/
void testLidInPnorOcc(void)
{
+ UTIL_FT(INFO_MRK"testLidInPnorOcc> Begin");
errlHndl_t l_errl = NULL;
do
@@ -217,6 +220,7 @@ public:
TS_FAIL("testLidInPnorOcc: failed to release lid from PNOR");
}
}while(0);
+ UTIL_FT(INFO_MRK"testLidInPnorOcc> End");
}
};
diff --git a/src/usr/util/test/testmclmgr.H b/src/usr/util/test/testmclmgr.H
index 97c606a9d..b3398e165 100644
--- a/src/usr/util/test/testmclmgr.H
+++ b/src/usr/util/test/testmclmgr.H
@@ -33,6 +33,7 @@
#include <usr/vmmconst.h>
#include <runtime/preverifiedlidmgr.H>
#include <util/util_reasoncodes.H>
+#include <util/utillidmgr.H>
namespace MCL
{
@@ -389,4 +390,4 @@ public:
}
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/usr/xscom/test/xscomtest.H b/src/usr/xscom/test/xscomtest.H
index 5bf9eaadd..2bb30ac12 100644
--- a/src/usr/xscom/test/xscomtest.H
+++ b/src/usr/xscom/test/xscomtest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -404,6 +404,11 @@ public:
uint32_t l_num;
do {
+#ifdef CONFIG_EARLY_TESTCASES
+ TS_TRACE("testXscom4: Skipping test, multicast groups not setup yet");
+ break;
+#endif
+
// Loop thru write table
for( l_num=0; l_num < g_xscomMultiWriteTableSz; l_num++)
{
@@ -459,7 +464,7 @@ public:
if( l_readData != l_testEntry.data )
{
- TS_FAIL("testXscom4: XSCom multicast read back doesn't match write!");
+ TS_FAIL("testXscom4: XSCom multicast read back doesn't match write for %.8X!", l_testEntry.addr);
/*@
* @errortype
* @moduleid XSCOM::XSCOM_TEST_XSCOM4
OpenPOWER on IntegriCloud