diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2019-02-11 11:47:13 -0600 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2019-02-28 09:51:50 -0600 |
commit | 7c0b8df175832b8ffb7510977283c0c390be9c8c (patch) | |
tree | 643df1eae00336f48392d36e2a7e40250831ad4c /src/usr/initservice | |
parent | cbea08dbf1b3609db30637d554f5cb47897f034f (diff) | |
download | talos-hostboot-7c0b8df175832b8ffb7510977283c0c390be9c8c.tar.gz talos-hostboot-7c0b8df175832b8ffb7510977283c0c390be9c8c.zip |
Method to execute testcases early in the boot
A new CONFIG variable has been created that will trigger the
istep dispatcher to start the CXX unit test execution at some
point during the boot rather than waiting until the end. This
is useful for quick targeted testing and also for early bringup
of new platforms.
CONFIG_EARLY_TESTCASES is the new flag, and it uses
ATTR_EARLY_TESTCASES_ISTEP to determine where in the boot to stop.
Changes were required in several testcases to either skip the
test completely (typically due to not having enough memory) or
to add additional logic to load new support libraries on demand.
The Axone platform has this flag enabled by default to execute
testcases at the end of istep 6.9 (host_gard).
Change-Id: I1da9479e2147d68102f44d60e064c3b79cc41bb6
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71693
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: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/initservice')
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 41 |
1 files changed, 39 insertions, 2 deletions
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) |