summaryrefslogtreecommitdiffstats
path: root/src/usr/pore/test
diff options
context:
space:
mode:
authorVan Lee <vanlee@us.ibm.com>2012-06-27 23:12:29 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-12 09:54:20 -0500
commit8de05d745201752e69c646e2586122b5cf89b48d (patch)
tree5dddc2e2ad6f5c662708eb72481b170ec683a694 /src/usr/pore/test
parent53cc1854646f8e1b82cf94f3beec8f36ef7cd353 (diff)
downloadtalos-hostboot-8de05d745201752e69c646e2586122b5cf89b48d.tar.gz
talos-hostboot-8de05d745201752e69c646e2586122b5cf89b48d.zip
Integrate cen_sbe procedures for Grub milestone
- Enable calling istep 10 under simics with required action rules - Update Fapiporeve HWP per code review - Pick up latest poreve code and update per code review - change mba_startclocks to mem_startclocks in do_sprint to sync with HB Change-Id: Id8fb932dc8409b50d3bd04be8b99724d81c74904 RTC: 42926 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1267 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/pore/test')
-rw-r--r--src/usr/pore/test/poretest.H208
1 files changed, 5 insertions, 203 deletions
diff --git a/src/usr/pore/test/poretest.H b/src/usr/pore/test/poretest.H
index 233fabb21..bd7c3c1c8 100644
--- a/src/usr/pore/test/poretest.H
+++ b/src/usr/pore/test/poretest.H
@@ -30,225 +30,27 @@
* @brief Test case for POREVE code
*/
-#include <list>
+#include <vector>
#include <cxxtest/TestSuite.H>
#include <targeting/common/commontargeting.H>
#include <fapiPoreVeArg.H>
#include <fapiTarget.H>
#include <fapi.H>
+#include <fapiPlatHwpInvoker.H>
#include <vfs/vfs.H>
+#include <errl/errlmanager.H>
-//@todo - These two include files are to workaround
-//1. Avoid running test case in VBU
-//2. To call isSlavePresent(). Need to be removed when PD works.
-#include <fsi/fsiif.H>
-
-#define CENTAUR_SBE_PNOR_MRR 0 // Memory Relocation Register for Centaur
+#define CENTAUR_SBE_PNOR_MRR 0 // Memory Relocation Register for Centaur
using namespace TARGETING;
using namespace vsbe;
extern fapi::ReturnCode fapiPoreVe(const fapi::Target i_target,
- std::list<uint64_t> & io_sharedObjectArgs);
+ std::vector<FapiPoreVeArg *> & io_sharedObjectArgs);
class PoreTest: public CxxTest::TestSuite
{
public:
- /**
- * @brief PORE test #1
- * Run a sample procedure on Centaur
- */
- void testPore1(void)
- {
- fapi::ReturnCode l_rc = fapi::FAPI_RC_SUCCESS;
- fapi::ReturnCode l_rc2 = fapi::FAPI_RC_SUCCESS;
- bool l_unloadSbePnorImg = false;
- size_t l_sbePnorSize = 0;
- const char * l_sbePnorAddr = NULL;
- errlHndl_t l_errl = NULL;
-
- do
- {
- // Loading sbe_pnor img
- l_errl = VFS::module_load("centaur.sbe_pnor.bin");
- if (l_errl)
- {
- TS_FAIL("testPore1: Error loading centaur.sbe_pnor.bin!");
- break;
- }
- else
- {
- // Set flag to unload
- l_unloadSbePnorImg = true;
- l_errl = VFS::module_address("centaur.sbe_pnor.bin", l_sbePnorAddr, l_sbePnorSize);
- if(l_errl)
- {
- TS_FAIL("testPore1: Error getting load address of centaur.sbe_pnor.bin!");
- break;
- }
- else
- {
- char l_header[10];
- memcpy (l_header, l_sbePnorAddr, 9);
- l_header[9] = '\0';
- FAPI_INF("testPore1:Loading centaur.sbe_pnor.bin, Addr 0x%llX, Size %d, Header %s",
- l_sbePnorAddr, l_sbePnorSize, l_header);
- }
- }
-
- // ------------ Setup Centaur targets -------------------
- // Use PredicateIsFunctional to filter only functional chips
- TARGETING::PredicateIsFunctional l_isFunctional;
- // filter for functional Centaur Chips
- TARGETING::PredicateCTM l_membufChipFilter(CLASS_CHIP, TYPE_MEMBUF);
- // Declare a postfix expression widget
- TARGETING::PredicatePostfixExpr l_functionalAndMembufChipFilter;
- // is-a-membuf-chip is-functional AND
- l_functionalAndMembufChipFilter.push(&l_membufChipFilter).push(&l_isFunctional).And();
- // loop through all the targets, applying the filter, and put the results in l_pMemBufs
- TARGETING::TargetRangeFilter l_pMemBufs(
- TARGETING::targetService().begin(),
- TARGETING::targetService().end(),
- &l_functionalAndMembufChipFilter );
-
- // ------------- Setup POREVE arguments -----------------
- // Setup args
- std::list<uint64_t> myArgs;
-
- // Set FapiPoreVeOtherArg: run unlimited instructions
- FapiPoreVeOtherArg *l_otherArg =
- new FapiPoreVeOtherArg(vsbe::RUN_UNLIMITED,
- vsbe::PORE_SBE);
- // Entry point
- l_otherArg->iv_entryPoint = const_cast<char*>("pnor::_sbe_pnor_start");
- l_otherArg->iv_mrr = CENTAUR_SBE_PNOR_MRR;
- uint64_t fapiArg = reinterpret_cast<uint64_t> (l_otherArg);
- myArgs.push_back(fapiArg);
-
- // Set FapiPoreVeMemArg for pnor option, base address = 0
- uint32_t base_addr = 0;
- char* l_dataPnor = const_cast<char*>(l_sbePnorAddr);
- FapiPoreVeMemArg* l_memArg = new FapiPoreVeMemArg(ARG_PNOR,
- base_addr, l_sbePnorSize,
- static_cast<void*>(l_dataPnor));
- fapiArg = reinterpret_cast<uint64_t> (l_memArg);
- myArgs.push_back(fapiArg);
-
- // Create state argument to dump out state for debugging purpose
- FapiPoreVeStateArg *l_stateArg = new FapiPoreVeStateArg(NULL);
- l_stateArg->iv_installState = false;
- l_stateArg->iv_extractState = true;
- fapiArg = reinterpret_cast<uint64_t> (l_stateArg);
- myArgs.push_back(fapiArg);
-
-
- // Run loop on all Centaurs
- for ( ; l_pMemBufs; ++l_pMemBufs )
- {
- // Create a FAPI Target
- const TARGETING::Target* l_membuf_target = *l_pMemBufs;
- const fapi::Target l_fapiTarget(
- fapi::TARGET_TYPE_MEMBUF_CHIP,
- reinterpret_cast<void *>
- (const_cast<TARGETING::Target*>(l_membuf_target)));
-
- // Put out info on target
- FAPI_INF("testPore1: Running cen_sbe_tp_chiplet_init1 on Centaur entity path...");
- EntityPath l_path;
- l_path = l_membuf_target->getAttr<ATTR_PHYS_PATH>();
- l_path.dump();
-
- //@todo - Make sure target is present
- // Temporary hack until PD works
- if ( !FSI::isSlavePresent(l_membuf_target) )
- {
- FAPI_INF("testPore1: Skip this Centaur because it's not present");
- continue;
- }
-
- // Run the engine
- FAPI_INF("testPore1: Start VSBE engine...");
- //@todo
- //@VBU workaround - Do not run in VPO since it takes too long
- //Temporarily disable this test case in VBU because it takes too long to run.
- //Also, the image used for Centaur is only a temporary image provided by Todd to try out.
- //When we have an official Centaur sbe_pnor image, use it to create a simple one to run
- //test case.
- if ( !TARGETING::is_vpo() )
- {
- // @todo - Must comment out for now because Todd's image will fail test case
- // l_rc = fapiPoreVe(l_fapiTarget, myArgs);
- }
-
- if (l_rc != fapi::FAPI_RC_SUCCESS)
- {
- uint32_t val = l_rc;
- FAPI_INF("testPore1: Error returned from VSBE engine on this Centaur, l_rc 0x%llX",
- val);
- break;
- }
- else
- {
- FAPI_INF("testPore1: VSBE engine runs successfully on this Centaur");
- }
-
- // @todo - For now, run only on 1 Centaur to save VPO time
- break;
-
-
- } // end for l_pMemBufs
-
-
- // Freeing memory
- if (l_otherArg)
- {
- delete l_otherArg;
- l_otherArg = NULL;
- }
-
- if (l_memArg)
- {
- delete l_memArg;
- l_memArg = NULL;
- }
-
- if (l_stateArg)
- {
- delete l_stateArg;
- l_stateArg = NULL;
- }
-
-
-
- } while(0);
-
- // Unload sbe_pnor
- if (l_unloadSbePnorImg == true)
- {
- l_rc2 = fapiUnloadInitFile("centaur.sbe_pnor.bin", l_sbePnorAddr,
- l_sbePnorSize);
- if (l_rc2 != fapi::FAPI_RC_SUCCESS)
- {
- FAPI_ERR("testPore1: Error unloading centaur.sbe_pnor.bin");
- if (l_rc == fapi::FAPI_RC_SUCCESS)
- {
- l_rc = l_rc2;
- }
- }
- }
-
- // Test fail/pass
- if (l_rc != fapi::FAPI_RC_SUCCESS)
- {
- TS_FAIL("testPore1 fails! Check FAPI trace");
- }
- else
- {
- TS_TRACE("testPore1 ran successfully!");
- }
-
- return;
- }
/**
* @brief PORE test #2
OpenPOWER on IntegriCloud