diff options
author | Mike Jones <mjjones@us.ibm.com> | 2012-07-09 16:51:16 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-07-12 13:37:17 -0500 |
commit | 314fb004240afaf365d4a78e2e29ce1ae3f84081 (patch) | |
tree | 76e22a6eadce025227313d8767889f52e42a6259 /src/usr | |
parent | c71d22e87eea8c6bf0ac40e261784b2794195ba9 (diff) | |
download | talos-hostboot-314fb004240afaf365d4a78e2e29ce1ae3f84081.tar.gz talos-hostboot-314fb004240afaf365d4a78e2e29ce1ae3f84081.zip |
HWPF Attribute Support: ATTR_FUNCTIONAL
This HWPF attribute was requested by the HW team in order to query if a Target
is functional. The common_attributes.xml file will be checked into eKB. The
other code is Hostboot support.
Change-Id: I451344a2c68e5e799c3da50097f1826470c0f771
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1332
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/hwpf/hwp/common_attributes.xml | 47 | ||||
-rw-r--r-- | src/usr/hwpf/makefile | 3 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatAttributeService.C | 62 | ||||
-rw-r--r-- | src/usr/hwpf/test/hwpftest.H | 13 |
4 files changed, 124 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/common_attributes.xml b/src/usr/hwpf/hwp/common_attributes.xml new file mode 100644 index 000000000..120e7c0ba --- /dev/null +++ b/src/usr/hwpf/hwp/common_attributes.xml @@ -0,0 +1,47 @@ +<!-- IBM_PROLOG_BEGIN_TAG + This is an automatically generated prolog. + + $Source: src/usr/hwpf/hwp/common_attributes.xml $ + + 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_TAG --> +<!-- + XML file specifying HWPF attributes. + These are platInit attributes associated with multiple target types + Each execution platform must initialize. +--> + +<attributes> + <!-- ********************************************************************* --> + <attribute> + <id>ATTR_FUNCTIONAL</id> + <targetType> + TARGET_TYPE_DIMM, TARGET_TYPE_PROC_CHIP, TARGET_TYPE_MEMBUF_CHIP, + TARGET_TYPE_EX_CHIPLET, TARGET_TYPE_MBA_CHIPLET, + TARGET_TYPE_MCS_CHIPLET, TARGET_TYPE_XBUS_ENDPOINT, + TARGET_TYPE_ABUS_ENDPOINT + </targetType> + <description> + 1 if the target is functional, else 0 + Set by the platform. + </description> + <valueType>uint8</valueType> + <enum>NON_FUNCTIONAL = 0, FUNCTIONAL = 1</enum> + <platInit/> + </attribute> +</attributes> diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile index daa74a146..d3fe96988 100644 --- a/src/usr/hwpf/makefile +++ b/src/usr/hwpf/makefile @@ -52,7 +52,8 @@ HWP_ATTR_XML_FILES = hwp/memory_attributes.xml \ hwp/freq_attributes.xml \ hwp/proc_mvpd_attributes.xml \ hwp/ei_bus_attributes.xml \ - hwp/chip_ec_attributes.xml + hwp/chip_ec_attributes.xml \ + hwp/common_attributes.xml #------------------------------------------------------------------------------ # Initfiles diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C index f51ae17bb..c08da58cd 100644 --- a/src/usr/hwpf/plat/fapiPlatAttributeService.C +++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C @@ -377,6 +377,68 @@ fapi::ReturnCode fapiPlatGetTargetName(const fapi::Target * i_pTarget, return l_rc; } +//****************************************************************************** +// fapiPlatGetFunctional function +//****************************************************************************** +fapi::ReturnCode fapiPlatGetFunctional(const fapi::Target * i_pTarget, + uint8_t & o_functional) +{ + fapi::ReturnCode l_rc; + o_functional = 0; + bool l_error = false; + + // TODO. Move the checking of the FAPI Target pointer and embedded Hostboot + // Target pointer to a common function. Not doing it here because there are + // currently other changes to this file going through review. + + // Check that the FAPI Target pointer is not NULL + if (i_pTarget == NULL) + { + FAPI_ERR("fapiPlatGetFunctional. NULL FAPI Target passed"); + l_error = true; + } + else + { + // Extract the MCS Hostboot Target pointer + TARGETING::Target * l_pHbTarget = reinterpret_cast<TARGETING::Target*>( + i_pTarget->get()); + + // Check that the MCS Hostboot Target pointer is not NULL + if (l_pHbTarget == NULL) + { + FAPI_ERR("fapiPlatGetFunctional. NULL HB Target passed"); + l_error = true; + } + else + { + TARGETING::PredicateIsFunctional l_functional; + if (l_functional(l_pHbTarget)) + { + o_functional = 1; + } + } + } + + if (l_error) + { + /*@ + * @errortype + * @moduleid MOD_ATTR_GET_FUNCTIONAL + * @reasoncode RC_ATTR_BAD_TARGET_PARAM + * @devdesc Failed to get the functional state due to bad target + * parameter. + */ + errlHndl_t l_pError = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + fapi::MOD_ATTR_GET_FUNCTIONAL, + fapi::RC_ATTR_BAD_TARGET_PARAM); + l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); + } + + return l_rc; +} + + } // End platAttrSvc namespace } // End fapi namespace diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H index 7c36f26c0..25e749f70 100644 --- a/src/usr/hwpf/test/hwpftest.H +++ b/src/usr/hwpf/test/hwpftest.H @@ -483,6 +483,19 @@ public: break; } + // Test ATTR_FUNCTIONAL attribute access through FAPI + uint8_t l_functional = 0xff; + l_rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL, &l_fapiTarget, l_functional); + if (l_rc != fapi::FAPI_RC_SUCCESS) + { + TS_FAIL("testHwpf5: ATTR_FUNCTIONAL. Error from GET"); + break; + } + else + { + FAPI_INF("testHwpf5: Master chip ATTR_FUNCTIONAL: %d", l_functional); + } + //printk("EC = %d\n", l_EC_R); /* |