diff options
author | CamVan Nguyen <ctnguyen@us.ibm.com> | 2011-10-24 16:11:42 -0500 |
---|---|---|
committer | CAMVAN T. NGUYEN <ctnguyen@us.ibm.com> | 2011-10-27 16:58:16 -0500 |
commit | 7e2d025969d46a4f6fe1dab6e4c40061ce8e6fec (patch) | |
tree | 392ebe5669c1e7e1b7d93be212693f5fae88de4d /src/include/usr/hwpf | |
parent | 9e86b070a4429e7db34a5438611a67098ab92dfb (diff) | |
download | talos-hostboot-7e2d025969d46a4f6fe1dab6e4c40061ce8e6fec.tar.gz talos-hostboot-7e2d025969d46a4f6fe1dab6e4c40061ce8e6fec.zip |
Added Hwp to execute initfiles
Change-Id: Ie597c23eadc51b7463487eff9316a30ad04d88e5
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/455
Tested-by: Jenkins Server
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwpf')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiAttributeService.H | 4 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiUtil.H | 38 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/fapiHwpExecInitFile.H | 113 |
3 files changed, 154 insertions, 1 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiAttributeService.H b/src/include/usr/hwpf/fapi/fapiAttributeService.H index e623a2e8a..bffe0341b 100644 --- a/src/include/usr/hwpf/fapi/fapiAttributeService.H +++ b/src/include/usr/hwpf/fapi/fapiAttributeService.H @@ -37,6 +37,8 @@ * mjjones 09/06/2011 Remove support for strings * mjjones 09/22/2011 Fixed example * mjjones 10/13/2011 Added fapiGetInitFileAttr + * camvanng 10/20/2011 Changed i_pTarget to "const" + * ptr */ #ifndef FAPIATTRIBUTESERVICE_H_ @@ -102,7 +104,7 @@ namespace fapi * @return ReturnCode. Zero if success */ ReturnCode fapiGetInitFileAttr(const AttributeId i_id, - Target * i_pTarget, + const Target * i_pTarget, uint64_t & o_val, const uint32_t i_arrayIndex1 = 0, const uint32_t i_arrayIndex2 = 0, diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H index e3a3b9f3a..e3033dc9a 100644 --- a/src/include/usr/hwpf/fapi/fapiUtil.H +++ b/src/include/usr/hwpf/fapi/fapiUtil.H @@ -38,6 +38,8 @@ * mjjones 09/14/2011 Prepended fapi to delay * mjjones 10/05/2011 Added fapiCheckType * mjjones 10/13/2011 Added extern "C" to functions + * camvanng 10/14/2011 Added fapiLoadInitFile & + * fapiUnloadInitFile */ #ifndef FAPIUTIL_H_ @@ -128,6 +130,42 @@ bool platIsScanTraceEnabled(); */ void platSetScanTrace(bool i_enable); +/** @brief Load the initfile + * + * This function can be called by a HWP to load an initfile. + * + * @note Implemented by platform code. Platform code is + * responsible for allocating any memory needed to load + * the initfile. + * + * @param[in] the .if filename: <initfile>.if + * @param[out] address in memory where initfile is loaded + * @param[out] size of memory allocated for initfile + * + * @return ReturnCode. Zero on success, else platform specified error. + */ + +fapi::ReturnCode fapiLoadInitFile(const char * i_file, const char *& o_addr, + size_t & o_size); + +/** @brief Unload the initfile + * + * This function can be called by a HWP to unload an initfile. + * + * @note Implemented by platform code. Platform code is + * responsible for deleting any allocated memory. + * + * @param[in] the .if filename: <initfile>.if + * @param[in,out] address in memory where initfile is loaded + * set to NULL on exit + * @param[in,out] size of memory allocated for initfile + * set to 0 on exit + * + * @return ReturnCode. Zero on success, else platform specified error. + */ +fapi::ReturnCode fapiUnloadInitFile(const char * i_file, const char *& io_addr, + size_t & io_size); + } namespace fapi diff --git a/src/include/usr/hwpf/hwp/fapiHwpExecInitFile.H b/src/include/usr/hwpf/hwp/fapiHwpExecInitFile.H new file mode 100644 index 000000000..7954f15cf --- /dev/null +++ b/src/include/usr/hwpf/hwp/fapiHwpExecInitFile.H @@ -0,0 +1,113 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwpf/hwp/fapiTestHwp.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 fapiHwpExecInitFile.H + * + * @brief Defines for Hardware Procedure initfile execution + */ + +/* + * Change Log ****************************************************************** + * Flag Defect/Feature User Date Description + * ------ -------------- ---------- ----------- ---------------------------- + * camvanng 09/29/2011 Created. + * + */ + +#ifndef FAPIHWPEXECINITFILE_H_ +#define FAPIHWPEXECINITFILE_H_ + +#include <fapi.H> + +// HWPs are defined as C functions because platforms may wish to package them +// in linux shared libraries which are DL-Opened +extern "C" +{ + +/** + * @brief Enumeration of RPN ops + */ +enum IfRpnOp +{ + AND = 0x00000001, + OR = 0x00000002, + NOT = 0x00000003, + EQ = 0x00000004, + NE = 0x00000005, + GT = 0x00000006, + GE = 0x00000007, + LT = 0x00000008, + LE = 0x00000009, + PLUS = 0x0000000A, + MINUS = 0x0000000B, + MULT = 0x0000000C, + DIVIDE = 0x0000000D, + MOD = 0x0000000E, + LIST = 0x0000000F, + SHIFTLEFT = 0x00000010, + SHIFTRIGHT = 0x00000011, + FALSE_OP = 0x00000012, + TRUE_OP = 0x00000013, + PUSH_MASK = 0x000000C0, + OP_MASK = 0x000000FF +}; + +/** + * @brief Enumeration of Type Mask + */ +enum IfTypeMask +{ + IF_LIT_TYPE = 0x4000, + IF_VAR_TYPE = 0x8000, + IF_NUM_TYPE = 0xC000, + IF_TYPE_MASK = 0xC000, +}; + +/** + * @brief Enumeration of Attribute types + */ +enum IfAttrType +{ + SYM_ATTR_UINT8_TYPE = 0x00, + SYM_ATTR_UINT32_TYPE = 0x01, + SYM_ATTR_UINT64_TYPE = 0x02, + SYM_ATTR_UINT8_ARRAY_TYPE = 0x03, + SYM_ATTR_UINT32_ARRAY_TYPE = 0x04, + SYM_ATTR_UINT64_ARRAY_TYPE = 0x05, +}; + + + +/** +* @brief HWP to execute an initfile. +* +* @param[in] i_chip Reference to target chip +* @param[in] i_file filename of binary initfile +* +* @return ReturnCode +*/ +fapi::ReturnCode hwpExecInitFile(const fapi::Target & i_chip, const char * i_file); + +} // extern "C" + +#endif // FAPIHWPEXECINITFILE_H_ |