summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2013-01-30 16:30:42 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-08 10:34:35 -0600
commit74c20caefdab7f7aa9268dd3f359f2038cee8ccf (patch)
treeb35a48fe1ea86bf181c16a5bfbcd4a5f5d823cab
parent6261fa26ccb412df36bb9ec400e85f9cc6e9cfb9 (diff)
downloadblackbird-hostboot-74c20caefdab7f7aa9268dd3f359f2038cee8ccf.tar.gz
blackbird-hostboot-74c20caefdab7f7aa9268dd3f359f2038cee8ccf.zip
FAPI Interface to get the target on the other side of the DMI bus
Add new fapiGetOtherSideOfMemChannel function Replace getAffinityChips with more general getChildAffinityTargets and added getParentAffinityTargets to find MCS from Centaur. RTC: 61987 Change-Id: I772ef95452215c54fdfab98998507e6db5a862d0 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3062 Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/hwpf/fapi/fapiSystemConfig.H63
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatReasonCodes.H7
-rw-r--r--src/include/usr/targeting/common/utilFilter.H75
-rw-r--r--src/usr/diag/attn/attntarget.C47
-rw-r--r--src/usr/hwpf/hwp/dmi_training/dmi_training.C9
-rw-r--r--src/usr/hwpf/hwp/fapiHwpErrorInfo.xml7
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpConfig.C138
-rw-r--r--src/usr/hwpf/hwp/mc_config/mc_config.C3
-rw-r--r--src/usr/hwpf/plat/fapiPlatSystemConfig.C143
-rw-r--r--src/usr/targeting/common/utilFilter.C91
10 files changed, 412 insertions, 171 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiSystemConfig.H b/src/include/usr/hwpf/fapi/fapiSystemConfig.H
index 7c2b904ee..944eeb940 100644
--- a/src/include/usr/hwpf/fapi/fapiSystemConfig.H
+++ b/src/include/usr/hwpf/fapi/fapiSystemConfig.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwpf/fapi/fapiSystemConfig.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
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/fapi/fapiSystemConfig.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file fapiSystemConfig.H
*
@@ -48,6 +48,25 @@
extern "C"
{
+/**
+* @brief Gets the Target on the other side of the memory channel
+* - Input MEMBUF_CHIP, Output MCS_CHIPLET
+* - Input MCS_CHIPLET, Output MEMBUF_CHIP
+*
+* @param[in] i_target Input MCS_CHIPLET or MEMBUF_CHIP Target
+* @param[out] o_target Reference to Target that is set to the Target on
+* the other side of the memory channel, if there is no such
+* Target in the specified state then an error is returned
+* @param[in] i_state Only return a target in the specified state. Either
+* present or functional (default)
+*
+* @return ReturnCode. Zero on success, else error
+*/
+fapi::ReturnCode fapiGetOtherSideOfMemChannel(
+ const fapi::Target& i_target,
+ fapi::Target & o_target,
+ const fapi::TargetState i_state = fapi::TARGET_STATE_FUNCTIONAL);
+
/**
* @brief Gets the chiplets that are children of the input chip
*
diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H
index 9029a6853..9f59f79cc 100644
--- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H
+++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
/* */
/* p1 */
/* */
@@ -78,6 +78,8 @@ namespace fapi
MOD_MVPD_ACCESS = 0x27,
MOD_EXIT_CACHE_CONTAINED = 0x28,
MOD_GET_CACHE_DECONFIG = 0x29,
+ MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL = 0x2A,
+
};
/**
@@ -113,6 +115,9 @@ namespace fapi
RC_INVALID_KEYWORD = HWPF_COMP_ID | 0x22,
RC_MM_EXTEND_FAILED = HWPF_COMP_ID | 0x23,
RC_INCORRECT_KEWORD_SIZE = HWPF_COMP_ID | 0x24,
+ RC_NO_SINGLE_MCS = HWPF_COMP_ID | 0x25,
+ RC_NO_SINGLE_MEMBUFF = HWPF_COMP_ID | 0x26,
+ RC_STATE_MISMATCH = HWPF_COMP_ID | 0x27,
};
/**
diff --git a/src/include/usr/targeting/common/utilFilter.H b/src/include/usr/targeting/common/utilFilter.H
index 6f49be71f..cd0acfaab 100644
--- a/src/include/usr/targeting/common/utilFilter.H
+++ b/src/include/usr/targeting/common/utilFilter.H
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/include/usr/targeting/common/utilFilter.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_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/targeting/common/utilFilter.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TARGETING_COMMON_UTIL_FILTER_H
#define __TARGETING_COMMON_UTIL_FILTER_H
@@ -80,18 +79,36 @@ void getChildChiplets(TARGETING::TargetHandleList & o_vector,
const Target * i_chip, TYPE i_type, bool i_functional = true );
/**
- * @brief Populate the o_vector with chip target object pointers which is
- * affinity child of the input chiplet
+ * @brief Populate the o_vector with target object pointers which are
+ * affinity children of the input target
+ *
+ * @parm[out] o_vector, reference of vector of target pointers.
+ * @parm[in] i_target, the target for retrieving affinity-child targets
+ * @parm[in] i_class, the class of the target to be obtained
+ * @parm[in] i_type, the type of the target to be obtained
+ * @parm[in] i_functional, set to true to return only functional targets
+ *
+ * @return N/A
+ */
+void getChildAffinityTargets ( TARGETING::TargetHandleList& o_vector,
+ const Target * i_target, CLASS i_class, TYPE i_type,
+ bool i_functional = true );
+
+/**
+ * @brief Populate the o_vector with target object pointers which are
+ * affinity parents of the input target
*
* @parm[out] o_vector, reference of vector of target pointers.
- * @parm[in] i_chiplet, the chiplet target for retrieving affinity-child chip
- * @parm[in] i_type, the type of the chip target to be obtained
+ * @parm[in] i_target, the target for retrieving affinity-parent targets
+ * @parm[in] i_class, the class of the target to be obtained
+ * @parm[in] i_type, the type of the target to be obtained
* @parm[in] i_functional, set to true to return only functional targets
*
* @return N/A
*/
-void getAffinityChips( TARGETING::TargetHandleList& o_vector,
- const Target * i_chiplet, TYPE i_type, bool i_functional = true );
+void getParentAffinityTargets ( TARGETING::TargetHandleList& o_vector,
+ const Target * i_target, CLASS i_class, TYPE i_type,
+ bool i_functional = true );
/**
* @brief return the parent chip target of the specified input chiplet
diff --git a/src/usr/diag/attn/attntarget.C b/src/usr/diag/attn/attntarget.C
index 2cc15d79d..0826ef6de 100644
--- a/src/usr/diag/attn/attntarget.C
+++ b/src/usr/diag/attn/attntarget.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/diag/attn/attntarget.C $
- *
- * 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
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/attn/attntarget.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file attntarget.C
*
@@ -168,7 +167,7 @@ TargetHandle_t TargetServiceImpl::getMembuf(
TargetHandle_t membuf = NULL;
TargetHandleList list;
- getAffinityChips(list, i_mcs, TYPE_MEMBUF);
+ getChildAffinityTargets(list, i_mcs, CLASS_CHIP, TYPE_MEMBUF);
if(list.size() == 1)
{
diff --git a/src/usr/hwpf/hwp/dmi_training/dmi_training.C b/src/usr/hwpf/hwp/dmi_training/dmi_training.C
index 1bd2c4667..9d966470e 100644
--- a/src/usr/hwpf/hwp/dmi_training/dmi_training.C
+++ b/src/usr/hwpf/hwp/dmi_training/dmi_training.C
@@ -400,7 +400,8 @@ void* call_dmi_erepair( void *io_pArgs )
ATTR_CHIP_UNIT_type l_mcsNum = l_mcs_target->getAttr<ATTR_CHIP_UNIT>();
// find all the Centaurs that are associated with this MCS
- getAffinityChips(l_memTargetList, l_mcs_target, TYPE_MEMBUF);
+ getChildAffinityTargets(l_memTargetList, l_mcs_target,
+ CLASS_CHIP, TYPE_MEMBUF);
if(l_memTargetList.size() != EREPAIR_MAX_CENTAUR_PER_MCS)
{
@@ -822,7 +823,8 @@ void* call_proc_cen_framelock( void *io_pArgs )
// find all the Centaurs that are associated with this MCS
TARGETING::TargetHandleList l_memTargetList;
- getAffinityChips(l_memTargetList, l_mcs_target, TYPE_MEMBUF);
+ getChildAffinityTargets(l_memTargetList, l_mcs_target,
+ CLASS_CHIP, TYPE_MEMBUF);
for (TargetHandleList::const_iterator
l_mem_iter = l_memTargetList.begin();
@@ -1038,7 +1040,8 @@ void get_dmi_io_targets(TargetPairs_t& o_dmi_io_targets)
// find all the Centaurs that are associated with this MCS
TARGETING::TargetHandleList l_memTargetList;
- getAffinityChips(l_memTargetList, l_mcs_target, TYPE_MEMBUF);
+ getChildAffinityTargets(l_memTargetList, l_mcs_target,
+ CLASS_CHIP, TYPE_MEMBUF);
for ( TargetHandleList::const_iterator
l_iterMemBuf = l_memTargetList.begin();
diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
index c101ab0a3..ff91a801a 100644
--- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
+++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- IBM CONFIDENTIAL -->
<!-- -->
-<!-- COPYRIGHT International Business Machines Corp. 2011,2012 -->
+<!-- COPYRIGHT International Business Machines Corp. 2011,2013 -->
<!-- -->
<!-- p1 -->
<!-- -->
@@ -147,4 +147,9 @@
<description>HWP Attribute Unit Test failed</description>
</hwpError>
<!-- *********************************************************************** -->
+ <hwpError>
+ <rc>RC_TEST_WRONG_MCS_RETURNED</rc>
+ <description>HWP Config Unit Test returned wrong MCS for memory buffer</description>
+ </hwpError>
+ <!-- *********************************************************************** -->
</hwpErrors>
diff --git a/src/usr/hwpf/hwp/fapiTestHwpConfig.C b/src/usr/hwpf/hwp/fapiTestHwpConfig.C
index dfd290f96..f01811356 100644
--- a/src/usr/hwpf/hwp/fapiTestHwpConfig.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpConfig.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
/* */
/* p1 */
/* */
@@ -58,61 +58,91 @@ fapi::ReturnCode hwpTestConfig(const fapi::Target & i_chip)
fapi::ReturnCode l_rc;
std::vector<fapi::Target> l_targets;
- // Call fapiGetChildChiplets to get the child MCS chiplets
- l_rc = fapiGetChildChiplets(i_chip, fapi::TARGET_TYPE_MCS_CHIPLET,
+ do {
+
+ // Call fapiGetChildChiplets to get the child MCS chiplets
+ l_rc = fapiGetChildChiplets(i_chip, fapi::TARGET_TYPE_MCS_CHIPLET,
l_targets);
- if (l_rc)
- {
- FAPI_ERR("hwpTestConfig: Error from fapiGetChildChiplets");
- }
- else
- {
- FAPI_INF("hwpTestConfig: %d MCS chiplets", l_targets.size());
-
- if (l_targets.size() == 0)
- {
- FAPI_ERR("hwpTestConfig: No MCS chiplets");
- FAPI_SET_HWP_ERROR(l_rc, RC_TEST_CONFIG_NO_MCS_CHIPLETS);
- }
- else
- {
- // Save the first MCS target
- fapi::Target l_mcs = l_targets[0];
-
- // Call fapiGetAssociatedDimms to get the dimms for this MCS
- l_rc = fapiGetAssociatedDimms(l_mcs, l_targets);
-
- if (l_rc)
- {
- FAPI_ERR("hwpTestConfig: Error from fapiGetAssociatedDimms");
- }
- else
- {
- FAPI_INF("hwpTestConfig: %d dimms", l_targets.size());
-
- // Call fapiGetParentChip to get the parent of the MCS
- fapi::Target l_chip;
-
- l_rc = fapiGetParentChip(l_mcs, l_chip);
-
- if (l_rc)
- {
- FAPI_ERR("hwpTestConfig: Error from fapiGetParentChip");
- }
- else
- {
- // Check that the parent chip is is same as the input chip
- if (i_chip != l_chip)
- {
- FAPI_ERR("hwpTestConfig: Chip mismatch");
- FAPI_SET_HWP_ERROR(l_rc,
- RC_TEST_CONFIG_PARENT_CHIP_MISMATCH);
- }
- }
- }
- }
- }
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetChildChiplets");
+ break;
+ }
+
+ FAPI_INF("hwpTestConfig: %d MCS chiplets", l_targets.size());
+
+ if (l_targets.size() == 0)
+ {
+ FAPI_ERR("hwpTestConfig: No MCS chiplets");
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_CONFIG_NO_MCS_CHIPLETS);
+ break;
+ }
+
+ // Save the first MCS target
+ fapi::Target l_mcs = l_targets[0];
+
+ // Call fapiGetAssociatedDimms to get the dimms for this MCS
+ l_rc = fapiGetAssociatedDimms(l_mcs, l_targets);
+
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetAssociatedDimms");
+ break;
+ }
+
+ FAPI_INF("hwpTestConfig: %d dimms", l_targets.size());
+
+ // Call fapiGetParentChip to get the parent of the MCS
+ fapi::Target l_chip;
+
+ l_rc = fapiGetParentChip(l_mcs, l_chip);
+
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetParentChip");
+ break;
+ }
+
+ // Check that the parent chip is is same as the input chip
+ if (i_chip != l_chip)
+ {
+ FAPI_ERR("hwpTestConfig: Chip mismatch");
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_CONFIG_PARENT_CHIP_MISMATCH);
+ break;
+ }
+
+ // Call fapiGetOtherSideOfDmiBus to get mem buffer
+ fapi::Target l_mb;
+ fapi::Target l_mcs2;
+
+ FAPI_INF("hwpTestConfig: mcs: %s", l_mcs.toEcmdString());
+
+ l_rc = fapiGetOtherSideOfMemChannel(l_mcs, l_mb);
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetOtherSideOfDmiBus");
+ break;
+ }
+ FAPI_INF("hwpTestConfig: mem buf: %s", l_mb.toEcmdString());
+
+ // Call fapiGetOtherSideOfDmiBus to get back to the same mcs
+ l_rc = fapiGetOtherSideOfMemChannel(l_mb, l_mcs2);
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetOtherSideOfDmiBus");
+ break;
+ }
+ FAPI_INF("hwpTestConfig: mcs: %s", l_mcs2.toEcmdString());
+
+ if (l_mcs != l_mcs2)
+ {
+ FAPI_ERR("hwpTestConfig: fapiGetOtherSideOfDmiBus wrong mcs");
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_WRONG_MCS_RETURNED);
+ break;
+ }
+
+ } while (0);
FAPI_INF("hwpTestConfig: End HWP");
return l_rc;
diff --git a/src/usr/hwpf/hwp/mc_config/mc_config.C b/src/usr/hwpf/hwp/mc_config/mc_config.C
index f6c122256..35c2a30f3 100644
--- a/src/usr/hwpf/hwp/mc_config/mc_config.C
+++ b/src/usr/hwpf/hwp/mc_config/mc_config.C
@@ -307,7 +307,8 @@ errlHndl_t call_mss_eff_grouping()
(const_cast<TARGETING::Target*>(l_cpu_target)) );
TARGETING::TargetHandleList l_membufsList;
- getAffinityChips(l_membufsList, l_cpu_target, TYPE_MEMBUF);
+ getChildAffinityTargets(l_membufsList, l_cpu_target,
+ CLASS_CHIP, TYPE_MEMBUF);
std::vector<fapi::Target> l_associated_centaurs;
for (TargetHandleList::const_iterator
diff --git a/src/usr/hwpf/plat/fapiPlatSystemConfig.C b/src/usr/hwpf/plat/fapiPlatSystemConfig.C
index 220c6ba88..f07d0e15b 100644
--- a/src/usr/hwpf/plat/fapiPlatSystemConfig.C
+++ b/src/usr/hwpf/plat/fapiPlatSystemConfig.C
@@ -32,12 +32,155 @@
#include <fapiSystemConfig.H>
#include <fapiPlatReasonCodes.H>
#include <errl/errlentry.H>
+#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
#include <targeting/common/targetservice.H>
#include <targeting/common/predicates/predicatectm.H>
extern "C"
{
+using namespace TARGETING;
+
+//******************************************************************************
+// fapiGetOtherSideOfMemChannel function
+//******************************************************************************
+fapi::ReturnCode fapiGetOtherSideOfMemChannel(
+ const fapi::Target& i_target,
+ fapi::Target & o_target,
+ const fapi::TargetState i_state)
+{
+ fapi::ReturnCode l_rc;
+ TargetHandleList l_targetList;
+
+ FAPI_INF(ENTER_MRK "fapiGetOtherSideOfMemChannel. State: 0x%x",
+ i_state);
+ if (i_target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET)
+ {
+ TargetHandle_t l_mcs_target =
+ reinterpret_cast<TargetHandle_t>(i_target.get());
+
+ // find the Centaur that is associated with this MCS
+ getChildAffinityTargets(l_targetList, l_mcs_target,
+ CLASS_CHIP, TYPE_MEMBUF, false);
+
+ if(l_targetList.size() != 1) // one and only one expected
+ {
+ FAPI_ERR("fapiGetOtherSideOfMemChannel. expect 1 Centaur %d",
+ l_targetList.size());
+ /*@
+ * @errortype
+ * @moduleid fapi:MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
+ * @reasoncode fapi:RC_NO_SINGLE_MCS
+ * @userdata1 Type of input target
+ * @devdesc fapiGetOtherSideOfMemChannel could not find exactly
+ * one target on the other side of the correct state
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
+ fapi::RC_NO_SINGLE_MCS,
+ l_targetList.size());
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+
+ } else {
+ o_target.setType(fapi::TARGET_TYPE_MEMBUF_CHIP);
+ o_target.set(reinterpret_cast<void *>(l_targetList[0]));
+ }
+
+ } else if (i_target.getType() == fapi::TARGET_TYPE_MEMBUF_CHIP)
+ {
+ TargetHandle_t l_mem_target =
+ reinterpret_cast<TargetHandle_t>(i_target.get());
+
+ // find the MCS that is associated with this Centaur
+ getParentAffinityTargets (l_targetList, l_mem_target,
+ CLASS_UNIT, TYPE_MCS, false);
+
+ if(l_targetList.size() != 1) // one and only one expected
+ {
+ FAPI_ERR("fapiGetOtherSideOfMemChannel. expect 1 MCS %d",
+ l_targetList.size());
+ /*@
+ * @errortype
+ * @moduleid fapi:MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
+ * @reasoncode fapi:RC_NO_SINGLE_MEMBUFF
+ * @userdata1 Type of input target
+ * @devdesc fapiGetOtherSideOfMemChannel could not find exactly
+ * one target on the other side of the correct state
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
+ fapi::RC_NO_SINGLE_MEMBUFF,
+ l_targetList.size());
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+
+ } else {
+ o_target.setType(fapi::TARGET_TYPE_MCS_CHIPLET);
+ o_target.set(reinterpret_cast<void *>(l_targetList[0]));
+ }
+
+ } else {
+
+ FAPI_ERR("fapiGetOtherSideOfMemChannel. target 0x%x not supported",
+ i_target.getType());
+ /*@
+ * @errortype
+ * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
+ * @reasoncode fapi::RC_UNSUPPORTED_REQUEST
+ * @userdata1 Type of requested chiplet
+ * @devdesc fapiGetOtherSideOfMemChannel request for unsupported
+ * or invalid target type
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
+ fapi::RC_UNSUPPORTED_REQUEST,
+ i_target.getType());
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+ }
+
+ if (!l_rc) // OK so far, check that state is as requested
+ {
+ HwasState l_state =
+ l_targetList[0]->getAttr<ATTR_HWAS_STATE>();
+
+ if (((i_state == fapi::TARGET_STATE_PRESENT) && !l_state.present) ||
+ ((i_state == fapi::TARGET_STATE_FUNCTIONAL) && !l_state.functional))
+ {
+ FAPI_ERR("fapiGetOtherSideOfMemChannel. state mismatch 0x%x",
+ l_state);
+ /*@
+ * @errortype
+ * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL
+ * @reasoncode fapi::RC_STATE_MISMATCH
+ * @userdata1 Type of requested chiplet
+ * @devdesc fapiGetOtherSideOfMemChannel target not present or
+ * functional as requested
+ */
+ errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL,
+ fapi::RC_STATE_MISMATCH,
+ i_state);
+
+ // Attach the error log to the fapi::ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_pError));
+ }
+
+ }
+
+ FAPI_INF(EXIT_MRK "fapiGetOtherSideOfMemChannel. rc = 0x%x",
+ static_cast<uint32_t>(l_rc));
+
+ return l_rc;
+}
//******************************************************************************
// fapiGetChildChiplets function
diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C
index 791f38a9e..24e2fc620 100644
--- a/src/usr/targeting/common/utilFilter.C
+++ b/src/usr/targeting/common/utilFilter.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/targeting/common/utilFilter.C $
- *
- * 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
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/targeting/common/utilFilter.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
//******************************************************************************
// Includes
//******************************************************************************
@@ -146,39 +145,59 @@ void getChildChiplets( TARGETING::TargetHandleList& o_vector,
}
-
-void getAffinityChips( TARGETING::TargetHandleList& o_vector,
- const Target * i_chiplet, TYPE i_type, bool i_functional )
+void getAffinityTargets ( TARGETING::TargetHandleList& o_vector,
+ const Target * i_target, CLASS i_class, TYPE i_type,
+ TARGETING::TargetService::ASSOCIATION_TYPE i_association,
+ bool i_functional )
{
- // find all the chip that are affinity-associated with i_chiplet
- TARGETING::PredicateCTM l_chipFilter(CLASS_CHIP, i_type);
+ // find all the targets that are affinity-associated with i_target
+ TARGETING::PredicateCTM l_targetFilter(i_class, i_type);
o_vector.clear();
if (i_functional)
{
// Use PredicateIsFunctional to filter only functional chips
TARGETING::PredicateIsFunctional l_functional;
- TARGETING::PredicatePostfixExpr l_functionalChips;
- l_functionalChips.push(&l_chipFilter).push(&l_functional).And();
+ TARGETING::PredicatePostfixExpr l_functionalTargets;
+ l_functionalTargets.push(&l_targetFilter).push(&l_functional).And();
TARGETING::targetService().getAssociated(
o_vector,
- i_chiplet,
- TARGETING::TargetService::CHILD_BY_AFFINITY,
+ i_target,
+ i_association,
TARGETING::TargetService::ALL,
- &l_functionalChips );
+ &l_functionalTargets );
}
else
{
TARGETING::targetService().getAssociated(
o_vector,
- i_chiplet,
- TARGETING::TargetService::CHILD_BY_AFFINITY,
+ i_target,
+ i_association,
TARGETING::TargetService::ALL,
- &l_chipFilter );
+ &l_targetFilter );
}
}
+void getChildAffinityTargets ( TARGETING::TargetHandleList& o_vector,
+ const Target * i_target, CLASS i_class, TYPE i_type,
+ bool i_functional )
+{
+ getAffinityTargets (o_vector, i_target, i_class, i_type,
+ TARGETING::TargetService::CHILD_BY_AFFINITY,
+ i_functional);
+}
+
+
+void getParentAffinityTargets ( TARGETING::TargetHandleList& o_vector,
+ const Target * i_target, CLASS i_class, TYPE i_type,
+ bool i_functional )
+{
+
+ getAffinityTargets (o_vector, i_target, i_class, i_type,
+ TARGETING::TargetService::PARENT_BY_AFFINITY,
+ i_functional);
+}
const Target * getParentChip( const Target * i_pChiplet )
{
OpenPOWER on IntegriCloud