diff options
Diffstat (limited to 'src/include/usr/hwas')
-rw-r--r-- | src/include/usr/hwas/deconfigGard.H | 12 | ||||
-rw-r--r-- | src/include/usr/hwas/hwas.H | 136 | ||||
-rw-r--r-- | src/include/usr/hwas/hwasCommon.H | 75 | ||||
-rw-r--r-- | src/include/usr/hwas/plat/hostbootIstep.H | 80 | ||||
-rw-r--r-- | src/include/usr/hwas/plat/hwasPlatTrace.H | 50 |
5 files changed, 249 insertions, 104 deletions
diff --git a/src/include/usr/hwas/deconfigGard.H b/src/include/usr/hwas/deconfigGard.H index c3254f50a..4a7b1cd3c 100644 --- a/src/include/usr/hwas/deconfigGard.H +++ b/src/include/usr/hwas/deconfigGard.H @@ -42,6 +42,18 @@ namespace HWAS { /** + * @brief collectGard Common HWAS function to collect the GARD info + * + * It will call into hwas platform-specific functions. + * + * @param none + * + * @return errlHndl_t valid errlHndl_t handle if there was an error + * NULL if no errors; + */ +errlHndl_t collectGard(); + +/** * @brief Returns a reference to the DeconfigGard singleton. */ class DeconfigGard; diff --git a/src/include/usr/hwas/hwas.H b/src/include/usr/hwas/hwas.H index e8e0a6a16..8d5c7fbb6 100644 --- a/src/include/usr/hwas/hwas.H +++ b/src/include/usr/hwas/hwas.H @@ -38,114 +38,42 @@ /******************************************************************************/ // Includes /******************************************************************************/ -#include <stdint.h> +#include <stdint.h> +#include <errl/errlentry.H> - -namespace HWAS +namespace HWAS { - /* - * @brief init_target_states - * - * Currently the state of every target is held in one bitmapped attribute - * called HWAS_STATE. - * - * This routine will walk through all the targets and initialize HWAS STATE - * to a known default value. This is useful if the developer wishes to - * clean everything up to an known state - as such it is the very first - * istep to run. - * - * Currently everything is initialized to to powered off, etc. - init_fsi - * and apply_fsi_info (the next isteps) will change this almost immediately. - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - * - */ - void init_target_states( void *io_pArgs ); - - /** - * @brief init_fsi - * - * Call into the fsi component to "walk the bus" and collect information - * on the hardware configuration. - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - */ - void init_fsi( void *io_pArgs ); - - /** - * @brief apply_fsi_info - * - * Call into the FSI Component, read the hardware information, and apply - * it to the target states. - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - */ - void apply_fsi_info( void *io_pArgs ); - - /** - * @brief apply_dd_presence - * - * Iterate over all targets and apply presence detect information to the - * target states. - * TBD - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - */ - void apply_dd_presence( void *io_pArgs ); - - /** - * @brief apply_pr_keyword_data - * - * TBD - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - * - */ - void apply_pr_keyword_data( void *io_pArgs ); - /** - * @brief apply_partial bad - * - * Collect Partial Bad information and apply it to the target states. - * TBD - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - */ - void apply_partial_bad( void *io_pArgs ); - - /** - * @brief apply_gard - * - * Collect GARD information and apply it to the target states. - * TBD - * - * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, - * or NULL. - * return none - */ - 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 ); +/** + * @brief initHardware Common HWAS function to setup the hardware + * + * It will call into the hwas platform-specific platInitHardware() + * function to init the FSI hardware. + * + * @param none + * + * @return errlHndl_t valid errlHndl_t handle if there was an error + * NULL if no errors; + */ +errlHndl_t initHardware(); +/** + * @brief discoverTagets Common HWAS function to build targeting + * + * This routine will walk through all the targets and initialize HWAS STATE + * to a known default value (powered off, etc.) + * + * Then call into the hwas platform-specific platPresenceDetect() function + * to read the hardware information, and apply it to the target states, + * and call into the hwas platform-specifiction platReadIDEC() function + * to get and set the ChipID and EC values. + * + * @param none + * + * @return errlHndl_t valid errlHndl_t handle if there was an error + * NULL if no errors; + */ +errlHndl_t discoverTargets(); }; // end namespace diff --git a/src/include/usr/hwas/hwasCommon.H b/src/include/usr/hwas/hwasCommon.H new file mode 100644 index 000000000..100113827 --- /dev/null +++ b/src/include/usr/hwas/hwasCommon.H @@ -0,0 +1,75 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwas/hwasCommon.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// 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 hwasCommon.H + * + * @brief Notes the HWAS common functions and the HWAS platform-specific + * interfaces that need to be defined and implemented. + */ + +#ifndef HWASCOMMON_H_ +#define HWASCOMMON_H_ + +// 'system' headers +#include <stdint.h> +#include <errl/errlentry.H> +#include <targeting/target.H> +#include <targeting/targetservice.H> + +// platform specific headers + +// following file needs to do +// #define HWAS_DBG(_fmt_, _args_...) +// #define HWAS_ERR(_fmt_, _args_...) +#include <hwasPlatTrace.H> + +namespace HWAS +{ + +/** + * @brief platform specific code to determine if the targets in the + * input list are present or not. If the target is NOT present, + * target should be erased from the list + * + * @param[in] io_targets TargetHandleList of targets to check for presence + * + * @return errlHndl_t valid errlHndl_t handle if there was an error + * NULL if no errors; + */ +errlHndl_t platPresenceDetect(TARGETING::TargetHandleList &io_targets); + +/** + * @brief platform specific code to determine the ID/EC of the targets + * in the input list. The platform specific code is responsible for setting + * the ATTR_EC and ATTR_CHIP_ID in each target. + * + * @param[in] i_targets TargetHandleList of targets to check for chip ID/EC + * + * @return errlHndl_t valid errlHndl_t handle if there was an error + * NULL if no errors; + */ +errlHndl_t platReadIDEC(const TARGETING::TargetHandleList &i_targets); + +} // namespace HWAS + +#endif // HWASCOMMON_H_ diff --git a/src/include/usr/hwas/plat/hostbootIstep.H b/src/include/usr/hwas/plat/hostbootIstep.H new file mode 100644 index 000000000..39c490f8a --- /dev/null +++ b/src/include/usr/hwas/plat/hostbootIstep.H @@ -0,0 +1,80 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwas/plat/hostbootIstep.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// 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 hostbootIstep.H + * + * @brief Defines hostboot functions that get called by the istep dispatcher + * and call into the HWAS common interface + */ + +#ifndef HOSTBOOTISTEP_H_ +#define HOSTBOOTISTEP_H_ + +namespace HWAS +{ + +// hostboot only functions that are called by the istep dispatcher +// and then call the HWAS common functions + +/** + * @brief host_init_fsi Setup the FSI links to slave chips + * + * Call into the hwas platform-specific initHardware() function + * to init the FSI hardware. + * + * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, + * or NULL. + * return none + */ +void host_init_fsi( void *io_pArgs ); + +/** + * @brief host_discover_targets Builds targeting + * + * This routine will walk through all the targets and initialize HWAS STATE + * to a known default value. + * + * Currently everything is initialized to powered off, etc. + * + * Call into the hwas platform-specific presenceDetect() function to + * read the hardware information, and apply it to the target states. + * + * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, + * or NULL. + * return none + */ +void host_discover_targets( void *io_pArgs ); + +/** + * @brief host_gard Do Gard + * + * Collect GARD information and apply it to the target states. + * + * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, + * or NULL. + * return none + */ +void host_gard( void *io_pArgs ); + +} // namespace HWAS +#endif // HOSTBOOTISTEP_H_ diff --git a/src/include/usr/hwas/plat/hwasPlatTrace.H b/src/include/usr/hwas/plat/hwasPlatTrace.H new file mode 100644 index 000000000..0dc3d36b2 --- /dev/null +++ b/src/include/usr/hwas/plat/hwasPlatTrace.H @@ -0,0 +1,50 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwas/plat/hwasPlatTrace.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// 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 hwasPlatTrace.H + * + * @brief Defines platform interfaces and whatnot needed for trace in the + * HWAS common and platform specific functions + */ + +#ifndef HWASPLATTRACE_H_ +#define HWASPLATTRACE_H_ + +#include <trace/interface.H> +#include <errl/errlentry.H> + +//****************************************************************************** +// Trace descriptors that are defined in a C file +//****************************************************************************** +extern trace_desc_t *g_trac_dbg_hwas; // debug - fast +extern trace_desc_t *g_trac_imp_hwas; // important - slow + +// Debug traces (go into fast trace buffer that can wrap often) +#define HWAS_DBG(_fmt_, _args_...) \ + TRACDCOMP(g_trac_dbg_hwas, TRACE_FILENAME _fmt_, ##_args_) + +// Error traces (go into slow trace buffer that should not wrap often) +#define HWAS_ERR(_fmt_, _args_...) \ + TRACFCOMP(g_trac_imp_hwas, TRACE_FILENAME _fmt_, ##_args_) + +#endif // HWASPLATTRACE_H_ |