diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2011-09-08 00:06:56 -0500 |
---|---|---|
committer | Nicholas E. Bofferding <bofferdn@us.ibm.com> | 2011-09-19 13:18:30 -0500 |
commit | b08159eb20f2a0ccfe2d654f56a6fe2079bec98e (patch) | |
tree | 5248e5cea65eff0ba758ed5d50bad1b26884e883 /src/include/usr/hwpf | |
parent | ea37c1fc02819175e8ede86718a3afc904c723bc (diff) | |
download | talos-hostboot-b08159eb20f2a0ccfe2d654f56a6fe2079bec98e.tar.gz talos-hostboot-b08159eb20f2a0ccfe2d654f56a6fe2079bec98e.zip |
Implement support for generating the PNOR targeting image
- Generate PNOR targeting image as part of the build process
- Load it into SIMICS physical memory
- Access image from targeting service at correct virtual address
- Bridge fapi attributes to host boot attributes using direct macro
- Support multidimensional arrays for simple attributes
- Removed support for fake PNOR image
Change-Id: I45d986d69397940a165c850d0db0fdeccd137d4d
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/341
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwpf')
-rwxr-xr-x | src/include/usr/hwpf/plat/fapiPlatAttributeService.H | 84 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatReasonCodes.H | 18 |
2 files changed, 94 insertions, 8 deletions
diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H index f1bd94133..3d38d0e79 100755 --- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H +++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H @@ -34,11 +34,95 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 06/27/2011 Created. + * bofferdn 09/13/2011 Support fapi->hb mapping */ #ifndef FAPIPLATATTRIBUTESERVICE_H_ #define FAPIPLATATTRIBUTESERVICE_H_ + +//****************************************************************************** +// Includes +//****************************************************************************** + #include <stdint.h> #include <fapiAttributeIds.H> +#include <targeting/target.H> +#include <targeting/attributes.H> +#include <attributeenums.H> +#include <fapiplatattrmacros.H> +#include <hwpf/fapi/fapiReturnCode.H> +#include <hwpf/fapi/fapiTarget.H> + +//****************************************************************************** +// Interface +//****************************************************************************** + +namespace fapi +{ + +namespace platAttrSvc +{ + /** + * @brief Returns the system target + * + * @par Detailed Description: + * Returns the system target. If the target service has not been + * initialized -or- there is any failure to acquire it, the function + * will assert + * + * @return Target handle to the system target + * + * @retval !NULL An actual target handle + * @retval NULL Not possible + */ + TARGETING::Target* getSystemTarget(); + + /** + * @brief Returns a fapiReturn code containing information on an attribute + * access error + * + * @param[in] i_targAttrId Platform attribute ID + * @param[in] i_fapiAttrId FAPI attribute ID which maps to the platform + * attribute ID + * @param[in] i_pFapiTarget Pointer to the FAPI target holding the + * requested attribute + * + * @return fapiReturn code containing a platform generated error log + * + * @retval FAPI_RC_PLAT_ERR_SEE_DATA (return code value) which informs + * caller there is a host boot error log attached + */ + fapi::ReturnCode createAttrAccessError( + const TARGETING::ATTRIBUTE_ID i_targAttrId, + const fapi::AttributeId i_fapiAttrId, + const fapi::Target* i_pFapiTarget); + + /** + * @brief Macro which directly maps a FAPI request to get a platform + * attribute to the equivalent host boot request + */ + #define FAPI_PLAT_ATTR_SVC_GETMACRO_DIRECT(ID, PTARGET, VAL) \ + ( ((PTARGET) ? \ + static_cast<TARGETING::Target*>( \ + static_cast<fapi::Target*>(PTARGET)->get()) \ + : fapi::platAttrSvc::getSystemTarget())->tryGetAttr< \ + FAPI_PLAT_ATTR_SVC_MACRO_DIRECT_FAPI_##ID>(VAL)) \ + ? FAPI_RC_SUCCESS : fapi::platAttrSvc::createAttrAccessError( \ + FAPI_PLAT_ATTR_SVC_MACRO_DIRECT_FAPI_##ID,ID,PTARGET) + /** + * @brief Macro which directly maps a FAPI request to set a platform + * attribute to the equivalent host boot request + */ + #define FAPI_PLAT_ATTR_SVC_SETMACRO_DIRECT(ID, PTARGET, VAL) \ + ( ((PTARGET) ? \ + static_cast<TARGETING::Target*>( \ + static_cast<fapi::Target*>(PTARGET)->get()) \ + : fapi::platAttrSvc::getSystemTarget())->trySetAttr< \ + FAPI_PLAT_ATTR_SVC_MACRO_DIRECT_FAPI_##ID>(VAL)) \ + ? FAPI_RC_SUCCESS : fapi::platAttrSvc::createAttrAccessError( \ + FAPI_PLAT_ATTR_SVC_MACRO_DIRECT_FAPI_##ID,ID,PTARGET) +} + +} #endif // FAPIPLATATTRIBUTESERVICE_H_ diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H index 03296c7dd..25ba997bc 100644 --- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H +++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H @@ -29,18 +29,20 @@ namespace fapi { enum hwpfModuleId { - MOD_RC_TO_ERRL = 0x01, - MOD_FAPI_GET_CHILD_CHIPLETS = 0x02, - MOD_FAPI_GET_PARENT_CHIP = 0x03, + MOD_RC_TO_ERRL = 0x01, + MOD_FAPI_GET_CHILD_CHIPLETS = 0x02, + MOD_FAPI_GET_PARENT_CHIP = 0x03, + MOD_PLAT_ATTR_SVC_CREATE_ATTR_ACCESS_ERROR = 0x04, }; enum hwpfReasonCode { - 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, + 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, + RC_FAILED_TO_ACCESS_ATTRIBUTE = HWPF_COMP_ID | 0x06, }; }; |