summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/plat/fapiPlatTarget.C
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2012-02-29 11:45:07 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-03-03 10:00:25 -0600
commit566f8f2356d148747a00447a06fc6555ca06fc30 (patch)
tree49665b269f287c3a2dbb507b8df3f0dd0213f6b4 /src/usr/hwpf/plat/fapiPlatTarget.C
parentb3a04d1638f20bd146590dd2c8b1e6fea96faf9c (diff)
downloadtalos-hostboot-566f8f2356d148747a00447a06fc6555ca06fc30.tar.gz
talos-hostboot-566f8f2356d148747a00447a06fc6555ca06fc30.zip
Minor fixes to target path decoding in TARGETING and HWPF
Change-Id: I029ab50189174de146f8855ac7b734994bb8de38 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/708 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/plat/fapiPlatTarget.C')
-rw-r--r--src/usr/hwpf/plat/fapiPlatTarget.C64
1 files changed, 33 insertions, 31 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatTarget.C b/src/usr/hwpf/plat/fapiPlatTarget.C
index 0578278d1..bd84316ab 100644
--- a/src/usr/hwpf/plat/fapiPlatTarget.C
+++ b/src/usr/hwpf/plat/fapiPlatTarget.C
@@ -91,8 +91,8 @@ void Target::toString(char (&o_ecmdString)[MAX_ECMD_STRING_LEN]) const
// TODO
// This is a temporary function that constructs the ECMD String from the
// target's physical path attribute, eventually, the ECMD String will be
- // its own attribute and this function will be changed to simply get the
- // attribute
+ // its own attribute (sourced from the MRW) and this function will be
+ // changed to simply get the attribute
// Try to get the physical path attribute
TARGETING::EntityPath l_path;
@@ -153,35 +153,6 @@ void Target::toString(char (&o_ecmdString)[MAX_ECMD_STRING_LEN]) const
}
}
- // Look for a chiplet in the path
- const char * l_pChipletType = NULL;
- uint32_t l_chipletPos = 0;
-
- for (uint32_t i = 0; ((i < l_sizePath) && (l_pChipletType == NULL));
- i++)
- {
- if (l_path[i].type == TARGETING::TYPE_EX)
- {
- l_pChipletType = ECMD_CHIPLET_EX;
- l_chipletPos = l_path[i].instance;
- }
- else if (l_path[i].type == TARGETING::TYPE_MCS)
- {
- l_pChipletType = ECMD_CHIPLET_MCS;
- l_chipletPos = l_path[i].instance;
- }
- else if (l_path[i].type == TARGETING::TYPE_MBS)
- {
- l_pChipletType = ECMD_CHIPLET_MBS;
- l_chipletPos = l_path[i].instance;
- }
- else if (l_path[i].type == TARGETING::TYPE_MBA)
- {
- l_pChipletType = ECMD_CHIPLET_MBA;
- l_chipletPos = l_path[i].instance;
- }
- }
-
if (l_pChipType == NULL)
{
FAPI_ERR("toString: Physical Path does not contain known chip");
@@ -189,6 +160,37 @@ void Target::toString(char (&o_ecmdString)[MAX_ECMD_STRING_LEN]) const
}
else
{
+ // Look for the last chiplet in the path (some chiplets are
+ // children of other chiplets in PHYS_PATH e.g. MBS->MBA)
+ const char * l_pChipletType = NULL;
+ uint32_t l_chipletPos = 0;
+
+ for (int32_t i = l_sizePath - 1;
+ ((i >= 0) && (l_pChipletType == NULL));
+ i--)
+ {
+ if (l_path[i].type == TARGETING::TYPE_EX)
+ {
+ l_pChipletType = ECMD_CHIPLET_EX;
+ l_chipletPos = l_path[i].instance;
+ }
+ else if (l_path[i].type == TARGETING::TYPE_MCS)
+ {
+ l_pChipletType = ECMD_CHIPLET_MCS;
+ l_chipletPos = l_path[i].instance;
+ }
+ else if (l_path[i].type == TARGETING::TYPE_MBS)
+ {
+ l_pChipletType = ECMD_CHIPLET_MBS;
+ l_chipletPos = l_path[i].instance;
+ }
+ else if (l_path[i].type == TARGETING::TYPE_MBA)
+ {
+ l_pChipletType = ECMD_CHIPLET_MBA;
+ l_chipletPos = l_path[i].instance;
+ }
+ }
+
// Construct the ecmd string
char * l_pStr = &o_ecmdString[0];
OpenPOWER on IntegriCloud