From e59e01da049d2b864ff7cb1dd03b82e5a8a393b9 Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Tue, 13 Sep 2011 11:44:54 -0500 Subject: HWPF: Add support for new System Config Query functions Change-Id: I00220dc4a1ee4f630138d0ed87a943053a7a93d5 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/337 Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler Reviewed-by: Monte K. Copeland Reviewed-by: MIKE J. JONES --- src/include/usr/hwpf/fapi/fapiSystemConfig.H | 99 +++++++++++++------------ src/include/usr/hwpf/fapi/fapiTarget.H | 29 ++++++++ src/include/usr/hwpf/hwp/fapiTestHwpConfig.H | 59 +++++++++++++++ src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H | 1 + src/include/usr/hwpf/plat/fapiPlatReasonCodes.H | 11 ++- 5 files changed, 149 insertions(+), 50 deletions(-) create mode 100644 src/include/usr/hwpf/hwp/fapiTestHwpConfig.H (limited to 'src/include/usr/hwpf') diff --git a/src/include/usr/hwpf/fapi/fapiSystemConfig.H b/src/include/usr/hwpf/fapi/fapiSystemConfig.H index cf00fda90..5bb704661 100644 --- a/src/include/usr/hwpf/fapi/fapiSystemConfig.H +++ b/src/include/usr/hwpf/fapi/fapiSystemConfig.H @@ -27,6 +27,14 @@ * implement. It is an eCMD requirement that these be "C" functions. */ +/* + * Change Log ****************************************************************** + * Flag Defect/Feature User Date Description + * ------ -------------- ---------- ----------- ---------------------------- + * mjjones 09/12/2011 Updated with new functions. + * + */ + #ifndef FAPISYSTEMCONFIG_H_ #define FAPISYSTEMCONFIG_H_ @@ -38,57 +46,54 @@ extern "C" { -/** - * @brief Gets the functional chiplets that are children of the supplied target - * - * @param[in] i_target Parent target - * @param[in] i_targetType Type of chiplet required - * @param[out] o_chiplets Reference to vector that is filled in with the - * result chiplets - * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode GetFunctionalChiplets(const fapi::Target& i_target, - const fapi::TargetType i_chipletType, - std::vector & o_chiplets); - -/** - * @brief Gets the existing chiplets that are children of the supplied target - * - * @param[in] i_target Parent target - * @param[in] i_targetType Type of chiplet required - * @param[out] o_chiplets Reference to vector that is filled in with the - * result chiplets - * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode GetExistingChiplets(const fapi::Target& i_target, - const fapi::TargetType i_chipletType, - std::vector & o_chiplets); +/** + * @brief Gets the chiplets that are children of the input chip + * + * @param[in] i_chip Input chip + * @param[in] i_chipletType Type of chiplet required + * @param[out] o_chiplets Reference to vector that is cleared then filled in + * with the children chiplet Targets + * @param[in] i_state Only return targets of the specified state. Either + * present or functional (default) + * + * @return ReturnCode. Zero on success, else error + */ +fapi::ReturnCode fapiGetChildChiplets( + const fapi::Target & i_chip, + const fapi::TargetType i_chipletType, + std::vector & o_chiplets, + const fapi::TargetState i_state = fapi::TARGET_STATE_FUNCTIONAL); -/** - * @brief Gets the functional DIMMs that are children of the supplied target - * - * @param[in] i_target Parent target - * @param[out] o_dimms Reference to vector that is filled in with the result - * DIMMs +/** + * @brief Gets the DIMMs that are logically associated with the input target * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode GetFunctionalDimms(const fapi::Target& i_target, - std::vector & o_dimms); + * The logical association is MCS-MBS-MBA-DIMM. The input target must be a MCS, + * MBS or MBA chiplet and the output will be the associated DIMMs + * + * @param[in] i_target Input target + * @param[out] o_dimms Reference to vector that is cleared then filled in with + * the associated DIMM Targets + * @param[in] i_state Only return targets of the specified state. Either + * present or functional (default) + * + * @return ReturnCode. Zero on success, else error + */ +fapi::ReturnCode fapiGetAssociatedDimms( + const fapi::Target& i_target, + std::vector & o_dimms, + const fapi::TargetState i_state = fapi::TARGET_STATE_FUNCTIONAL); -/** - * @brief Gets the existing DIMMs that are children of the supplied target +/** + * @brief Gets the parent chip of the input chiplet * - * @param[in] i_target Parent target - * @param[out] o_dimms Reference to vector that is filled in with the result - * DIMMs - * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode GetExistingDimms(const fapi::Target& i_target, - std::vector & o_dimms); + * @param[in] i_chiplet Input chiplet + * @param[out] o_chip Reference to Target that is set to the parent chip + * + * @return ReturnCode. Zero on success, else error + */ +fapi::ReturnCode fapiGetParentChip( + const fapi::Target& i_chiplet, + fapi::Target & o_chip); } // extern "C" diff --git a/src/include/usr/hwpf/fapi/fapiTarget.H b/src/include/usr/hwpf/fapi/fapiTarget.H index 1ee28236d..7b87ffc16 100644 --- a/src/include/usr/hwpf/fapi/fapiTarget.H +++ b/src/include/usr/hwpf/fapi/fapiTarget.H @@ -35,6 +35,7 @@ * mjjones 06/29/2011 Removed incorrect MSB from 2 enums * mjjones 07/05/2011 Removed const from handle * mjjones 08/29/2011 Updated toString function + * mjjones 09/12/2011 Added isChip and isChiplet */ #ifndef FAPITARGET_H_ @@ -67,6 +68,20 @@ enum TargetType */ typedef uint32_t TargetTypes_t; +/** + * @brief Enumeration of target state values (bitmask values) + */ +enum TargetState +{ + TARGET_STATE_PRESENT = 0x00000001, + TARGET_STATE_FUNCTIONAL = 0x00000002, +}; + +/** + * @brief Typedef used when passing multiple TargetState values + */ +typedef uint32_t TargetStates_t; + /** * @brief ECMD constants */ @@ -175,6 +190,20 @@ public: */ void setType(const TargetType i_type); + /** + * @brief Returns if the target is a chip + * + * @return boolean. true if chip else fase + */ + bool isChip() const; + + /** + * @brief Returns if the target is a chiplet + * + * @return boolean. true if chiplet else fase + */ + bool isChiplet() const; + /** * @brief Convert a target to an ecmd-format target string * diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H b/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H new file mode 100644 index 000000000..4faec30ef --- /dev/null +++ b/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H @@ -0,0 +1,59 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwpf/hwp/fapiTestHwpConfig.H $ +// +// 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 fapiTestHwpConfig.H + * + * @brief Defines a Hardware Procedure that exercises the FAPI System Config + * Query functions. + */ + +/* + * Change Log ****************************************************************** + * Flag Defect/Feature User Date Description + * ------ -------------- ---------- ----------- ---------------------------- + * mjjones 09/12/2011 Created. + * + */ + +#ifndef FAPITESTHWCONFIG_H_ +#define FAPITESTHWCONFIG_H_ + +#include + +// HWPs are defined as C functions because platforms may wish to package them +// in linux shared libraries which are DL-Opened +extern "C" +{ + +/** + * @brief A simple HWP that exercises the FAPI System Config Query functions. + * + * @param[in] i_chip Reference to target processor chip + * + * @return ReturnCode + */ +fapi::ReturnCode hwpTestConfig(const fapi::Target & i_chip); + +} // extern "C" + +#endif diff --git a/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H b/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H index 85a41e2e9..f751ffaf2 100644 --- a/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H +++ b/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H @@ -37,6 +37,7 @@ #include #include #include +#include /** * @brief HWP Executor macro diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H index 124ec8171..03296c7dd 100644 --- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H +++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H @@ -29,13 +29,18 @@ namespace fapi { enum hwpfModuleId { - MOD_RC_TO_ERRL = 0x01, + MOD_RC_TO_ERRL = 0x01, + MOD_FAPI_GET_CHILD_CHIPLETS = 0x02, + MOD_FAPI_GET_PARENT_CHIP = 0x03, }; enum hwpfReasonCode { - RC_HWP_ERROR = HWPF_COMP_ID | 0x01, - RC_FAPI_ERROR = HWPF_COMP_ID | 0x02, + RC_HWP_ERROR = HWPF_COMP_ID | 0x01, + RC_FAPI_ERROR = HWPF_COMP_ID | 0x02, + RC_INVALID_REQUEST = HWPF_COMP_ID | 0x03, + RC_UNSUPPORTED_REQUEST = HWPF_COMP_ID | 0x04, + RC_NO_SINGLE_PARENT = HWPF_COMP_ID | 0x05, }; }; -- cgit v1.2.1