diff options
-rw-r--r-- | src/include/usr/hwas/hwas.H | 9 | ||||
-rw-r--r-- | src/include/usr/initservice/initsvcreasoncodes.H | 1 | ||||
-rw-r--r-- | src/include/usr/isteps/istep4list.H | 9 | ||||
-rw-r--r-- | src/include/usr/isteps/istepmasterlist.H | 3 | ||||
-rw-r--r-- | src/usr/hwas/makefile | 8 | ||||
-rw-r--r-- | src/usr/hwas/testHWP.C | 95 |
6 files changed, 123 insertions, 2 deletions
diff --git a/src/include/usr/hwas/hwas.H b/src/include/usr/hwas/hwas.H index b053bc843..883de2dd0 100644 --- a/src/include/usr/hwas/hwas.H +++ b/src/include/usr/hwas/hwas.H @@ -132,6 +132,15 @@ namespace HWAS */ void apply_gard( void *io_pArgs ); + /** + * @brief testHWP + * + * test Hardware procedure. Althought this is called a test, we want it + * to run even in non-test builds. Thus it is added here at the end of + * HWAS inititialization. + */ + void testHWP( void * io_pArgs ); + }; // end namespace diff --git a/src/include/usr/initservice/initsvcreasoncodes.H b/src/include/usr/initservice/initsvcreasoncodes.H index 52c58d669..1f13850ea 100644 --- a/src/include/usr/initservice/initsvcreasoncodes.H +++ b/src/include/usr/initservice/initsvcreasoncodes.H @@ -93,6 +93,7 @@ enum InitServiceModuleID HWAS_6_ERRL_ID, HWAS_7_ERRL_ID, HWAS_8_ERRL_ID, + HWAS_9_ERRL_ID, // reserve some tasks for my unit tests... START_CXXTEST_ERRL_ID = 0xf0, diff --git a/src/include/usr/isteps/istep4list.H b/src/include/usr/isteps/istep4list.H index bae45fc18..f520452ec 100644 --- a/src/include/usr/isteps/istep4list.H +++ b/src/include/usr/isteps/istep4list.H @@ -121,6 +121,15 @@ const TaskInfo g_istep4[] = { EXT_IMAGE, // Extended Module HWAS_8_ERRL_ID, // module id } + }, + { + "testHWP" , // substep name + HWAS::testHWP, // pointer to fn + { + START_FN, // task type + EXT_IMAGE, // Extended Module + HWAS_9_ERRL_ID, // module id + } } // END OF LIST! diff --git a/src/include/usr/isteps/istepmasterlist.H b/src/include/usr/isteps/istepmasterlist.H index ebdad717d..d0123d6ca 100644 --- a/src/include/usr/isteps/istepmasterlist.H +++ b/src/include/usr/isteps/istepmasterlist.H @@ -62,10 +62,11 @@ namespace INITSERVICE // initialize an array of ExtTaskInfo const ExtTaskInfo g_isteps[] = { + { NULL, 0 }, // dummy IStep 0 { NULL, 0 }, // dummy IStep 1 { NULL, 0 }, // dummy IStep 2 { NULL, 0 }, // dummy IStep 3 - INITSERVICE::g_istep4TaskList, // HWAS + INITSERVICE::g_istep4TaskList, // HWAS IStep 4 // // add further istep lists at the end. diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile index c4a596500..2542f0c39 100644 --- a/src/usr/hwas/makefile +++ b/src/usr/hwas/makefile @@ -21,9 +21,15 @@ # # IBM_PROLOG_END ROOTPATH = ../../.. + +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp + MODULE = hwas -OBJS = hwas.o +OBJS = hwas.o testHWP.o SUBDIRS=test.d diff --git a/src/usr/hwas/testHWP.C b/src/usr/hwas/testHWP.C new file mode 100644 index 000000000..ce18e1961 --- /dev/null +++ b/src/usr/hwas/testHWP.C @@ -0,0 +1,95 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/hwas/testHWP.C $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2011 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + +/** + * @file testHWP.C + * + * testHWP -this is the last substep of IStep4 (HWAS) + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include <stdint.h> +#include <stdio.h> +#include <string.h> + +#include <sys/task.h> + +#include <trace/interface.H> // trace support +#include <errl/errlentry.H> // errlHndl_t +#include <errl/errlmanager.H> +#include <initservice/taskargs.H> // task args + +// pull in stuff to run HW procedure - +// NOTE: there are extra include paths in the makefile to find the fapi +// includes: +// EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +// EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +// EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +// EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp +// + +#include <fapiTarget.H> +#include <fapiPlatHwpInvoker.H> +#include <targeting/targetservice.H> + +using namespace fapi; +using namespace TARGETING; + +namespace HWAS +{ + +/******************************************************************************/ +// Globals/Constants +/******************************************************************************/ +extern trace_desc_t *g_trac_hwas; + +void testHWP( void * io_pArgs ) +{ + TASKARGS_INIT_TASKARGS(io_pArgs); + errlHndl_t l_err = NULL; + + // Get the master processor chip + TARGETING::Target* l_pTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_pTarget); + + // Create a FAPI Target and invoke the hwpInitialTest HWP + fapi::Target l_fapiTarget(TARGET_TYPE_PROC_CHIP, + reinterpret_cast<void *> (l_pTarget)); + + FAPI_INVOKE_HWP(l_err, hwpInitialTest, l_fapiTarget); + + if (l_err) + { + TRACFCOMP( g_trac_hwas, "testHWP failed, committing errorlog"); + errlCommit(l_err); + } + + TASKARGS_WAIT_AND_ENDTASK(); +} + + +} // namespace |